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
@@ -31,21 +31,48 @@ If you don't find what you're looking for, feel free to create an issue and prop
31
31
> **Note**
32
32
> Sway is a language under heavy development therefore the standards may not be the most ergonomic. Over time they should receive updates / improvements in order to demonstrate how Sway can be used in real use cases.
33
33
34
+
## Using a standard
35
+
36
+
To import a standard the following should be added to the project's `Forc.toml` file under `[dependencies]` with the most recent release:
37
+
38
+
```toml
39
+
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.7.0" }
40
+
```
41
+
42
+
> **NOTE:**
43
+
> Be sure to set the tag to the latest release.
44
+
45
+
You may then import your desired standard in your Sway Smart Contract as so:
46
+
47
+
```sway
48
+
use standards::<standard>::<standard_abi>;
49
+
```
50
+
51
+
For example, to import the SRC-20 Native Asset Standard use the following statement in your Sway Smart Contract file:
52
+
53
+
```sway
54
+
use standards::src20::SRC20;
55
+
```
56
+
34
57
## Standards
35
58
36
59
### Native Assets
37
60
38
61
-[SRC-20; Native Asset Standard](https://docs.fuel.network/docs/sway-standards/src-20-native-asset/) defines the implementation of a standard API for [Native Assets](https://docs.fuel.network/docs/sway/blockchain-development/native_assets) using the Sway Language.
39
62
-[SRC-3; Mint and Burn](https://docs.fuel.network/docs/sway-standards/src-3-minting-and-burning/) is used to enable mint and burn functionality for fungible assets.
40
-
-[SRC-7; Onchain Asset Metadata Standard](https://docs.fuel.network/docs/sway-standards/src-7-asset-metadata/) is used to store metadata for [Native Assets](https://docs.fuel.network/docs/sway/blockchain-development/native_assets).
41
-
-[SRC-9; Metadata Keys Standard](https://docs.fuel.network/docs/sway-standards/src-9-metadata-keys/) is used to store standardized metadata keys for [Native Assets](https://docs.fuel.network/docs/sway/blockchain-development/native_assets) in combination with the SRC-7 standard.
42
63
-[SRC-6; Vault Standard](https://docs.fuel.network/docs/sway-standards/src-6-vault/) defines the implementation of a standard API for asset vaults developed in Sway.
43
64
-[SRC-13; Soulbound Address](https://docs.fuel.network/docs/sway-standards/src-13-soulbound-address/) provides a predicate interface to lock [Native Assets](https://docs.fuel.network/docs/sway/blockchain-development/native_assets) as soulbound.
65
+
66
+
### Metadata
67
+
68
+
-[SRC-7; Onchain Asset Metadata Standard](https://docs.fuel.network/docs/sway-standards/src-7-asset-metadata/) is used to store metadata for [Native Assets](https://docs.fuel.network/docs/sway/blockchain-development/native_assets).
69
+
-[SRC-9; Metadata Keys Standard](https://docs.fuel.network/docs/sway-standards/src-9-metadata-keys/) is used to store standardized metadata keys for [Native Assets](https://docs.fuel.network/docs/sway/blockchain-development/native_assets) in combination with the SRC-7 standard.
44
70
-[SRC-15; Offchain Asset Metadata Standard](https://docs.fuel.network/docs/sway-standards/src-15-offchain-asset-metadata/) enables arbitrary metadata that is not required by other contracts onchain, in a stateless manner for [Native Assets](https://docs.fuel.network/docs/sway/blockchain-development/native_assets).
45
71
46
-
### Access Control
72
+
### Security and Access Control
47
73
48
74
-[SRC-5; Ownership Standard](https://docs.fuel.network/docs/sway-standards/src-5-ownership/) is used to restrict function calls to admin users in contracts.
75
+
-[SRC-11; Security Information Standard](https://docs.fuel.network/docs/sway-standards/src-11-security-information/) is used to make communication information readily available in the case white hat hackers find a vulnerability in a contract.
49
76
50
77
### Contracts
51
78
@@ -57,34 +84,15 @@ If you don't find what you're looking for, feel free to create an issue and prop
57
84
-[SRC-8; Bridged Asset](https://docs.fuel.network/docs/sway-standards/src-8-bridged-asset/) defines the metadata required for an asset bridged to the Fuel Network.
58
85
-[SRC-10; Native Bridge Standard](https://docs.fuel.network/docs/sway-standards/src-10-native-bridge/) defines the standard API for the Native Bridge between the Fuel Chain and the canonical base chain.
59
86
60
-
### Documentation
61
-
62
-
-[SRC-2; Inline Documentation](https://docs.fuel.network/docs/sway-standards/src-2-inline-documentation/) defines how to document your Sway files.
63
-
64
-
## Using a standard
65
-
66
-
To import a standard the following should be added to the project's `Forc.toml` file under `[dependencies]` with the most recent release:
67
-
68
-
```toml
69
-
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.6.2" }
70
-
```
71
-
72
-
> **NOTE:**
73
-
> Be sure to set the tag to the latest release.
74
-
75
-
You may then import your desired standard in your Sway Smart Contract as so:
87
+
### Encoding and Hashing
76
88
77
-
```sway
78
-
use standards::<standard>::<standard_abi>;
79
-
```
89
+
-[SRC-16; Typed Structure Data](https://docs.fuel.network/docs/sway-standards/src-16-typed-structured-data/) standardize encoding and hashing of typed structured data.
80
90
81
-
For example, to import the SRC-20 Native Asset Standard use the following statement in your Sway Smart Contract file:
91
+
### Documentation
82
92
83
-
```sway
84
-
use standards::src20::SRC20;
85
-
```
93
+
-[SRC-2; Inline Documentation](https://docs.fuel.network/docs/sway-standards/src-2-inline-documentation/) defines how to document your Sway files.
86
94
87
-
###Examples of Standards
95
+
## Examples of Standards
88
96
89
97
Minimal example implementations for every standard can be found in the [`examples/`](./examples/) folder.
90
98
@@ -163,7 +171,7 @@ Example of a minimal SRC-14 implementation with no access control.
163
171
Example of a SRC-14 implementation that also implements [SRC-5](https://docs.fuel.network/docs/sway-standards/src-5-ownership/).
Copy file name to clipboardExpand all lines: docs/src/index.md
+7-4Lines changed: 7 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,14 +7,14 @@ Standards in this repository may be in various stages of development. Use of dra
7
7
If you don't find what you're looking for, feel free to create an issue and propose a new standard!
8
8
9
9
> **Note**
10
-
> All standards currently use `forc v0.66.6`.
10
+
> All standards currently use `forc v0.67.0`.
11
11
12
12
## Using a standard
13
13
14
14
To import a standard the following should be added to the project's `Forc.toml` file under `[dependencies]` with the most recent release:
15
15
16
16
```toml
17
-
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.6.2" }
17
+
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.7.0" }
18
18
```
19
19
20
20
> **NOTE:**
@@ -38,10 +38,13 @@ use standards::src20::SRC20;
38
38
39
39
-[SRC-20; Native Asset Standard](./src-20-native-asset.md) defines the implementation of a standard API for [Native Assets](https://docs.fuel.network/docs/sway/blockchain-development/native_assets) using the Sway Language.
40
40
-[SRC-3; Mint and Burn](./src-3-minting-and-burning.md) is used to enable mint and burn functionality for fungible assets.
41
-
-[SRC-7; Onchain Asset Metadata Standard](./src-7-asset-metadata.md) is used to store metadata for [Native Assets](https://docs.fuel.network/docs/sway/blockchain-development/native_assets).
42
-
-[SRC-9; Metadata Keys Standard](./src-9-metadata-keys.md) is used to store standardized metadata keys for [Native Assets](https://docs.fuel.network/docs/sway/blockchain-development/native_assets) in combination with the SRC-7 standard.
43
41
-[SRC-6; Vault Standard](./src-6-vault.md) defines the implementation of a standard API for asset vaults developed in Sway.
44
42
-[SRC-13; Soulbound Address](./src-13-soulbound-address.md) defines the implementation of a soulbound address.
43
+
44
+
### Metadata
45
+
46
+
-[SRC-7; Onchain Asset Metadata Standard](./src-7-asset-metadata.md) is used to store metadata for [Native Assets](https://docs.fuel.network/docs/sway/blockchain-development/native_assets).
47
+
-[SRC-9; Metadata Keys Standard](./src-9-metadata-keys.md) is used to store standardized metadata keys for [Native Assets](https://docs.fuel.network/docs/sway/blockchain-development/native_assets) in combination with the SRC-7 standard.
45
48
-[SRC-15; Offchain Asset Metadata Standard](./src-15-offchain-asset-metadata.md) is used to associated metadata with [Native Assets](https://docs.fuel.network/docs/sway/blockchain-development/native_assets) offchain.
0 commit comments