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
* Hotfix: Update Cargo.toml to v0.5.1 (#115)
* Hotfix: Update Cargo.toml to v0.5.1
* Udpate CHANGELOG
* fix vault reads
* add changelog
* move changelog to new empty changelog
* add "unreleased" to changelog heads
* remove date
* add v0.5.1
* SRC-6 example contract does not update managed assets (#122)
* Update SRC-6 example with decrementation of managed assets
* Update CHANGELOG
* Fix link on CHANGELOG.md
* Update CHANGELOG to resolve markdown error with duplicate headers
* Write to storage
* Use new namespace syntax for storage (#120)
* chore: fix compiler warnings
* remove for examples
* Update changelog
* Prepare master for v0.5.2 release (#126)
* Prepare for v0.5.2 release
* Update CHANGELOG
* Update CHANGELOG formatting
* Make the `SubId` an `Option` in SRC-3's `mint()` function (#131)
* Update specifications to change SRC-3 mint sub_id to an Option
* Update SRC-3 standard for option in mint
* Update examples
* Udpate CHANGELOG
* Run formatter
* Fix spelling
* Add event logging to SRC-20 and SRC-7 standards (#130)
* Add event logging to SRC-20 and SRC-7 specification
* Add event logging structs to SRC-20 and SRC-7
* Update CHANGELOG
* Add inline docs to SRC-20 events
* Fix CI
* Require that logs of metadata are emitted even with contants
* Update standards with additional log and ordering
* Update examples to follow new specs
* Add custom word to spell checker
* Run formatter
* Fix markdown formatting
* Resolve warnings in examples
* Build CI with release
* Store srv7 metadata to storage
* Remove cancel in progress from CI
* Update name for TotalSupplyEvent
* Split examples into seperate workspace projects
* Prepare for v0.6.0 release
* Update CHANGELOG
* Add trailing line in CHANGELOG
---------
Co-authored-by: SwayStar123 <[email protected]>
Co-authored-by: SwayStar123 <[email protected]>
Co-authored-by: IGI-111 <[email protected]>
Co-authored-by: Sophie <[email protected]>
Co-authored-by: K1-R1 <[email protected]>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+31-1Lines changed: 31 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
7
7
8
8
## [Unreleased]
9
9
10
+
Description of the upcoming release here.
11
+
10
12
### Added Unreleased
11
13
12
14
- Something new here 1
@@ -22,11 +24,39 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
22
24
- Some fix here 1
23
25
- Some fix here 2
24
26
25
-
### Breaking Unreleased
27
+
####Breaking Unreleased
26
28
27
29
- Some breaking change here 1
28
30
- Some breaking change here 2
29
31
32
+
## [Version 0.6.0]
33
+
34
+
### Added v0.6.0
35
+
36
+
-[#130](https://github.com/FuelLabs/sway-standards/pull/130) Adds the `SetNameEvent`, `SetSymbolEvent`, `SetDecimalsEvent` and `TotalSupplyEvent` to the SRC-20 standard.
37
+
-[#130](https://github.com/FuelLabs/sway-standards/pull/130) Adds the `SetMetadataEvent` to the SRC-7 standard.
38
+
39
+
### Changed v0.6.0
40
+
41
+
-[#130](https://github.com/FuelLabs/sway-standards/pull/130) Splits examples into seperate workspace projects for improved continuous integration.
42
+
-[#139](https://github.com/FuelLabs/sway-standards/pull/139) Prepares for the v0.6.0 release.
43
+
44
+
### Breaking v0.6.0
45
+
46
+
-[#131](https://github.com/FuelLabs/sway-standards/pull/131) Makes the SRC-3 `mint()` function's `SubId` argument an `Option`.
Copy file name to clipboardExpand all lines: docs/src/src-20-native-asset.md
+87Lines changed: 87 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,93 @@ Non-Fungible Tokens (NFT) or Non-Fungible Assets on Fuel are Native Assets and t
47
47
* Non-Fungible Assets SHALL have a total supply of one per asset.
48
48
* Non-Fungible Assets SHALL have a decimal of `0u8`.
49
49
50
+
### Logging
51
+
52
+
The following logs MUST be implemented and emitted to follow the SRC-20 standard.
53
+
54
+
* IF a value is updated via a function call, a log MUST be emitted.
55
+
* IF a value is embedded in a contract as a constant, configurable, or other manner, an event MUST be emitted at least once.
56
+
57
+
#### SetNameEvent
58
+
59
+
The `SetNameEvent` MUST be emitted when the name of an asset has updated.
60
+
61
+
There SHALL be the following fields in the `SetNameEvent` struct:
62
+
63
+
*`asset`: The `asset` field SHALL be used for the corresponding `AssetId` of the asset has been updated.
64
+
*`name`: The `name` field SHALL be used for the corresponding `Option<String>` which represents the name of the asset.
65
+
*`sender`: The `sender` field SHALL be used for the corresponding `Identity` which made the function call that has updated the name of the asset.
66
+
67
+
Example:
68
+
69
+
```sway
70
+
pub struct SetNameEvent {
71
+
pub asset: AssetId,
72
+
pub name: Option<String>,
73
+
pub sender: Identity,
74
+
}
75
+
```
76
+
77
+
#### SetSymbolEvent
78
+
79
+
The `SetSymbolEvent` MUST be emitted when the symbol of an asset has updated.
80
+
81
+
There SHALL be the following fields in the `SetSymbolEvent` struct:
82
+
83
+
*`asset`: The `asset` field SHALL be used for the corresponding `AssetId` of the asset has been updated.
84
+
*`symbol`: The `symbol` field SHALL be used for the corresponding `Option<String>` which represents the symbol of the asset.
85
+
*`sender`: The `sender` field SHALL be used for the corresponding `Identity` which made the function call that has updated the symbol of the asset.
86
+
87
+
Example:
88
+
89
+
```sway
90
+
pub struct SetSymbolEvent {
91
+
pub asset: AssetId,
92
+
pub symbol: Option<String>,
93
+
pub sender: Identity,
94
+
}
95
+
```
96
+
97
+
#### SetDecimalsEvent
98
+
99
+
The `SetDecimalsEvent` MUST be emitted when the decimals of an asset has updated.
100
+
101
+
There SHALL be the following fields in the `SetDecimalsEvent` struct:
102
+
103
+
*`asset`: The `asset` field SHALL be used for the corresponding `AssetId` of the asset has been updated.
104
+
*`decimals`: The `decimals` field SHALL be used for the corresponding `u8` which represents the decimals of the asset.
105
+
*`sender`: The `sender` field SHALL be used for the corresponding `Identity` which made the function call that has updated the decimals of the asset.
106
+
107
+
Example:
108
+
109
+
```sway
110
+
pub struct SetDecimalsEvent {
111
+
pub asset: AssetId,
112
+
pub decimals: u8,
113
+
pub sender: Identity,
114
+
}
115
+
```
116
+
117
+
#### UpdateTotalSupplyEvent
118
+
119
+
The `UpdateTotalSupplyEvent` MUST be emitted when the total supply of an asset has updated.
120
+
121
+
There SHALL be the following fields in the `UpdateTotalSupplyEvent` struct:
122
+
123
+
*`asset`: The `asset` field SHALL be used for the corresponding `AssetId` of the asset has been updated.
124
+
*`supply`: The `supply` field SHALL be used for the corresponding `u64` which represents the total supply of the asset.
125
+
*`sender`: The `sender` field SHALL be used for the corresponding `Identity` which made the function call that has updated the total supply of the asset.
126
+
127
+
Example:
128
+
129
+
```sway
130
+
pub struct UpdateTotalSupplyEvent {
131
+
pub asset: AssetId,
132
+
pub supply: u64,
133
+
pub sender: Identity,
134
+
}
135
+
```
136
+
50
137
## Rationale
51
138
52
139
As the SRC-20 Native Asset Standard leverages Native Assets on Fuel, we do not require the implementation of certain functions such as transfer or approval. This is done directly within the FuelVM and there is no smart contract that requires updating of balances. As Fuel is UTXO based, any transfer events may be indexed on transaction receipts.
This function MUST mint `amount` coins with sub-identifier `sub_id` and transfer them to the `recipient`.
21
+
This function MUST mint `amount` coins with a sub-identifier and transfer them to the `recipient`.
22
+
This function MUST use the `sub_id` as the sub-identifier IF `sub_id` is `Some`, otherwise this function MUST assign a `SubId` if the `sub_id` argument is `None`.
22
23
This function MAY contain arbitrary conditions for minting, and revert if those conditions are not met.
23
24
24
25
##### Mint Arguments
25
26
26
27
*`recipient` - The `Identity` to which the newly minted asset is transferred to.
27
-
*`sub_id` - The sub-identifier of the asset to mint.
28
+
*`sub_id` - The sub-identifier of the asset to mint. If this is `None`, a `SubId` MUST be assigned.
28
29
*`amount` - The quantity of coins to mint.
29
30
30
31
#### `fn burn(sub_id: SubId, amount: u64)`
@@ -57,7 +58,7 @@ The burn function may also introduce a security consideration if the total suppl
Copy file name to clipboardExpand all lines: docs/src/src-7-asset-metadata.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,35 @@ The `String` variant SHALL be used when the stored metadata for the correspondin
44
44
45
45
This function MUST return valid metadata for the corresponding `asset` and `key`, where the data is either a `B256`, `Bytes`, `Int`, or `String` variant. If the asset does not exist or no metadata exists, the function MUST return `None`.
46
46
47
+
### Logging
48
+
49
+
The following logs MUST be implemented and emitted to follow the SRC-7 standard.
50
+
51
+
* IF a value is updated via a function call, a log MUST be emitted.
52
+
* IF a value is embedded in a contract as a constant, configurable, or other manner, an event MUST be emitted at least once.
53
+
54
+
#### SetMetadataEvent
55
+
56
+
The `SetMetadataEvent` MUST be emitted when the metadata of an asset has updated.
57
+
58
+
There SHALL be the following fields in the `SetMetadataEvent` struct:
59
+
60
+
*`asset`: The `asset` field SHALL be used for the corresponding `AssetId` of the asset has been updated.
61
+
*`metadata`: The `metadata` field SHALL be used for the corresponding `Option<Metadata>` which represents the metadata of the asset.
62
+
*`key`: The `key` field SHALL be used for the corresponding `String` which represents the key used for storing the metadata.
63
+
*`sender`: The `sender` field SHALL be used for the corresponding `Identity` which made the function call that has updated the metadata of the asset.
64
+
65
+
Example:
66
+
67
+
```sway
68
+
pub struct SetMetadataEvent {
69
+
pub asset: AssetId,
70
+
pub metadata: Option<Metadata>,
71
+
pub key: String,
72
+
pub sender: Identity,
73
+
}
74
+
```
75
+
47
76
## Rationale
48
77
49
78
The SRC-7 standard should allow for data-rich assets to interact with one another in a safe manner.
0 commit comments