【发布时间】:2020-10-25 01:44:24
【问题描述】:
我正在尝试将 eth 从智能合约发送到合约所有者的地址,但没有成功。这是我的合约函数:
function ownerDebit(uint amount) public payable onlyOwner returns(bool status){
status = owner.send(amount);
return status;
}
我正在使用 NodeJS 和 Web3JS 与此合约进行交互:
contract.methods.ownerDebit(10000000000000000).call().then(function(response){
console.log(response);
});
console.log 中的响应是“true”。
但我帐户中的 eth 保持不变。
任何建议都会有所帮助!
【问题讨论】:
标签: blockchain ethereum solidity smartcontracts web3