From 1ef69917d0b931ab1077fd3947edd785ca2935eb Mon Sep 17 00:00:00 2001 From: bitzoic Date: Fri, 1 Sep 2023 11:47:33 +0200 Subject: [PATCH] Change Example return type to Option and change ordering --- standards/src_20/README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/standards/src_20/README.md b/standards/src_20/README.md index eb2a968..b47725c 100644 --- a/standards/src_20/README.md +++ b/standards/src_20/README.md @@ -27,26 +27,26 @@ There has also been a Fungible Token Standard and Non-Fungible Token Standard im The following functions MUST be implemented to follow the SRC-20 standard: -### `fn name(asset: AssetId) -> Option` +### `fn total_assets() -> u64` -This function MUST return the name of the asset, such as “Ether”. This function MUST return `Some` for any assets minted by the contract. +This function MUST return the total number of individual assets for a contract. ### `fn total_supply(asset: AssetId) -> Option` This function MUST return the total supply of tokens for an asset. This function MUST return `Some` for any assets minted by the contract. -### `fn total_assets() -> u64` - -This function MUST return the total number of individual assets for a contract. - -### `fn decimals(asset: AssetId) -> Option` +### `fn name(asset: AssetId) -> Option` -This function must return the number of decimals the asset uses - e.g. 8, means to divide the token amount by 100000000 to get its user representation. This function MUST return `Some` for any assets minted by the contract. +This function MUST return the name of the asset, such as “Ether”. This function MUST return `Some` for any assets minted by the contract. ### `fn symbol(asset: AssetId) -> Option` This function must return the symbol of the asset, such as “ETH”. This function MUST return `Some` for any assets minted by the contract. +### `fn decimals(asset: AssetId) -> Option` + +This function must return the number of decimals the asset uses - e.g. 8, means to divide the token amount by 100000000 to get its user representation. This function MUST return `Some` for any assets minted by the contract. + ## Non-Fungible Token Restrictions Non-Fungible Tokens (NFT) on Fuel are Native Assets and thus follow the same standard as Fungible Tokens with some restrictions. For a Native Asset on Fuel to be deemed an NFT, the following must be applied: @@ -72,16 +72,16 @@ This standard does not introduce any security concerns, as it does not call exte ```rust abi MyToken { - #[storage(read)] - fn total_supply(asset: AssetId) -> u64; #[storage(read)] fn total_assets() -> u64; #[storage(read)] - fn decimals(asset: AssetId) -> u8; + fn total_supply(asset: AssetId) -> Option; + #[storage(read)] + fn name(asset: AssetId) -> Option; #[storage(read)] - fn name(asset: AssetId) -> String; + fn symbol(asset: AssetId) -> Option; #[storage(read)] - fn symbol(asset: AssetId) -> String; + fn decimals(asset: AssetId) -> Option; } ```