智能合约转账eth到地址失败
Smart contract transfer eth to address failed
我试图从智能合约发送 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 中的响应是“真”。
但是我账户里的eth没变
任何建议都会有所帮助!
address(this)用于获取合约地址
status = address(this).transfer(owner, amount)
我试图从智能合约发送 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 中的响应是“真”。
但是我账户里的eth没变
任何建议都会有所帮助!
address(this)用于获取合约地址
status = address(this).transfer(owner, amount)