'Transaction Error invalid BigNumber string (argument="value", value="1.2e+21", code=INVALID_ARGUMENT, version=bignumber/5.5.0)
Hello i have a problem on string bignumber when transfering morthan 1000BUSD this is my transfer code,, i dont know what problem i hope someone help me thanks
const transfer = async (fromAddress, toAddress, amount, callback) => {
if (connected === true) {
if (chainId !== config.chainId) {
//56 97
alert("Please select Biance Smart Chain network!");
return;
}
setIsLoading(true);
try {
let tx = await Contract.methods
.transfer(toAddress, (amount * Math.pow(10, 18)).toString())
.send({ from: fromAddress, to: toAddress });
// console.log(tx.events.Transfer.id);
setIsLoading(false);
success_transfer();
callback();
} catch (error) {
setIsLoading(false);
//console.log(error.message);
error_transfer(error.message);
}
} else {
alert("Please connect to the wallet");
ConnectWallet();
}
};
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
