diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 81cb9b19051..bdb38dc2c31 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -2,12 +2,12 @@ * @FuelLabs/leads # Documentation -/docs/ @FuelLabs/tooling @FuelLabs/sway-compiler @FuelLabs/application-dev @FuelLabs/Devrel +/docs/ @FuelLabs/tooling @FuelLabs/sway-compiler @FuelLabs/swayex @FuelLabs/Devrel # Sway files and standard library -/examples/ @FuelLabs/sway-compiler @FuelLabs/application-dev -/sway-lib-core/ @FuelLabs/sway-compiler @FuelLabs/application-dev -/sway-lib-std/ @FuelLabs/sway-compiler @FuelLabs/application-dev +/examples/ @FuelLabs/sway-compiler @FuelLabs/swayex +/sway-lib-core/ @FuelLabs/sway-compiler @FuelLabs/swayex +/sway-lib-std/ @FuelLabs/sway-compiler @FuelLabs/swayex # Tooling /forc/ @FuelLabs/tooling diff --git a/.github/ISSUE_TEMPLATE/blank_issue.md b/.github/ISSUE_TEMPLATE/blank_issue.md new file mode 100644 index 00000000000..9aef3ebe637 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/blank_issue.md @@ -0,0 +1,4 @@ +--- +name: Blank Issue +about: Create a blank issue. +--- diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 00000000000..77342d8b2ba --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,69 @@ +name: Bug Report +description: Create a report to help us improve. +labels: [bug, triage] +body: + - type: markdown + attributes: + value: > + **Thank you for filing a bug report!** + + - type: dropdown + id: component + attributes: + label: Related Component + description: Which component does this relate to? + options: + - compiler + - forc + - forc-deploy + - forc-lsp + - forc-fmt + - another forc plugin + - other + default: 0 + validations: + required: true + + - type: textarea + id: problem + attributes: + label: Problem + description: > + A clear and concise description of what the bug is, + including what currently happens and what you expected to happen. + validations: + required: true + + - type: textarea + id: steps + attributes: + label: Steps + description: The steps to reproduce the bug. + placeholder: | + 1. + 2. + 3. + validations: + required: true + + - type: textarea + id: solutions + attributes: + label: Possible Solution(s) + description: > + Not obligatory, but suggest a fix/reason for the bug, + or ideas how to implement the addition or change. + + - type: textarea + id: notes + attributes: + label: Notes + + - type: textarea + id: components + attributes: + label: Installed components + description: Output of `fuelup check`, if using `fuelup`. Otherwise, list the relevant component(s) and version(s). + render: console + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000000..da10d666447 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: true +contact_links: + - name: Fuel Network & Sway Language Community Support + url: https://forum.fuel.network/ + about: Please ask and answer questions here. + - name: Fuel Network Security Bug Bounty + url: https://immunefi.com/boost/fuel-network-attackathon/ + about: Please report security vulnerabilities here. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/enhancement_request.yml b/.github/ISSUE_TEMPLATE/enhancement_request.yml new file mode 100644 index 00000000000..04a3dc02acd --- /dev/null +++ b/.github/ISSUE_TEMPLATE/enhancement_request.yml @@ -0,0 +1,50 @@ +name: Enhancement Request +description: Suggest an enhancement for this project. +labels: [enhancement, triage] +body: + - type: markdown + attributes: + value: > + **Thank you for filing an enhancement request!** + + - type: dropdown + id: component + attributes: + label: Related Component + description: Which component does this relate to? + options: + - compiler + - forc + - forc-deploy + - forc-lsp + - forc-fmt + - another forc plugin + - other + default: 0 + validations: + required: true + + - type: textarea + id: problem + attributes: + label: Problem you are trying to solve + description: > + A clear and concise description of the problem this enhancement request is trying to solve. + validations: + required: true + + - type: textarea + id: solution + attributes: + label: Solution you'd like + description: > + A clear and concise description of what you want to happen. + validations: + required: true + + - type: textarea + id: notes + attributes: + label: Notes + description: > + Any additional context or information you feel may be relevant to the issue. diff --git a/.gitignore b/.gitignore index b58ac9c06c6..3de2d377b4e 100644 --- a/.gitignore +++ b/.gitignore @@ -30,4 +30,5 @@ sway-lsp/tests/**/Forc.lock forc-plugins/forc-debug/tests/**/Forc.lock # Generated files in example directories -examples/**/Forc.lock +examples/**/*/Forc.lock +docs/reference/src/code/examples/**/*/Forc.lock diff --git a/Cargo.lock b/Cargo.lock index eb012eee036..833a3735f3a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2280,9 +2280,9 @@ dependencies = [ [[package]] name = "forc-wallet" -version = "0.7.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d7522f7f2cec4cc1748d58ca6a527b4734b79c8c171a506679fb4bb3e0ea3c" +checksum = "223adda9aca17455167e0bea681b31a7a5819c83b73978876424eafc4ee48611" dependencies = [ "anyhow", "clap 4.5.4", @@ -2345,9 +2345,9 @@ dependencies = [ [[package]] name = "fuel-abi-types" -version = "0.5.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee6135cb6e12773a7abf7d6c3a8de6467dee86fcf7293720d33e33feb01dc6d8" +checksum = "e0e7e87f94417ff1a5d60e496906033c58bfe5367546621f131fe8cdabaa2671" dependencies = [ "itertools 0.10.5", "lazy_static", @@ -2362,9 +2362,9 @@ dependencies = [ [[package]] name = "fuel-asm" -version = "0.49.0" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42df651415e443094f86102473b7f9fa23633ab6c3c98dd3f713adde251acf0f" +checksum = "db81c0bdf07b052d1c595b5ee71e20f0286ca3dc88c7ab3f775e08c8e055c34f" dependencies = [ "bitflags 2.5.0", "fuel-types", @@ -2374,9 +2374,9 @@ dependencies = [ [[package]] name = "fuel-core-chain-config" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d202fe1dfeb98882bdc5a0206a58e469d76fd09d952c4050bb979102bd690398" +checksum = "16323762c4a5d58b11121580bee9f3a76ac7f655f95d727f957b05a9e35f477f" dependencies = [ "anyhow", "bech32", @@ -2394,9 +2394,9 @@ dependencies = [ [[package]] name = "fuel-core-client" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc636a8706e36c713606ee4226fdef5260e3650ba0e8a57f0fc06258d0078a34" +checksum = "f33af785942254f23e30a03a08a08ffb8eea645a87f06895e5d84f4205fc191a" dependencies = [ "anyhow", "cynic", @@ -2418,9 +2418,9 @@ dependencies = [ [[package]] name = "fuel-core-metrics" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bacc62bc4fec2fe6a818a1a7145b892bd486d69266190ca8dd31a036a3a327b7" +checksum = "2a47f442a32f2e5917066bbf9be3d6fd5d85252a131f1b5fc2f2f0ee75008066" dependencies = [ "axum", "once_cell", @@ -2432,9 +2432,9 @@ dependencies = [ [[package]] name = "fuel-core-poa" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68d189ecd635688ddc896b44c8497b29c04bb4a3719a24eea0ca9691a6f76d5e" +checksum = "1f6185f492f9ddb65228db0f250b3f6384637ebf76b72fc81b2efb629d887912" dependencies = [ "anyhow", "async-trait", @@ -2449,9 +2449,9 @@ dependencies = [ [[package]] name = "fuel-core-services" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf2ab4d3931b8cafdb2e69fe8ca97918a168d74c73c070481ca0e552cc37bb93" +checksum = "d35200489fdcdafbe5a6a3a39baad4da523e5c004db9a885056be0137ee35098" dependencies = [ "anyhow", "async-trait", @@ -2464,9 +2464,9 @@ dependencies = [ [[package]] name = "fuel-core-storage" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e039c1c6ebef314c74c34728e1f2199dcf9ede041d6f5c6e11479517c8f4d320" +checksum = "87f4e85b634f42fb53193da517b4a2efa8ac73031cdab653029a5b1d3725572d" dependencies = [ "anyhow", "derive_more", @@ -2486,9 +2486,9 @@ dependencies = [ [[package]] name = "fuel-core-types" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf038dd8df8d3aa665a13295c9ef888ba8118600cccdf8fb4587410e0e102fdf" +checksum = "ffe21004dd036f4c454666e339bd0fc3b037535bbc5510321db2565087edd4fc" dependencies = [ "anyhow", "bs58", @@ -2505,9 +2505,9 @@ dependencies = [ [[package]] name = "fuel-crypto" -version = "0.49.0" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71cef93970fb8a26d3a683ae211833c6bbf391066887f501bd5859f29992b59a" +checksum = "4ca73b3409086e772315625304cabd2eeec10e4bd1f8b8a99cc72e0aed755e5c" dependencies = [ "coins-bip32", "coins-bip39", @@ -2526,9 +2526,9 @@ dependencies = [ [[package]] name = "fuel-derive" -version = "0.49.0" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b85e8e508b26d088262075fcfe9921b7009c931fef1cc55fe1dafb116c99884" +checksum = "d8d6e66d1b68eb916640c12a1c6c40880e11fcf569359b04483d5e18237c5229" dependencies = [ "proc-macro2", "quote", @@ -2609,9 +2609,9 @@ dependencies = [ [[package]] name = "fuel-merkle" -version = "0.49.0" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5198b4eab5a19b0034971da88199dae7dd61806ebd8df366d6af1f17cda2e151" +checksum = "faa4b60ddfa51b64d02a1d71b0cf51488171d313b32ae3fb9f39f64ddd21791b" dependencies = [ "derive_more", "digest 0.10.7", @@ -2624,15 +2624,15 @@ dependencies = [ [[package]] name = "fuel-storage" -version = "0.49.0" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa738e9c244f3f312af09faef108ec9a285f02afcefbc579c19c242cea742dd0" +checksum = "beef5f12c40118e87ef6abf611c6bba5c88754e727fb825120ae7d0872123055" [[package]] name = "fuel-tx" -version = "0.49.0" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e4b4ea79ffe711af7bbf363b25f383fc6e481e652cf55a5ef8b5a458fcf4ef9" +checksum = "fc95857e761db34a50967f53af7a74be08130d210bd985c5585f36bd753d346c" dependencies = [ "bitflags 2.5.0", "derivative", @@ -2653,9 +2653,9 @@ dependencies = [ [[package]] name = "fuel-types" -version = "0.49.0" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455cf5275d96f6907e81ed1825c4e6a9dd79f7c1c37a4e15134562f83024c7e7" +checksum = "0af9f9d8c9eb3f4e644731c829ee7da5c3cae0886864731089627af25e336cea" dependencies = [ "fuel-derive", "hex", @@ -2665,9 +2665,9 @@ dependencies = [ [[package]] name = "fuel-vm" -version = "0.49.0" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8811f949db8ce61cc68dcf81644047df4ee23be55879efcfe9f1aa5adc378965" +checksum = "71df1a9ede5237febbc7864888f26365814327732ccd11002e9bddac1ce9a4e6" dependencies = [ "anyhow", "async-trait", @@ -2699,9 +2699,9 @@ dependencies = [ [[package]] name = "fuels" -version = "0.62.0" +version = "0.63.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eeb6fa017c6d695cf4468d21c640857ba1c74d31fdac3277ad4414593a14a7b" +checksum = "e318b107e6fef3d786f2366cc78a6314a6b326342d375203238f130a7356fe49" dependencies = [ "fuel-core-client", "fuel-crypto", @@ -2715,9 +2715,9 @@ dependencies = [ [[package]] name = "fuels-accounts" -version = "0.62.0" +version = "0.63.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a55f3ba7346cb73a5565fd7b6ab2c0016be052863323ca076e6ac9fec719759" +checksum = "0e17d23b925d3d5e21dc5428330695c596db356d4adfc90eadecc2a490d7d5ce" dependencies = [ "async-trait", "chrono", @@ -2739,9 +2739,9 @@ dependencies = [ [[package]] name = "fuels-code-gen" -version = "0.62.0" +version = "0.63.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8db288a46989c20bc48dee787008959a2a7c17061fe78cf4ae4c1263c80692e1" +checksum = "86a7a5b4811f5563bb5c2485efc7653ed6ce465c452a1182ae9062aa13dd19af" dependencies = [ "Inflector", "fuel-abi-types", @@ -2755,9 +2755,9 @@ dependencies = [ [[package]] name = "fuels-core" -version = "0.62.0" +version = "0.63.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63d0abdc7230e4adb619a3735c237af545dcfdf86f4096b9d1daaf315838987e" +checksum = "9774ae9b35f808fa18b92d0478a3b0acbea41011409efa3117f972dfe528ae09" dependencies = [ "async-trait", "bech32", @@ -2774,6 +2774,7 @@ dependencies = [ "fuels-macros", "hex", "itertools 0.12.1", + "postcard", "serde", "serde_json", "thiserror", @@ -2782,23 +2783,22 @@ dependencies = [ [[package]] name = "fuels-macros" -version = "0.62.0" +version = "0.63.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e137a52541dbd0345bf000301091b5266644fd4de04bb8238457c5c70b9ac4e" +checksum = "ba92a701fa86eed843db68d991807207b8b3d47099d49fb82467e8900f680e01" dependencies = [ "fuels-code-gen", "itertools 0.12.1", "proc-macro2", "quote", - "rand", "syn 2.0.65", ] [[package]] name = "fuels-programs" -version = "0.62.0" +version = "0.63.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ada44df4a718da78add027d1204af8154265fc2f64b60cc28b1bba597df7e5d6" +checksum = "f6c72ac2f1cdda800dbc1c3714459f83bf208cef78812448992b6dbdda6841dc" dependencies = [ "async-trait", "fuel-abi-types", @@ -2815,14 +2815,15 @@ dependencies = [ [[package]] name = "fuels-test-helpers" -version = "0.62.0" +version = "0.63.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46d53ef79da8600d8ef580c0acc859be80b07eef0c9ddc19c61bb04b3cf4c15" +checksum = "30b8a632f2b4ddb52e8ad92871f63521e9f5cc299f842a3207f3655acc21c148" dependencies = [ "fuel-core-chain-config", "fuel-core-client", "fuel-core-poa", "fuel-core-services", + "fuel-core-types", "fuel-crypto", "fuel-tx", "fuel-types", diff --git a/Cargo.toml b/Cargo.toml index 4518aa5d62b..ae06a4828c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,22 +34,22 @@ exclude = [ [workspace.dependencies] # Dependencies from the `fuel-core` repository: -fuel-core-client = { version = "0.26.0", default-features = false } -fuel-core-types = { version = "0.26.0", default-features = false } +fuel-core-client = { version = "0.27.0", default-features = false } +fuel-core-types = { version = "0.27.0", default-features = false } # Dependencies from the `fuel-vm` repository: -fuel-asm = "0.49.0" -fuel-crypto = "0.49.0" -fuel-types = "0.49.0" -fuel-tx = "0.49.0" -fuel-vm = "0.49.0" +fuel-asm = "0.50.0" +fuel-crypto = "0.50.0" +fuel-types = "0.50.0" +fuel-tx = "0.50.0" +fuel-vm = "0.50.0" # Dependencies from the `fuels-rs` repository: -fuels-core = "0.62.0" -fuels-accounts = "0.62.0" +fuels-core = "0.63.0" +fuels-accounts = "0.63.0" # Dependencies from the `forc-wallet` repository: -forc-wallet = "0.7.1" +forc-wallet = "0.8.0" # Dependencies from the `fuel-abi-types` repository: fuel-abi-types = "0.5.0" diff --git a/docs/book/src/blockchain-development/access_control.md b/docs/book/src/blockchain-development/access_control.md index ca4887f6b4c..3e8aad92479 100644 --- a/docs/book/src/blockchain-development/access_control.md +++ b/docs/book/src/blockchain-development/access_control.md @@ -27,7 +27,7 @@ The `msg_sender` function works as follows: ## Contract Ownership -Many contracts require some form of ownership for access control. The [SRC-5 Ownership Standard](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-5.md) has been defined to provide an interoperable interface for ownership within contracts. +Many contracts require some form of ownership for access control. The [SRC-5 Ownership Standard](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-5-ownership.md) has been defined to provide an interoperable interface for ownership within contracts. To accomplish this, use the [Ownership Library](https://fuellabs.github.io/sway-libs/book/ownership/index.html) to keep track of the owner. This allows setting and revoking ownership using the variants `Some(..)` and `None` respectively. This is better, safer, and more readable than using the `Identity` type directly where revoking ownership has to be done using some magic value such as `b256::zero()` or otherwise. @@ -67,7 +67,7 @@ Setting ownership can be done in one of two ways; During compile time or run tim [Sway-Libs](../reference/sway_libs.md) provides the following libraries to enable further access control. -- [Ownership Library](https://fuellabs.github.io/sway-libs/book/ownership/index.html); used to apply restrictions on functions such that only a **single** user may call them. This library provides helper functions for the [SRC-5; Ownership Standard](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-5.md). +- [Ownership Library](https://fuellabs.github.io/sway-libs/book/ownership/index.html); used to apply restrictions on functions such that only a **single** user may call them. This library provides helper functions for the [SRC-5; Ownership Standard](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-5-ownership.md). - [Admin Library](https://fuellabs.github.io/sway-libs/book/admin/index.html); used to apply restrictions on functions such that only a select few users may call them like a whitelist. - [Pausable Library](https://fuellabs.github.io/sway-libs/book/pausable/index.html); allows contracts to implement an emergency stop mechanism. - [Reentrancy Guard Library](https://fuellabs.github.io/sway-libs/book/reentrancy/index.html); used to detect and prevent reentrancy attacks. diff --git a/docs/book/src/blockchain-development/native_assets.md b/docs/book/src/blockchain-development/native_assets.md index 8adcf8fa72e..49b1b0bef79 100644 --- a/docs/book/src/blockchain-development/native_assets.md +++ b/docs/book/src/blockchain-development/native_assets.md @@ -14,7 +14,7 @@ On the FuelVM, _all_ assets are native and the process for sending _any_ native While you would still need a smart contract to handle the minting and burning of assets, the sending and receiving of these assets can be done independently of the asset contract. -Just like the EVM however, Fuel has a standard that describes a standard API for Native Assets using the Sway Language. The ERC-20 equivalent for the Sway Language is the [SRC-20; Native Asset Standard](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-20.md). +Just like the EVM however, Fuel has a standard that describes a standard API for Native Assets using the Sway Language. The ERC-20 equivalent for the Sway Language is the [SRC-20; Native Asset Standard](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-20-native-asset.md). > **NOTE** It is important to note that Fuel does not have tokens. @@ -22,7 +22,7 @@ Just like the EVM however, Fuel has a standard that describes a standard API for On the EVM, an ERC-721 token or NFT is a contract that contains multiple tokens which are non-fungible with one another. -On the FuelVM, the ERC-721 equivalent is a Native Asset where each asset has a supply of one. This is defined in the [SRC-20; Native Asset Standard](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-20.md#non-fungible-asset-restrictions) under the Non-Fungible Asset Restrictions. +On the FuelVM, the ERC-721 equivalent is a Native Asset where each asset has a supply of one. This is defined in the [SRC-20; Native Asset Standard](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-20-native-asset.md#non-fungible-asset-restrictions) under the Non-Fungible Asset Restrictions. In practice, this means all NFTs are treated the same as any other Native Asset on Fuel. When writing Sway code, no additional cases for handling non-fungible and fungible assets are required. @@ -106,7 +106,7 @@ You may also mint an asset to a specific entity with the `std::asset::mint_to()` {{#include ../../../../examples/native_asset/src/main.sw:mint_to_asset}} ``` -If you intend to allow external users to mint assets using your contract, the [SRC-3; Mint and Burn Standard](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-3.md#fn-mintrecipient-identity-vault_sub_id-subid-amount-u64) defines a standard API for minting assets. The [Sway-Libs Asset Library](https://fuellabs.github.io/sway-libs/book/asset/supply.html) also provides an additional library to support implementations of the SRC-3 Standard into your contract. +If you intend to allow external users to mint assets using your contract, the [SRC-3; Mint and Burn Standard](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-3-minting-and-burning.md#fn-mintrecipient-identity-vault_sub_id-subid-amount-u64) defines a standard API for minting assets. The [Sway-Libs Asset Library](https://fuellabs.github.io/sway-libs/book/asset/supply.html) also provides an additional library to support implementations of the SRC-3 Standard into your contract. ### Burning a Native Asset @@ -116,7 +116,7 @@ To burn an asset, the `std::asset::burn()` function must be called internally fr {{#include ../../../../examples/native_asset/src/main.sw:burn_asset}} ``` -If you intend to allow external users to burn assets using your contract, the [SRC-3; Mint and Burn Standard](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-3.md#fn-mintrecipient-identity-vault_sub_id-subid-amount-u64) defines a standard API for burning assets. The [Sway-Libs Asset Library](https://fuellabs.github.io/sway-libs/book/asset/supply.html) also provides an additional library to support implementations of the SRC-3 Standard into your contract. +If you intend to allow external users to burn assets using your contract, the [SRC-3; Mint and Burn Standard](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-3-minting-and-burning.md#fn-mintrecipient-identity-vault_sub_id-subid-amount-u64) defines a standard API for burning assets. The [Sway-Libs Asset Library](https://fuellabs.github.io/sway-libs/book/asset/supply.html) also provides an additional library to support implementations of the SRC-3 Standard into your contract. ### Transfer a Native Asset @@ -176,16 +176,16 @@ There are a number of standards developed to enable further functionality for Na We currently have the following standards for Native Assets: -- [SRC-20; Native Asset Standard](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-20.md) defines the implementation of a standard API for Native Assets using the Sway Language. -- [SRC-3; Mint and Burn Standard](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-3.md) is used to enable mint and burn functionality for Native Assets. -- [SRC-7; Arbitrary Asset Metadata Standard](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-7.md) is used to store metadata for Native Assets. -- [SRC-6; Vault Standard](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-6.md) defines the implementation of a standard API for asset vaults developed in Sway. +- [SRC-20; Native Asset Standard](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-20-native-asset.md) defines the implementation of a standard API for Native Assets using the Sway Language. +- [SRC-3; Mint and Burn Standard](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-3-minting-and-burning.md) is used to enable mint and burn functionality for Native Assets. +- [SRC-7; Arbitrary Asset Metadata Standard](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-7-asset-metadata.md) is used to store metadata for Native Assets. +- [SRC-6; Vault Standard](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-6-vault.md) defines the implementation of a standard API for asset vaults developed in Sway. ## Native Asset Libraries Additional Libraries have been developed to allow you to quickly create an deploy dApps that follow the [Sway Standards](https://github.com/FuelLabs/sway-standards). -- [Asset Library](https://fuellabs.github.io/sway-libs/book/asset/index.html) provides functionality to implement the [SRC-20; Native Asset Standard](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-20.md), [SRC-3; Mint and Burn Standard](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-3.md), and [SRC-7; Arbitrary Asset Metadata Standard](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-7.md) standards. +- [Asset Library](https://fuellabs.github.io/sway-libs/book/asset/index.html) provides functionality to implement the [SRC-20; Native Asset Standard](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-20-native-asset.md), [SRC-3; Mint and Burn Standard](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-3-minting-and-burning.md), and [SRC-7; Arbitrary Asset Metadata Standard](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-7-asset-metadata.md) standards. @@ -193,7 +193,7 @@ Additional Libraries have been developed to allow you to quickly create an deplo In this fully fleshed out example, we show a native asset contract which mints a single asset. This is the equivalent to the ERC-20 Standard use in Ethereum. Note there are no token approval functions. -It implements the [SRC-20; Native Asset](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-20.md), [SRC-3; Mint and Burn](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-3.md), and [SRC-5; Ownership](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-5.md) standards. It does not use any external libraries. +It implements the [SRC-20; Native Asset](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-20-native-asset.md), [SRC-3; Mint and Burn](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-3-minting-and-burning.md), and [SRC-5; Ownership](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-5-ownership.md) standards. It does not use any external libraries. ```sway // ERC20 equivalent in Sway. @@ -335,7 +335,7 @@ fn require_access_owner() { In this fully fleshed out example, we show a native asset contract which mints multiple assets. This is the equivalent to the ERC-1155 Standard use in Ethereum. Note there are no token approval functions. -It implements the [SRC-20; Native Asset](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-20.md), [SRC-3; Mint and Burn](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-3.md), and [SRC-5; Ownership](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-5.md) standards. It does not use any external libraries. +It implements the [SRC-20; Native Asset](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-20-native-asset.md), [SRC-3; Mint and Burn](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-3-minting-and-burning.md), and [SRC-5; Ownership](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-5-ownership.md) standards. It does not use any external libraries. ```sway // ERC1155 equivalent in Sway. diff --git a/docs/book/src/introduction/sway_standards.md b/docs/book/src/introduction/sway_standards.md index d51925c00bc..e421c0c6b20 100644 --- a/docs/book/src/introduction/sway_standards.md +++ b/docs/book/src/introduction/sway_standards.md @@ -8,32 +8,32 @@ For more information on using a Sway Standard, please refer to the [Sway-Standar ### Native Asset Standards -- [SRC-20; Native Asset Standard](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-20.md) defines the implementation of a standard API for [Native Assets](../blockchain-development/native_assets.md) using the Sway Language. -- [SRC-3; Mint and Burn](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-3.md) is used to enable mint and burn functionality for Native Assets. -- [SRC-7; Arbitrary Asset Metadata Standard](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-7.md) is used to store metadata for [Native Assets](../blockchain-development/native_assets.md), usually as NFTs. -- [SRC-9; Metadata Keys Standard](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-9.md) is used to store standardized metadata keys for [Native Assets](../blockchain-development/native_assets.md) in combination with the SRC-7 standard. -- [SRC-6; Vault Standard](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-6.md) defines the implementation of a standard API for asset vaults developed in Sway. +- [SRC-20; Native Asset Standard](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-20-native-asset.md) defines the implementation of a standard API for [Native Assets](../blockchain-development/native_assets.md) using the Sway Language. +- [SRC-3; Mint and Burn](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-3-minting-and-burning.md) is used to enable mint and burn functionality for Native Assets. +- [SRC-7; Arbitrary Asset Metadata Standard](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-7-asset-metadata.md) is used to store metadata for [Native Assets](../blockchain-development/native_assets.md), usually as NFTs. +- [SRC-9; Metadata Keys Standard](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-9-metadata-keys.md) is used to store standardized metadata keys for [Native Assets](../blockchain-development/native_assets.md) in combination with the SRC-7 standard. +- [SRC-6; Vault Standard](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-6-vault.md) defines the implementation of a standard API for asset vaults developed in Sway. ### Predicate Standards -- [SRC-13; Soulbound Address Standard](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-13.md) defines a specific `Address` as a Soulbound Address for Soulbound Assets to become non-transferable. +- [SRC-13; Soulbound Address Standard](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-13-soulbound-address.md) defines a specific `Address` as a Soulbound Address for Soulbound Assets to become non-transferable. ### Access Control Standards -- [SRC-5; Ownership Standard](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-5.md) is used to restrict function calls to admin users in contracts. +- [SRC-5; Ownership Standard](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-5-ownership.md) is used to restrict function calls to admin users in contracts. ### Contract Standards -- [SRC-12; Contract Factory](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-12.md) defines the implementation of a standard API for contract factories. +- [SRC-12; Contract Factory](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-12-contract-factory.md) defines the implementation of a standard API for contract factories. ### Bridge Standards -- [SRC-8; Bridged Asset](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-8.md) defines the metadata required for an asset bridged to the Fuel Network. -- [SRC-10; Native Bridge Standard](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-10.md) defines the standard API for the Native Bridge between the Fuel Chain and the canonical base chain. +- [SRC-8; Bridged Asset](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-8-bridged-asset.md) defines the metadata required for an asset bridged to the Fuel Network. +- [SRC-10; Native Bridge Standard](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-10-native-bridge.md) defines the standard API for the Native Bridge between the Fuel Chain and the canonical base chain. ### Documentation Standards -- [SRC-2; Inline Documentation](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-2.md) defines how to document your Sway files. +- [SRC-2; Inline Documentation](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-2-inline-documentation.md) defines how to document your Sway files. ## Standards Support diff --git a/docs/book/src/reference/sway_libs.md b/docs/book/src/reference/sway_libs.md index 507a15abe0d..8e5d237fe07 100644 --- a/docs/book/src/reference/sway_libs.md +++ b/docs/book/src/reference/sway_libs.md @@ -10,13 +10,13 @@ For more information on how to use a Sway-Libs library, please refer to the [Swa Asset Libraries are any libraries that use [Native Assets](../blockchain-development/native_assets.md) on the Fuel Network. -- [Asset Library](https://fuellabs.github.io/sway-libs/book/asset/index.html); provides helper functions for the [SRC-20](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-20.md), [SRC-3](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-3.md), and [SRC-7](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-7.md) standards. +- [Asset Library](https://fuellabs.github.io/sway-libs/book/asset/index.html); provides helper functions for the [SRC-20](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-20-native-asset.md), [SRC-3](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-3-minting-and-burning.md), and [SRC-7](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-7-asset-metadata.md) standards. ## Access Control and Security Libraries Access Control and Security Libraries are any libraries that are built and intended to provide additional safety when developing smart contracts. -- [Ownership Library](https://fuellabs.github.io/sway-libs/book/ownership/index.html); used to apply restrictions on functions such that only a **single** user may call them. This library provides helper functions for the [SRC-5; Ownership Standard](https://github.com/FuelLabs/sway-standards/blob/master/SRCs/src-5.md). +- [Ownership Library](https://fuellabs.github.io/sway-libs/book/ownership/index.html); used to apply restrictions on functions such that only a **single** user may call them. This library provides helper functions for the [SRC-5; Ownership Standard](https://github.com/FuelLabs/sway-standards/blob/master/docs/src/src-5-ownership.md). - [Admin Library](https://fuellabs.github.io/sway-libs/book/admin/index.html); used to apply restrictions on functions such that only a select few users may call them like a whitelist. - [Pausable Library](https://fuellabs.github.io/sway-libs/book/pausable/index.html); allows contracts to implement an emergency stop mechanism. - [Reentrancy Guard Library](https://fuellabs.github.io/sway-libs/book/reentrancy/index.html); used to detect and prevent reentrancy attacks. diff --git a/docs/reference/src/code/examples/access-control/ownership/Forc.lock b/docs/reference/src/code/examples/access-control/ownership/Forc.lock deleted file mode 100644 index 29ac8935221..00000000000 --- a/docs/reference/src/code/examples/access-control/ownership/Forc.lock +++ /dev/null @@ -1,13 +0,0 @@ -[[package]] -name = 'core' -source = 'path+from-root-AE2967028D5567DA' - -[[package]] -name = 'ownership' -source = 'member' -dependencies = ['std'] - -[[package]] -name = 'std' -source = 'git+https://github.com/fuellabs/sway?tag=v0.31.1#c32b0759d25c0b515cbf535f9fb9b8e6fda38ff2' -dependencies = ['core'] diff --git a/docs/reference/src/code/examples/counter/Forc.lock b/docs/reference/src/code/examples/counter/Forc.lock deleted file mode 100644 index 815750e37b5..00000000000 --- a/docs/reference/src/code/examples/counter/Forc.lock +++ /dev/null @@ -1,13 +0,0 @@ -[[package]] -name = 'core' -source = 'path+from-root-AE2967028D5567DA' - -[[package]] -name = 'counter' -source = 'member' -dependencies = ['std'] - -[[package]] -name = 'std' -source = 'git+https://github.com/fuellabs/sway?tag=v0.31.1#c32b0759d25c0b515cbf535f9fb9b8e6fda38ff2' -dependencies = ['core'] diff --git a/docs/reference/src/code/examples/fizzbuzz/Forc.lock b/docs/reference/src/code/examples/fizzbuzz/Forc.lock deleted file mode 100644 index 4052c90315a..00000000000 --- a/docs/reference/src/code/examples/fizzbuzz/Forc.lock +++ /dev/null @@ -1,13 +0,0 @@ -[[package]] -name = 'core' -source = 'path+from-root-AE2967028D5567DA' - -[[package]] -name = 'fizzbuzz' -source = 'member' -dependencies = ['std'] - -[[package]] -name = 'std' -source = 'git+https://github.com/fuellabs/sway?tag=v0.31.1#c32b0759d25c0b515cbf535f9fb9b8e6fda38ff2' -dependencies = ['core'] diff --git a/docs/reference/src/code/examples/wallet_example/Forc.lock b/docs/reference/src/code/examples/wallet_example/Forc.lock deleted file mode 100644 index 633f2d6d9a2..00000000000 --- a/docs/reference/src/code/examples/wallet_example/Forc.lock +++ /dev/null @@ -1,13 +0,0 @@ -[[package]] -name = 'core' -source = 'path+from-root-AE2967028D5567DA' - -[[package]] -name = 'std' -source = 'git+https://github.com/fuellabs/sway?tag=v0.31.1#c32b0759d25c0b515cbf535f9fb9b8e6fda38ff2' -dependencies = ['core'] - -[[package]] -name = 'wallet' -source = 'member' -dependencies = ['std'] diff --git a/docs/reference/src/documentation/language/program-types/predicate.md b/docs/reference/src/documentation/language/program-types/predicate.md index c267acb619f..ea715888132 100644 --- a/docs/reference/src/documentation/language/program-types/predicate.md +++ b/docs/reference/src/documentation/language/program-types/predicate.md @@ -4,7 +4,7 @@ A predicate is an executable that represents a UTXO spending condition, such as It does not need to be deployed to a blockchain because it only exists during a transaction. That being said, the predicate root is on chain as the owner of one or more UTXOs. -Predicates can neither read from nor write to any contract state. Moreover, they cannot use any [contract instructions](https://fuellabs.github.io/fuel-specs/master/vm/instruction_set.html#contract-instructions). +Predicates can neither read from nor write to any contract state. Moreover, they cannot use any [contract instructions](https://docs.fuel.network/docs/specs/fuel-vm/instruction-set/#contract-instructions). ## Transfer Coins to a Predicate diff --git a/forc-pkg/src/manifest/mod.rs b/forc-pkg/src/manifest/mod.rs index e6d94f1079f..3f7bc21b1bd 100644 --- a/forc-pkg/src/manifest/mod.rs +++ b/forc-pkg/src/manifest/mod.rs @@ -8,7 +8,9 @@ use serde::{Deserialize, Serialize}; use serde_with::{serde_as, DisplayFromStr}; use std::{ collections::{BTreeMap, HashMap}, + fmt::Display, path::{Path, PathBuf}, + str::FromStr, sync::Arc, }; use sway_core::{fuel_prelude::fuel_tx, language::parsed::TreeType, parse_tree_type, BuildTarget}; @@ -206,6 +208,35 @@ pub struct Network { pub url: String, } +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] +pub struct HexSalt(pub fuel_tx::Salt); + +impl FromStr for HexSalt { + type Err = anyhow::Error; + + fn from_str(s: &str) -> Result { + // cut 0x from start. + let normalized = s + .strip_prefix("0x") + .ok_or_else(|| anyhow::anyhow!("hex salt declaration needs to start with 0x"))?; + let salt: fuel_tx::Salt = + fuel_tx::Salt::from_str(normalized).map_err(|e| anyhow::anyhow!("{e}"))?; + let hex_salt = Self(salt); + Ok(hex_salt) + } +} + +impl Display for HexSalt { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let salt = self.0; + write!(f, "{}", salt) + } +} + +fn default_hex_salt() -> HexSalt { + HexSalt(fuel_tx::Salt::default()) +} + #[serde_as] #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)] #[serde(rename_all = "kebab-case")] @@ -213,8 +244,8 @@ pub struct ContractDependency { #[serde(flatten)] pub dependency: Dependency, #[serde_as(as = "DisplayFromStr")] - #[serde(default = "fuel_tx::Salt::default")] - pub salt: fuel_tx::Salt, + #[serde(default = "default_hex_salt")] + pub salt: HexSalt, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)] @@ -1025,8 +1056,31 @@ pub fn find_dir_within(dir: &Path, pkg_name: &str) -> Option { #[cfg(test)] mod tests { + use std::str::FromStr; + use super::*; + #[test] + fn deserialize_contract_dependency() { + let contract_dep_str = r#"{"path": "../", "salt": "0x1111111111111111111111111111111111111111111111111111111111111111" }"#; + + let contract_dep_expected: ContractDependency = + serde_json::from_str(contract_dep_str).unwrap(); + + let dependency_det = DependencyDetails { + path: Some("../".to_owned()), + ..Default::default() + }; + let dependency = Dependency::Detailed(dependency_det); + let contract_dep = ContractDependency { + dependency, + salt: HexSalt::from_str( + "0x1111111111111111111111111111111111111111111111111111111111111111", + ) + .unwrap(), + }; + assert_eq!(contract_dep, contract_dep_expected) + } #[test] fn test_invalid_dependency_details_mixed_together() { let dependency_details_path_branch = DependencyDetails { diff --git a/forc-pkg/src/pkg.rs b/forc-pkg/src/pkg.rs index 2c24049acb5..cccead1051b 100644 --- a/forc-pkg/src/pkg.rs +++ b/forc-pkg/src/pkg.rs @@ -1444,7 +1444,7 @@ fn fetch_deps( ( n.clone(), d.dependency.clone(), - DepKind::Contract { salt: d.salt }, + DepKind::Contract { salt: d.salt.0 }, ) }) .chain( diff --git a/sway-lib-std/src/alloc.sw b/sway-lib-std/src/alloc.sw index 1e0958c0b4d..9841fe5e1e1 100644 --- a/sway-lib-std/src/alloc.sw +++ b/sway-lib-std/src/alloc.sw @@ -27,7 +27,7 @@ library; /// ▴ptr ▴VM_MAX_RAM /// ``` /// For more information, see the Fuel Spec for [VM Initialization](https://fuellabs.github.io/fuel-specs/master/vm#vm-initialization) -/// and the VM Instruction Set for [Memory Allocation](https://fuellabs.github.io/fuel-specs/master/vm/instruction_set.html#aloc-allocate-memory). +/// and the VM Instruction Set for [Memory Allocation](https://docs.fuel.network/docs/specs/fuel-vm/instruction-set#aloc-allocate-memory). /// /// # Arguments /// diff --git a/sway-lib-std/src/call_frames.sw b/sway-lib-std/src/call_frames.sw index 6ae7b2cdf19..8d69188204d 100644 --- a/sway-lib-std/src/call_frames.sw +++ b/sway-lib-std/src/call_frames.sw @@ -46,7 +46,7 @@ pub fn msg_asset_id() -> AssetId { /// # Additional Information /// /// More information on data from call frames can be found in the Fuel Specs. -/// https://specs.fuel.network/master/fuel-vm/index.html?search=#call-frames +/// https://docs.fuel.network/docs/specs/fuel-vm/#call-frames /// /// # Returns /// @@ -74,7 +74,7 @@ pub fn code_size() -> u64 { /// # Additional Information /// /// More information on data from call frames can be found in the Fuel Specs. -/// https://specs.fuel.network/master/fuel-vm/index.html?search=#call-frames +/// https://docs.fuel.network/docs/specs/fuel-vm/#call-frames /// /// # Returns /// @@ -99,7 +99,7 @@ pub fn first_param() -> u64 { /// # Additional Information /// /// More information on data from call frames can be found in the Fuel Specs. -/// https://specs.fuel.network/master/fuel-vm/index.html?search=#call-frames +/// https://docs.fuel.network/docs/specs/fuel-vm/#call-frames /// /// # Returns /// @@ -141,7 +141,7 @@ where /// # Additional Information /// /// More information on data from call frames can be found in the Fuel Specs. -/// https://specs.fuel.network/master/fuel-vm/index.html?search=#call-frames +/// https://docs.fuel.network/docs/specs/fuel-vm/#call-frames /// /// # Arguments /// diff --git a/swayfmt/tests/mod.rs b/swayfmt/tests/mod.rs index b71f2f148c4..13e063d7f81 100644 --- a/swayfmt/tests/mod.rs +++ b/swayfmt/tests/mod.rs @@ -2405,7 +2405,7 @@ fn long_doc_break_new_line() { /// ▴ptr ▴VM_MAX_RAM /// ``` /// For more information, see the Fuel Spec for [VM Initialization](https://fuellabs.github.io/fuel-specs/master/vm#vm-initialization) -/// and the VM Instruction Set for [Memory Allocation](https://fuellabs.github.io/fuel-specs/master/vm/instruction_set.html#aloc-allocate-memory). +/// and the VM Instruction Set for [Memory Allocation](https://docs.fuel.network/docs/specs/fuel-vm/instruction-set#aloc-allocate-memory). /// /// # Arguments /// @@ -2499,7 +2499,7 @@ pub fn alloc_bytes(count: u64) -> raw_ptr { /// ▴ptr ▴VM_MAX_RAM /// ``` /// For more information, see the Fuel Spec for [VM Initialization](https://fuellabs.github.io/fuel-specs/master/vm#vm-initialization) -/// and the VM Instruction Set for [Memory Allocation](https://fuellabs.github.io/fuel-specs/master/vm/instruction_set.html#aloc-allocate-memory). +/// and the VM Instruction Set for [Memory Allocation](https://docs.fuel.network/docs/specs/fuel-vm/instruction-set#aloc-allocate-memory). /// /// # Arguments /// diff --git a/test/src/e2e_vm_tests/test_programs/should_fail/contract_dependencies_conflicting_salt/contract_a/Forc.toml b/test/src/e2e_vm_tests/test_programs/should_fail/contract_dependencies_conflicting_salt/contract_a/Forc.toml index 8631fc1acab..ad4ccaa5d70 100644 --- a/test/src/e2e_vm_tests/test_programs/should_fail/contract_dependencies_conflicting_salt/contract_a/Forc.toml +++ b/test/src/e2e_vm_tests/test_programs/should_fail/contract_dependencies_conflicting_salt/contract_a/Forc.toml @@ -10,5 +10,5 @@ core = { path = "../../../../../../../sway-lib-core" } std = { path = "../../../../reduced_std_libs/sway-lib-std-assert/" } [contract-dependencies] -contract_b = { path = "../contract_b", salt = "0x11111111111111111111111111111111111111111111111111111111111111111" } -contract_c = { path = "../contract_c", salt = "0x00000000000000000000000000000000000000000000000000000000000000000" } +contract_b = { path = "../contract_b", salt = "0x1111111111111111111111111111111111111111111111111111111111111111" } +contract_c = { path = "../contract_c", salt = "0x0000000000000000000000000000000000000000000000000000000000000000" } diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/forc/contract_dependencies/contract_a/Forc.toml b/test/src/e2e_vm_tests/test_programs/should_pass/forc/contract_dependencies/contract_a/Forc.toml index e97499c6f3c..8beb0574be9 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/forc/contract_dependencies/contract_a/Forc.toml +++ b/test/src/e2e_vm_tests/test_programs/should_pass/forc/contract_dependencies/contract_a/Forc.toml @@ -9,5 +9,5 @@ name = "contract_a" std = { path = "../../../../../../../../sway-lib-std/" } [contract-dependencies] -contract_b = { path = "../contract_b", salt = "0x11111111111111111111111111111111111111111111111111111111111111111" } +contract_b = { path = "../contract_b", salt = "0x1111111111111111111111111111111111111111111111111111111111111111" } contract_c = { path = "../contract_c" } diff --git a/test/src/sdk-harness/Cargo.lock b/test/src/sdk-harness/Cargo.lock index 3b5151f339c..81c7d47a9d4 100644 --- a/test/src/sdk-harness/Cargo.lock +++ b/test/src/sdk-harness/Cargo.lock @@ -1551,9 +1551,9 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "fuel-abi-types" -version = "0.5.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee6135cb6e12773a7abf7d6c3a8de6467dee86fcf7293720d33e33feb01dc6d8" +checksum = "e0e7e87f94417ff1a5d60e496906033c58bfe5367546621f131fe8cdabaa2671" dependencies = [ "itertools 0.10.5", "lazy_static", @@ -1568,9 +1568,9 @@ dependencies = [ [[package]] name = "fuel-asm" -version = "0.49.0" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42df651415e443094f86102473b7f9fa23633ab6c3c98dd3f713adde251acf0f" +checksum = "db81c0bdf07b052d1c595b5ee71e20f0286ca3dc88c7ab3f775e08c8e055c34f" dependencies = [ "bitflags 2.5.0", "fuel-types", @@ -1580,9 +1580,9 @@ dependencies = [ [[package]] name = "fuel-core" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b030e12851d70598e12722886b899e28884d168367fc20d9a809951dd599004" +checksum = "5ecef9aa6c04239c408e37613eb542f81cabb3a10a619b9c793312d38eed9e34" dependencies = [ "anyhow", "async-graphql", @@ -1626,9 +1626,9 @@ dependencies = [ [[package]] name = "fuel-core-chain-config" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d202fe1dfeb98882bdc5a0206a58e469d76fd09d952c4050bb979102bd690398" +checksum = "16323762c4a5d58b11121580bee9f3a76ac7f655f95d727f957b05a9e35f477f" dependencies = [ "anyhow", "bech32", @@ -1646,9 +1646,9 @@ dependencies = [ [[package]] name = "fuel-core-client" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc636a8706e36c713606ee4226fdef5260e3650ba0e8a57f0fc06258d0078a34" +checksum = "f33af785942254f23e30a03a08a08ffb8eea645a87f06895e5d84f4205fc191a" dependencies = [ "anyhow", "cynic", @@ -1670,9 +1670,9 @@ dependencies = [ [[package]] name = "fuel-core-consensus-module" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f99179c08972efffe7628f0ff8d59028218b126347a6f9eba86f71e20966eeb" +checksum = "85320bb1990ea54ad9fcda4c527c2e42651103c2332cb7ff0b51ecaa23b4c07a" dependencies = [ "anyhow", "fuel-core-chain-config", @@ -1683,9 +1683,9 @@ dependencies = [ [[package]] name = "fuel-core-database" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5b1fd08a72609ebf0c8106359a37a4b205055be15e9f4fc30a4c0b5f0644c6b" +checksum = "d540b36b409d36ace39902509d55d0c758f9cfebc1bcbea07d7115b9923196c9" dependencies = [ "anyhow", "derive_more", @@ -1695,9 +1695,9 @@ dependencies = [ [[package]] name = "fuel-core-executor" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f98d89798007bc781d56e02681144683f5c645ee0725e7717e38694e8e5e31d" +checksum = "367ef0966c99cf1104035257023596256d61a3a5b58b8bac4dcb0bdc8e9b2459" dependencies = [ "anyhow", "fuel-core-storage", @@ -1710,9 +1710,9 @@ dependencies = [ [[package]] name = "fuel-core-importer" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f51837a53f2d8b78a701aee61b99c7f1873f23e864f01f4b4d0644a06e1f7c41" +checksum = "4c7c89083930099a8dad11f5602d4bd935ff5db546ba600cbb9325f6b3bd78ac" dependencies = [ "anyhow", "derive_more", @@ -1726,9 +1726,9 @@ dependencies = [ [[package]] name = "fuel-core-metrics" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bacc62bc4fec2fe6a818a1a7145b892bd486d69266190ca8dd31a036a3a327b7" +checksum = "2a47f442a32f2e5917066bbf9be3d6fd5d85252a131f1b5fc2f2f0ee75008066" dependencies = [ "axum", "once_cell", @@ -1740,9 +1740,9 @@ dependencies = [ [[package]] name = "fuel-core-p2p" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6496068f0f5736f9e51bba8f8bb04cb83f68df2f6142e410fe62854b47621b3" +checksum = "5cc6a321f2b1df5be84444ee8b12b647313a5b92a2589d06489bb2b00dbdb2e1" dependencies = [ "anyhow", "async-trait", @@ -1772,9 +1772,9 @@ dependencies = [ [[package]] name = "fuel-core-poa" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68d189ecd635688ddc896b44c8497b29c04bb4a3719a24eea0ca9691a6f76d5e" +checksum = "1f6185f492f9ddb65228db0f250b3f6384637ebf76b72fc81b2efb629d887912" dependencies = [ "anyhow", "async-trait", @@ -1789,9 +1789,9 @@ dependencies = [ [[package]] name = "fuel-core-producer" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d2901a7ba2c0e724bbb88a3111fdb9844f5faf9f0bd4005944f61f093730b4d" +checksum = "efad4ce5bc2f4542e3838a4256158fdd7c537d73e359ba589a4ea86e5c8a2ee0" dependencies = [ "anyhow", "async-trait", @@ -1805,9 +1805,9 @@ dependencies = [ [[package]] name = "fuel-core-services" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf2ab4d3931b8cafdb2e69fe8ca97918a168d74c73c070481ca0e552cc37bb93" +checksum = "d35200489fdcdafbe5a6a3a39baad4da523e5c004db9a885056be0137ee35098" dependencies = [ "anyhow", "async-trait", @@ -1820,9 +1820,9 @@ dependencies = [ [[package]] name = "fuel-core-storage" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e039c1c6ebef314c74c34728e1f2199dcf9ede041d6f5c6e11479517c8f4d320" +checksum = "87f4e85b634f42fb53193da517b4a2efa8ac73031cdab653029a5b1d3725572d" dependencies = [ "anyhow", "derive_more", @@ -1844,9 +1844,9 @@ dependencies = [ [[package]] name = "fuel-core-txpool" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "985684e2d67d5018e9227a4f9ed79cac02b23b207e457ee95833ab047769c2ac" +checksum = "800ab382b81de3fa62858862acb25410fdba514fae9b3862065524ac25244678" dependencies = [ "anyhow", "async-trait", @@ -1865,9 +1865,9 @@ dependencies = [ [[package]] name = "fuel-core-types" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf038dd8df8d3aa665a13295c9ef888ba8118600cccdf8fb4587410e0e102fdf" +checksum = "ffe21004dd036f4c454666e339bd0fc3b037535bbc5510321db2565087edd4fc" dependencies = [ "anyhow", "bs58", @@ -1884,9 +1884,9 @@ dependencies = [ [[package]] name = "fuel-core-upgradable-executor" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc54c84a7dc13f76930761ebca391b167caa096dc2bdb2413b5a2400bf65f99d" +checksum = "e7136365b6d48f78ea5ce6bbd3c3c79dece5777ec13a9b63ef4f56abeab6017e" dependencies = [ "fuel-core-executor", "fuel-core-storage", @@ -1895,9 +1895,9 @@ dependencies = [ [[package]] name = "fuel-crypto" -version = "0.49.0" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71cef93970fb8a26d3a683ae211833c6bbf391066887f501bd5859f29992b59a" +checksum = "4ca73b3409086e772315625304cabd2eeec10e4bd1f8b8a99cc72e0aed755e5c" dependencies = [ "coins-bip32", "coins-bip39", @@ -1916,9 +1916,9 @@ dependencies = [ [[package]] name = "fuel-derive" -version = "0.49.0" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b85e8e508b26d088262075fcfe9921b7009c931fef1cc55fe1dafb116c99884" +checksum = "d8d6e66d1b68eb916640c12a1c6c40880e11fcf569359b04483d5e18237c5229" dependencies = [ "proc-macro2", "quote", @@ -1928,9 +1928,9 @@ dependencies = [ [[package]] name = "fuel-merkle" -version = "0.49.0" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5198b4eab5a19b0034971da88199dae7dd61806ebd8df366d6af1f17cda2e151" +checksum = "faa4b60ddfa51b64d02a1d71b0cf51488171d313b32ae3fb9f39f64ddd21791b" dependencies = [ "derive_more", "digest 0.10.7", @@ -1943,15 +1943,15 @@ dependencies = [ [[package]] name = "fuel-storage" -version = "0.49.0" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa738e9c244f3f312af09faef108ec9a285f02afcefbc579c19c242cea742dd0" +checksum = "beef5f12c40118e87ef6abf611c6bba5c88754e727fb825120ae7d0872123055" [[package]] name = "fuel-tx" -version = "0.49.0" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e4b4ea79ffe711af7bbf363b25f383fc6e481e652cf55a5ef8b5a458fcf4ef9" +checksum = "fc95857e761db34a50967f53af7a74be08130d210bd985c5585f36bd753d346c" dependencies = [ "bitflags 2.5.0", "derivative", @@ -1972,9 +1972,9 @@ dependencies = [ [[package]] name = "fuel-types" -version = "0.49.0" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455cf5275d96f6907e81ed1825c4e6a9dd79f7c1c37a4e15134562f83024c7e7" +checksum = "0af9f9d8c9eb3f4e644731c829ee7da5c3cae0886864731089627af25e336cea" dependencies = [ "fuel-derive", "hex", @@ -1984,9 +1984,9 @@ dependencies = [ [[package]] name = "fuel-vm" -version = "0.49.0" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8811f949db8ce61cc68dcf81644047df4ee23be55879efcfe9f1aa5adc378965" +checksum = "71df1a9ede5237febbc7864888f26365814327732ccd11002e9bddac1ce9a4e6" dependencies = [ "anyhow", "async-trait", @@ -2018,9 +2018,9 @@ dependencies = [ [[package]] name = "fuels" -version = "0.62.0" +version = "0.63.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eeb6fa017c6d695cf4468d21c640857ba1c74d31fdac3277ad4414593a14a7b" +checksum = "e318b107e6fef3d786f2366cc78a6314a6b326342d375203238f130a7356fe49" dependencies = [ "fuel-core", "fuel-core-client", @@ -2035,9 +2035,9 @@ dependencies = [ [[package]] name = "fuels-accounts" -version = "0.62.0" +version = "0.63.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a55f3ba7346cb73a5565fd7b6ab2c0016be052863323ca076e6ac9fec719759" +checksum = "0e17d23b925d3d5e21dc5428330695c596db356d4adfc90eadecc2a490d7d5ce" dependencies = [ "async-trait", "chrono", @@ -2059,9 +2059,9 @@ dependencies = [ [[package]] name = "fuels-code-gen" -version = "0.62.0" +version = "0.63.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8db288a46989c20bc48dee787008959a2a7c17061fe78cf4ae4c1263c80692e1" +checksum = "86a7a5b4811f5563bb5c2485efc7653ed6ce465c452a1182ae9062aa13dd19af" dependencies = [ "Inflector", "fuel-abi-types", @@ -2075,9 +2075,9 @@ dependencies = [ [[package]] name = "fuels-core" -version = "0.62.0" +version = "0.63.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63d0abdc7230e4adb619a3735c237af545dcfdf86f4096b9d1daaf315838987e" +checksum = "9774ae9b35f808fa18b92d0478a3b0acbea41011409efa3117f972dfe528ae09" dependencies = [ "async-trait", "bech32", @@ -2094,6 +2094,7 @@ dependencies = [ "fuels-macros", "hex", "itertools 0.12.1", + "postcard", "serde", "serde_json", "thiserror", @@ -2102,23 +2103,22 @@ dependencies = [ [[package]] name = "fuels-macros" -version = "0.62.0" +version = "0.63.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e137a52541dbd0345bf000301091b5266644fd4de04bb8238457c5c70b9ac4e" +checksum = "ba92a701fa86eed843db68d991807207b8b3d47099d49fb82467e8900f680e01" dependencies = [ "fuels-code-gen", "itertools 0.12.1", "proc-macro2", "quote", - "rand", "syn 2.0.63", ] [[package]] name = "fuels-programs" -version = "0.62.0" +version = "0.63.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ada44df4a718da78add027d1204af8154265fc2f64b60cc28b1bba597df7e5d6" +checksum = "f6c72ac2f1cdda800dbc1c3714459f83bf208cef78812448992b6dbdda6841dc" dependencies = [ "async-trait", "fuel-abi-types", @@ -2135,15 +2135,16 @@ dependencies = [ [[package]] name = "fuels-test-helpers" -version = "0.62.0" +version = "0.63.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46d53ef79da8600d8ef580c0acc859be80b07eef0c9ddc19c61bb04b3cf4c15" +checksum = "30b8a632f2b4ddb52e8ad92871f63521e9f5cc299f842a3207f3655acc21c148" dependencies = [ "fuel-core", "fuel-core-chain-config", "fuel-core-client", "fuel-core-poa", "fuel-core-services", + "fuel-core-types", "fuel-crypto", "fuel-tx", "fuel-types", diff --git a/test/src/sdk-harness/Cargo.toml b/test/src/sdk-harness/Cargo.toml index 58a22e4a182..87716e1238c 100644 --- a/test/src/sdk-harness/Cargo.toml +++ b/test/src/sdk-harness/Cargo.toml @@ -10,14 +10,14 @@ publish = false assert_matches = "1.5.0" # Dependencies from the `fuel-core` repository: -fuel-core = { version = "0.26.0", default-features = false } -fuel-core-client = { version = "0.26.0", default-features = false } +fuel-core = { version = "0.27.0", default-features = false } +fuel-core-client = { version = "0.27.0", default-features = false } # Dependencies from the `fuel-vm` repository: -fuel-vm = { version = "0.49.0", features = ["random"] } +fuel-vm = { version = "0.50.0", features = ["random"] } # Dependencies from the `fuels-rs` repository: -fuels = { version = "0.62.0", features = ["fuel-core-lib"] } +fuels = { version = "0.63.0", features = ["fuel-core-lib"] } hex = "0.4.3" paste = "1.0.14"