我初学JavaScript并尝试进行一次交易,但总是出现如下错误,不知道该如何排除原因

QQ20210519230341.png QQ20210519230148.png 这是我交易函数的代码

const tx = await router.swapExactTokensForTokens( amountIn, amountOutMin, [tokenIn, tokenOut], data.recipient, Date.now() + 1000 60 10, //10 minutes { 'gasLimit': data.gasLimit, 'gasPrice': ethers.utils.parseUnits(${data.gasPrice}, 'gwei') }); console.log(tx) const receipt = await tx.wait(); console.log('Transaction receipt'); console.log(receipt); };

我应该从哪方面排除我的问题呢,感激不尽

请先 登录 后评论

1 个回答

Tiny熊 - 布道者
  擅长:智能合约,以太坊
请先 登录 后评论
  • 1 关注
  • 0 收藏,1648 浏览
  • LIzh 提出于 2021-05-19 23:06

相似问题