From bd1e8ea041b94f4ea95ba2b35a6b0f11e992ec44 Mon Sep 17 00:00:00 2001 From: Paul Razvan Berg Date: Mon, 13 May 2024 10:41:49 +0100 Subject: [PATCH 01/17] docs: fix typos in README (#86) --- README.md | 16 ++++++++-------- SRCs/src-20.md | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 0e5ea80..3c04803 100644 --- a/README.md +++ b/README.md @@ -22,9 +22,9 @@ ## Overview -The purpose of this repository is to contain standards for the Sway Language which users can import and use. +The purpose of this repository is to contain standards for the Sway Language which users can import and use. -Standards in this repository may be in various stages of development. Use of draft standards and feedback on the proposed standards is encouraged. To use a draft, search for a standard using the appropriate GitHub label and implement the standard abi into your contract. +Standards in this repository may be in various stages of development. Use of draft standards and feedback on the proposed standards is encouraged. To use a draft, search for a standard using the appropriate GitHub label and implement the standard abi into your contract. If you don't find what you're looking for, feel free to create an issue and propose a new standard! @@ -66,7 +66,7 @@ To import a standard the following should be added to the project's `Forc.toml` standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.5.0" } ``` -> **NOTE:** +> **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: @@ -87,7 +87,7 @@ Minimal example implementations for every standard can be found in the [`example #### SRC-20; Native Asset Standard Examples -##### - [Single Native Assset](./examples/src20-native-asset/single_asset/src/single_asset.sw) +##### - [Single Native Asset](./examples/src20-native-asset/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. @@ -119,15 +119,15 @@ Example of the SRC-5 implementation where a contract has an owner set at compile ##### [Multi Asset Vault](./examples/src6-vault/multi_asset_vault/) -A basic implementation of the vault standard that supports any number of sub vaults being created for every AssetId. +A basic implementation of the vault standard that supports any number of sub vaults being created for every `AssetId`. ##### [Single Asset Vault](./examples/src6-vault/single_asset_vault/) -A basic implementation of the vault standard demonstrating how to restrict deposits and withdrawals to a single AssetId. +A basic implementation of the vault standard demonstrating how to restrict deposits and withdrawals to a single `AssetId`. ##### [Single Asset Single Sub Vault](./examples/src6-vault/single_asset_single_sub_vault/) -A basic implementation of the vault standard demonstrating how to restrict deposits and withdrawals to a single AssetId, and to a single Sub vault. +A basic implementation of the vault standard demonstrating how to restrict deposits and withdrawals to a single `AssetId`, and to a single Sub vault. #### SRC-7; Arbitrary Asset Metadata Standard Examples @@ -147,7 +147,7 @@ Example of the SRC-12 implementation where contract deployments contain configur ##### [Without Configurables](./examples/src12-contract-factory/without_configurables/src/without_configurables.sw) -Example of the SRC-12 implementation where all contract deployments are identitcal and thus have the same bytecode and root. +Example of the SRC-12 implementation where all contract deployments are identical and thus have the same bytecode and root. > **Note** > All standards currently use `forc v0.56.0`. diff --git a/SRCs/src-20.md b/SRCs/src-20.md index 49bcdbb..6d3e1f8 100644 --- a/SRCs/src-20.md +++ b/SRCs/src-20.md @@ -11,13 +11,13 @@ The following standard allows for the implementation of a standard API for [Nati # Motivation -A standard interface for [Native Assets](https://docs.fuel.network/docs/sway/blockchain-development/native_assets) on Fuel allows external applications to interact with the native asset, whether that be decentralized exchanges, wallets, or Fuel's [Scripts](https://docs.fuel.network/docs/sway/sway-program-types/scripts/) and [Predicates](https://docs.fuel.network/docs/sway/sway-program-types/predicates/). +A standard interface for [Native Assets](https://docs.fuel.network/docs/sway/blockchain-development/native_assets) on Fuel allows external applications to interact with the native asset, whether that be decentralized exchanges, wallets, or Fuel's [Scripts](https://docs.fuel.network/docs/sway/sway-program-types/scripts/) and [Predicates](https://docs.fuel.network/docs/sway/sway-program-types/predicates/). # Prior Art The SRC-20 Native Asset Standard naming pays homage to the [ERC-20 Token Standard](https://eips.ethereum.org/EIPS/eip-20) seen on Ethereum. While there is functionality we may use as a reference, it is noted that Fuel's [Native Assets](https://docs.fuel.network/docs/sway/blockchain-development/native_assets) are fundamentally different than Ethereum's tokens. -There has been a discussion of the Fungile Token Standard on the [Fuel Forum](https://forum.fuel.network/). This discussion can be found [here](https://forum.fuel.network/t/src-20-fungible-token-standard/186). +There has been a discussion of the Fungible Token Standard on the [Fuel Forum](https://forum.fuel.network/). This discussion can be found [here](https://forum.fuel.network/t/src-20-fungible-token-standard/186). There has also been a Fungible Token Standard and Non-Fungible Token Standard implementations added to the [Sway-Libs](https://github.com/FuelLabs/sway-libs) repository before the creation of the [Sway-Standards](https://github.com/FuelLabs/sway-standards) repository. The introduction of this standard in the [Sway-Standards](https://github.com/FuelLabs/sway-standards) repository will deprecate the Sway-Libs Fungible Token Standard. From c89a7003991153504a39dc3903f69dcda4607db5 Mon Sep 17 00:00:00 2001 From: SwayStar123 Date: Tue, 14 May 2024 20:07:42 +0530 Subject: [PATCH 02/17] change vault_sub_id back to sub_id --- SRCs/src-3.md | 16 ++++++++-------- standards/src/src3.sw | 14 +++++++------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/SRCs/src-3.md b/SRCs/src-3.md index 5c97d0d..f7e7c58 100644 --- a/SRCs/src-3.md +++ b/SRCs/src-3.md @@ -16,27 +16,27 @@ Minting and burning were initially added to the [SRC-20](./src-20.md) standard. The following functions MUST be implemented to follow the SRC-3 standard: -### `fn mint(recipient: Identity, vault_sub_id: SubId, amount: u64)` +### `fn mint(recipient: Identity, sub_id: SubId, amount: u64)` -This function MUST mint `amount` coins with sub-identifier `vault_sub_id` and transfer them to the `recipient`. +This function MUST mint `amount` coins with sub-identifier `sub_id` and transfer them to the `recipient`. This function MAY contain arbitrary conditions for minting, and revert if those conditions are not met. ##### Arguments * `recipient` - The `Identity` to which the newly minted asset is transferred to. -* `vault_sub_id` - The sub-identifier of the asset to mint. +* `sub_id` - The sub-identifier of the asset to mint. * `amount` - The quantity of coins to mint. -### `fn burn(vault_sub_id: SubId, amount: u64)` +### `fn burn(sub_id: SubId, amount: u64)` -This function MUST burn `amount` coins with the sub-identifier `vault_sub_id` and MUST ensure the `AssetId` of the asset is the sha-256 hash of `(ContractId, SubId)` for the implementing contract. +This function MUST burn `amount` coins with the sub-identifier `sub_id` and MUST ensure the `AssetId` of the asset is the sha-256 hash of `(ContractId, SubId)` for the implementing contract. This function MUST ensure at least `amount` coins have been transferred to the implementing contract. This function MUST update the total supply defined in the [SRC-20](./src-20.md) standard. This function MAY contain arbitrary conditions for burning, and revert if those conditions are not met. ##### Arguments -* `vault_sub_id` - The sub-identifier of the asset to burn. +* `sub_id` - The sub-identifier of the asset to burn. * `amount` - The quantity of coins to burn. # Rationale @@ -57,10 +57,10 @@ The burn function may also introduce a security consideration if the total suppl ```rust abi MySRC3Asset { #[storage(read, write)] - fn mint(recipient: Identity, vault_sub_id: SubId, amount: u64); + fn mint(recipient: Identity, sub_id: SubId, amount: u64); #[payable] #[storage(read, write)] - fn burn(vault_sub_id: SubId, amount: u64); + fn burn(sub_id: SubId, amount: u64); } ``` diff --git a/standards/src/src3.sw b/standards/src/src3.sw index eb52e00..8fede48 100644 --- a/standards/src/src3.sw +++ b/standards/src/src3.sw @@ -1,12 +1,12 @@ library; abi SRC3 { - /// Mints new assets using the `vault_sub_id` sub-identifier. + /// Mints new assets using the `sub_id` sub-identifier. /// /// # Arguments /// /// * `recipient`: [Identity] - The user to which the newly minted asset is transferred to. - /// * `vault_sub_id`: [SubId] - The sub-identifier of the newly minted asset. + /// * `sub_id`: [SubId] - The sub-identifier of the newly minted asset. /// * `amount`: [u64] - The quantity of coins to mint. /// /// # Examples @@ -20,18 +20,18 @@ abi SRC3 { /// } /// ``` #[storage(read, write)] - fn mint(recipient: Identity, vault_sub_id: SubId, amount: u64); + fn mint(recipient: Identity, sub_id: SubId, amount: u64); - /// Burns assets sent with the given `vault_sub_id`. + /// Burns assets sent with the given `sub_id`. /// /// # Additional Information /// /// NOTE: The sha-256 hash of `(ContractId, SubId)` must match the `AssetId` where `ContractId` is the id of - /// the implementing contract and `SubId` is the given `vault_sub_id` argument. + /// the implementing contract and `SubId` is the given `sub_id` argument. /// /// # Arguments /// - /// * `vault_sub_id`: [SubId] - The sub-identifier of the asset to burn. + /// * `sub_id`: [SubId] - The sub-identifier of the asset to burn. /// * `amount`: [u64] - The quantity of coins to burn. /// /// # Examples @@ -50,5 +50,5 @@ abi SRC3 { /// ``` #[payable] #[storage(read, write)] - fn burn(vault_sub_id: SubId, amount: u64); + fn burn(sub_id: SubId, amount: u64); } From b1d6aaeb80acf6172c8c8d97a3ac9d6454cddd4c Mon Sep 17 00:00:00 2001 From: Paul Razvan Berg Date: Mon, 20 May 2024 04:36:33 +0100 Subject: [PATCH 03/17] docs: improve SRC-20 (#88) --- SRCs/src-20.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SRCs/src-20.md b/SRCs/src-20.md index 6d3e1f8..c68ed9c 100644 --- a/SRCs/src-20.md +++ b/SRCs/src-20.md @@ -47,7 +47,7 @@ This function must return the symbol of the asset, such as “ETH”. This funct This function must return the number of decimals the asset uses - e.g. 8, which means to divide the coin amount by 100000000 to get its user representation. This function MUST return `Some` for any assets minted by the contract. -## Non-Fungible Asset Restrictions +## Non-Fungible Asset Restrictions Non-Fungible Tokens (NFT) or Non-Fungible Assets on Fuel are Native Assets and thus follow the same standard as Fungible Native Assets with some restrictions. For a Native Asset on Fuel to be deemed an NFT, the following must be applied: @@ -56,9 +56,9 @@ Non-Fungible Tokens (NFT) or Non-Fungible Assets on Fuel are Native Assets and t # Rationale -As the SRC-20 Native Asset Standard leverages Native Assets on Fuel, we do not require the implementation of certain functions such as transfer or approval. This is done directly within the FuelVM and there is no smart contract that requires updating of balances. As Fuel is UTXO based, any transfer events may be indexed on transaction receipts. +As the SRC-20 Native Asset Standard leverages Native Assets on Fuel, we do not require the implementation of certain functions such as transfer or approval. This is done directly within the FuelVM and there is no smart contract that requires updating of balances. As Fuel is UTXO based, any transfer events may be indexed on transaction receipts. -Following this, we have omitted the inclusion of any transfer functions or events. The provided specification outlines only the required functions and events to implement fully functional native assets on the Fuel Network. Additional functionality and properties may be added as needed. +Following this, we have omitted the inclusion of any transfer functions or events. The provided specification outlines only the functions necessary to implement fully functional native assets on the Fuel Network. Additional functionality and properties may be added as needed. # Backwards Compatibility @@ -87,7 +87,7 @@ abi MyAsset { # Example Implementation -## [Single Native Assset](../examples/src20-native-asset/multi_asset/src/multi_asset.sw) +## [Single Native Asset](../examples/src20-native-asset/multi_asset/src/multi_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. From ace74e0859b87a074f88b7457d4b21e1e371c868 Mon Sep 17 00:00:00 2001 From: Paul Razvan Berg Date: Mon, 20 May 2024 04:36:56 +0100 Subject: [PATCH 04/17] docs: improve SRC-3 (#85) --- README.md | 2 +- SRCs/src-3.md | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 3c04803..6ae3f02 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ 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](./SRCs/src-20.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. -- [SRC-3; Mint and Burn](./SRCs/src-3.md) is used to enable mint and burn functionality for Native Assets. +- [SRC-3; Mint and Burn](./SRCs/src-3.md) is used to enable mint and burn functionality for fungible assets. - [SRC-7; Arbitrary Asset Metadata Standard](./SRCs/src-7.md) is used to store metadata for [Native Assets](https://docs.fuel.network/docs/sway/blockchain-development/native_assets). - [SRC-9; Metadata Keys Standard](./SRCs/src-9.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. - [SRC-6; Vault Standard](./SRCs/src-6.md) defines the implementation of a standard API for asset vaults developed in Sway. diff --git a/SRCs/src-3.md b/SRCs/src-3.md index 5c97d0d..0b9cb78 100644 --- a/SRCs/src-3.md +++ b/SRCs/src-3.md @@ -1,6 +1,6 @@ # Abstract -The following standard enables the minting and burning of native assets for any fungible assets within the Sway Language. It seeks to define mint and burn functions defined separately from the [SRC-20](./src-20.md) standard. Any contract that implements the SRC-3 standard MUST implement the [SRC-20](./src-20.md) standard. +The following standard enables the minting and burning of native assets for any fungible assets within the Sway Language. It seeks to define mint and burn functions defined separately from the [SRC-20](./src-20.md) standard. # Motivation @@ -16,27 +16,27 @@ Minting and burning were initially added to the [SRC-20](./src-20.md) standard. The following functions MUST be implemented to follow the SRC-3 standard: -### `fn mint(recipient: Identity, vault_sub_id: SubId, amount: u64)` +### `fn mint(recipient: Identity, sub_id: SubId, amount: u64)` -This function MUST mint `amount` coins with sub-identifier `vault_sub_id` and transfer them to the `recipient`. +This function MUST mint `amount` coins with sub-identifier `sub_id` and transfer them to the `recipient`. This function MAY contain arbitrary conditions for minting, and revert if those conditions are not met. ##### Arguments * `recipient` - The `Identity` to which the newly minted asset is transferred to. -* `vault_sub_id` - The sub-identifier of the asset to mint. +* `sub_id` - The sub-identifier of the asset to mint. * `amount` - The quantity of coins to mint. -### `fn burn(vault_sub_id: SubId, amount: u64)` +### `fn burn(sub_id: SubId, amount: u64)` -This function MUST burn `amount` coins with the sub-identifier `vault_sub_id` and MUST ensure the `AssetId` of the asset is the sha-256 hash of `(ContractId, SubId)` for the implementing contract. +This function MUST burn `amount` coins with the sub-identifier `sub_id` and MUST ensure the `AssetId` of the asset is the sha-256 hash of `(ContractId, SubId)` for the implementing contract. This function MUST ensure at least `amount` coins have been transferred to the implementing contract. This function MUST update the total supply defined in the [SRC-20](./src-20.md) standard. This function MAY contain arbitrary conditions for burning, and revert if those conditions are not met. ##### Arguments -* `vault_sub_id` - The sub-identifier of the asset to burn. +* `sub_id` - The sub-identifier of the asset to burn. * `amount` - The quantity of coins to burn. # Rationale @@ -57,10 +57,10 @@ The burn function may also introduce a security consideration if the total suppl ```rust abi MySRC3Asset { #[storage(read, write)] - fn mint(recipient: Identity, vault_sub_id: SubId, amount: u64); + fn mint(recipient: Identity, sub_id: SubId, amount: u64); #[payable] #[storage(read, write)] - fn burn(vault_sub_id: SubId, amount: u64); + fn burn(sub_id: SubId, amount: u64); } ``` From 8a42be3ff247328b3dcf783b68e53f5962f44bdd Mon Sep 17 00:00:00 2001 From: IGI-111 Date: Tue, 21 May 2024 17:12:07 +0400 Subject: [PATCH 05/17] Update to latest Sway Transform abusive usage of configurables into constants to support latest version of Sway that uses encoded configurables. --- .github/workflows/ci.yaml | 4 +- .../hardcoded-information/src/main.sw | 65 +++++++++---------- .../variable-information/src/main.sw | 56 ++++++++-------- .../src/initialized_example.sw | 6 +- 4 files changed, 63 insertions(+), 68 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ea85bbe..b3d1995 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -15,8 +15,8 @@ concurrency: env: CARGO_TERM_COLOR: always REGISTRY: ghcr.io - RUST_VERSION: 1.75.0 - FORC_VERSION: 0.56.0 + RUST_VERSION: 1.76.0 + FORC_VERSION: 0.59.0 CORE_VERSION: 0.24.2 PATH_TO_SCRIPTS: .github/scripts diff --git a/examples/src11-security-information/hardcoded-information/src/main.sw b/examples/src11-security-information/hardcoded-information/src/main.sw index 13e1178..fcabcae 100644 --- a/examples/src11-security-information/hardcoded-information/src/main.sw +++ b/examples/src11-security-information/hardcoded-information/src/main.sw @@ -4,25 +4,24 @@ use standards::src11::{SecurityInformation, SRC11}; use std::{string::String, vec::Vec,}; -configurable { - /// The name of the project - NAME: str[7] = __to_str_array("Example"), - /// The URL of the project - PROJECT_URL: str[19] = __to_str_array("https://example.com"), - /// The contact information of the project - CONTACT1: str[25] = __to_str_array("email:example@example.com"), - CONTACT2: str[41] = __to_str_array("link:https://example.com/security_contact"), - CONTACT3: str[20] = __to_str_array("discord:example#1234"), - /// The security policy of the project - POLICY: str[35] = __to_str_array("https://example.com/security_policy"), - /// The preferred languages of the project - PREFERRED_LANGUAGES1: str[2] = __to_str_array("en"), - PREFERRED_LANGUAGES2: str[2] = __to_str_array("ja"), - PREFERRED_LANGUAGES3: str[2] = __to_str_array("zh"), - PREFERRED_LANGUAGES4: str[2] = __to_str_array("hi"), - /// The encryption key of the project - ENCRYPTION: str[751] = __to_str_array( - "-----BEGIN PGP PUBLIC KEY BLOCK----- +/// The name of the project +const NAME: str[7] = __to_str_array("Example"); +/// The URL of the project +const PROJECT_URL: str[19] = __to_str_array("https://example.com"); +/// The contact information of the project +const CONTACT1: str[25] = __to_str_array("email:example@example.com"); +const CONTACT2: str[41] = __to_str_array("link:https://example.com/security_contact"); +const CONTACT3: str[20] = __to_str_array("discord:example#1234"); +/// The security policy of the project +const POLICY: str[35] = __to_str_array("https://example.com/security_policy"); +/// The preferred languages of the project +const PREFERRED_LANGUAGES1: str[2] = __to_str_array("en"); +const PREFERRED_LANGUAGES2: str[2] = __to_str_array("ja"); +const PREFERRED_LANGUAGES3: str[2] = __to_str_array("zh"); +const PREFERRED_LANGUAGES4: str[2] = __to_str_array("hi"); +/// The encryption key of the project +const ENCRYPTION: str[751] = __to_str_array( + "-----BEGIN PGP PUBLIC KEY BLOCK----- Comment: Alice's OpenPGP certificate Comment: https://www.ietf.org/id/draft-bre-openpgp-samples-01.html @@ -37,20 +36,20 @@ DAAKCRDyMVUMT0fjjlnQAQDFHUs6TIcxrNTtEZFjUFm1M0PJ1Dng/cDW4xN80fsn 0QEA22Kr7VkCjeAEC08VSTeV+QFsmz55/lntWkwYWhmvOgE= =iIGO -----END PGP PUBLIC KEY BLOCK-----", - ), - /// The URL of the project's source code - SOURCE_CODE: str[31] = __to_str_array("https://github.com/example/test"), - /// The release identifier of this build - SOURCE_RELEASE: str[6] = __to_str_array("v1.0.0"), - /// The revision identifier of this build - SOURCE_REVISION: str[12] = __to_str_array("a1b2c3d4e5f6"), - /// The URL of the project's auditors - AUDITORS: str[28] = __to_str_array("https://example.com/auditors"), - /// The URL of the project's acknowledgements - ACKNOWLEDGEMENTS: str[36] = __to_str_array("https://example.com/acknowledgements"), - /// The URL of the project's additional information - ADDITIONAL_INFORMATION: str[42] = __to_str_array("https://example.com/additional_information"), -} +); +/// The URL of the project's source code +const SOURCE_CODE: str[31] = __to_str_array("https://github.com/example/test"); +/// The release identifier of this build +const SOURCE_RELEASE: str[6] = __to_str_array("v1.0.0"); +/// The revision identifier of this build +const SOURCE_REVISION: str[12] = __to_str_array("a1b2c3d4e5f6"); +/// The URL of the project's auditors +const AUDITORS: str[28] = __to_str_array("https://example.com/auditors"); +/// The URL of the project's acknowledgements +const ACKNOWLEDGEMENTS: str[36] = __to_str_array("https://example.com/acknowledgements"); +/// The URL of the project's additional information +const ADDITIONAL_INFORMATION: str[42] = __to_str_array("https://example.com/additional_information"); + impl SRC11 for Contract { #[storage(read)] fn security_information() -> SecurityInformation { diff --git a/examples/src11-security-information/variable-information/src/main.sw b/examples/src11-security-information/variable-information/src/main.sw index a3e078b..b2d3f88 100644 --- a/examples/src11-security-information/variable-information/src/main.sw +++ b/examples/src11-security-information/variable-information/src/main.sw @@ -4,21 +4,20 @@ use standards::src11::{SecurityInformation, SRC11}; use std::{storage::{storage_string::*, storage_vec::*,}, string::String, vec::Vec,}; -configurable { - /// The name of the project - NAME: str[7] = __to_str_array("Example"), - /// The URL of the project - PROJECT_URL: str[19] = __to_str_array("https://example.com"), - /// The security policy of the project - POLICY: str[35] = __to_str_array("https://example.com/security_policy"), - /// The preferred languages of the project - PREFERRED_LANGUAGES1: str[2] = __to_str_array("en"), - PREFERRED_LANGUAGES2: str[2] = __to_str_array("ja"), - PREFERRED_LANGUAGES3: str[2] = __to_str_array("zh"), - PREFERRED_LANGUAGES4: str[2] = __to_str_array("hi"), - /// The encryption key of the project - ENCRYPTION: str[751] = __to_str_array( - "-----BEGIN PGP PUBLIC KEY BLOCK----- +/// The name of the project +const NAME: str[7] = __to_str_array("Example"); +/// The URL of the project +const PROJECT_URL: str[19] = __to_str_array("https://example.com"); +/// The security policy of the project +const POLICY: str[35] = __to_str_array("https://example.com/security_policy"); +/// The preferred languages of the project +const PREFERRED_LANGUAGES1: str[2] = __to_str_array("en"); +const PREFERRED_LANGUAGES2: str[2] = __to_str_array("ja"); +const PREFERRED_LANGUAGES3: str[2] = __to_str_array("zh"); +const PREFERRED_LANGUAGES4: str[2] = __to_str_array("hi"); +/// The encryption key of the project +const ENCRYPTION: str[751] = __to_str_array( + "-----BEGIN PGP PUBLIC KEY BLOCK----- Comment: Alice's OpenPGP certificate Comment: https://www.ietf.org/id/draft-bre-openpgp-samples-01.html @@ -33,20 +32,19 @@ DAAKCRDyMVUMT0fjjlnQAQDFHUs6TIcxrNTtEZFjUFm1M0PJ1Dng/cDW4xN80fsn 0QEA22Kr7VkCjeAEC08VSTeV+QFsmz55/lntWkwYWhmvOgE= =iIGO -----END PGP PUBLIC KEY BLOCK-----", - ), - /// The URL of the project's source code - SOURCE_CODE: str[31] = __to_str_array("https://github.com/example/test"), - /// The release identifier of this build - SOURCE_RELEASE: str[6] = __to_str_array("v1.0.0"), - /// The revision identifier of this build - SOURCE_REVISION: str[12] = __to_str_array("a1b2c3d4e5f6"), - /// The URL of the project's auditors - AUDITORS: str[28] = __to_str_array("https://example.com/auditors"), - /// The URL of the project's acknowledgements - ACKNOWLEDGEMENTS: str[36] = __to_str_array("https://example.com/acknowledgements"), - /// The URL of the project's additional information - ADDITIONAL_INFORMATION: str[42] = __to_str_array("https://example.com/additional_information"), -} +); +/// The URL of the project's source code +const SOURCE_CODE: str[31] = __to_str_array("https://github.com/example/test"); +/// The release identifier of this build +const SOURCE_RELEASE: str[6] = __to_str_array("v1.0.0"); +/// The revision identifier of this build +const SOURCE_REVISION: str[12] = __to_str_array("a1b2c3d4e5f6"); +/// The URL of the project's auditors +const AUDITORS: str[28] = __to_str_array("https://example.com/auditors"); +/// The URL of the project's acknowledgements +const ACKNOWLEDGEMENTS: str[36] = __to_str_array("https://example.com/acknowledgements"); +/// The URL of the project's additional information +const ADDITIONAL_INFORMATION: str[42] = __to_str_array("https://example.com/additional_information"); storage { /// The contact information for the security contact. diff --git a/examples/src5-ownership/initialized_example/src/initialized_example.sw b/examples/src5-ownership/initialized_example/src/initialized_example.sw index dae9f36..ee71143 100644 --- a/examples/src5-ownership/initialized_example/src/initialized_example.sw +++ b/examples/src5-ownership/initialized_example/src/initialized_example.sw @@ -3,10 +3,8 @@ contract; use standards::src5::{SRC5, State}; use std::constants::ZERO_B256; -configurable { - /// The owner of this contract at deployment. - INITIAL_OWNER: Identity = Identity::Address(Address::from(ZERO_B256)), -} +/// The owner of this contract at deployment. +const INITIAL_OWNER: Identity = Identity::Address(Address::from(ZERO_B256)); storage { /// The owner in storage. From 78038586adce592a5a0ce132d1998d96534b6d33 Mon Sep 17 00:00:00 2001 From: IGI-111 Date: Wed, 22 May 2024 12:49:55 +0400 Subject: [PATCH 06/17] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3c04803..62f4ede 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,8 @@ - - + + @@ -150,7 +150,7 @@ Example of the SRC-12 implementation where contract deployments contain configur Example of the SRC-12 implementation where all contract deployments are identical and thus have the same bytecode and root. > **Note** -> All standards currently use `forc v0.56.0`. +> All standards currently use `forc v0.59.0`. Closes #\ + +## Checklist + +- [ ] I have linked to any relevant issues. +- [ ] I have commented my code, particularly in hard-to-understand areas. +- [ ] I have updated the documentation where relevant (API docs, the reference, and the Sway book). + - [ ] If my change requires substantial documentation changes, I have [requested support from the DevRel team](https://github.com/FuelLabs/devrel-requests/issues/new/choose) +- [ ] I have added tests that prove my fix is effective or that my feature works. +- [ ] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. +- [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). +- [ ] I have requested a review from the relevant team or maintainers. From b670eb6bcaf40a2d831f1e2923d9f5e179bfed71 Mon Sep 17 00:00:00 2001 From: bitzoic Date: Thu, 30 May 2024 21:11:32 +0800 Subject: [PATCH 17/17] Fix README for release --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c6dc532..1b62f12 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,8 @@ - - + + @@ -150,7 +150,7 @@ Example of the SRC-12 implementation where contract deployments contain configur Example of the SRC-12 implementation where all contract deployments are identical and thus have the same bytecode and root. > **Note** -> All standards currently use `forc v0.59.0`. +> All standards currently use `forc v0.60.0`.