尝试使用函数部署智能合约时出现此错误:
错误:无效地址(参数=“地址”,值=未定义,代码=INVALID_ARGUMENT,版本=地址/5.1.0)(参数=“tokenAddress”,值=未定义,代码=INVALID_ARGUMENT,版本=abi/5.0.7)
这是我的代码:
const handlePresale = async (e) => {
e.preventDefault();
const web3 = await getWeb3();
const abiData = SafeHubPresaleAbi;
const contractAddress = "0x4498F943E0a13D70B28e7565CF4E33bF443e6Bf9";
const duration = {
seconds: function (val) {
return val;
},
minutes: function (val) {
return val * this.seconds(60);
},
hours: function (val) {
return val * this.minutes(60);
},
days: function (val) {
return val * this.hours(24);
},
weeks: function (val) {
return val * this.days(7);
},
years: function (val) {
return val * this.days(365);
}, …Run Code Online (Sandbox Code Playgroud)