交易错误无效的bignumber字符串(参数=; value&quot'value =; quot'1.2e+ 21"
您好,我在转移Morthan 1000busd时在字符串Bignumber上有问题,这是我的传输代码,我不知道我希望有人帮我,谢谢
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();
}
};
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();
}
};
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论