You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import { ERC20Abi } from "./ERC20Abi.js";
import Web3 from "web3";
const web3 = new Web3();
const contract = new web3.eth.Contract(
ERC20Abi,
"0xdac17f958d2ee523a2206206994597c13d831ec7"
); //USDT
const amountBN = web3.utils.toBN(100 * 1e8);
const encoded = contract.methods
.transfer("0x71294893dcc8fcbf802fad690a34d697c756f585", amountBN)
.encodeABI();
console.log(encoded)
Error message: Error: invalid number value (arg="_value", coderType="uint256", value="2540be400", version=4.0.40)
Working fine if passed as string.
BN Arguments supported in 1.2.x at least.
The text was updated successfully, but these errors were encountered:
vlddm
changed the title
2.0.0-alpha.1: contracts methods not supporting BigNumbers as arguments.
2.0.0-alpha.1: contracts methods does not support BigNumbers as arguments.
Jun 29, 2020
ryanio
changed the title
2.0.0-alpha.1: contracts methods does not support BigNumbers as arguments.
2.0.0-alpha.1: contract methods do not support BigNumbers as arguments.
Jun 29, 2020
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment.
Error message:
Error: invalid number value (arg="_value", coderType="uint256", value="2540be400", version=4.0.40)
Working fine if passed as string.
BN Arguments supported in 1.2.x at least.
The text was updated successfully, but these errors were encountered: