diff --git a/README.md b/README.md index de32097..2a7b3ac 100644 --- a/README.md +++ b/README.md @@ -57,11 +57,11 @@ use standard::; For example, to import the SRC-20 Token Standard use the following statements in your `Forc.toml` and Sway Smart Contract file respectively: ```rust -src_20 = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.1.1" } +src20 = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.1.1" } ``` ```rust -use src_20::SRC20; +use src20::SRC20; ``` ### Examples of Standards @@ -70,41 +70,41 @@ Minimal example implementations for every standard can be found in the [`example #### SRC-20; Token Standard Examples -##### - [Single Native Assset](./examples/src_20/single_asset/src/single_asset.sw) +##### - [Single Native Assset](./examples/src20-token/single_asset/src/single_asset.sw) Example of the SRC-20 implementation where a contract contains a single asset with one `SubId`. This implementation is recommended for users that intend to deploy a single asset with their contract. -##### - [Multi Native Asset](./examples/src_20/multi_asset/src/multi_asset.sw) +##### - [Multi Native Asset](./examples/src20-token/multi_asset/src/multi_asset.sw) Example of the SRC-20 implementation where a contract contains multiple assets with differing `SubId`s. This implementation is recommended for users that intend to deploy multiple assets with their contract. #### SRC-3; Mint and Burn Standard Examples -##### - [Single Native Asset](./examples/src_3/single_asset/src/single_asset.sw) +##### - [Single Native Asset](./examples/src3-mint-burn/single_asset/src/single_asset.sw) Example of the SRC-3 implementation where a contract only mints a single asset with one `SubId`. -##### - [Multi Native Asset](./examples/src_3/multi_asset/src/multi_asset.sw) +##### - [Multi Native Asset](./examples/src3-mint-burn/multi_asset/src/multi_asset.sw) Example of the SRC-3 implementation where a contract mints multiple assets with differing `SubId`s. #### SRC-5; Ownership Examples -##### - [Uninitalized](./examples/src_5/uninitialized_example/src/uninitialized_example.sw) +##### - [Uninitalized](./examples/src5-ownership/uninitialized_example/src/uninitialized_example.sw) Example of the SRC-5 implementation where a contract does not have an owner set at compile time with the intent to set it during runtime. -##### - [Initialized](./examples/src_5/initialized_example/src/initialized_example.sw) +##### - [Initialized](./examples/src5-ownership/initialized_example/src/initialized_example.sw) Example of the SRC-5 implementation where a contract has an owner set at compile time. #### SRC-7; Arbitrary Asset Metadata Standard Examples -##### - [Single Native Asset](./examples/src_7/single_asset/src/single_asset.sw) +##### - [Single Native Asset](./examples/src7-metadata/single_asset/src/single_asset.sw) Example of the SRC-7 implementation where metadata exists for only a single asset with one `SubId`. -##### - [Mutli Native Asset](./examples/src_7/multi_asset/src/multi_asset.sw) +##### - [Mutli Native Asset](./examples/src7-metadata/multi_asset/src/multi_asset.sw) Example of the SRC-7 implementation where metadata exists for multiple assets with differing `SubId`s. diff --git a/examples/Forc.toml b/examples/Forc.toml index 2fbfd70..be17827 100644 --- a/examples/Forc.toml +++ b/examples/Forc.toml @@ -1,11 +1,11 @@ [workspace] members = [ - "src_3/single_asset", - "src_3/multi_asset", - "src_5/initialized_example", - "src_5/uninitialized_example", - "src_7/single_asset", - "src_7/multi_asset", - "src_20/single_asset", - "src_20/multi_asset", + "src3-mint-burn/single_asset", + "src3-mint-burn/multi_asset", + "src5-ownership/initialized_example", + "src5-ownership/uninitialized_example", + "src7-metadata/single_asset", + "src7-metadata/multi_asset", + "src20-token/single_asset", + "src20-token/multi_asset", ] diff --git a/examples/src_20/multi_asset/Forc.toml b/examples/src20-token/multi_asset/Forc.toml similarity index 73% rename from examples/src_20/multi_asset/Forc.toml rename to examples/src20-token/multi_asset/Forc.toml index 9a19bfb..6291a77 100644 --- a/examples/src_20/multi_asset/Forc.toml +++ b/examples/src20-token/multi_asset/Forc.toml @@ -5,4 +5,4 @@ license = "Apache-2.0" name = "multi_src20_asset" [dependencies] -src_20 = { path = "../../../standards/src_20" } +src20 = { path = "../../../standards/src20-token" } diff --git a/examples/src_20/multi_asset/src/multi_asset.sw b/examples/src20-token/multi_asset/src/multi_asset.sw similarity index 96% rename from examples/src_20/multi_asset/src/multi_asset.sw rename to examples/src20-token/multi_asset/src/multi_asset.sw index 179d127..54852a6 100644 --- a/examples/src_20/multi_asset/src/multi_asset.sw +++ b/examples/src20-token/multi_asset/src/multi_asset.sw @@ -1,6 +1,6 @@ contract; -use src_20::SRC20; +use src20::SRC20; use std::{hash::Hash, storage::storage_string::*, string::String}; storage { @@ -34,7 +34,7 @@ impl SRC20 for Contract { /// # Examples /// /// ```sway - /// use src_20::SRC20; + /// use src20::SRC20; /// /// fn foo(contract_id: ContractId) { /// let src_20_abi = abi(SRC20, contract_id); @@ -64,7 +64,7 @@ impl SRC20 for Contract { /// # Examples /// /// ```sway - /// use src_20::SRC20; + /// use src20::SRC20; /// use std::constants::DEFAULT_SUB_ID; /// /// fn foo(contract_id: ContractId) { @@ -95,7 +95,7 @@ impl SRC20 for Contract { /// # Examples /// /// ```sway - /// use src_20::SRC20; + /// use src20::SRC20; /// use std::constants::DEFAULT_SUB_ID; /// /// fn foo(contract_id: ContractId) { @@ -126,7 +126,7 @@ impl SRC20 for Contract { /// # Examples /// /// ```sway - /// use src_20::SRC20; + /// use src20::SRC20; /// use std::constants::DEFAULT_SUB_ID; /// /// fn foo(contract_id: ContractId) { @@ -157,7 +157,7 @@ impl SRC20 for Contract { /// # Examples /// /// ```sway - /// use src_20::SRC20; + /// use src20::SRC20; /// use std::constants::DEFAULT_SUB_ID; /// /// fn foo(contract_id: ContractId) { diff --git a/examples/src_20/single_asset/Forc.toml b/examples/src20-token/single_asset/Forc.toml similarity index 73% rename from examples/src_20/single_asset/Forc.toml rename to examples/src20-token/single_asset/Forc.toml index 2ef6299..3fb9050 100644 --- a/examples/src_20/single_asset/Forc.toml +++ b/examples/src20-token/single_asset/Forc.toml @@ -5,4 +5,4 @@ license = "Apache-2.0" name = "single_src20_asset" [dependencies] -src_20 = { path = "../../../standards/src_20" } +src20 = { path = "../../../standards/src20-token" } diff --git a/examples/src_20/single_asset/src/single_asset.sw b/examples/src20-token/single_asset/src/single_asset.sw similarity index 96% rename from examples/src_20/single_asset/src/single_asset.sw rename to examples/src20-token/single_asset/src/single_asset.sw index 25e4972..50506ed 100644 --- a/examples/src_20/single_asset/src/single_asset.sw +++ b/examples/src20-token/single_asset/src/single_asset.sw @@ -1,6 +1,6 @@ contract; -use src_20::SRC20; +use src20::SRC20; use std::{call_frames::contract_id, string::String}; configurable { @@ -28,7 +28,7 @@ impl SRC20 for Contract { /// # Examples /// /// ```sway - /// use src_20::SRC20; + /// use src20::SRC20; /// /// fn foo(contract_id: ContractId) { /// let src_20_abi = abi(SRC20, contract_id); @@ -54,7 +54,7 @@ impl SRC20 for Contract { /// # Examples /// /// ```sway - /// use src_20::SRC20; + /// use src20::SRC20; /// use std::constants::DEFAULT_SUB_ID; /// /// fn foo(contract_id: ContractId) { @@ -85,7 +85,7 @@ impl SRC20 for Contract { /// # Examples /// /// ```sway - /// use src_20::SRC20; + /// use src20::SRC20; /// use std::constants::DEFAULT_SUB_ID; /// /// fn foo(contract_id: ContractId) { @@ -116,7 +116,7 @@ impl SRC20 for Contract { /// # Examples /// /// ```sway - /// use src_20::SRC20; + /// use src20::SRC20; /// use std::constants::DEFAULT_SUB_ID; /// /// fn foo(contract_id: ContractId) { @@ -147,7 +147,7 @@ impl SRC20 for Contract { /// # Examples /// /// ```sway - /// use src_20::SRC20; + /// use src20::SRC20; /// use std::constants::DEFAULT_SUB_ID; /// /// fn foo(contract_id: ContractId) { diff --git a/examples/src_3/multi_asset/Forc.toml b/examples/src3-mint-burn/multi_asset/Forc.toml similarity index 57% rename from examples/src_3/multi_asset/Forc.toml rename to examples/src3-mint-burn/multi_asset/Forc.toml index a8033eb..2283191 100644 --- a/examples/src_3/multi_asset/Forc.toml +++ b/examples/src3-mint-burn/multi_asset/Forc.toml @@ -5,5 +5,5 @@ license = "Apache-2.0" name = "multi_src3_asset" [dependencies] -src_20 = { path = "../../../standards/src_20" } -src_3 = { path = "../../../standards/src_3" } +src20 = { path = "../../../standards/src20-token" } +src3 = { path = "../../../standards/src3-mint-burn" } diff --git a/examples/src_3/multi_asset/src/multi_asset.sw b/examples/src3-mint-burn/multi_asset/src/multi_asset.sw similarity index 97% rename from examples/src_3/multi_asset/src/multi_asset.sw rename to examples/src3-mint-burn/multi_asset/src/multi_asset.sw index 6e8d442..f1a1a16 100644 --- a/examples/src_3/multi_asset/src/multi_asset.sw +++ b/examples/src3-mint-burn/multi_asset/src/multi_asset.sw @@ -1,7 +1,7 @@ contract; -use src_3::SRC3; -use src_20::SRC20; +use src3::SRC3; +use src20::SRC20; use std::{ call_frames::{ contract_id, @@ -55,7 +55,7 @@ impl SRC3 for Contract { /// use std::constants::DEFAULT_SUB_ID; /// /// fn foo(contract_id: ContractId) { - /// let contract_abi = abi(SR3, contract_id); + /// let contract_abi = abi(SRC3, contract_id); /// contract_abi.mint(Identity::ContractId(contract_id), DEFAULT_SUB_ID, 100); /// } /// ``` @@ -105,7 +105,7 @@ impl SRC3 for Contract { /// use std::constants::DEFAULT_SUB_ID; /// /// fn foo(contract_id: ContractId, asset_id: AssetId) { - /// let contract_abi = abi(SR3, contract_id); + /// let contract_abi = abi(SRC3, contract_id); /// contract_abi { /// gas: 10000, /// coins: 100, diff --git a/examples/src_3/single_asset/Forc.toml b/examples/src3-mint-burn/single_asset/Forc.toml similarity index 57% rename from examples/src_3/single_asset/Forc.toml rename to examples/src3-mint-burn/single_asset/Forc.toml index 03765ff..6278faa 100644 --- a/examples/src_3/single_asset/Forc.toml +++ b/examples/src3-mint-burn/single_asset/Forc.toml @@ -5,5 +5,5 @@ license = "Apache-2.0" name = "single_src3_asset" [dependencies] -src_20 = { path = "../../../standards/src_20" } -src_3 = { path = "../../../standards/src_3" } +src20 = { path = "../../../standards/src20-token" } +src3 = { path = "../../../standards/src3-mint-burn" } diff --git a/examples/src_3/single_asset/src/single_asset.sw b/examples/src3-mint-burn/single_asset/src/single_asset.sw similarity index 96% rename from examples/src_3/single_asset/src/single_asset.sw rename to examples/src3-mint-burn/single_asset/src/single_asset.sw index 8f8acc0..874d0c6 100644 --- a/examples/src_3/single_asset/src/single_asset.sw +++ b/examples/src3-mint-burn/single_asset/src/single_asset.sw @@ -1,7 +1,7 @@ contract; -use src_3::SRC3; -use src_20::SRC20; +use src3::SRC3; +use src20::SRC20; use std::{ call_frames::{ contract_id, @@ -55,7 +55,7 @@ impl SRC3 for Contract { /// use std::constants::DEFAULT_SUB_ID; /// /// fn foo(contract_id: ContractId) { - /// let contract_abi = abi(SR3, contract); + /// let contract_abi = abi(SRC3, contract); /// contract_abi.mint(Identity::ContractId(contract_id), DEFAULT_SUB_ID, 100); /// } /// ``` @@ -95,7 +95,7 @@ impl SRC3 for Contract { /// use std::constants::DEFAULT_SUB_ID; /// /// fn foo(contract_id: ContractId, asset_id: AssetId) { - /// let contract_abi = abi(SR3, contract_id); + /// let contract_abi = abi(SRC3, contract_id); /// contract_abi { /// gas: 10000, /// coins: 100, diff --git a/examples/src_5/initialized_example/Forc.toml b/examples/src5-ownership/initialized_example/Forc.toml similarity index 74% rename from examples/src_5/initialized_example/Forc.toml rename to examples/src5-ownership/initialized_example/Forc.toml index 6325c38..2ef8d49 100644 --- a/examples/src_5/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] -src_5 = { path = "../../../standards/src_5" } +src5 = { path = "../../../standards/src5-ownership" } diff --git a/examples/src_5/initialized_example/src/initialized_example.sw b/examples/src5-ownership/initialized_example/src/initialized_example.sw similarity index 95% rename from examples/src_5/initialized_example/src/initialized_example.sw rename to examples/src5-ownership/initialized_example/src/initialized_example.sw index e2bdcf1..f48cfd4 100644 --- a/examples/src_5/initialized_example/src/initialized_example.sw +++ b/examples/src5-ownership/initialized_example/src/initialized_example.sw @@ -1,6 +1,6 @@ contract; -use src_5::{SRC5, State}; +use src5::{SRC5, State}; use std::constants::ZERO_B256; configurable { @@ -27,7 +27,7 @@ impl SRC5 for Contract { /// # Examples /// /// ```sway - /// use src_5::SRC_5; + /// use src5::SRC5; /// /// fn foo(contract_id: ContractId) { /// let ownership_abi = abi(contract_id, SRC_5); diff --git a/examples/src_5/uninitialized_example/Forc.toml b/examples/src5-ownership/uninitialized_example/Forc.toml similarity index 75% rename from examples/src_5/uninitialized_example/Forc.toml rename to examples/src5-ownership/uninitialized_example/Forc.toml index 44fda49..78ecb97 100644 --- a/examples/src_5/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] -src_5 = { path = "../../../standards/src_5" } +src5 = { path = "../../../standards/src5-ownership" } diff --git a/examples/src_5/uninitialized_example/src/uninitialized_example.sw b/examples/src5-ownership/uninitialized_example/src/uninitialized_example.sw similarity index 93% rename from examples/src_5/uninitialized_example/src/uninitialized_example.sw rename to examples/src5-ownership/uninitialized_example/src/uninitialized_example.sw index 1a8d401..bc3842f 100644 --- a/examples/src_5/uninitialized_example/src/uninitialized_example.sw +++ b/examples/src5-ownership/uninitialized_example/src/uninitialized_example.sw @@ -1,6 +1,6 @@ contract; -use src_5::{SRC5, State}; +use src5::{SRC5, State}; storage { /// The owner in storage. @@ -21,7 +21,7 @@ impl SRC5 for Contract { /// # Examples /// /// ```sway - /// use src_5::SRC_5; + /// use src5::SRC5; /// /// fn foo(contract_id: ContractId) { /// let ownership_abi = abi(contract_id, SRC_5); diff --git a/examples/src_6/multi_token_vault/.gitignore b/examples/src6-vault/multi_token_vault/.gitignore similarity index 100% rename from examples/src_6/multi_token_vault/.gitignore rename to examples/src6-vault/multi_token_vault/.gitignore diff --git a/examples/src_6/multi_token_vault/Forc.toml b/examples/src6-vault/multi_token_vault/Forc.toml similarity index 57% rename from examples/src_6/multi_token_vault/Forc.toml rename to examples/src6-vault/multi_token_vault/Forc.toml index 7451256..b88b6fe 100644 --- a/examples/src_6/multi_token_vault/Forc.toml +++ b/examples/src6-vault/multi_token_vault/Forc.toml @@ -5,5 +5,5 @@ license = "Apache-2.0" name = "multi_token_vault" [dependencies] -src_20 = { path = "../../../standards/src_20" } -src_6 = { path = "../../../standards/src_6" } +src20 = { path = "../../../standards/src20-token" } +src6 = { path = "../../../standards/src6-vault" } diff --git a/examples/src_6/multi_token_vault/src/main.sw b/examples/src6-vault/multi_token_vault/src/main.sw similarity index 99% rename from examples/src_6/multi_token_vault/src/main.sw rename to examples/src6-vault/multi_token_vault/src/main.sw index 3648807..706eb9c 100644 --- a/examples/src_6/multi_token_vault/src/main.sw +++ b/examples/src6-vault/multi_token_vault/src/main.sw @@ -12,8 +12,8 @@ use std::{ token::transfer, }; -use src_6::{Deposit, SRC6, Withdraw}; -use src_20::SRC20; +use src6::{Deposit, SRC6, Withdraw}; +use src20::SRC20; pub struct VaultInfo { /// Amount of assets currently managed by this vault diff --git a/examples/src_6/single_token_single_sub_vault/.gitignore b/examples/src6-vault/single_token_single_sub_vault/.gitignore similarity index 100% rename from examples/src_6/single_token_single_sub_vault/.gitignore rename to examples/src6-vault/single_token_single_sub_vault/.gitignore diff --git a/examples/src_6/single_token_single_sub_vault/Forc.toml b/examples/src6-vault/single_token_single_sub_vault/Forc.toml similarity index 59% rename from examples/src_6/single_token_single_sub_vault/Forc.toml rename to examples/src6-vault/single_token_single_sub_vault/Forc.toml index 6446f7a..f5f91f1 100644 --- a/examples/src_6/single_token_single_sub_vault/Forc.toml +++ b/examples/src6-vault/single_token_single_sub_vault/Forc.toml @@ -5,5 +5,5 @@ license = "Apache-2.0" name = "single_token_single_sub_vault" [dependencies] -src_20 = { path = "../../../standards/src_20" } -src_6 = { path = "../../../standards/src_6" } +src20 = { path = "../../../standards/src20-token" } +src6 = { path = "../../../standards/src6-vault" } diff --git a/examples/src_6/single_token_single_sub_vault/src/main.sw b/examples/src6-vault/single_token_single_sub_vault/src/main.sw similarity index 99% rename from examples/src_6/single_token_single_sub_vault/src/main.sw rename to examples/src6-vault/single_token_single_sub_vault/src/main.sw index f20be31..b63e74f 100644 --- a/examples/src_6/single_token_single_sub_vault/src/main.sw +++ b/examples/src6-vault/single_token_single_sub_vault/src/main.sw @@ -16,8 +16,8 @@ use std::{ token::transfer, }; -use src_6::{Deposit, SRC6, Withdraw}; -use src_20::SRC20; +use src6::{Deposit, SRC6, Withdraw}; +use src20::SRC20; configurable { /// The only asset that can be deposited and withdrawn from this vault. diff --git a/examples/src_6/single_token_vault/.gitignore b/examples/src6-vault/single_token_vault/.gitignore similarity index 100% rename from examples/src_6/single_token_vault/.gitignore rename to examples/src6-vault/single_token_vault/.gitignore diff --git a/examples/src_6/single_token_vault/Forc.toml b/examples/src6-vault/single_token_vault/Forc.toml similarity index 57% rename from examples/src_6/single_token_vault/Forc.toml rename to examples/src6-vault/single_token_vault/Forc.toml index 72a79eb..1730994 100644 --- a/examples/src_6/single_token_vault/Forc.toml +++ b/examples/src6-vault/single_token_vault/Forc.toml @@ -5,5 +5,5 @@ license = "Apache-2.0" name = "single_token_vault" [dependencies] -src_20 = { path = "../../../standards/src_20" } -src_6 = { path = "../../../standards/src_6" } +src20 = { path = "../../../standards/src20-token" } +src6 = { path = "../../../standards/src6-vault" } diff --git a/examples/src_6/single_token_vault/src/main.sw b/examples/src6-vault/single_token_vault/src/main.sw similarity index 99% rename from examples/src_6/single_token_vault/src/main.sw rename to examples/src6-vault/single_token_vault/src/main.sw index 06c7270..3c9cf4d 100644 --- a/examples/src_6/single_token_vault/src/main.sw +++ b/examples/src6-vault/single_token_vault/src/main.sw @@ -13,8 +13,8 @@ use std::{ token::transfer, }; -use src_6::{Deposit, SRC6, Withdraw}; -use src_20::SRC20; +use src6::{Deposit, SRC6, Withdraw}; +use src20::SRC20; pub struct VaultInfo { /// Amount of assets currently managed by this vault diff --git a/examples/src_7/multi_asset/Forc.toml b/examples/src7-metadata/multi_asset/Forc.toml similarity index 57% rename from examples/src_7/multi_asset/Forc.toml rename to examples/src7-metadata/multi_asset/Forc.toml index 7f3b6f2..e1802fb 100644 --- a/examples/src_7/multi_asset/Forc.toml +++ b/examples/src7-metadata/multi_asset/Forc.toml @@ -5,5 +5,5 @@ license = "Apache-2.0" name = "multi_src7_asset" [dependencies] -src_20 = { path = "../../../standards/src_20" } -src_7 = { path = "../../../standards/src_7" } +src20 = { path = "../../../standards/src20-token" } +src7 = { path = "../../../standards/src7-metadata" } diff --git a/examples/src_7/multi_asset/src/multi_asset.sw b/examples/src7-metadata/multi_asset/src/multi_asset.sw similarity index 97% rename from examples/src_7/multi_asset/src/multi_asset.sw rename to examples/src7-metadata/multi_asset/src/multi_asset.sw index 4d734e8..cfa6212 100644 --- a/examples/src_7/multi_asset/src/multi_asset.sw +++ b/examples/src7-metadata/multi_asset/src/multi_asset.sw @@ -1,7 +1,7 @@ contract; -use src_7::{Metadata, SRC7}; -use src_20::SRC20; +use src7::{Metadata, SRC7}; +use src20::SRC20; use std::{call_frames::contract_id, hash::Hash, storage::storage_string::*, string::String}; @@ -45,7 +45,7 @@ impl SRC7 for Contract { /// # Examples /// /// ```sway - /// use src_7::{SRC7, Metadata}; + /// use src7::{SRC7, Metadata}; /// use std::string::String; /// /// fn foo(contract_id: ContractId, asset: AssetId) { diff --git a/examples/src_7/single_asset/Forc.toml b/examples/src7-metadata/single_asset/Forc.toml similarity index 57% rename from examples/src_7/single_asset/Forc.toml rename to examples/src7-metadata/single_asset/Forc.toml index 12fbd9e..66955e3 100644 --- a/examples/src_7/single_asset/Forc.toml +++ b/examples/src7-metadata/single_asset/Forc.toml @@ -5,5 +5,5 @@ license = "Apache-2.0" name = "single_src7_asset" [dependencies] -src_20 = { path = "../../../standards/src_20" } -src_7 = { path = "../../../standards/src_7" } +src20 = { path = "../../../standards/src20-token" } +src7 = { path = "../../../standards/src7-metadata" } diff --git a/examples/src_7/single_asset/src/single_asset.sw b/examples/src7-metadata/single_asset/src/single_asset.sw similarity index 97% rename from examples/src_7/single_asset/src/single_asset.sw rename to examples/src7-metadata/single_asset/src/single_asset.sw index 787a806..30091ab 100644 --- a/examples/src_7/single_asset/src/single_asset.sw +++ b/examples/src7-metadata/single_asset/src/single_asset.sw @@ -1,7 +1,7 @@ contract; -use src_7::{Metadata, SRC7}; -use src_20::SRC20; +use src7::{Metadata, SRC7}; +use src20::SRC20; use std::{call_frames::contract_id, string::String}; @@ -41,7 +41,7 @@ impl SRC7 for Contract { /// # Examples /// /// ```sway - /// use src_7::{SRC7, Metadata}; + /// use src7::{SRC7, Metadata}; /// use std::string::String; /// /// fn foo(contract_id: ContractId, asset: AssetId) { diff --git a/standards/Forc.toml b/standards/Forc.toml index 67c80e8..ee28ffc 100644 --- a/standards/Forc.toml +++ b/standards/Forc.toml @@ -1,2 +1,8 @@ [workspace] -members = ["src_3", "src_5", "src_6", "src_7", "src_20"] +members = [ + "src3-mint-burn", + "src5-ownership", + "src6-vault", + "src7-metadata", + "src20-token", +] diff --git a/standards/src_2/.docs/src-2-logo-dark-theme.png b/standards/src2-inline-docs/.docs/src-2-logo-dark-theme.png similarity index 100% rename from standards/src_2/.docs/src-2-logo-dark-theme.png rename to standards/src2-inline-docs/.docs/src-2-logo-dark-theme.png diff --git a/standards/src_2/.docs/src-2-logo-light-theme.png b/standards/src2-inline-docs/.docs/src-2-logo-light-theme.png similarity index 100% rename from standards/src_2/.docs/src-2-logo-light-theme.png rename to standards/src2-inline-docs/.docs/src-2-logo-light-theme.png diff --git a/standards/src_2/README.md b/standards/src2-inline-docs/README.md similarity index 100% rename from standards/src_2/README.md rename to standards/src2-inline-docs/README.md diff --git a/standards/src_20/.docs/src-20-logo-dark-theme.png b/standards/src20-token/.docs/src-20-logo-dark-theme.png similarity index 100% rename from standards/src_20/.docs/src-20-logo-dark-theme.png rename to standards/src20-token/.docs/src-20-logo-dark-theme.png diff --git a/standards/src_20/.docs/src-20-logo-light-theme.png b/standards/src20-token/.docs/src-20-logo-light-theme.png similarity index 100% rename from standards/src_20/.docs/src-20-logo-light-theme.png rename to standards/src20-token/.docs/src-20-logo-light-theme.png diff --git a/standards/src_6/Forc.toml b/standards/src20-token/Forc.toml similarity index 68% rename from standards/src_6/Forc.toml rename to standards/src20-token/Forc.toml index 7beb7a0..5ef53ee 100644 --- a/standards/src_6/Forc.toml +++ b/standards/src20-token/Forc.toml @@ -1,5 +1,5 @@ [project] authors = ["Fuel Labs "] -entry = "src_6.sw" +entry = "src20.sw" license = "Apache-2.0" -name = "src_6" +name = "src20" diff --git a/standards/src_20/README.md b/standards/src20-token/README.md similarity index 96% rename from standards/src_20/README.md rename to standards/src20-token/README.md index 2077ca2..1441989 100644 --- a/standards/src_20/README.md +++ b/standards/src20-token/README.md @@ -87,10 +87,10 @@ abi MyToken { # Example Implementation -## [Single Native Assset](../../examples/src_20/single_asset/src/single_asset.sw) +## [Single Native Assset](../../examples/src20-token/single_asset/src/single_asset.sw) Example of the SRC-20 implementation where a contract contains a single asset with one `SubId`. This implementation is recommended for users that intend to deploy a single asset with their contract. -## [Multi Native Asset](../../examples/src_20/multi_asset/src/multi_asset.sw) +## [Multi Native Asset](../../examples/src20-token/multi_asset/src/multi_asset.sw) Example of the SRC-20 implementation where a contract contains multiple assets with differing `SubId`s. This implementation is recommended for users that intend to deploy multiple assets with their contract. diff --git a/standards/src_20/src/src_20.sw b/standards/src20-token/src/src20.sw similarity index 100% rename from standards/src_20/src/src_20.sw rename to standards/src20-token/src/src20.sw diff --git a/standards/src_3/Forc.toml b/standards/src3-mint-burn/Forc.toml similarity index 68% rename from standards/src_3/Forc.toml rename to standards/src3-mint-burn/Forc.toml index a6fd513..aea9017 100644 --- a/standards/src_3/Forc.toml +++ b/standards/src3-mint-burn/Forc.toml @@ -1,5 +1,5 @@ [project] authors = ["Fuel Labs "] -entry = "src_3.sw" +entry = "src3.sw" license = "Apache-2.0" -name = "src_3" +name = "src3" diff --git a/standards/src_3/README.md b/standards/src3-mint-burn/README.md similarity index 95% rename from standards/src_3/README.md rename to standards/src3-mint-burn/README.md index 3a92c17..9d04875 100644 --- a/standards/src_3/README.md +++ b/standards/src3-mint-burn/README.md @@ -63,10 +63,10 @@ abi MySRC3Token { # Example Implementation -## [Single Native Asset](../../examples/src_3/single_asset/src/single_asset.sw) +## [Single Native Asset](../../examples/src3-mint-burn/single_asset/src/single_asset.sw) Example of the SRC-3 implementation where a contract only mints a single asset with one `SubId`. -## [Multi Native Asset](../../examples/src_3/multi_asset/src/multi_asset.sw) +## [Multi Native Asset](../../examples/src3-mint-burn/multi_asset/src/multi_asset.sw) Example of the SRC-3 implementation where a contract mints multiple assets with differing `SubId`s. diff --git a/standards/src_3/src/src_3.sw b/standards/src3-mint-burn/src/src3.sw similarity index 100% rename from standards/src_3/src/src_3.sw rename to standards/src3-mint-burn/src/src3.sw diff --git a/standards/src_5/.docs/src-5-logo-dark-theme.png b/standards/src5-ownership/.docs/src-5-logo-dark-theme.png similarity index 100% rename from standards/src_5/.docs/src-5-logo-dark-theme.png rename to standards/src5-ownership/.docs/src-5-logo-dark-theme.png diff --git a/standards/src_5/.docs/src-5-logo-light-theme.png b/standards/src5-ownership/.docs/src-5-logo-light-theme.png similarity index 100% rename from standards/src_5/.docs/src-5-logo-light-theme.png rename to standards/src5-ownership/.docs/src-5-logo-light-theme.png diff --git a/standards/src_5/Forc.toml b/standards/src5-ownership/Forc.toml similarity index 68% rename from standards/src_5/Forc.toml rename to standards/src5-ownership/Forc.toml index 1c433be..c1b1313 100644 --- a/standards/src_5/Forc.toml +++ b/standards/src5-ownership/Forc.toml @@ -1,5 +1,5 @@ [project] authors = ["Fuel Labs "] -entry = "src_5.sw" +entry = "src5.sw" license = "Apache-2.0" -name = "src_5" +name = "src5" diff --git a/standards/src_5/README.md b/standards/src5-ownership/README.md similarity index 93% rename from standards/src_5/README.md rename to standards/src5-ownership/README.md index bd9d1f8..f81c99c 100644 --- a/standards/src_5/README.md +++ b/standards/src5-ownership/README.md @@ -83,10 +83,10 @@ abi SRC5 { # Example Implementation -## [Uninitalized](../../examples/src_5/uninitialized_example/src/uninitialized_example.sw) +## [Uninitalized](../../examples/src5-ownership/uninitialized_example/src/uninitialized_example.sw) Example of the SRC-5 implementation where a contract does not have an owner set at compile time with the intent to set it during runtime. -## [Initialized](../../examples/src_5/initialized_example/src/initialized_example.sw) +## [Initialized](../../examples/src5-ownership/initialized_example/src/initialized_example.sw) Example of the SRC-5 implementation where a contract has an owner set at compile time. diff --git a/standards/src_5/src/src_5.sw b/standards/src5-ownership/src/src5.sw similarity index 100% rename from standards/src_5/src/src_5.sw rename to standards/src5-ownership/src/src5.sw diff --git a/standards/src_6/.docs/src-6-logo-dark-theme.png b/standards/src6-vault/.docs/src-6-logo-dark-theme.png similarity index 100% rename from standards/src_6/.docs/src-6-logo-dark-theme.png rename to standards/src6-vault/.docs/src-6-logo-dark-theme.png diff --git a/standards/src_6/.docs/src-6-logo-light-theme.png b/standards/src6-vault/.docs/src-6-logo-light-theme.png similarity index 100% rename from standards/src_6/.docs/src-6-logo-light-theme.png rename to standards/src6-vault/.docs/src-6-logo-light-theme.png diff --git a/standards/src_7/Forc.toml b/standards/src6-vault/Forc.toml similarity index 68% rename from standards/src_7/Forc.toml rename to standards/src6-vault/Forc.toml index 07e2a98..d342344 100644 --- a/standards/src_7/Forc.toml +++ b/standards/src6-vault/Forc.toml @@ -1,5 +1,5 @@ [project] authors = ["Fuel Labs "] -entry = "src_7.sw" +entry = "src6.sw" license = "Apache-2.0" -name = "src_7" +name = "src6" diff --git a/standards/src_6/README.md b/standards/src6-vault/README.md similarity index 97% rename from standards/src_6/README.md rename to standards/src6-vault/README.md index 6114f24..a16d137 100644 --- a/standards/src_6/README.md +++ b/standards/src6-vault/README.md @@ -172,14 +172,14 @@ abi SRC6 { # Example Implementation -## [Multi Token Vault](../../examples/src_6/multi_token_vault/) +## [Multi Token Vault](../../examples/src6-vault/multi_token_vault/) A barebones implementation of the vault standard that supports any number of sub vaults being created for every AssetId. -## [Single Token Vault](../../examples/src_6/single_token_vault/) +## [Single Token Vault](../../examples/src6-vault/single_token_vault/) A barebones implemenation of the vault standard demonstrating how to constrict deposits and withdrawals to a single AssetId. -## [Single Token Single Sub Vault](../../examples/src_6/single_token_single_sub_vault/) +## [Single Token Single Sub Vault](../../examples/src6-vault/single_token_single_sub_vault/) A barebones implementation of the vault standard demonstrating how to constrict deposits and withdrawals to a single AssetId, and to a single Sub vault. \ No newline at end of file diff --git a/standards/src_6/src/src_6.sw b/standards/src6-vault/src/src6.sw similarity index 100% rename from standards/src_6/src/src_6.sw rename to standards/src6-vault/src/src6.sw diff --git a/standards/src_7/.docs/src-7-logo-dark-theme.png b/standards/src7-metadata/.docs/src-7-logo-dark-theme.png similarity index 100% rename from standards/src_7/.docs/src-7-logo-dark-theme.png rename to standards/src7-metadata/.docs/src-7-logo-dark-theme.png diff --git a/standards/src_7/.docs/src-7-logo-light-theme.png b/standards/src7-metadata/.docs/src-7-logo-light-theme.png similarity index 100% rename from standards/src_7/.docs/src-7-logo-light-theme.png rename to standards/src7-metadata/.docs/src-7-logo-light-theme.png diff --git a/standards/src7-metadata/Forc.toml b/standards/src7-metadata/Forc.toml new file mode 100644 index 0000000..ede2b39 --- /dev/null +++ b/standards/src7-metadata/Forc.toml @@ -0,0 +1,5 @@ +[project] +authors = ["Fuel Labs "] +entry = "src7.sw" +license = "Apache-2.0" +name = "src7" diff --git a/standards/src_7/README.md b/standards/src7-metadata/README.md similarity index 96% rename from standards/src_7/README.md rename to standards/src7-metadata/README.md index aadadf5..17837c4 100644 --- a/standards/src_7/README.md +++ b/standards/src7-metadata/README.md @@ -74,10 +74,10 @@ abi SRC7Metadata { # Example Implementation -## [Single Native Asset](../../examples/src_7/single_asset/src/single_asset.sw) +## [Single Native Asset](../../examples/src7-metadata/single_asset/src/single_asset.sw) Example of the SRC-7 implementation where metadata exists for only a single asset with one `SubId`. -## [Mutli Native Asset](../../examples/src_7/multi_asset/src/multi_asset.sw) +## [Mutli Native Asset](../../examples/src7-metadata/multi_asset/src/multi_asset.sw) Example of the SRC-7 implementation where metadata exists for multiple assets with differing `SubId`s. diff --git a/standards/src_7/src/src_7.sw b/standards/src7-metadata/src/src7.sw similarity index 98% rename from standards/src_7/src/src_7.sw rename to standards/src7-metadata/src/src7.sw index bb4a473..e307d11 100644 --- a/standards/src_7/src/src_7.sw +++ b/standards/src7-metadata/src/src7.sw @@ -17,7 +17,7 @@ abi SRC7 { /// # Examples /// /// ```sway - /// use src_7::{SRC7, Metadata}; + /// use src7::{SRC7, Metadata}; /// use std::string::String; /// /// fn foo(contract_id: ContractId, asset: AssetId) { diff --git a/standards/src_8/.docs/src-8-logo-dark-theme.png b/standards/src8-bridged-asset/.docs/src-8-logo-dark-theme.png similarity index 100% rename from standards/src_8/.docs/src-8-logo-dark-theme.png rename to standards/src8-bridged-asset/.docs/src-8-logo-dark-theme.png diff --git a/standards/src_8/.docs/src-8-logo-light-theme.png b/standards/src8-bridged-asset/.docs/src-8-logo-light-theme.png similarity index 100% rename from standards/src_8/.docs/src-8-logo-light-theme.png rename to standards/src8-bridged-asset/.docs/src-8-logo-light-theme.png diff --git a/standards/src_8/README.md b/standards/src8-bridged-asset/README.md similarity index 100% rename from standards/src_8/README.md rename to standards/src8-bridged-asset/README.md diff --git a/standards/src_9/.docs/src-9-logo-dark-theme.png b/standards/src9-metadata-keys/.docs/src-9-logo-dark-theme.png similarity index 100% rename from standards/src_9/.docs/src-9-logo-dark-theme.png rename to standards/src9-metadata-keys/.docs/src-9-logo-dark-theme.png diff --git a/standards/src_9/.docs/src-9-logo-light-theme.png b/standards/src9-metadata-keys/.docs/src-9-logo-light-theme.png similarity index 100% rename from standards/src_9/.docs/src-9-logo-light-theme.png rename to standards/src9-metadata-keys/.docs/src-9-logo-light-theme.png diff --git a/standards/src_9/README.md b/standards/src9-metadata-keys/README.md similarity index 100% rename from standards/src_9/README.md rename to standards/src9-metadata-keys/README.md diff --git a/standards/src_20/Forc.toml b/standards/src_20/Forc.toml deleted file mode 100644 index c9621a4..0000000 --- a/standards/src_20/Forc.toml +++ /dev/null @@ -1,5 +0,0 @@ -[project] -authors = ["Fuel Labs "] -entry = "src_20.sw" -license = "Apache-2.0" -name = "src_20"