diff --git a/master/deploying/configurable-constants.html b/master/deploying/configurable-constants.html index 37792db58..09c5f6bd6 100644 --- a/master/deploying/configurable-constants.html +++ b/master/deploying/configurable-constants.html @@ -214,7 +214,7 @@
LoadScript
Deploy(
name = "lib_contract_instance",
contract = "LibContract",
- wallet = "wallet"
+ wallet = "wallet",
+ random_salt = false,
),
Deploy(
name = "contract_caller_instance",
contract = "LibContractCaller",
- wallet = "wallet"
+ wallet = "wallet",
),
Deploy(
name = "contract_caller_instance2",
contract = "LibContractCaller",
- wallet = "wallet"
+ wallet = "wallet",
),
);
let lib_contract_id = lib_contract_instance.contract_id();
@@ -3840,7 +3841,8 @@ LoadScript
Deploy(
name = "contract_instance",
contract = "TestContract",
- wallet = "wallet"
+ wallet = "wallet",
+ random_salt = false,
),
);
diff --git a/master/searchindex.js b/master/searchindex.js
index 76c850235..3f1745fe0 100644
--- a/master/searchindex.js
+++ b/master/searchindex.js
@@ -1 +1 @@
-Object.assign(window.search, {"doc_urls":["index.html#the-fuel-rust-sdk","getting-started.html#getting-started","getting-started.html#installation-guide","getting-started.html#creating-a-new-project-with-forc","getting-started.html#adding-a-rust-integration-test-to-the-sway-project","getting-started.html#importing-the-fuel-rust-sdk","getting-started.html#the-fuel-rust-sdk-source-code","getting-started.html#more-in-depth-fuel-and-sway-knowledge","connecting/index.html#connecting-to-a-fuel-node","connecting/external-node.html#connecting-to-the-testnet-or-an-external-node","connecting/short-lived.html#running-a-short-lived-fuel-node-with-the-sdk","connecting/short-lived.html#features","connecting/short-lived.html#fuel-core-lib","connecting/short-lived.html#rocksdb","connecting/rocksdb.html#rocksdb","connecting/querying.html#querying-the-blockchain","connecting/querying.html#set-up","connecting/querying.html#get-all-coins-from-an-address","connecting/querying.html#get-spendable-resources-owned-by-an-address","connecting/querying.html#get-balances-from-an-address","connecting/retrying.html#retrying-requests","connecting/retrying.html#retryconfig","connecting/retrying.html#interval-strategy---backoff","connecting/retrying.html#variants","accounts.html#accounts","accounts.html#transferring-assets","accounts.html#account-impersonation","wallets/index.html#managing-wallets","wallets/private-keys.html#creating-a-wallet-from-a-private-key","wallets/mnemonic-wallet.html#creating-a-wallet-from-mnemonic-phrases","wallets/access.html#wallet-access","wallets/access.html#wallet-states","wallets/access.html#transitioning-states","wallets/access.html#design-guidelines","wallets/encrypting-and-storing.html#encrypting-and-storing-wallets","wallets/encrypting-and-storing.html#creating-a-wallet-and-storing-an-encrypted-json-wallet-on-disk","wallets/encrypting-and-storing.html#encrypting-and-storing-a-wallet-created-from-a-mnemonic-or-private-key","wallets/checking-balances-and-coins.html#checking-balances-and-coins","wallets/test-wallets.html#setting-up-test-wallets","wallets/test-wallets.html#setting-up-multiple-test-wallets","wallets/test-wallets.html#setting-up-a-test-wallet-with-multiple-random-assets","wallets/test-wallets.html#setting-up-a-test-wallet-with-multiple-custom-assets","wallets/test-wallets.html#setting-up-assets","wallets/signing.html#signing","wallets/signing.html#adding-signers-to-a-transaction-builder","wallets/signing.html#signing-a-built-transaction","abigen/index.html#generating-bindings-with-abigen","abigen/the-json-abi-file.html#the-json-abi-file","abigen/the-abigen-macro.html#abigen","abigen/the-abigen-macro.html#how-does-the-generated-code-look","abigen/the-abigen-macro.html#using-the-bindings","deploying/index.html#deploying-contracts","deploying/index.html#deploying-a-contract-binary","deploying/configurable-constants.html#configurable-constants","deploying/storage-slots.html#overriding-storage-slots","deploying/interacting-with-contracts.html#interacting-with-contracts","deploying/the-fuelvm-binary-file.html#the-fuelvm-binary-file","deploying/large_contracts.html#deploying-large-contracts","deploying/large_contracts.html#blob-size-considerations","calling-contracts/index.html#calling-contracts","calling-contracts/calls-with-different-wallets.html#calls-with-different-wallets","calling-contracts/tx-policies.html#transaction-policies","calling-contracts/call-params.html#call-parameters","calling-contracts/custom-asset-transfer.html#custom-asset-transfer","calling-contracts/call-response.html#call-response","calling-contracts/call-response.html#error-handling","calling-contracts/logs.html#logs","calling-contracts/variable-outputs.html#output-variables","calling-contracts/simulation.html#simulating-calls","calling-contracts/other-contracts.html#calling-other-contracts","calling-contracts/multicalls.html#multiple-contract-calls","calling-contracts/multicalls.html#output-values","calling-contracts/tx-dependency-estimation.html#transaction-dependency-estimation","calling-contracts/cost-estimation.html#estimating-contract-call-cost","calling-contracts/low-level-calls.html#low-level-calls","running-scripts.html#running-scripts","running-scripts.html#running-scripts-with-transaction-policies","running-scripts.html#logs","running-scripts.html#calling-contracts-from-scripts","running-scripts.html#configurable-constants","predicates/index.html#predicates","predicates/index.html#instantiating-predicates","predicates/index.html#configurable-constants","predicates/send-spend-predicate.html#signatures-in-predicates-example","preuploading-code.html#pre-uploading-code","preuploading-code.html#scripts","preuploading-code.html#predicates","custom-transactions/index.html#custom-transactions","custom-transactions/transaction-builders.html#transaction-builders","custom-transactions/transaction-builders.html#role-of-the-transaction-builders","custom-transactions/transaction-builders.html#creating-a-custom-transaction","custom-transactions/transaction-builders.html#building-a-transaction-without-signatures","custom-transactions/custom-calls.html#custom-contract-and-script-calls","custom-transactions/custom-calls.html#custom-contract-call","custom-transactions/custom-calls.html#custom-script-call","types/index.html#types","types/bytes32.html#bytes32","types/address.html#address","types/contract-id.html#contractid","types/asset-id.html#assetid","types/bech32.html#bech32","types/custom_types.html#structs-and-enums","types/custom_types.html#generics","types/custom_types.html#unused-generic-type-parameters","types/string.html#string","types/bits256.html#bits256","types/bytes.html#bytes","types/B512.html#b512","types/evm_address.html#evmaddress","types/vectors.html#vectors","types/vectors.html#passing-in-vectors","types/vectors.html#returning-vectors","types/conversion.html#converting-types","types/conversion.html#convert-between-native-types","types/conversion.html#convert-to-bytes32","types/conversion.html#convert-to-address","types/conversion.html#convert-to-contractid","types/conversion.html#convert-to-identity","types/conversion.html#convert-to-assetid","types/conversion.html#convert-to-bech32","types/conversion.html#convert-to-str","types/conversion.html#convert-to-bits256","types/conversion.html#convert-to-bytes","types/conversion.html#convert-to-b512","types/conversion.html#convert-to-evmaddress","codec/index.html#codec","codec/index.html#prerequisites-for-decodingencoding","codec/index.html#deriving-the-traits","codec/index.html#tweaking-the-derivation","codec/encoding.html#encoding","codec/encoding.html#configuring-the-encoder","codec/encoding.html#configuring-the-encoder-for-contractscript-calls","codec/decoding.html#decoding","codec/decoding.html#configuring-the-decoder","codec/decoding.html#configuring-the-decoder-for-contractscript-calls","reference.html#api-reference","testing/index.html#fuels-rs-testing","testing/basics.html#testing-basics","testing/basics.html#the-assert-macro","testing/basics.html#the-assert_eq-macro","testing/basics.html#the-assert_ne-macro","testing/basics.html#the-println-macro","testing/basics.html#run-commands","testing/the-setup-program-test-macro.html#the-setup_program_test-macro","testing/the-setup-program-test-macro.html#options","testing/the-setup-program-test-macro.html#wallets","testing/the-setup-program-test-macro.html#abigen","testing/the-setup-program-test-macro.html#deploy","testing/the-setup-program-test-macro.html#loadscript","testing/chains.html#increasing-the-block-height","cookbook/index.html#cookbook","cookbook/custom-chain.html#custom-chain","cookbook/deposit-and-withdraw.html#deposit-and-withdraw","cookbook/transfer-all-assets.html#transfer-all-assets","debugging/index.html#debugging","debugging/function-selector.html#function-selector","glossary.html#glossary","glossary.html#contract","glossary.html#provider","glossary.html#wallet-and-signer","contributing/CONTRIBUTING.html#contributing-to-the-fuel-rust-sdk","contributing/CONTRIBUTING.html#finding-something-to-work-on","contributing/CONTRIBUTING.html#contribution-flow","contributing/CONTRIBUTING.html#linking-issues","contributing/tests-structure.html#integration-tests-structure-in-fuels-rs","cli/index.html#fuels-rs-rust-workspaces","cli/fuels-abi-cli.html#fuels-abi-cli","cli/fuels-abi-cli.html#usage","cli/fuels-abi-cli.html#examples","cli/fuels-abi-cli.html#encoding-params-only","cli/fuels-abi-cli.html#encoding-function-call","cli/fuels-abi-cli.html#decoding-params-only","cli/fuels-abi-cli.html#decoding-function-output"],"index":{"documentStore":{"docInfo":{"0":{"body":51,"breadcrumbs":6,"title":3},"1":{"body":0,"breadcrumbs":4,"title":2},"10":{"body":73,"breadcrumbs":15,"title":6},"100":{"body":87,"breadcrumbs":3,"title":1},"101":{"body":67,"breadcrumbs":5,"title":2},"102":{"body":71,"breadcrumbs":4,"title":1},"103":{"body":108,"breadcrumbs":7,"title":4},"104":{"body":95,"breadcrumbs":3,"title":1},"105":{"body":58,"breadcrumbs":3,"title":1},"106":{"body":48,"breadcrumbs":3,"title":1},"107":{"body":33,"breadcrumbs":3,"title":1},"108":{"body":60,"breadcrumbs":3,"title":1},"109":{"body":0,"breadcrumbs":3,"title":1},"11":{"body":0,"breadcrumbs":10,"title":1},"110":{"body":29,"breadcrumbs":4,"title":2},"111":{"body":32,"breadcrumbs":4,"title":2},"112":{"body":32,"breadcrumbs":5,"title":2},"113":{"body":35,"breadcrumbs":7,"title":4},"114":{"body":18,"breadcrumbs":5,"title":2},"115":{"body":33,"breadcrumbs":5,"title":2},"116":{"body":25,"breadcrumbs":5,"title":2},"117":{"body":10,"breadcrumbs":5,"title":2},"118":{"body":18,"breadcrumbs":5,"title":2},"119":{"body":41,"breadcrumbs":5,"title":2},"12":{"body":37,"breadcrumbs":12,"title":3},"120":{"body":24,"breadcrumbs":5,"title":2},"121":{"body":23,"breadcrumbs":5,"title":2},"122":{"body":7,"breadcrumbs":5,"title":2},"123":{"body":14,"breadcrumbs":5,"title":2},"124":{"body":6,"breadcrumbs":5,"title":2},"125":{"body":12,"breadcrumbs":2,"title":1},"126":{"body":65,"breadcrumbs":3,"title":2},"127":{"body":34,"breadcrumbs":3,"title":2},"128":{"body":48,"breadcrumbs":3,"title":2},"129":{"body":48,"breadcrumbs":3,"title":1},"13":{"body":20,"breadcrumbs":10,"title":1},"130":{"body":26,"breadcrumbs":4,"title":2},"131":{"body":23,"breadcrumbs":6,"title":4},"132":{"body":93,"breadcrumbs":3,"title":1},"133":{"body":32,"breadcrumbs":4,"title":2},"134":{"body":24,"breadcrumbs":6,"title":4},"135":{"body":23,"breadcrumbs":4,"title":2},"136":{"body":11,"breadcrumbs":4,"title":3},"137":{"body":11,"breadcrumbs":5,"title":2},"138":{"body":18,"breadcrumbs":5,"title":2},"139":{"body":16,"breadcrumbs":5,"title":2},"14":{"body":44,"breadcrumbs":5,"title":1},"140":{"body":11,"breadcrumbs":5,"title":2},"141":{"body":98,"breadcrumbs":5,"title":2},"142":{"body":26,"breadcrumbs":5,"title":2},"143":{"body":68,"breadcrumbs":5,"title":2},"144":{"body":22,"breadcrumbs":4,"title":1},"145":{"body":16,"breadcrumbs":4,"title":1},"146":{"body":41,"breadcrumbs":4,"title":1},"147":{"body":45,"breadcrumbs":4,"title":1},"148":{"body":220,"breadcrumbs":4,"title":1},"149":{"body":91,"breadcrumbs":6,"title":3},"15":{"body":30,"breadcrumbs":7,"title":2},"150":{"body":30,"breadcrumbs":2,"title":1},"151":{"body":78,"breadcrumbs":6,"title":2},"152":{"body":281,"breadcrumbs":5,"title":2},"153":{"body":210,"breadcrumbs":5,"title":2},"154":{"body":7,"breadcrumbs":2,"title":1},"155":{"body":55,"breadcrumbs":5,"title":2},"156":{"body":0,"breadcrumbs":2,"title":1},"157":{"body":24,"breadcrumbs":2,"title":1},"158":{"body":15,"breadcrumbs":2,"title":1},"159":{"body":37,"breadcrumbs":3,"title":2},"16":{"body":53,"breadcrumbs":7,"title":2},"160":{"body":24,"breadcrumbs":5,"title":4},"161":{"body":52,"breadcrumbs":4,"title":3},"162":{"body":111,"breadcrumbs":3,"title":2},"163":{"body":50,"breadcrumbs":3,"title":2},"164":{"body":99,"breadcrumbs":9,"title":5},"165":{"body":13,"breadcrumbs":7,"title":4},"166":{"body":15,"breadcrumbs":9,"title":3},"167":{"body":44,"breadcrumbs":7,"title":1},"168":{"body":20,"breadcrumbs":7,"title":1},"169":{"body":41,"breadcrumbs":8,"title":2},"17":{"body":15,"breadcrumbs":7,"title":2},"170":{"body":83,"breadcrumbs":9,"title":3},"171":{"body":17,"breadcrumbs":8,"title":2},"172":{"body":8,"breadcrumbs":9,"title":3},"18":{"body":68,"breadcrumbs":9,"title":4},"19":{"body":21,"breadcrumbs":7,"title":2},"2":{"body":42,"breadcrumbs":4,"title":2},"20":{"body":29,"breadcrumbs":8,"title":2},"21":{"body":33,"breadcrumbs":7,"title":1},"22":{"body":22,"breadcrumbs":9,"title":3},"23":{"body":29,"breadcrumbs":7,"title":1},"24":{"body":43,"breadcrumbs":2,"title":1},"25":{"body":236,"breadcrumbs":3,"title":2},"26":{"body":54,"breadcrumbs":3,"title":2},"27":{"body":77,"breadcrumbs":4,"title":2},"28":{"body":84,"breadcrumbs":10,"title":4},"29":{"body":129,"breadcrumbs":10,"title":4},"3":{"body":15,"breadcrumbs":6,"title":4},"30":{"body":25,"breadcrumbs":6,"title":2},"31":{"body":87,"breadcrumbs":6,"title":2},"32":{"body":42,"breadcrumbs":6,"title":2},"33":{"body":32,"breadcrumbs":6,"title":2},"34":{"body":0,"breadcrumbs":8,"title":3},"35":{"body":67,"breadcrumbs":12,"title":7},"36":{"body":58,"breadcrumbs":12,"title":7},"37":{"body":74,"breadcrumbs":8,"title":3},"38":{"body":10,"breadcrumbs":10,"title":4},"39":{"body":68,"breadcrumbs":11,"title":5},"4":{"body":100,"breadcrumbs":8,"title":6},"40":{"body":68,"breadcrumbs":13,"title":7},"41":{"body":89,"breadcrumbs":13,"title":7},"42":{"body":131,"breadcrumbs":9,"title":3},"43":{"body":63,"breadcrumbs":4,"title":1},"44":{"body":110,"breadcrumbs":7,"title":4},"45":{"body":10,"breadcrumbs":6,"title":3},"46":{"body":47,"breadcrumbs":6,"title":3},"47":{"body":72,"breadcrumbs":9,"title":3},"48":{"body":61,"breadcrumbs":6,"title":1},"49":{"body":210,"breadcrumbs":8,"title":3},"5":{"body":24,"breadcrumbs":6,"title":4},"50":{"body":390,"breadcrumbs":7,"title":2},"51":{"body":14,"breadcrumbs":4,"title":2},"52":{"body":261,"breadcrumbs":5,"title":3},"53":{"body":202,"breadcrumbs":6,"title":2},"54":{"body":73,"breadcrumbs":7,"title":3},"55":{"body":98,"breadcrumbs":6,"title":2},"56":{"body":234,"breadcrumbs":8,"title":3},"57":{"body":216,"breadcrumbs":7,"title":3},"58":{"body":64,"breadcrumbs":7,"title":3},"59":{"body":130,"breadcrumbs":4,"title":2},"6":{"body":77,"breadcrumbs":7,"title":5},"60":{"body":93,"breadcrumbs":7,"title":3},"61":{"body":134,"breadcrumbs":6,"title":2},"62":{"body":239,"breadcrumbs":6,"title":2},"63":{"body":31,"breadcrumbs":8,"title":3},"64":{"body":126,"breadcrumbs":6,"title":2},"65":{"body":33,"breadcrumbs":6,"title":2},"66":{"body":166,"breadcrumbs":4,"title":1},"67":{"body":98,"breadcrumbs":7,"title":2},"68":{"body":93,"breadcrumbs":6,"title":2},"69":{"body":76,"breadcrumbs":6,"title":2},"7":{"body":14,"breadcrumbs":7,"title":5},"70":{"body":81,"breadcrumbs":8,"title":3},"71":{"body":31,"breadcrumbs":7,"title":2},"72":{"body":158,"breadcrumbs":8,"title":3},"73":{"body":104,"breadcrumbs":8,"title":4},"74":{"body":121,"breadcrumbs":8,"title":3},"75":{"body":68,"breadcrumbs":4,"title":2},"76":{"body":18,"breadcrumbs":6,"title":4},"77":{"body":32,"breadcrumbs":3,"title":1},"78":{"body":28,"breadcrumbs":5,"title":3},"79":{"body":185,"breadcrumbs":4,"title":2},"8":{"body":76,"breadcrumbs":6,"title":3},"80":{"body":53,"breadcrumbs":2,"title":1},"81":{"body":176,"breadcrumbs":3,"title":2},"82":{"body":158,"breadcrumbs":3,"title":2},"83":{"body":276,"breadcrumbs":6,"title":3},"84":{"body":31,"breadcrumbs":6,"title":3},"85":{"body":64,"breadcrumbs":4,"title":1},"86":{"body":54,"breadcrumbs":4,"title":1},"87":{"body":28,"breadcrumbs":4,"title":2},"88":{"body":25,"breadcrumbs":6,"title":2},"89":{"body":147,"breadcrumbs":7,"title":3},"9":{"body":106,"breadcrumbs":11,"title":4},"90":{"body":284,"breadcrumbs":7,"title":3},"91":{"body":46,"breadcrumbs":8,"title":4},"92":{"body":39,"breadcrumbs":10,"title":4},"93":{"body":22,"breadcrumbs":9,"title":3},"94":{"body":23,"breadcrumbs":9,"title":3},"95":{"body":13,"breadcrumbs":2,"title":1},"96":{"body":123,"breadcrumbs":3,"title":1},"97":{"body":54,"breadcrumbs":3,"title":1},"98":{"body":54,"breadcrumbs":3,"title":1},"99":{"body":54,"breadcrumbs":3,"title":1}},"docs":{"0":{"body":"The Fuel Rust SDK can be used for a variety of things, including: Compiling, deploying, and testing Sway contracts Using the testnet or running a local Fuel node Crafting and signing transactions with hand-crafted scripts or contract calls Generating type-safe Rust bindings of contract ABI methods This book is an overview of the different things one can achieve using the Rust SDK, and how to implement them. Keep in mind that both the SDK and the documentation are works-in-progress!","breadcrumbs":"The Fuel Rust SDK » The Fuel Rust SDK","id":"0","title":"The Fuel Rust SDK"},"1":{"body":"","breadcrumbs":"Getting Started » Getting Started","id":"1","title":"Getting Started"},"10":{"body":"You can use the SDK to spin up a local, ideally short-lived Fuel node. Then, you can instantiate a Fuel client, pointing to this node. use fuels::prelude::{FuelService, Provider}; // Run the fuel node. let server = FuelService::start( NodeConfig::default(), ChainConfig::default(), StateConfig::default(), ) .await?; // Create a client that will talk to the node created above. let client = Provider::from(server.bound_address()).await?; assert!(client.healthy().await?); This approach is ideal for contract testing. You can also use the test helper setup_test_provider() for this: use fuels::prelude::*; // Use the test helper to setup a test provider. let provider = setup_test_provider(vec![], vec![], None, None).await?; // Create the wallet. let _wallet = WalletUnlocked::new_random(Some(provider)); You can also use launch_provider_and_get_wallet(), which abstracts away the setup_test_provider() and the wallet creation, all in one single method: let wallet = launch_provider_and_get_wallet().await?;","breadcrumbs":"Connecting to a Fuel node » Running a short-lived Fuel node with the SDK » Running a short-lived Fuel node with the SDK","id":"10","title":"Running a short-lived Fuel node with the SDK"},"100":{"body":"Bech32Address and Bech32ContractId enable the use of addresses and contract IDs in the bech32 format. They can easily be converted to their counterparts Address and ContractId. Here are the main ways of creating a Bech32Address, but note that the same applies to Bech32ContractId: use fuels::types::{bech32::Bech32Address, Address, Bytes32}; // New from HRP string and a hash let hrp = \"fuel\"; let my_slice = [1u8; 32]; let _bech32_address = Bech32Address::new(hrp, my_slice); // Note that you can also pass a hash stored as Bytes32 to new: let my_hash = Bytes32::new([1u8; 32]); let _bech32_address = Bech32Address::new(hrp, my_hash); // From a string. let address = \"fuel1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqsx2mt2\"; let bech32_address = Bech32Address::from_str(address)?; assert_eq!([0u8; 32], *bech32_address.hash()); // From Address let plain_address = Address::new([0u8; 32]); let bech32_address = Bech32Address::from(plain_address); assert_eq!([0u8; 32], *bech32_address.hash()); // Convert to Address let _plain_address: Address = bech32_address.into(); Note: when creating a Bech32Address from Address or Bech32ContractId from ContractId the HRP (Human-Readable Part) is set to \"fuel\" per default.","breadcrumbs":"Types » Bech32 » Bech32","id":"100","title":"Bech32"},"101":{"body":"The structs and enums you define in your Sway code have equivalents automatically generated by the SDK's abigen! macro. For instance, if in your Sway code you have a struct called CounterConfig that looks like this: struct CounterConfig { dummy: bool, initial_value: u64,\n} After using the abigen! macro, CounterConfig will be accessible in your Rust file! Here's an example: abigen!(Contract(name=\"MyContract\", abi=\"e2e/sway/types/contracts/complex_types_contract/out/release/complex_types_contract-abi.json\")); // Here we can use `CounterConfig`, a struct originally // defined in the contract. let counter_config = CounterConfig { dummy: true, initial_value: 42, }; You can freely use your custom types (structs or enums) within this scope. That also means passing custom types to functions and receiving custom types from function calls.","breadcrumbs":"Types » Structs and enums » Structs and enums","id":"101","title":"Structs and enums"},"102":{"body":"The Fuel Rust SDK supports both generic enums and generic structs. If you're already familiar with Rust, it's your typical struct MyStruct