【发布时间】:2022-12-16 08:04:58
【问题描述】:
我使用 ethers 与 solidity 合约进行交互。我想同时执行多个事务。要做到这一点,我知道我必须定义 noonce 对于每个下一个交易都是 +1。当我这样做时,我知道该怎么做
await signer.sendTransaction()
但是当我创建 Contract 对象并在其上执行函数时,如何使用自定义 noonce 执行多个事务?我试过了
contract.methodName(methodParams, {
gasLimit: gasLimit,
gasPrice,
value: ethers.utils.parseEther(
"0.01"
),
noonce: nextNoonce
})
但它不起作用,我收到错误 cannot override "noonce"。我怎样才能在这里定义它?
【问题讨论】:
-
我希望你指的是“nonce”——help.myetherwallet.com/en/articles/5461509-what-is-a-nonce
标签: javascript blockchain solidity ethers.js