# Token::transfer failing for fuels Rust SDK 0.42?

**URL:** <https://forum.fuel.network/t/token-transfer-failing-for-fuels-rust-sdk-0-42/2755>\
**Category:** Rust SDK\
**Created:** [June 15, 2023, 2:36am UTC](https://forum.fuel.network/t/token-transfer-failing-for-fuels-rust-sdk-0-42/2755 "2023-06-15T02:36:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tsk](https://avatars.discourse-cdn.com/v4/letter/t/e0b2c6/32.png) [@tsk](https://forum.fuel.network/u/tsk)\
**Post date:** [June 15, 2023, 2:36am UTC](https://forum.fuel.network/t/token-transfer-failing-for-fuels-rust-sdk-0-42/2755/1 "2023-06-15T02:36:48Z")

</div>

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

> <https://github.com/t4sk/hello-sway/blob/3a740b3038d507bb8ffcca7916c1f5c8fb9efafa/test-token-transfer/tests/harness.rs#L55-L65>

Here is the contract

> <https://github.com/t4sk/hello-sway/blob/3a740b3038d507bb8ffcca7916c1f5c8fb9efafa/test-token-transfer/src/main.sw#L14-L21>

This is the error

```shell
[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

> <https://github.com/t4sk/hello-sway/blob/3a740b3038d507bb8ffcca7916c1f5c8fb9efafa/native_token/tests/harness.rs#L115-L124>

> <https://github.com/t4sk/hello-sway/blob/3a740b3038d507bb8ffcca7916c1f5c8fb9efafa/native_token/src/main.sw#L59-L61>

---

<div class="post-metadata">

**Author:** ![tsk](https://avatars.discourse-cdn.com/v4/letter/t/e0b2c6/32.png) [@tsk](https://forum.fuel.network/u/tsk)\
**Post date:** [June 16, 2023, 1:05am UTC](https://forum.fuel.network/t/token-transfer-failing-for-fuels-rust-sdk-0-42/2755/2 "2023-06-16T01:05:34Z")

</div>

Test passes for version 0.41

---

<div class="post-metadata">

**Author:** ![Salka1988](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/salka1988/32/1447_2.png) [@Salka1988](https://forum.fuel.network/u/Salka1988)\
**Post date:** [June 16, 2023, 9:46am UTC](https://forum.fuel.network/t/token-transfer-failing-for-fuels-rust-sdk-0-42/2755/3 "2023-06-16T09:46:14Z")

</div>

HI! Did you try to update fuel-core?

---

<div class="post-metadata">

**Author:** ![tsk](https://avatars.discourse-cdn.com/v4/letter/t/e0b2c6/32.png) [@tsk](https://forum.fuel.network/u/tsk)\
**Post date:** [June 16, 2023, 11:50pm UTC](https://forum.fuel.network/t/token-transfer-failing-for-fuels-rust-sdk-0-42/2755/4 "2023-06-16T23:50:45Z")

</div>

Updating and changing fuel versions fixed it. Thanks

```shell
$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

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/fuel/original/2X/5/57d5a345cc15a64b636e0d56e042857f8a0e80b1.png) [@system](https://forum.fuel.network/u/system)\
**Post date:** [July 7, 2023, 7:51pm UTC](https://forum.fuel.network/t/token-transfer-failing-for-fuels-rust-sdk-0-42/2755/5 "2023-07-07T19:51:33Z")

</div>

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