From bb3b42533c1d26d2ba5b676952ea59efa2a1f0a4 Mon Sep 17 00:00:00 2001 From: Cameron Carstens Date: Fri, 29 Mar 2024 10:33:04 +0900 Subject: [PATCH] Remove workspace (#72) * Move SRCs to seperate folder * Remove workspace from standards * Update examples * Update source README --- README.md | 33 +++++++++--------- .../.docs/src-10-logo-dark-theme.png | Bin .../.docs/src-10-logo-light-theme.png | Bin .../.docs/src-11-logo-dark-theme.png | Bin .../.docs/src-11-logo-light-theme.png | Bin .../.docs/src-2-logo-dark-theme.png | Bin .../.docs/src-2-logo-light-theme.png | Bin .../.docs/src-20-logo-dark-theme.png | Bin .../.docs/src-20-logo-light-theme.png | Bin .../.docs/src-5-logo-dark-theme.png | Bin .../.docs/src-5-logo-light-theme.png | Bin .../.docs/src-6-logo-dark-theme.png | Bin .../.docs/src-6-logo-light-theme.png | Bin .../.docs/src-7-logo-dark-theme.png | Bin .../.docs/src-7-logo-light-theme.png | Bin .../.docs/src-8-logo-dark-theme.png | Bin .../.docs/src-8-logo-light-theme.png | Bin .../.docs/src-9-logo-dark-theme.png | Bin .../.docs/src-9-logo-light-theme.png | Bin .../README.md => SRCs/src-10.md | 0 .../README.md => SRCs/src-11.md | 0 .../README.md => SRCs/src-2.md | 2 +- .../README.md => SRCs/src-20.md | 0 .../src3-mint-burn/README.md => SRCs/src-3.md | 0 .../src5-ownership/README.md => SRCs/src-5.md | 0 .../src6-vault/README.md => SRCs/src-6.md | 0 .../src7-metadata/README.md => SRCs/src-7.md | 0 .../README.md => SRCs/src-8.md | 0 .../README.md => SRCs/src-9.md | 0 .../hardcoded-information/Forc.toml | 2 +- .../hardcoded-information/src/main.sw | 2 +- .../variable-information/Forc.toml | 2 +- .../variable-information/src/main.sw | 2 +- .../src20-native-asset/multi_asset/Forc.toml | 2 +- .../multi_asset/src/multi_asset.sw | 2 +- .../src20-native-asset/single_asset/Forc.toml | 2 +- .../single_asset/src/single_asset.sw | 2 +- examples/src3-mint-burn/multi_asset/Forc.toml | 3 +- .../multi_asset/src/multi_asset.sw | 3 +- .../src3-mint-burn/single_asset/Forc.toml | 3 +- .../single_asset/src/single_asset.sw | 3 +- .../initialized_example/Forc.toml | 2 +- .../src/initialized_example.sw | 2 +- .../uninitialized_example/Forc.toml | 2 +- .../src/uninitialized_example.sw | 2 +- .../src6-vault/multi_asset_vault/Forc.toml | 3 +- .../src6-vault/multi_asset_vault/src/main.sw | 3 +- .../single_asset_single_sub_vault/Forc.toml | 3 +- .../single_asset_single_sub_vault/src/main.sw | 3 +- .../src6-vault/single_asset_vault/Forc.toml | 3 +- .../src6-vault/single_asset_vault/src/main.sw | 3 +- examples/src7-metadata/multi_asset/Forc.toml | 3 +- .../multi_asset/src/multi_asset.sw | 3 +- examples/src7-metadata/single_asset/Forc.toml | 3 +- .../single_asset/src/single_asset.sw | 3 +- standards/Forc.toml | 14 +++----- .../{src10-native-bridge => }/src/src10.sw | 0 .../src/src11.sw | 0 .../{src20-native-asset => }/src/src20.sw | 0 standards/{src3-mint-burn => }/src/src3.sw | 0 standards/{src5-ownership => }/src/src5.sw | 0 standards/{src6-vault => }/src/src6.sw | 0 standards/{src7-metadata => }/src/src7.sw | 0 standards/src/standards.sw | 9 +++++ standards/src10-native-bridge/Forc.toml | 5 --- .../src11-security-information/Forc.toml | 5 --- standards/src20-native-asset/Forc.toml | 5 --- standards/src3-mint-burn/Forc.toml | 5 --- standards/src5-ownership/Forc.toml | 5 --- standards/src6-vault/Forc.toml | 5 --- standards/src7-metadata/Forc.toml | 5 --- 71 files changed, 57 insertions(+), 102 deletions(-) rename {standards/src10-native-bridge => SRCs}/.docs/src-10-logo-dark-theme.png (100%) rename {standards/src10-native-bridge => SRCs}/.docs/src-10-logo-light-theme.png (100%) rename {standards/src11-security-information => SRCs}/.docs/src-11-logo-dark-theme.png (100%) rename {standards/src11-security-information => SRCs}/.docs/src-11-logo-light-theme.png (100%) rename {standards/src2-inline-docs => SRCs}/.docs/src-2-logo-dark-theme.png (100%) rename {standards/src2-inline-docs => SRCs}/.docs/src-2-logo-light-theme.png (100%) rename {standards/src20-native-asset => SRCs}/.docs/src-20-logo-dark-theme.png (100%) rename {standards/src20-native-asset => SRCs}/.docs/src-20-logo-light-theme.png (100%) rename {standards/src5-ownership => SRCs}/.docs/src-5-logo-dark-theme.png (100%) rename {standards/src5-ownership => SRCs}/.docs/src-5-logo-light-theme.png (100%) rename {standards/src6-vault => SRCs}/.docs/src-6-logo-dark-theme.png (100%) rename {standards/src6-vault => SRCs}/.docs/src-6-logo-light-theme.png (100%) rename {standards/src7-metadata => SRCs}/.docs/src-7-logo-dark-theme.png (100%) rename {standards/src7-metadata => SRCs}/.docs/src-7-logo-light-theme.png (100%) rename {standards/src8-bridged-asset => SRCs}/.docs/src-8-logo-dark-theme.png (100%) rename {standards/src8-bridged-asset => SRCs}/.docs/src-8-logo-light-theme.png (100%) rename {standards/src9-metadata-keys => SRCs}/.docs/src-9-logo-dark-theme.png (100%) rename {standards/src9-metadata-keys => SRCs}/.docs/src-9-logo-light-theme.png (100%) rename standards/src10-native-bridge/README.md => SRCs/src-10.md (100%) rename standards/src11-security-information/README.md => SRCs/src-11.md (100%) rename standards/src2-inline-docs/README.md => SRCs/src-2.md (99%) rename standards/src20-native-asset/README.md => SRCs/src-20.md (100%) rename standards/src3-mint-burn/README.md => SRCs/src-3.md (100%) rename standards/src5-ownership/README.md => SRCs/src-5.md (100%) rename standards/src6-vault/README.md => SRCs/src-6.md (100%) rename standards/src7-metadata/README.md => SRCs/src-7.md (100%) rename standards/src8-bridged-asset/README.md => SRCs/src-8.md (100%) rename standards/src9-metadata-keys/README.md => SRCs/src-9.md (100%) rename standards/{src10-native-bridge => }/src/src10.sw (100%) rename standards/{src11-security-information => }/src/src11.sw (100%) rename standards/{src20-native-asset => }/src/src20.sw (100%) rename standards/{src3-mint-burn => }/src/src3.sw (100%) rename standards/{src5-ownership => }/src/src5.sw (100%) rename standards/{src6-vault => }/src/src6.sw (100%) rename standards/{src7-metadata => }/src/src7.sw (100%) create mode 100644 standards/src/standards.sw delete mode 100644 standards/src10-native-bridge/Forc.toml delete mode 100644 standards/src11-security-information/Forc.toml delete mode 100644 standards/src20-native-asset/Forc.toml delete mode 100644 standards/src3-mint-burn/Forc.toml delete mode 100644 standards/src5-ownership/Forc.toml delete mode 100644 standards/src6-vault/Forc.toml delete mode 100644 standards/src7-metadata/Forc.toml diff --git a/README.md b/README.md index 8a91f1cb..f9d2f0ac 100644 --- a/README.md +++ b/README.md @@ -35,47 +35,46 @@ If you don't find what you're looking for, feel free to create an issue and prop ### Native Assets -- [SRC-20; Native Asset Standard](./standards/src20-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. -- [SRC-3; Mint and Burn](./standards/src3-mint-burn/) is used to enable mint and burn functionality for Native Assets. -- [SRC-7; Arbitrary Asset Metadata Standard](./standards/src7-metadata/) is used to store metadata for [Native Assets](https://docs.fuel.network/docs/sway/blockchain-development/native_assets). -- [SRC-9; Metadata Keys Standard](./standards/src9-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. -- [SRC-6; Vault Standard](./standards/src6-vault/) defines the implementation of a standard API for asset vaults developed in Sway. +- [SRC-20; Native Asset Standard](./SRCs/src20/) defines the implementation of a standard API for [Native Assets](https://docs.fuel.network/docs/sway/blockchain-development/native_assets) using the Sway Language. +- [SRC-3; Mint and Burn](./SRCs/src3/) is used to enable mint and burn functionality for Native Assets. +- [SRC-7; Arbitrary Asset Metadata Standard](./SRCs/src7/) is used to store metadata for [Native Assets](https://docs.fuel.network/docs/sway/blockchain-development/native_assets). +- [SRC-9; Metadata Keys Standard](./SRCs/src9/) 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. +- [SRC-6; Vault Standard](./SRCs/src6/) defines the implementation of a standard API for asset vaults developed in Sway. ### Access Control -- [SRC-5; Ownership Standard](./standards/src5-ownership/) is used to restrict function calls to admin users in contracts. +- [SRC-5; Ownership Standard](./SRCs/src5/) is used to restrict function calls to admin users in contracts. ### Bridge -- [SRC-8; Bridged Asset](./standards/src8-bridged-asset/) defines the metadata required for an asset bridged to the Fuel Network. -- [SRC-10; Native Bridge Standard](./standards/src10-native-bridge/) defines the standard API for the Native Bridge between the Fuel Chain and the canonical base chain. +- [SRC-8; Bridged Asset](./SRCs/src8/) defines the metadata required for an asset bridged to the Fuel Network. +- [SRC-10; Native Bridge Standard](./SRCs/src10/) defines the standard API for the Native Bridge between the Fuel Chain and the canonical base chain. ### Documentation -- [SRC-2; Inline Documentation](./standards/src2-inline-docs/) defines how to document your Sway files. +- [SRC-2; Inline Documentation](./SRCs/src2/) defines how to document your Sway files. ## Using a standard To import a standard the following should be added to the project's `Forc.toml` file under `[dependencies]` with the most recent release: ```rust -standard = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.1.0" } +standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.1.0" } ``` +> **NOTE:** +> Be sure to set the tag to the latest release. + You may then import your desired standard in your Sway Smart Contract as so: ```rust -use standard::; +use standards::::; ``` -For example, to import the SRC-20 Native Asset Standard use the following statements in your `Forc.toml` and Sway Smart Contract file respectively: - -```rust -src20 = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.3.3" } -``` +For example, to import the SRC-20 Native Asset Standard use the following statement in your Sway Smart Contract file: ```rust -use src20::SRC20; +use standards::src20::SRC20; ``` ### Examples of Standards diff --git a/standards/src10-native-bridge/.docs/src-10-logo-dark-theme.png b/SRCs/.docs/src-10-logo-dark-theme.png similarity index 100% rename from standards/src10-native-bridge/.docs/src-10-logo-dark-theme.png rename to SRCs/.docs/src-10-logo-dark-theme.png diff --git a/standards/src10-native-bridge/.docs/src-10-logo-light-theme.png b/SRCs/.docs/src-10-logo-light-theme.png similarity index 100% rename from standards/src10-native-bridge/.docs/src-10-logo-light-theme.png rename to SRCs/.docs/src-10-logo-light-theme.png diff --git a/standards/src11-security-information/.docs/src-11-logo-dark-theme.png b/SRCs/.docs/src-11-logo-dark-theme.png similarity index 100% rename from standards/src11-security-information/.docs/src-11-logo-dark-theme.png rename to SRCs/.docs/src-11-logo-dark-theme.png diff --git a/standards/src11-security-information/.docs/src-11-logo-light-theme.png b/SRCs/.docs/src-11-logo-light-theme.png similarity index 100% rename from standards/src11-security-information/.docs/src-11-logo-light-theme.png rename to SRCs/.docs/src-11-logo-light-theme.png diff --git a/standards/src2-inline-docs/.docs/src-2-logo-dark-theme.png b/SRCs/.docs/src-2-logo-dark-theme.png similarity index 100% rename from standards/src2-inline-docs/.docs/src-2-logo-dark-theme.png rename to SRCs/.docs/src-2-logo-dark-theme.png diff --git a/standards/src2-inline-docs/.docs/src-2-logo-light-theme.png b/SRCs/.docs/src-2-logo-light-theme.png similarity index 100% rename from standards/src2-inline-docs/.docs/src-2-logo-light-theme.png rename to SRCs/.docs/src-2-logo-light-theme.png diff --git a/standards/src20-native-asset/.docs/src-20-logo-dark-theme.png b/SRCs/.docs/src-20-logo-dark-theme.png similarity index 100% rename from standards/src20-native-asset/.docs/src-20-logo-dark-theme.png rename to SRCs/.docs/src-20-logo-dark-theme.png diff --git a/standards/src20-native-asset/.docs/src-20-logo-light-theme.png b/SRCs/.docs/src-20-logo-light-theme.png similarity index 100% rename from standards/src20-native-asset/.docs/src-20-logo-light-theme.png rename to SRCs/.docs/src-20-logo-light-theme.png diff --git a/standards/src5-ownership/.docs/src-5-logo-dark-theme.png b/SRCs/.docs/src-5-logo-dark-theme.png similarity index 100% rename from standards/src5-ownership/.docs/src-5-logo-dark-theme.png rename to SRCs/.docs/src-5-logo-dark-theme.png diff --git a/standards/src5-ownership/.docs/src-5-logo-light-theme.png b/SRCs/.docs/src-5-logo-light-theme.png similarity index 100% rename from standards/src5-ownership/.docs/src-5-logo-light-theme.png rename to SRCs/.docs/src-5-logo-light-theme.png diff --git a/standards/src6-vault/.docs/src-6-logo-dark-theme.png b/SRCs/.docs/src-6-logo-dark-theme.png similarity index 100% rename from standards/src6-vault/.docs/src-6-logo-dark-theme.png rename to SRCs/.docs/src-6-logo-dark-theme.png diff --git a/standards/src6-vault/.docs/src-6-logo-light-theme.png b/SRCs/.docs/src-6-logo-light-theme.png similarity index 100% rename from standards/src6-vault/.docs/src-6-logo-light-theme.png rename to SRCs/.docs/src-6-logo-light-theme.png diff --git a/standards/src7-metadata/.docs/src-7-logo-dark-theme.png b/SRCs/.docs/src-7-logo-dark-theme.png similarity index 100% rename from standards/src7-metadata/.docs/src-7-logo-dark-theme.png rename to SRCs/.docs/src-7-logo-dark-theme.png diff --git a/standards/src7-metadata/.docs/src-7-logo-light-theme.png b/SRCs/.docs/src-7-logo-light-theme.png similarity index 100% rename from standards/src7-metadata/.docs/src-7-logo-light-theme.png rename to SRCs/.docs/src-7-logo-light-theme.png diff --git a/standards/src8-bridged-asset/.docs/src-8-logo-dark-theme.png b/SRCs/.docs/src-8-logo-dark-theme.png similarity index 100% rename from standards/src8-bridged-asset/.docs/src-8-logo-dark-theme.png rename to SRCs/.docs/src-8-logo-dark-theme.png diff --git a/standards/src8-bridged-asset/.docs/src-8-logo-light-theme.png b/SRCs/.docs/src-8-logo-light-theme.png similarity index 100% rename from standards/src8-bridged-asset/.docs/src-8-logo-light-theme.png rename to SRCs/.docs/src-8-logo-light-theme.png diff --git a/standards/src9-metadata-keys/.docs/src-9-logo-dark-theme.png b/SRCs/.docs/src-9-logo-dark-theme.png similarity index 100% rename from standards/src9-metadata-keys/.docs/src-9-logo-dark-theme.png rename to SRCs/.docs/src-9-logo-dark-theme.png diff --git a/standards/src9-metadata-keys/.docs/src-9-logo-light-theme.png b/SRCs/.docs/src-9-logo-light-theme.png similarity index 100% rename from standards/src9-metadata-keys/.docs/src-9-logo-light-theme.png rename to SRCs/.docs/src-9-logo-light-theme.png diff --git a/standards/src10-native-bridge/README.md b/SRCs/src-10.md similarity index 100% rename from standards/src10-native-bridge/README.md rename to SRCs/src-10.md diff --git a/standards/src11-security-information/README.md b/SRCs/src-11.md similarity index 100% rename from standards/src11-security-information/README.md rename to SRCs/src-11.md diff --git a/standards/src2-inline-docs/README.md b/SRCs/src-2.md similarity index 99% rename from standards/src2-inline-docs/README.md rename to SRCs/src-2.md index e40a70bc..a7e78386 100644 --- a/standards/src2-inline-docs/README.md +++ b/SRCs/src-2.md @@ -1,7 +1,7 @@

- SRC-5 logo + SRC-2 logo

diff --git a/standards/src20-native-asset/README.md b/SRCs/src-20.md similarity index 100% rename from standards/src20-native-asset/README.md rename to SRCs/src-20.md diff --git a/standards/src3-mint-burn/README.md b/SRCs/src-3.md similarity index 100% rename from standards/src3-mint-burn/README.md rename to SRCs/src-3.md diff --git a/standards/src5-ownership/README.md b/SRCs/src-5.md similarity index 100% rename from standards/src5-ownership/README.md rename to SRCs/src-5.md diff --git a/standards/src6-vault/README.md b/SRCs/src-6.md similarity index 100% rename from standards/src6-vault/README.md rename to SRCs/src-6.md diff --git a/standards/src7-metadata/README.md b/SRCs/src-7.md similarity index 100% rename from standards/src7-metadata/README.md rename to SRCs/src-7.md diff --git a/standards/src8-bridged-asset/README.md b/SRCs/src-8.md similarity index 100% rename from standards/src8-bridged-asset/README.md rename to SRCs/src-8.md diff --git a/standards/src9-metadata-keys/README.md b/SRCs/src-9.md similarity index 100% rename from standards/src9-metadata-keys/README.md rename to SRCs/src-9.md diff --git a/examples/src11-security-information/hardcoded-information/Forc.toml b/examples/src11-security-information/hardcoded-information/Forc.toml index 97944fd9..1f7332a9 100644 --- a/examples/src11-security-information/hardcoded-information/Forc.toml +++ b/examples/src11-security-information/hardcoded-information/Forc.toml @@ -5,4 +5,4 @@ license = "Apache-2.0" name = "hardcoded-information" [dependencies] -src11 = { path = "../../../standards/src11-security-information" } +standards = { path = "../../../standards" } diff --git a/examples/src11-security-information/hardcoded-information/src/main.sw b/examples/src11-security-information/hardcoded-information/src/main.sw index dff6e12e..13e11787 100644 --- a/examples/src11-security-information/hardcoded-information/src/main.sw +++ b/examples/src11-security-information/hardcoded-information/src/main.sw @@ -1,6 +1,6 @@ contract; -use src11::{SecurityInformation, SRC11}; +use standards::src11::{SecurityInformation, SRC11}; use std::{string::String, vec::Vec,}; diff --git a/examples/src11-security-information/variable-information/Forc.toml b/examples/src11-security-information/variable-information/Forc.toml index 06d80aa5..ec6b0b7c 100644 --- a/examples/src11-security-information/variable-information/Forc.toml +++ b/examples/src11-security-information/variable-information/Forc.toml @@ -5,4 +5,4 @@ license = "Apache-2.0" name = "variable-information" [dependencies] -src11 = { path = "../../../standards/src11-security-information" } +standards = { path = "../../../standards" } diff --git a/examples/src11-security-information/variable-information/src/main.sw b/examples/src11-security-information/variable-information/src/main.sw index 697955ac..a3e078bc 100644 --- a/examples/src11-security-information/variable-information/src/main.sw +++ b/examples/src11-security-information/variable-information/src/main.sw @@ -1,6 +1,6 @@ contract; -use src11::{SecurityInformation, SRC11}; +use standards::src11::{SecurityInformation, SRC11}; use std::{storage::{storage_string::*, storage_vec::*,}, string::String, vec::Vec,}; diff --git a/examples/src20-native-asset/multi_asset/Forc.toml b/examples/src20-native-asset/multi_asset/Forc.toml index adf301ba..e83036aa 100644 --- a/examples/src20-native-asset/multi_asset/Forc.toml +++ b/examples/src20-native-asset/multi_asset/Forc.toml @@ -5,4 +5,4 @@ license = "Apache-2.0" name = "multi_src20_asset" [dependencies] -src20 = { path = "../../../standards/src20-native-asset" } +standards = { path = "../../../standards" } diff --git a/examples/src20-native-asset/multi_asset/src/multi_asset.sw b/examples/src20-native-asset/multi_asset/src/multi_asset.sw index 635cc4fd..e20a95e8 100644 --- a/examples/src20-native-asset/multi_asset/src/multi_asset.sw +++ b/examples/src20-native-asset/multi_asset/src/multi_asset.sw @@ -1,6 +1,6 @@ contract; -use src20::SRC20; +use standards::src20::SRC20; use std::{hash::Hash, storage::storage_string::*, string::String}; storage { diff --git a/examples/src20-native-asset/single_asset/Forc.toml b/examples/src20-native-asset/single_asset/Forc.toml index dc8c7a0e..29d1b6fc 100644 --- a/examples/src20-native-asset/single_asset/Forc.toml +++ b/examples/src20-native-asset/single_asset/Forc.toml @@ -5,4 +5,4 @@ license = "Apache-2.0" name = "single_src20_asset" [dependencies] -src20 = { path = "../../../standards/src20-native-asset" } +standards = { path = "../../../standards" } diff --git a/examples/src20-native-asset/single_asset/src/single_asset.sw b/examples/src20-native-asset/single_asset/src/single_asset.sw index 610c536e..c9fa0283 100644 --- a/examples/src20-native-asset/single_asset/src/single_asset.sw +++ b/examples/src20-native-asset/single_asset/src/single_asset.sw @@ -1,6 +1,6 @@ contract; -use src20::SRC20; +use standards::src20::SRC20; use std::{call_frames::contract_id, string::String}; configurable { diff --git a/examples/src3-mint-burn/multi_asset/Forc.toml b/examples/src3-mint-burn/multi_asset/Forc.toml index 60a1f470..24301456 100644 --- a/examples/src3-mint-burn/multi_asset/Forc.toml +++ b/examples/src3-mint-burn/multi_asset/Forc.toml @@ -5,5 +5,4 @@ license = "Apache-2.0" name = "multi_src3_asset" [dependencies] -src20 = { path = "../../../standards/src20-native-asset" } -src3 = { path = "../../../standards/src3-mint-burn" } +standards = { path = "../../../standards" } diff --git a/examples/src3-mint-burn/multi_asset/src/multi_asset.sw b/examples/src3-mint-burn/multi_asset/src/multi_asset.sw index 9413ad19..e003d221 100644 --- a/examples/src3-mint-burn/multi_asset/src/multi_asset.sw +++ b/examples/src3-mint-burn/multi_asset/src/multi_asset.sw @@ -1,7 +1,6 @@ contract; -use src3::SRC3; -use src20::SRC20; +use standards::{src20::SRC20, src3::SRC3}; use std::{ asset::{ burn, diff --git a/examples/src3-mint-burn/single_asset/Forc.toml b/examples/src3-mint-burn/single_asset/Forc.toml index b7d6e533..4c157081 100644 --- a/examples/src3-mint-burn/single_asset/Forc.toml +++ b/examples/src3-mint-burn/single_asset/Forc.toml @@ -5,5 +5,4 @@ license = "Apache-2.0" name = "single_src3_asset" [dependencies] -src20 = { path = "../../../standards/src20-native-asset" } -src3 = { path = "../../../standards/src3-mint-burn" } +standards = { path = "../../../standards" } diff --git a/examples/src3-mint-burn/single_asset/src/single_asset.sw b/examples/src3-mint-burn/single_asset/src/single_asset.sw index 66228661..9d3a808a 100644 --- a/examples/src3-mint-burn/single_asset/src/single_asset.sw +++ b/examples/src3-mint-burn/single_asset/src/single_asset.sw @@ -1,7 +1,6 @@ contract; -use src3::SRC3; -use src20::SRC20; +use standards::{src20::SRC20, src3::SRC3}; use std::{ asset::{ burn, diff --git a/examples/src5-ownership/initialized_example/Forc.toml b/examples/src5-ownership/initialized_example/Forc.toml index 2ef8d497..5265d02d 100644 --- a/examples/src5-ownership/initialized_example/Forc.toml +++ b/examples/src5-ownership/initialized_example/Forc.toml @@ -5,4 +5,4 @@ license = "Apache-2.0" name = "initialized_src5_example" [dependencies] -src5 = { path = "../../../standards/src5-ownership" } +standards = { path = "../../../standards" } diff --git a/examples/src5-ownership/initialized_example/src/initialized_example.sw b/examples/src5-ownership/initialized_example/src/initialized_example.sw index f48cfd4b..dae9f363 100644 --- a/examples/src5-ownership/initialized_example/src/initialized_example.sw +++ b/examples/src5-ownership/initialized_example/src/initialized_example.sw @@ -1,6 +1,6 @@ contract; -use src5::{SRC5, State}; +use standards::src5::{SRC5, State}; use std::constants::ZERO_B256; configurable { diff --git a/examples/src5-ownership/uninitialized_example/Forc.toml b/examples/src5-ownership/uninitialized_example/Forc.toml index 78ecb979..51d964d3 100644 --- a/examples/src5-ownership/uninitialized_example/Forc.toml +++ b/examples/src5-ownership/uninitialized_example/Forc.toml @@ -5,4 +5,4 @@ license = "Apache-2.0" name = "uninitialized_src5_example" [dependencies] -src5 = { path = "../../../standards/src5-ownership" } +standards = { path = "../../../standards" } diff --git a/examples/src5-ownership/uninitialized_example/src/uninitialized_example.sw b/examples/src5-ownership/uninitialized_example/src/uninitialized_example.sw index bc3842fa..454f975e 100644 --- a/examples/src5-ownership/uninitialized_example/src/uninitialized_example.sw +++ b/examples/src5-ownership/uninitialized_example/src/uninitialized_example.sw @@ -1,6 +1,6 @@ contract; -use src5::{SRC5, State}; +use standards::src5::{SRC5, State}; storage { /// The owner in storage. diff --git a/examples/src6-vault/multi_asset_vault/Forc.toml b/examples/src6-vault/multi_asset_vault/Forc.toml index a1a60324..6a5ae946 100644 --- a/examples/src6-vault/multi_asset_vault/Forc.toml +++ b/examples/src6-vault/multi_asset_vault/Forc.toml @@ -5,5 +5,4 @@ license = "Apache-2.0" name = "multi_asset_vault" [dependencies] -src20 = { path = "../../../standards/src20-native-asset" } -src6 = { path = "../../../standards/src6-vault" } +standards = { path = "../../../standards" } diff --git a/examples/src6-vault/multi_asset_vault/src/main.sw b/examples/src6-vault/multi_asset_vault/src/main.sw index 9aeb20d1..26d34283 100644 --- a/examples/src6-vault/multi_asset_vault/src/main.sw +++ b/examples/src6-vault/multi_asset_vault/src/main.sw @@ -12,8 +12,7 @@ use std::{ string::String, }; -use src6::{Deposit, SRC6, Withdraw}; -use src20::SRC20; +use standards::{src20::SRC20, src6::{Deposit, SRC6, Withdraw}}; pub struct VaultInfo { /// Amount of assets currently managed by this vault diff --git a/examples/src6-vault/single_asset_single_sub_vault/Forc.toml b/examples/src6-vault/single_asset_single_sub_vault/Forc.toml index dc19ccff..31ffe275 100644 --- a/examples/src6-vault/single_asset_single_sub_vault/Forc.toml +++ b/examples/src6-vault/single_asset_single_sub_vault/Forc.toml @@ -5,5 +5,4 @@ license = "Apache-2.0" name = "single_asset_single_sub_vault" [dependencies] -src20 = { path = "../../../standards/src20-native-asset" } -src6 = { path = "../../../standards/src6-vault" } +standards = { path = "../../../standards" } diff --git a/examples/src6-vault/single_asset_single_sub_vault/src/main.sw b/examples/src6-vault/single_asset_single_sub_vault/src/main.sw index 62a0720f..458928bf 100644 --- a/examples/src6-vault/single_asset_single_sub_vault/src/main.sw +++ b/examples/src6-vault/single_asset_single_sub_vault/src/main.sw @@ -16,8 +16,7 @@ use std::{ string::String, }; -use src6::{Deposit, SRC6, Withdraw}; -use src20::SRC20; +use standards::{src20::SRC20, src6::{Deposit, SRC6, Withdraw}}; configurable { /// The only asset that can be deposited and withdrawn from this vault. diff --git a/examples/src6-vault/single_asset_vault/Forc.toml b/examples/src6-vault/single_asset_vault/Forc.toml index a6ecc74c..57dad053 100644 --- a/examples/src6-vault/single_asset_vault/Forc.toml +++ b/examples/src6-vault/single_asset_vault/Forc.toml @@ -5,5 +5,4 @@ license = "Apache-2.0" name = "single_asset_vault" [dependencies] -src20 = { path = "../../../standards/src20-native-asset" } -src6 = { path = "../../../standards/src6-vault" } +standards = { path = "../../../standards" } diff --git a/examples/src6-vault/single_asset_vault/src/main.sw b/examples/src6-vault/single_asset_vault/src/main.sw index 6f2ce7f3..0a914eae 100644 --- a/examples/src6-vault/single_asset_vault/src/main.sw +++ b/examples/src6-vault/single_asset_vault/src/main.sw @@ -13,8 +13,7 @@ use std::{ string::String, }; -use src6::{Deposit, SRC6, Withdraw}; -use src20::SRC20; +use standards::{src20::SRC20, src6::{Deposit, SRC6, Withdraw}}; pub struct VaultInfo { /// Amount of assets currently managed by this vault diff --git a/examples/src7-metadata/multi_asset/Forc.toml b/examples/src7-metadata/multi_asset/Forc.toml index c5032480..80896160 100644 --- a/examples/src7-metadata/multi_asset/Forc.toml +++ b/examples/src7-metadata/multi_asset/Forc.toml @@ -5,5 +5,4 @@ license = "Apache-2.0" name = "multi_src7_asset" [dependencies] -src20 = { path = "../../../standards/src20-native-asset" } -src7 = { path = "../../../standards/src7-metadata" } +standards = { path = "../../../standards" } diff --git a/examples/src7-metadata/multi_asset/src/multi_asset.sw b/examples/src7-metadata/multi_asset/src/multi_asset.sw index cfa6212c..7a7d4685 100644 --- a/examples/src7-metadata/multi_asset/src/multi_asset.sw +++ b/examples/src7-metadata/multi_asset/src/multi_asset.sw @@ -1,7 +1,6 @@ contract; -use src7::{Metadata, SRC7}; -use src20::SRC20; +use standards::{src20::SRC20, src7::{Metadata, SRC7}}; use std::{call_frames::contract_id, hash::Hash, storage::storage_string::*, string::String}; diff --git a/examples/src7-metadata/single_asset/Forc.toml b/examples/src7-metadata/single_asset/Forc.toml index df2c9bc8..40ce61ad 100644 --- a/examples/src7-metadata/single_asset/Forc.toml +++ b/examples/src7-metadata/single_asset/Forc.toml @@ -5,5 +5,4 @@ license = "Apache-2.0" name = "single_src7_asset" [dependencies] -src20 = { path = "../../../standards/src20-native-asset" } -src7 = { path = "../../../standards/src7-metadata" } +standards = { path = "../../../standards" } diff --git a/examples/src7-metadata/single_asset/src/single_asset.sw b/examples/src7-metadata/single_asset/src/single_asset.sw index ccd8572d..07618332 100644 --- a/examples/src7-metadata/single_asset/src/single_asset.sw +++ b/examples/src7-metadata/single_asset/src/single_asset.sw @@ -1,7 +1,6 @@ contract; -use src7::{Metadata, SRC7}; -use src20::SRC20; +use standards::{src20::SRC20, src7::{Metadata, SRC7}}; use std::{call_frames::contract_id, string::String}; diff --git a/standards/Forc.toml b/standards/Forc.toml index 7a30db41..d1f5aa36 100644 --- a/standards/Forc.toml +++ b/standards/Forc.toml @@ -1,9 +1,5 @@ -[workspace] -members = [ - "src3-mint-burn", - "src5-ownership", - "src6-vault", - "src7-metadata", - "src10-native-bridge", - "src20-native-asset", -] +[project] +authors = ["Fuel Labs "] +entry = "standards.sw" +license = "Apache-2.0" +name = "standards" diff --git a/standards/src10-native-bridge/src/src10.sw b/standards/src/src10.sw similarity index 100% rename from standards/src10-native-bridge/src/src10.sw rename to standards/src/src10.sw diff --git a/standards/src11-security-information/src/src11.sw b/standards/src/src11.sw similarity index 100% rename from standards/src11-security-information/src/src11.sw rename to standards/src/src11.sw diff --git a/standards/src20-native-asset/src/src20.sw b/standards/src/src20.sw similarity index 100% rename from standards/src20-native-asset/src/src20.sw rename to standards/src/src20.sw diff --git a/standards/src3-mint-burn/src/src3.sw b/standards/src/src3.sw similarity index 100% rename from standards/src3-mint-burn/src/src3.sw rename to standards/src/src3.sw diff --git a/standards/src5-ownership/src/src5.sw b/standards/src/src5.sw similarity index 100% rename from standards/src5-ownership/src/src5.sw rename to standards/src/src5.sw diff --git a/standards/src6-vault/src/src6.sw b/standards/src/src6.sw similarity index 100% rename from standards/src6-vault/src/src6.sw rename to standards/src/src6.sw diff --git a/standards/src7-metadata/src/src7.sw b/standards/src/src7.sw similarity index 100% rename from standards/src7-metadata/src/src7.sw rename to standards/src/src7.sw diff --git a/standards/src/standards.sw b/standards/src/standards.sw new file mode 100644 index 00000000..f5708f42 --- /dev/null +++ b/standards/src/standards.sw @@ -0,0 +1,9 @@ +library; + +pub mod src3; +pub mod src5; +pub mod src6; +pub mod src7; +pub mod src10; +pub mod src11; +pub mod src20; diff --git a/standards/src10-native-bridge/Forc.toml b/standards/src10-native-bridge/Forc.toml deleted file mode 100644 index 331e3ffb..00000000 --- a/standards/src10-native-bridge/Forc.toml +++ /dev/null @@ -1,5 +0,0 @@ -[project] -authors = ["Fuel Labs "] -entry = "src10.sw" -license = "Apache-2.0" -name = "src10" diff --git a/standards/src11-security-information/Forc.toml b/standards/src11-security-information/Forc.toml deleted file mode 100644 index 141f81f6..00000000 --- a/standards/src11-security-information/Forc.toml +++ /dev/null @@ -1,5 +0,0 @@ -[project] -authors = ["Fuel Labs "] -entry = "src11.sw" -license = "Apache-2.0" -name = "src11" diff --git a/standards/src20-native-asset/Forc.toml b/standards/src20-native-asset/Forc.toml deleted file mode 100644 index 5ef53ee4..00000000 --- a/standards/src20-native-asset/Forc.toml +++ /dev/null @@ -1,5 +0,0 @@ -[project] -authors = ["Fuel Labs "] -entry = "src20.sw" -license = "Apache-2.0" -name = "src20" diff --git a/standards/src3-mint-burn/Forc.toml b/standards/src3-mint-burn/Forc.toml deleted file mode 100644 index aea9017c..00000000 --- a/standards/src3-mint-burn/Forc.toml +++ /dev/null @@ -1,5 +0,0 @@ -[project] -authors = ["Fuel Labs "] -entry = "src3.sw" -license = "Apache-2.0" -name = "src3" diff --git a/standards/src5-ownership/Forc.toml b/standards/src5-ownership/Forc.toml deleted file mode 100644 index c1b13132..00000000 --- a/standards/src5-ownership/Forc.toml +++ /dev/null @@ -1,5 +0,0 @@ -[project] -authors = ["Fuel Labs "] -entry = "src5.sw" -license = "Apache-2.0" -name = "src5" diff --git a/standards/src6-vault/Forc.toml b/standards/src6-vault/Forc.toml deleted file mode 100644 index d3423443..00000000 --- a/standards/src6-vault/Forc.toml +++ /dev/null @@ -1,5 +0,0 @@ -[project] -authors = ["Fuel Labs "] -entry = "src6.sw" -license = "Apache-2.0" -name = "src6" diff --git a/standards/src7-metadata/Forc.toml b/standards/src7-metadata/Forc.toml deleted file mode 100644 index ede2b398..00000000 --- a/standards/src7-metadata/Forc.toml +++ /dev/null @@ -1,5 +0,0 @@ -[project] -authors = ["Fuel Labs "] -entry = "src7.sw" -license = "Apache-2.0" -name = "src7"