Skip to content

Commit 7d35df9

Browse files
authored
Squashed commit of the following: (#173)
commit 90951da Author: Cameron Carstens <[email protected]> Date: Mon Mar 17 10:18:02 2025 -0300 Update to forc `v0.67.0` and prepare `v0.7.0` release (#172) * Update to forc v0.67.0 * Prepare for v0.7.0 release * Update CHANGELOG * Remove draft standard commit 60a406e Author: Cameron Carstens <[email protected]> Date: Wed Feb 5 11:19:02 2025 -0300 Create Metadata section for standards and add SRC-16 to README (#169) * Create Metadata section for standards * Update CHANGELOG * update readme --------- Co-authored-by: calldelegation <[email protected]> commit 8b2f0ed Merge: ea5c821 5ce2828 Author: Call Delegation <[email protected]> Date: Mon Feb 3 14:24:04 2025 -0500 Merge pull request #170 from FuelLabs/docs/fix-16-examples docs: Fix src16 docs commit 5ce2828 Author: calldelegation <[email protected]> Date: Fri Jan 31 17:15:31 2025 -0500 fix commit ea5c821 Author: Cameron Carstens <[email protected]> Date: Mon Jan 27 12:37:00 2025 +0100 Prepare for v0.6.3 release (#167) * Prepare for v0.6.3 release * Update CHANGELOG commit d6ee572 Merge: a50375e 5bda589 Author: SwayStar123 <[email protected]> Date: Mon Jan 27 15:51:16 2025 +0530 Merge pull request #166 from FuelLabs/bitzoic-v0.66.6 Update to use forc `v0.66.6` and fuel core `v0.40.0` commit 5bda589 Author: bitzoic <[email protected]> Date: Fri Jan 24 12:14:43 2025 +0100 Remove sway-lib-core import commit 10d90f9 Author: bitzoic <[email protected]> Date: Fri Jan 24 12:10:20 2025 +0100 Run formatter commit 2def8e8 Author: bitzoic <[email protected]> Date: Thu Jan 23 10:29:48 2025 +0100 Update CHANGELOG commit 420fc98 Author: bitzoic <[email protected]> Date: Thu Jan 23 10:25:49 2025 +0100 Update to use forc v0.66.6 commit a50375e Author: Antony Burrows <[email protected]> Date: Wed Jan 22 22:19:03 2025 +1300 feat: add SRC-16 Typed Structured Data (#161) * feat: add SRC-16 typed structured data standard * Add backwards compatibility for EIP712. * Add encoding for native Fuel types, add Fixed array encoding, adjust SRC16Domain fuel_example contract, Adjust types for domains. Update docs. * fix code block in Domain Separator Compatibility decion in doc. * address spell check, add notes on salt and verifying contract, add note on chian_id padding in docs. * Add spell check and formatting fixes to src-16 docs. * adjust typeOf in src-16 docs. * add custom spell check words. commit ce56cde Author: Cameron Carstens <[email protected]> Date: Mon Jan 20 14:36:19 2025 +0100 Add SRC-15 to README (#165) commit 3f6543f Author: Cameron Carstens <[email protected]> Date: Sat Dec 14 08:51:30 2024 +0000 Update master from v0.6.1 to v0.6.2 (#163) * Update from v0.6.1 to v0.6.2 * Update CHANGELOG * Add PR #162 commit e7d3617 Author: Cameron Carstens <[email protected]> Date: Fri Dec 13 11:03:50 2024 +0000 SRC-15; Offchain Metadata Standard (#159) * Create SRC-15 specifications * Create SRC-15 standard * Create SRC-15 examples * Add SRC-15 examples to CI * Update CHANGELOG * Run formatter * Fix markdown * Update custom words spellcheck * Remove sender and add nonce to SRC15 event * Update standards and examples with nonce * Resolve review comments * Add comment on restricting who may emit * Remove nonce from SRC-15 log commit ccf84fd Author: Call Delegation <[email protected]> Date: Thu Dec 12 07:27:52 2024 -0500 docs: Add CI link check (#162) * add * r * r commit fefbd93 Author: Cameron Carstens <[email protected]> Date: Mon Nov 25 23:07:09 2024 +0700 Fix typo in SRC-7 inline docs (#160) * Fix typo in SRC-7 inline docs * Update CHANGELOG commit c53ef03 Author: Cameron Carstens <[email protected]> Date: Mon Oct 28 19:16:59 2024 +0700 Rename SRC-7 to Onchain Native Asset Metadata Standard (#157) * Update SRC-7 to Onchain Native Asset Metadata Standard * Add onchain to spellcheck * Update CHANGELOG commit a3f87a4 Author: Cameron Carstens <[email protected]> Date: Mon Oct 7 13:15:10 2024 +0545 Update abi names in standards docs (#154) * Update abi names in standards docs * Update CHANGELOG commit 408d81a Merge: 04a5248 55541de Author: SwayStar123 <[email protected]> Date: Tue Sep 17 11:45:29 2024 +0530 Merge pull request #153 from FuelLabs/swaystar123/fix-set_src20_data-bug Actually write to storage in src20 multi asset example commit 04a5248 Merge: ee95fad c8b5618 Author: SwayStar123 <[email protected]> Date: Tue Sep 17 10:51:52 2024 +0530 Merge pull request #152 from FuelLabs/add-src6-inline-doc-examples Add inline docs examples to SRC-6 abi commit ee95fad Merge: 29986f1 2a822da Author: SwayStar123 <[email protected]> Date: Tue Sep 17 10:51:28 2024 +0530 Merge pull request #151 from FuelLabs/update-src-6-to-latest-src-20-specs Add required logging of SRC-20 to SRC-6 examples commit 55541de Author: SwayStar123 <[email protected]> Date: Mon Sep 16 11:51:57 2024 +0530 add write to storage annotation commit 607066a Author: SwayStar123 <[email protected]> Date: Mon Sep 16 11:50:20 2024 +0530 add changelog commit 17809b0 Author: SwayStar123 <[email protected]> Date: Mon Sep 16 11:47:47 2024 +0530 add sotrage writes to set_src20_data commit c8b5618 Author: SwayStar123 <[email protected]> Date: Wed Sep 11 18:01:19 2024 +0530 move changelog commit 2a822da Author: SwayStar123 <[email protected]> Date: Wed Sep 11 17:56:13 2024 +0530 add write permission commit 2ebb457 Author: SwayStar123 <[email protected]> Date: Wed Sep 11 17:54:19 2024 +0530 get(asset) for maps commit 6948958 Author: SwayStar123 <[email protected]> Date: Wed Sep 11 17:51:55 2024 +0530 fmt commit 731e5a2 Author: SwayStar123 <[email protected]> Date: Wed Sep 11 17:51:18 2024 +0530 resolve comments commit 1718d5a Author: SwayStar123 <[email protected]> Date: Tue Sep 10 11:40:38 2024 +0530 ujpdate changelog pr number commit d467526 Author: SwayStar123 <[email protected]> Date: Tue Sep 10 11:40:22 2024 +0530 init commit d9ad426 Author: SwayStar123 <[email protected]> Date: Tue Sep 10 11:29:18 2024 +0530 remove get from sasbv commit 3263c4a Author: SwayStar123 <[email protected]> Date: Tue Sep 10 11:27:20 2024 +0530 unwrap -> read commit 90d748c Author: SwayStar123 <[email protected]> Date: Tue Sep 10 11:24:43 2024 +0530 fmt 2 commit 6dc8a28 Author: SwayStar123 <[email protected]> Date: Tue Sep 10 11:23:24 2024 +0530 fix some get calls commit 6ab90c3 Author: SwayStar123 <[email protected]> Date: Tue Sep 10 11:20:03 2024 +0530 fix import commit 64dbef4 Author: SwayStar123 <[email protected]> Date: Tue Sep 10 11:17:28 2024 +0530 remove unused param from SetSRC20Data impl commit 18d4842 Author: SwayStar123 <[email protected]> Date: Tue Sep 10 11:12:18 2024 +0530 init commit 29986f1 Author: Cameron Carstens <[email protected]> Date: Mon Sep 9 14:37:47 2024 +0800 Add helper functions to struct types and `Eq` implementations for all types (#149) * Add helper functions to struct types and Eq implementations * Add checks to enum types * Update CHANGELOG commit ab52d73 Author: Cameron Carstens <[email protected]> Date: Wed Sep 4 10:15:04 2024 +0800 Prepare for Sway-Standards `v0.6.1` release (#147) * Prepare for Sway-Standards v0.6.1 release * Update CHANGELOG commit 5b501cf Author: Cameron Carstens <[email protected]> Date: Mon Sep 2 11:13:31 2024 +0800 Fix Sway Standards inline docs (#142) * Update sway standards inline docs * Update CHANGELOG * Fix typo commit 7ce70c9 Author: Cameron Carstens <[email protected]> Date: Fri Aug 30 21:47:38 2024 +0800 Remove metadata functions (#148) commit 955061b Author: Cameron Carstens <[email protected]> Date: Fri Aug 30 14:01:49 2024 +0800 Add helper functions to SRC7 standard's `Metadata` (#144) * Add helper functions to SRC7 standard * Update CHANGELOG commit d264041 Author: K1-R1 <[email protected]> Date: Fri Aug 30 06:58:25 2024 +0100 docs: update src14 storage recommendation and general typos (#136) * chore: update to forc 0.63.1 * chore: updated changelog * docs: update src14 and general typos * Apply PR review comments * Fix markdown * Update CHANGELOG * Improve CHANGELOG comment --------- Co-authored-by: bitzoic <[email protected]> commit a477a91 Author: K1-R1 <[email protected]> Date: Fri Aug 30 06:41:26 2024 +0100 chore: update to forc 0.63.3 (#135) * chore: update to forc 0.63.1 * chore: updated changelog * Update to forc v0.63.3 --------- Co-authored-by: bitzoic <[email protected]> commit 0cbef85 Author: Cameron Carstens <[email protected]> Date: Tue Aug 27 13:38:25 2024 +0800 Resolve warnings in examples (#137) * Resolve warnings * Update CHANGELOG * Run formatter * Remove cancel in progress from CI * Revert remove cancel in progress from CI * fix max_depositable and max_withdrawable examples --------- Co-authored-by: SwayStar123 <[email protected]> commit bab74e4 Merge: 69217c2 94bc033 Author: SwayStar123 <[email protected]> Date: Tue Aug 27 08:19:21 2024 +0530 Merge pull request #139 from FuelLabs/bitzoic-release-v0.6.0 Prepare for v0.6.0 release commit 94bc033 Author: bitzoic <[email protected]> Date: Mon Aug 26 21:29:41 2024 +0800 Update CHANGELOG commit 81c9e65 Author: bitzoic <[email protected]> Date: Mon Aug 26 21:28:23 2024 +0800 Prepare for v0.6.0 release commit 69217c2 Author: Cameron Carstens <[email protected]> Date: Mon Aug 26 21:03:38 2024 +0800 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 commit 89e9882 Author: Cameron Carstens <[email protected]> Date: Fri Aug 23 18:08:00 2024 +0800 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 commit 2f45270 Author: Cameron Carstens <[email protected]> Date: Tue Aug 6 10:51:32 2024 +0700 Prepare master for v0.5.2 release (#126) * Prepare for v0.5.2 release * Update CHANGELOG * Update CHANGELOG formatting commit d736ca6 Merge: ade6077 94b3978 Author: K1-R1 <[email protected]> Date: Thu Aug 1 19:13:53 2024 +0100 Merge pull request #124 from FuelLabs/sophie/fix-warnings commit 94b3978 Author: Sophie <[email protected]> Date: Wed Jul 31 11:33:31 2024 -0700 Update changelog commit 6f2b07c Author: Sophie <[email protected]> Date: Thu Jul 25 10:34:28 2024 -0700 remove for examples commit e7e8dfa Author: Sophie <[email protected]> Date: Thu Jul 25 10:28:50 2024 -0700 chore: fix compiler warnings commit ade6077 Author: IGI-111 <[email protected]> Date: Mon Jul 22 07:53:53 2024 +0200 Use new namespace syntax for storage (#120) commit 3acac2b Author: Cameron Carstens <[email protected]> Date: Tue Jul 9 22:24:50 2024 +0800 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 commit b0e99a6 Merge: 9c85a02 babc929 Author: SwayStar123 <[email protected]> Date: Mon Jul 8 19:56:47 2024 +0530 Merge pull request #121 from FuelLabs/fixsrc6eg Fix vault standard examples commit babc929 Author: SwayStar123 <[email protected]> Date: Mon Jul 8 16:37:19 2024 +0530 add v0.5.1 commit b70a650 Author: SwayStar123 <[email protected]> Date: Mon Jul 8 16:36:04 2024 +0530 remove date commit cb4dbab Author: SwayStar123 <[email protected]> Date: Mon Jul 8 16:32:05 2024 +0530 add "unreleased" to changelog heads commit 7edb337 Author: SwayStar123 <[email protected]> Date: Mon Jul 8 16:27:51 2024 +0530 move changelog to new empty changelog commit 050977c Author: SwayStar123 <[email protected]> Date: Tue Jul 2 14:38:33 2024 +0000 add changelog commit f0b5631 Author: SwayStar123 <[email protected]> Date: Tue Jul 2 14:32:46 2024 +0000 fix vault reads commit 9c85a02 Author: Cameron Carstens <[email protected]> Date: Thu Jun 27 19:34:29 2024 +0800 Hotfix: Update Cargo.toml to v0.5.1 (#115) * Hotfix: Update Cargo.toml to v0.5.1 * Udpate CHANGELOG
1 parent 6ffb53d commit 7d35df9

File tree

14 files changed

+136
-60
lines changed

14 files changed

+136
-60
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ env:
1616
CARGO_TERM_COLOR: always
1717
REGISTRY: ghcr.io
1818
RUST_VERSION: 1.80.1
19-
FORC_VERSION: 0.66.6
20-
CORE_VERSION: 0.40.0
19+
FORC_VERSION: 0.67.0
20+
CORE_VERSION: 0.41.4
2121
PATH_TO_SCRIPTS: .github/scripts
2222

2323
jobs:

CHANGELOG.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,46 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8+
## [Unreleased]
9+
10+
### Added
11+
12+
- Some addition here.
13+
- Some addition here.
14+
15+
### Changed
16+
17+
- Some change here.
18+
- Some change here.
19+
20+
### Fixed
21+
22+
- Some fix here.
23+
- Some fix here.
24+
25+
### Breaking
26+
27+
- Some breaking change here.
28+
- Some breaking change here.
29+
30+
## [Version 0.7.0]
31+
32+
### Added v0.7.0
33+
34+
- [#169](https://github.com/FuelLabs/sway-standards/pull/169) Adds a metadata section to the README and about page of the docs hub.
35+
36+
### Changed v0.7.0
37+
38+
- [#172](https://github.com/FuelLabs/sway-standards/pull/172) Prepares for the `v0.7.0` release.
39+
40+
### Fixed v0.7.0
41+
42+
- None
43+
44+
### Breaking v0.7.0
45+
46+
- [#172](https://github.com/FuelLabs/sway-standards/pull/172) Updates to the forc `v0.67.0` release. Earlier releases are not compatible.
47+
848
## [Version 0.6.3]
949

1050
### New Standards v0.6.3

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[package]
22
name = "sway-standards"
3-
version = "0.6.2"
3+
version = "0.7.0"
44
edition = "2021"

README.md

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
<a href="https://github.com/FuelLabs/sway-standards/actions/workflows/ci.yaml" alt="CI">
1010
<img src="https://github.com/FuelLabs/sway-standards/actions/workflows/ci.yaml/badge.svg" />
1111
</a>
12-
<a href="https://crates.io/crates/forc/0.66.6" alt="forc">
13-
<img src="https://img.shields.io/badge/forc-v0.66.6-orange" />
12+
<a href="https://crates.io/crates/forc/0.67.0" alt="forc">
13+
<img src="https://img.shields.io/badge/forc-v0.67.0-orange" />
1414
</a>
1515
<a href="./LICENSE" alt="forc">
1616
<img src="https://img.shields.io/github/license/FuelLabs/sway-standards" />
@@ -31,21 +31,48 @@ If you don't find what you're looking for, feel free to create an issue and prop
3131
> **Note**
3232
> 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.
3333
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+
3457
## Standards
3558

3659
### Native Assets
3760

3861
- [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.
3962
- [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.
4263
- [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.
4364
- [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.
4470
- [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).
4571

46-
### Access Control
72+
### Security and Access Control
4773

4874
- [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.
4976

5077
### Contracts
5178

@@ -57,34 +84,15 @@ If you don't find what you're looking for, feel free to create an issue and prop
5784
- [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.
5885
- [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.
5986

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
7688

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.
8090

81-
For example, to import the SRC-20 Native Asset Standard use the following statement in your Sway Smart Contract file:
91+
### Documentation
8292

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.
8694

87-
### Examples of Standards
95+
## Examples of Standards
8896

8997
Minimal example implementations for every standard can be found in the [`examples/`](./examples/) folder.
9098

@@ -163,7 +171,7 @@ Example of a minimal SRC-14 implementation with no access control.
163171
Example of a SRC-14 implementation that also implements [SRC-5](https://docs.fuel.network/docs/sway-standards/src-5-ownership/).
164172

165173
> **Note**
166-
> All standards currently use `forc v0.66.6`.
174+
> All standards currently use `forc v0.67.0`.
167175
168176
<!-- TODO:
169177
## Contributing

docs/src/index.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ Standards in this repository may be in various stages of development. Use of dra
77
If you don't find what you're looking for, feel free to create an issue and propose a new standard!
88

99
> **Note**
10-
> All standards currently use `forc v0.66.6`.
10+
> All standards currently use `forc v0.67.0`.
1111
1212
## Using a standard
1313

1414
To import a standard the following should be added to the project's `Forc.toml` file under `[dependencies]` with the most recent release:
1515

1616
```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" }
1818
```
1919

2020
> **NOTE:**
@@ -38,10 +38,13 @@ use standards::src20::SRC20;
3838

3939
- [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.
4040
- [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.
4341
- [SRC-6; Vault Standard](./src-6-vault.md) defines the implementation of a standard API for asset vaults developed in Sway.
4442
- [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.
4548
- [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.
4649

4750
### Security and Access Control

docs/src/src-16-typed-structured-data.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@ Example of the SRC16 implementation where a contract utilizes the encoding schem
266266

267267
```sway
268268
{{#include ../examples/src16-typed-data/fuel_example/src/main.sw}}
269+
```
269270

271+
```sway
270272
{{#include ../examples/src16-typed-data/ethereum_example/src/main.sw}}
271273
```

standards/src/src10.sw

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,18 @@ pub enum DepositType {
1515
/// Enscapsultes metadata sent between the canonical chain and Fuel when a deposit is made.
1616
pub struct DepositMessage {
1717
/// The number of tokens.
18-
#[allow(dead_code)]
1918
pub amount: b256,
2019
/// The user's address on the canonical chain.
21-
#[allow(dead_code)]
2220
pub from: b256,
2321
/// The bridging target destination on the Fuel chain.
24-
#[allow(dead_code)]
2522
pub to: Identity,
2623
/// The bridged token's address on the canonical chain.
27-
#[allow(dead_code)]
2824
pub token_address: b256,
2925
/// The token's ID on the canonical chain.
30-
#[allow(dead_code)]
3126
pub token_id: b256,
3227
/// The decimals of the token.
33-
#[allow(dead_code)]
3428
pub decimals: u8,
3529
/// The type of deposit made.
36-
#[allow(dead_code)]
3730
pub deposit_type: DepositType,
3831
}
3932

@@ -121,7 +114,7 @@ abi SRC10 {
121114
);
122115
}
123116

124-
impl core::ops::Eq for DepositType {
117+
impl PartialEq for DepositType {
125118
fn eq(self, other: Self) -> bool {
126119
match (self, other) {
127120
(Self::Address, Self::Address) => true,
@@ -132,18 +125,24 @@ impl core::ops::Eq for DepositType {
132125
}
133126
}
134127

135-
impl core::ops::Eq for DepositMessage {
128+
impl Eq for DepositType {}
129+
130+
impl PartialEq for DepositMessage {
136131
fn eq(self, other: Self) -> bool {
137132
self.amount == other.amount && self.from == other.from && self.to == other.to && self.token_address == other.token_address && self.token_id == other.token_id && self.decimals == other.decimals && self.deposit_type == other.deposit_type
138133
}
139134
}
140135

141-
impl core::ops::Eq for MetadataMessage {
136+
impl Eq for DepositMessage {}
137+
138+
impl PartialEq for MetadataMessage {
142139
fn eq(self, other: Self) -> bool {
143140
self.token_address == other.token_address && self.token_id == other.token_id && self.name == other.name && self.symbol == other.symbol
144141
}
145142
}
146143

144+
impl Eq for MetadataMessage {}
145+
147146
impl DepositMessage {
148147
/// Returns a new `DepositMessage`.
149148
///

standards/src/src11.sw

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ abi SRC11 {
4747
fn security_information() -> SecurityInformation;
4848
}
4949

50-
impl core::ops::Eq for SecurityInformation {
50+
impl PartialEq for SecurityInformation {
5151
fn eq(self, other: Self) -> bool {
5252
// If both contact info contain data, check each string
5353
let self_contact_information_len = self.contact_information.len();
@@ -120,6 +120,8 @@ impl core::ops::Eq for SecurityInformation {
120120
}
121121
}
122122

123+
impl Eq for SecurityInformation {}
124+
123125
impl SecurityInformation {
124126
/// Returns a new `SecurityInformation`.
125127
///

standards/src/src15.sw

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ pub struct SRC15MetadataEvent {
1010
pub metadata: Metadata,
1111
}
1212

13-
impl core::ops::Eq for SRC15MetadataEvent {
13+
impl PartialEq for SRC15MetadataEvent {
1414
fn eq(self, other: Self) -> bool {
1515
self.asset == other.asset && self.metadata == other.metadata
1616
}
1717
}
1818

19+
impl Eq for SRC15MetadataEvent {}
20+
1921
impl SRC15MetadataEvent {
2022
/// Returns a new `SRC15MetadataEvent` event.
2123
///

standards/src/src16.sw

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ impl EIP712Domain {
215215
name: domain_name,
216216
version: version,
217217
chain_id: chain_id,
218-
verifying_contract: verifying_contract_last_20.into(),
218+
verifying_contract: verifying_contract_last_20.try_into().unwrap(),
219219
}
220220
}
221221

0 commit comments

Comments
 (0)