Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transferToContract not allows for big amounts #3456

Closed
luizstacio opened this issue Dec 8, 2024 · 0 comments · Fixed by #3458
Closed

transferToContract not allows for big amounts #3456

luizstacio opened this issue Dec 8, 2024 · 0 comments · Fixed by #3458
Assignees
Labels
bug Issue is a bug

Comments

@luizstacio
Copy link
Member

fuels-ts SDK Version

0.97.0

Toolchain Versions

mainnet

Node.js Version

22.8

Browser

No response

Operating System

No response

Describe the Problem

When trying to transfer amount to a contract using transferToContract method that operation returns an error due to usage of toNumber().

I believe this is the place:

const encoded = numberCoder.encode(new BN(amount).toNumber());
const scriptData = concat([

Code Snippet

This happens to any value over 100MM.


await wallet
        .transferToContract(CONTRACT_ID, bn.parseUnits('1000000000', 9), ASSET_ID)
        .then((tx) => tx.waitForResult());

Contract ABI

No response

Errors

`Error: Number can only safely store up to 53 bits`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants