# Rust SDK

**URL:** https://forum.fuel.network/c/rust-sdk/11.md

[Latest](https://forum.fuel.network/latest.md) · [Categories](https://forum.fuel.network/categories.md) · [Tags](https://forum.fuel.network/tags.md)

---

## [About the Rust SDK category](https://forum.fuel.network/t/about-the-rust-sdk-category/51)

<div class="topic-metadata">

**Author:** [@camiinthisthang.sway](https://forum.fuel.network/u/camiinthisthang.sway)\
**Replies:** 0

</div>

---

## [Parsing custom contract errors](https://forum.fuel.network/t/parsing-custom-contract-errors/9478)

<div class="topic-metadata">

**Author:** [@HenryMBaldwin](https://forum.fuel.network/u/HenryMBaldwin)\
**Replies:** 2\
**Last updated:** [August 1, 2025, 8:48pm UTC](https://forum.fuel.network/t/parsing-custom-contract-errors/9478 "2025-08-01T20:48:56Z")

</div>

I am hitting a contract that follows an error emitting pattern like: log(CustomError::ErrorOne) revert(0) where CustomError is defined as: pub enum CustomError { ErrorOne: (), ErrorTwo: (), … } In rus…

---

## [Provider errors related to Coin storage](https://forum.fuel.network/t/provider-errors-related-to-coin-storage/9035)

<div class="topic-metadata">

**Author:** [@soltheon](https://forum.fuel.network/u/soltheon)\
**Replies:** 20\
**Last updated:** [May 20, 2025, 1:21pm UTC](https://forum.fuel.network/t/provider-errors-related-to-coin-storage/9035 "2025-05-20T13:21:23Z")

</div>

I am running the same fuel-core and fuels-rs version on my home computer and a server. fuel-core on the server is returning errors about coin storage, but it works fine on my home computer. fuel-core: v0.42.0 Fuels-rs …

---

## [I am unable to submit transactions to local node](https://forum.fuel.network/t/i-am-unable-to-submit-transactions-to-local-node/8487)

<div class="topic-metadata">

**Author:** [@soltheon](https://forum.fuel.network/u/soltheon)\
**Replies:** 8\
**Last updated:** [March 3, 2025, 11:03pm UTC](https://forum.fuel.network/t/i-am-unable-to-submit-transactions-to-local-node/8487 "2025-03-03T23:03:54Z")

</div>

I haven’t been able to submit transactions through my local node. Wondering if this is not supported or if its a bug. Rust SDK error: Provider( "io error: Decode error: Custom { kind: Other, error: \\"Response error…

---

## [How to effectively call the needed imports for testing SRC14 (upgradeable) contracts?](https://forum.fuel.network/t/how-to-effectively-call-the-needed-imports-for-testing-src14-upgradeable-contracts/8583)

<div class="topic-metadata">

**Author:** [@Kingmaggerz](https://forum.fuel.network/u/Kingmaggerz)\
**Replies:** 1\
**Last updated:** [February 20, 2025, 6:07pm UTC](https://forum.fuel.network/t/how-to-effectively-call-the-needed-imports-for-testing-src14-upgradeable-contracts/8583 "2025-02-20T18:07:48Z")

</div>

Morning. I have been searching the docs and examples for any indication on how to effectively use sway\_libs and standards within rust harness.rs test file to test proxy and implement contracts. Any help or suggestions?

---

## [Error while connecting with provider](https://forum.fuel.network/t/error-while-connecting-with-provider/8250)

<div class="topic-metadata">

**Author:** [@etherhood](https://forum.fuel.network/u/etherhood)\
**Replies:** 1\
**Last updated:** [January 24, 2025, 2:32pm UTC](https://forum.fuel.network/t/error-while-connecting-with-provider/8250 "2025-01-24T14:32:25Z")

</div>

When I try to connect with RPC using fuel rust sdk, I am getting the following error while running the code Error: io: Response errors; Unknown field "maxGas" on type "NodeInfo".; Unknown field "maxSize" on type "NodeIn…

---

## [Token data by asset\_id](https://forum.fuel.network/t/token-data-by-asset-id/7916)

<div class="topic-metadata">

**Author:** [@czareko](https://forum.fuel.network/u/czareko)\
**Replies:** 2\
**Last updated:** [January 8, 2025, 5:48pm UTC](https://forum.fuel.network/t/token-data-by-asset-id/7916 "2025-01-08T17:48:18Z")

</div>

Is there any recommended way how I can get token details by asset\_id?

---

## [All eth gone after executing a script using rust sdk](https://forum.fuel.network/t/all-eth-gone-after-executing-a-script-using-rust-sdk/7694)

<div class="topic-metadata">

**Author:** [@asobazol](https://forum.fuel.network/u/asobazol)\
**Replies:** 1\
**Last updated:** [December 29, 2024, 3:56pm UTC](https://forum.fuel.network/t/all-eth-gone-after-executing-a-script-using-rust-sdk/7694 "2024-12-29T15:56:38Z")

</div>

used mira amm swap\_exact\_input script with rust sdk (abigen) had a script error related to not being able to transfer assets, then i added this option: with\_variable\_output\_policy(VariableOutputPolicy::Exactly(1)) run…

---

## [How to encode structs into bytes?](https://forum.fuel.network/t/how-to-encode-structs-into-bytes/2725)

<div class="topic-metadata">

**Author:** [@tsk](https://forum.fuel.network/u/tsk)\
**Replies:** 2\
**Last updated:** [December 8, 2024, 6:25pm UTC](https://forum.fuel.network/t/how-to-encode-structs-into-bytes/2725 "2024-12-08T18:25:46Z")

</div>

How do I encode a struct imported from Sway into bytes using Rust SDK? For example I have a struct defined in Sway struct TransferParams { to: Identity, asset\_id: ContractId, amount: u64, } I need to sha…

---

## [ETH Wallet address conversion](https://forum.fuel.network/t/eth-wallet-address-conversion/6901)

<div class="topic-metadata">

**Author:** [@diyahir](https://forum.fuel.network/u/diyahir)\
**Replies:** 6\
**Last updated:** [November 11, 2024, 11:26pm UTC](https://forum.fuel.network/t/eth-wallet-address-conversion/6901 "2024-11-11T23:26:52Z")

</div>

How are the wallet addresses associated with an ETH address determined? I see that an ETH address has 42 chars and a fuel hex address has 66. Also, Is the wallet an Identity::Address or an Identity::ContractId under th…

---

## [Proxy contract not in inputs error, but it IS in the inputs?](https://forum.fuel.network/t/proxy-contract-not-in-inputs-error-but-it-is-in-the-inputs/7007)

<div class="topic-metadata">

**Author:** [@diyahir](https://forum.fuel.network/u/diyahir)\
**Replies:** 1\
**Last updated:** [November 7, 2024, 3:50pm UTC](https://forum.fuel.network/t/proxy-contract-not-in-inputs-error-but-it-is-in-the-inputs/7007 "2024-11-07T15:50:11Z")

</div>

I’m beginning to make all my contracts proxy upgradeable. I’m starting with the borrow\_operations contract wrapping the Contract in a ContractInstance struct. Here you can see that the contract not in inputs is actually …

---

## [The \`determine\_missing\_contracts\` function is failing to figure out the nested contract calls](https://forum.fuel.network/t/the-determine-missing-contracts-function-is-failing-to-figure-out-the-nested-contract-calls/6956)

<div class="topic-metadata">

**Author:** [@Mantas-M](https://forum.fuel.network/u/Mantas-M)\
**Replies:** 2\
**Last updated:** [November 6, 2024, 6:01pm UTC](https://forum.fuel.network/t/the-determine-missing-contracts-function-is-failing-to-figure-out-the-nested-contract-calls/6956 "2024-11-06T18:01:31Z")

</div>

I am using determine\_missing\_contracts in places of my application where I do not have access to the contract ids used for the nested calls within my contract. If I isolate this code which is causing this issue and do t…

---

## [Simulation results differ with local mainnet node and block producer as provider](https://forum.fuel.network/t/simulation-results-differ-with-local-mainnet-node-and-block-producer-as-provider/6977)

<div class="topic-metadata">

**Author:** [@soltheon](https://forum.fuel.network/u/soltheon)\
**Replies:** 0\
**Last updated:** [November 4, 2024, 1:12pm UTC](https://forum.fuel.network/t/simulation-results-differ-with-local-mainnet-node-and-block-producer-as-provider/6977 "2024-11-04T13:12:07Z")

</div>

fuelup show Default host: x86\_64-unknown-linux-gnu Installed toolchains -------------------- latest-x86\_64-unknown-linux-gnu nightly-x86\_64-unknown-linux-gnu (default) latest-2023-07-05-x86\_64-unknown-linux-gnu testnet-…

---

## [The \`estimate\_transaction\_cost\` function is undervaluing contract calls](https://forum.fuel.network/t/the-estimate-transaction-cost-function-is-undervaluing-contract-calls/6955)

<div class="topic-metadata">

**Author:** [@Mantas-M](https://forum.fuel.network/u/Mantas-M)\
**Replies:** 5\
**Last updated:** [November 1, 2024, 2:18pm UTC](https://forum.fuel.network/t/the-estimate-transaction-cost-function-is-undervaluing-contract-calls/6955 "2024-11-01T14:18:48Z")

</div>

I’ve been trying to use estimate\_transaction\_cost to estimate gas costs so I could set up hard limits for my applications calls. The issue seems to be that with the tolerance set to 0.0 or None it underestimates the pri…

---

## [RPC Error: The specified coin doesn't exist](https://forum.fuel.network/t/rpc-error-the-specified-coin-doesnt-exist/6954)

<div class="topic-metadata">

**Author:** [@Mantas-M](https://forum.fuel.network/u/Mantas-M)\
**Replies:** 3\
**Last updated:** [November 1, 2024, 2:07pm UTC](https://forum.fuel.network/t/rpc-error-the-specified-coin-doesnt-exist/6954 "2024-11-01T14:07:35Z")

</div>

I have started encountering this RPC response error randomly and I cannot seem to pinpoint it. It occurs during various calls to contracts when using the Rust SDK. One user suggested that it may be due to invoking more…

---

## [Unable to call mainnet contracts](https://forum.fuel.network/t/unable-to-call-mainnet-contracts/6841)

<div class="topic-metadata">

**Author:** [@soltheon](https://forum.fuel.network/u/soltheon)\
**Replies:** 6\
**Last updated:** [October 18, 2024, 8:17pm UTC](https://forum.fuel.network/t/unable-to-call-mainnet-contracts/6841 "2024-10-18T20:17:32Z")

</div>

Topic discussion checklist Run $ fuelup show and add the output below: Installed toolchains -------------------- latest-x86\_64-unknown-linux-gnu nightly-x86\_64-unknown-linux-gnu (default) testnet-x86\_64-unknown-linux-…

---

## [How to read from Storage Slots](https://forum.fuel.network/t/how-to-read-from-storage-slots/6828)

<div class="topic-metadata">

**Author:** [@Walter-Phillips](https://forum.fuel.network/u/Walter-Phillips)\
**Replies:** 4\
**Last updated:** [October 16, 2024, 5:01am UTC](https://forum.fuel.network/t/how-to-read-from-storage-slots/6828 "2024-10-16T05:01:28Z")

</div>

I am trying to read directly from contract storage in Rust. I found the fuel-strorage and fuel-core-storage crates. However, I am having difficulty reading the bytes stored in a given storage slot. Is this something that…

---

## [Error: use of undeclared type \`VariableOutputPolicy\`](https://forum.fuel.network/t/error-use-of-undeclared-type-variableoutputpolicy/6831)

<div class="topic-metadata">

**Author:** [@eesheng](https://forum.fuel.network/u/eesheng)\
**Replies:** 1\
**Last updated:** [October 15, 2024, 4:08pm UTC](https://forum.fuel.network/t/error-use-of-undeclared-type-variableoutputpolicy/6831 "2024-10-15T16:08:51Z")

</div>

Refer to: Deposit and Withdraw - The Fuel Rust SDK How to fix the following codes: pub async fn withdraw( contract: &Exchange\<WalletUnlocked\>, amount: u64, asset: AssetId, ) -\> CallRespo…

---

## [Error: failed to run custom build command for \`fuel-core-upgradable-executor v0.36.0\`](https://forum.fuel.network/t/error-failed-to-run-custom-build-command-for-fuel-core-upgradable-executor-v0-36-0/6829)

<div class="topic-metadata">

**Author:** [@eesheng](https://forum.fuel.network/u/eesheng)\
**Replies:** 5\
**Last updated:** [October 15, 2024, 1:42pm UTC](https://forum.fuel.network/t/error-failed-to-run-custom-build-command-for-fuel-core-upgradable-executor-v0-36-0/6829 "2024-10-15T13:42:15Z")

</div>

Commands: cargo test The error: error: failed to run custom build command for \`fuel-core-upgradable-executor v0.36.0\` Caused by: process didn't exit successfully: \`/home/donkey/Desktop/Donkeyswapv1/contracts/target/…

---

## [Error: Graphql error: UnexpectedResponse(401)](https://forum.fuel.network/t/error-graphql-error-unexpectedresponse-401/6787)

<div class="topic-metadata">

**Author:** [@PrabhatYaadav](https://forum.fuel.network/u/PrabhatYaadav)\
**Replies:** 3\
**Last updated:** [October 14, 2024, 1:29pm UTC](https://forum.fuel.network/t/error-graphql-error-unexpectedresponse-401/6787 "2024-10-14T13:29:51Z")

</div>

forc deploy --node-url https://username:password@mainnet.fuel.network/v1/graphql (I have replaced my username and password) With the above command im getting the below response error: Graphql error: UnexpectedResponse…

---

## [Is there currently a way to view historic logs of contracts?](https://forum.fuel.network/t/is-there-currently-a-way-to-view-historic-logs-of-contracts/6648)

<div class="topic-metadata">

**Author:** [@soltheon](https://forum.fuel.network/u/soltheon)\
**Replies:** 5\
**Last updated:** [October 8, 2024, 10:46pm UTC](https://forum.fuel.network/t/is-there-currently-a-way-to-view-historic-logs-of-contracts/6648 "2024-10-08T22:46:33Z")

</div>

If it is not yet supported in the rust SDK, is there another way to get the logs?

---

## [How to issue my own token on the fuel testnet using Rust SDK?](https://forum.fuel.network/t/how-to-issue-my-own-token-on-the-fuel-testnet-using-rust-sdk/1157)

<div class="topic-metadata">

**Author:** [@fuel](https://forum.fuel.network/u/fuel)\
**Replies:** 4\
**Last updated:** [October 2, 2024, 7:18am UTC](https://forum.fuel.network/t/how-to-issue-my-own-token-on-the-fuel-testnet-using-rust-sdk/1157 "2024-10-02T07:18:12Z")

</div>

How to issue my own token on the fuel testnet using Rust SDK? Intro In the continuation of this topic, I wrote a tutorial on how to work with tokens. This tutorial walks you through the process of issuing your own token …

---

## [\`cargo test\` error: could not connect to fuel core server](https://forum.fuel.network/t/cargo-test-error-could-not-connect-to-fuel-core-server/6679)

<div class="topic-metadata">

**Author:** [@Adg0](https://forum.fuel.network/u/Adg0)\
**Replies:** 4\
**Last updated:** [September 25, 2024, 9:46am UTC](https://forum.fuel.network/t/cargo-test-error-could-not-connect-to-fuel-core-server/6679 "2024-09-25T09:46:56Z")

</div>

I created a new counter contract and added Rust SDK as the documentation suggests. Then I am seeing this error message when I run cargo test on the default contract, how could I fix it? $ cargo test ... running 1 test …

---

## [Started getting OutOfGas since the last update](https://forum.fuel.network/t/started-getting-outofgas-since-the-last-update/6673)

<div class="topic-metadata">

**Author:** [@vecheslav](https://forum.fuel.network/u/vecheslav)\
**Replies:** 1\
**Last updated:** [September 24, 2024, 10:16am UTC](https://forum.fuel.network/t/started-getting-outofgas-since-the-last-update/6673 "2024-09-24T10:16:38Z")

</div>

Since the last update, my multicalls started ending with OutOfGas error. match multicall .with\_tx\_policies( TxPolicies::default() .with\_tip(1) .with\_sc…

---

## [Multicall parameters when calling a function that sends tokens](https://forum.fuel.network/t/multicall-parameters-when-calling-a-function-that-sends-tokens/6630)

<div class="topic-metadata">

**Author:** [@partylikeits1983](https://forum.fuel.network/u/partylikeits1983)\
**Replies:** 6\
**Last updated:** [September 23, 2024, 11:08am UTC](https://forum.fuel.network/t/multicall-parameters-when-calling-a-function-that-sends-tokens/6630 "2024-09-23T11:08:42Z")

</div>

Hello, I was wondering if there is a specific way to call a function in a contract that sends tokens when using the multicall feature. For example, when not using multicall, this works just fine: market.withdraw(quote\_…

---

## [Cannot deploy a new contract with fuels-rs 0.66.2 node 0.33.0 forc 0.63.1](https://forum.fuel.network/t/cannot-deploy-a-new-contract-with-fuels-rs-0-66-2-node-0-33-0-forc-0-63-1/6511)

<div class="topic-metadata">

**Author:** [@sway](https://forum.fuel.network/u/sway)\
**Replies:** 2\
**Last updated:** [August 22, 2024, 2:25pm UTC](https://forum.fuel.network/t/cannot-deploy-a-new-contract-with-fuels-rs-0-66-2-node-0-33-0-forc-0-63-1/6511 "2024-08-22T14:25:29Z")

</div>

Run $ fuelup show and add the output below Configuration: cargo.toml fuels = { version = “0.66.2”, features = \[“fuel-core-lib”\] } fuel-toolchain.toml \[toolchain\] channel = “latest-x86\_64-apple-darwin” \[components…

---

## [Unable to run basic test provided in documentation](https://forum.fuel.network/t/unable-to-run-basic-test-provided-in-documentation/6005)

<div class="topic-metadata">

**Author:** [@Chester-King](https://forum.fuel.network/u/Chester-King)\
**Replies:** 3\
**Last updated:** [August 6, 2024, 7:31am UTC](https://forum.fuel.network/t/unable-to-run-basic-test-provided-in-documentation/6005 "2024-08-06T07:31:38Z")

</div>

Tried to use the test example mentioned here Updated the path to load ABI as well I did forc build and then cargo test here’s the sway contract - contract; abi TestContract { #\[storage(write)\] fn initializ…

---

## [ChildNotFound and failed to decode log problems](https://forum.fuel.network/t/childnotfound-and-failed-to-decode-log-problems/6056)

<div class="topic-metadata">

**Author:** [@fuel](https://forum.fuel.network/u/fuel)\
**Replies:** 6\
**Last updated:** [August 6, 2024, 7:29am UTC](https://forum.fuel.network/t/childnotfound-and-failed-to-decode-log-problems/6056 "2024-08-06T07:29:53Z")

</div>

Hi everyone, We’ve just launched a new matching engine, and we’re encountering some errors intermittently during the matching process. Can anyone help me figure out how to fix these issues? ChildNotFound Response error…

---

## [Issue with with\_contracts function](https://forum.fuel.network/t/issue-with-with-contracts-function/6365)

<div class="topic-metadata">

**Author:** [@xpluscal](https://forum.fuel.network/u/xpluscal)\
**Replies:** 4\
**Last updated:** [August 6, 2024, 7:28am UTC](https://forum.fuel.network/t/issue-with-with-contracts-function/6365 "2024-08-06T07:28:02Z")

</div>

I have a contract calling another contract. Now even though I did set the “with\_contracts” with an instance, I do get “ContractNotInInputs” error. Here’s the test interface function: pub(crate) async fn mint( contr…

---

## [How to burn nft](https://forum.fuel.network/t/how-to-burn-nft/5937)

<div class="topic-metadata">

**Author:** [@lopo1](https://forum.fuel.network/u/lopo1)\
**Replies:** 17\
**Last updated:** [July 10, 2024, 8:26am UTC](https://forum.fuel.network/t/how-to-burn-nft/5937 "2024-07-10T08:26:47Z")

</div>

my code is here let balances = wallet.get\_balances().await.unwrap(); println!("balances: {:?}", balances); let asset\_id = contract\_instance.methods().asset\_id(sub\_id).call().await.unwrap(); let asset = asse…

[Next page](https://forum.fuel.network/c/rust-sdk/11.md?page=1)
