【发布时间】:2021-10-01 12:56:03
【问题描述】:
我可以调用可改变合约状态的应付函数。我不能调用改变状态的非付费函数。
问题不在于函数,我可以在 Remix IDE 上调用它。
await contract.methods.test().send({from:account}).catch(err=>console.log(err))
我做错了什么?
【问题讨论】:
标签: ethereum solidity web3 web3js
我可以调用可改变合约状态的应付函数。我不能调用改变状态的非付费函数。
问题不在于函数,我可以在 Remix IDE 上调用它。
await contract.methods.test().send({from:account}).catch(err=>console.log(err))
我做错了什么?
【问题讨论】:
标签: ethereum solidity web3 web3js
您需要将 0 传递给value 参数。
contract.methods.test().send({from:account, value: 0})
【讨论】: