You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/getting_started/contract_publish.md
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,6 @@ The ParallelChain F smart contract publishing service provides a platform for sm
18
18
19
19
1. The service generates identity verification bytes using the contract address and transaction hash provided by the user.
20
20
2. The user then signs the ID bytes with the help of our `very_light` client using the instructions on the front end which generates a signature.
21
-
3. The back end accepts the signature, github link and commit SHA of the source code, builds the
22
-
source code with `pchain_compile` and verifies the generated binary against that existing on ParallelChain F. The service returns Status Code 200
21
+
3. The back end accepts the signature, github link and commit SHA of the source code, builds the source code with `pchain_compile` and verifies the generated binary against that existing on ParallelChain F. The service returns Status Code 200
23
22
to the user if the contract is successfully verified.
Copy file name to clipboardExpand all lines: docs/getting_started/installation.md
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ Throughout the section [Getting Started](installation.md), we will describe how
17
17
## For Windows
18
18
---
19
19
20
-
Download the compressed zip file from [https://cms.parallelchain.io/parallelchain-very-light_win_v0.1.0.zip](https://cms.parallelchain.io/parallelchain-very-light_win_v0.1.0.zip)
20
+
Download the compressed zip file from [https://cms.parallelchain.io/parallelchain-very-light_win_v0.2.0.zip](https://cms.parallelchain.io/parallelchain-very-light_win_v0.2.0.zip)
21
21
22
22
Unzip the file to extract the executable `pchain.exe`.
23
23
@@ -43,26 +43,26 @@ Open up `PowerShell` using the `run` keyboard shortcut. That is *WIN+R* and type
43
43
44
44
Unzip the compressed zip file by `Expand-Archive`. Please specify the source path and destination path for your command parameters:
45
45
46
-
-`<SOURCE_PATH>`: the directory where `parallelchain-very-light_win_v0.1.0.zip` is located.
46
+
-`<SOURCE_PATH>`: the directory where `parallelchain-very-light_win_v0.2.0.zip` is located.
47
47
-`<DESTINATION_PATH>`: the directory you intend to install `pchain`.
To extract the client program, head to the directory where the downloaded file `parallelchain-very-light_linux_v0.1.0.tar.xz` or `parallelchain-very-light_mac_x86_v0.1.0.tar.xz` is located and extract via `tar`:
110
+
To extract the client program, head to the directory where the downloaded file `parallelchain-very-light_linux_v0.2.0.tar.xz` or `parallelchain-very-light_mac_x86_v0.2.0.tar.xz` is located and extract via `tar`:
111
111
=== "Linux"
112
112
```bash
113
-
tar -xvf parallelchain-very-light_linux_v0.1.0.tar.xz
113
+
tar -xvf parallelchain-very-light_linux_v0.2.0.tar.xz
114
114
```
115
115
=== "macOS"
116
116
```bash
117
-
tar -xvf parallelchain-very-light_mac_x86_v0.1.0.tar.xz
117
+
tar -xvf parallelchain-very-light_mac_x86_v0.2.0.tar.xz
118
118
```
119
119
120
120
Rename the client program to `pchain` so that it becomes easier to follow this guide:
121
121
```bash
122
-
mv parallelchain-very-light_linux_v0.1.0 pchain
122
+
mv parallelchain-very-light_linux_v0.2.0 pchain
123
123
```
124
124
125
125
Run the command `pchain` to see if it launches.
@@ -149,7 +149,7 @@ Run the command `pchain` to see if it launches.
149
149
<details>
150
150
<summary>To verify that the Light Client works</summary>
Copy file name to clipboardExpand all lines: docs/smart_contract_sdk/PRFC1.md
+44-61Lines changed: 44 additions & 61 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
| PRFC | Title | Author | Version | Date First Published |
4
4
| --- | ----- | ---- | --- | --- |
5
-
| 1 | Fungible Token Standard | ParallelChain Lab |1| July 7th, 2022 |
5
+
| 1 | Fungible Token Standard | ParallelChain Lab |3| July 23rd, 2022 |
6
6
7
7
## Summary
8
8
@@ -12,108 +12,91 @@ A standard contract interface for fungible tokens allows more seamless interoper
12
12
13
13
The below section lists the set of methods that all smart contracts that want to be PRFC 1-compliant must implement, as well as the behavior that each method must exhibit. Required behavior involves emitting certain events. These are also listed and described.
14
14
15
-
## Required Methods
15
+
## Required types
16
16
17
-
Note: the following uses syntax from Rust (version 1.59.0).
17
+
```rust
18
+
structToken {
19
+
name:String,
20
+
symbol:String,
18
21
19
-
**ACTION**
22
+
// the number of decimals that should be divided from a token amount (such as that returned by method
23
+
// 'balance_of') to get its user representation. i.e., `n` means to divide the token amount by `10^n`.
Event `Transfer` must trigger if ‘transfer_from’ is successful. Note that the value of the `Transfer` event should contain the owner address, not txn.from_address.
47
+
Queries the balance for an owner account 'address'.
'set_allowance' allows 'spender' to withdraw from your account multiple times, up to 'value' amount. If this function is called again it overwrites the current allowance with 'value'.
50
+
## Required Actions
46
51
47
-
set_allowance must panic if txn.from_address's balance is less than 'value'.
Event `SetAllowance` must be emitted if set_allowance is successful.
54
+
'transfer' transfers 'amount' tokens to address 'to_address' from the account identified by txn.from_address. If `to_address`is None, this burns the amount.
50
55
56
+
Transfer must panic if txn.from_address's balance is less than amount.
51
57
52
-
**VIEW**
58
+
Event `Transfer` must be emitted if 'transfer' is successful.
'transfer_from' transfers 'amount' tokens to address 'to_address' on behalf of ‘owner’. If `to_address` is None, this burns the amount.
58
64
59
-
**VIEW**
65
+
transfer_from must panic if get_allowance_from(owner) < value.
60
66
61
-
`fn total_supply() -> u64`
67
+
Event `Transfer` must trigger if ‘transfer_from’ is successful. Note that the value of the `Transfer` event must contain the owner address, not txn.from_address.
62
68
63
-
'total_supply' returns the total token supply. ‘Supply’ here means the sum of token balances over *all* addresses at any given point of time. Total supply may increase, for example, when new tokens are minted, or decrease, for example, when tokens are burned. PRFC 1 has no opinion about how to implement minting and burning, nor does not require that contracts implement them.
'set_allowance' allows 'spender' to withdraw from your account multiple times, up to 'value' amount. If this function is called again it overwrites the current allowance with 'value'.
67
73
68
-
`fn balance_of(address: PublicAddress) -> u64`
74
+
set_allowance must panic if txn.from_address's balance is less than 'value'.
69
75
70
-
'balance_of' queries the balance for an owner account 'address'.
76
+
Event `SetAllowance` must be emitted if set_allowance is successful.
71
77
72
78
## Required Events
73
79
74
-
`Transfer`
80
+
In this section, `++` denotes bytes concatenation.
81
+
82
+
### `Transfer`
75
83
76
84
| Field | Value |
77
85
| ----- | ----- |
78
-
| Topic |`0u8`|
79
-
| Value |`owner_address: PublicAddress \|\| recipient_address: PublicAddress`|
Gets triggered on successful delegation of tokens through method 'set_allowance'.
91
99
92
-
## Optional Methods
93
-
94
-
**VIEW**
95
-
96
-
`fn name() -> String`
97
-
98
-
'name' returns the name of the token.
99
-
100
-
**VIEW**
101
-
102
-
`fn symbol() -> String`
103
-
104
-
'symbol' returns the symbol of the token.
105
-
106
-
**VIEW**
107
-
108
-
`fn decimals() -> u8`
109
-
110
-
'decimals' returns the number of decimals that should be divided from a token amount (such as that returned by method 'balance_of') to get its user representation. i.e., `n` means to divide the token amount by `10^n`.
111
-
112
-
## Implementation
113
-
114
-
An example smart contract implementing the token standard is available.
115
-
See [here](https://github.com/parallelchain-io/example-smart-contracts).
116
-
117
100
## License
118
101
119
102
[GNU Public License 3](https://www.gnu.org/licenses/gpl-3.0.en.html).
0 commit comments