Token::transfer failing for fuels Rust SDK 0.42?

Token transfer is failing for Rust SDK version 0.42. Am I doing something wrong?
Similar code works fine for Rust SDK 0.39.

Any help? Thanks

Here is the code that is not working

Here is the contract

This is the error

[tests/harness.rs:65] res = Err(
    RevertTransactionError {
        reason: "failed transfer to address.",
        revert_id: 18446744073709486081,
        receipts: [
            Call {
                id: 0x0000000000000000000000000000000000000000000000000000000000000000,
                to: 0xba896e0725f512c1f0fd80e4334015394ac2f0148a01cf586d87157f66decfdc,
                amount: 0,
                asset_id: 0x0000000000000000000000000000000000000000000000000000000000000000,
                gas: 1000000,
                param1: 2185534222,
                param2: 10472,
                pc: 11680,
                is: 11680,
            },
            Revert {
                id: 0xba896e0725f512c1f0fd80e4334015394ac2f0148a01cf586d87157f66decfdc,
                ra: 18446744073709486081,
                pc: 12096,
                is: 11680,
            },
            ScriptResult {
                result: Revert,
                gas_used: 380,
            },
        ],
    },
)

Here is the test that passes Rust SDK 0.39

1 Like

Test passes for version 0.41

1 Like

HI! Did you try to update fuel-core?

Updating and changing fuel versions fixed it. Thanks

$fuelup default latest
$fuelup show
Default host: x86_64-unknown-linux-gnu
fuelup home: /home/t4sk/.fuelup

installed toolchains
--------------------
beta-3-x86_64-unknown-linux-gnu
latest-x86_64-unknown-linux-gnu (default)

active toolchain
-----------------
latest-x86_64-unknown-linux-gnu (default)
  forc : 0.40.1
    - forc-client
      - forc-deploy : 0.40.1
      - forc-run : 0.40.1
    - forc-doc : 0.40.1
    - forc-explore : 0.28.1
    - forc-fmt : 0.40.1
    - forc-index : 0.16.2
    - forc-lsp : 0.40.1
    - forc-tx : 0.40.1
    - forc-wallet : 0.2.2
  fuel-core : 0.18.3
  fuel-indexer : 0.16.2

fuels versions
---------------
forc : 0.42

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.