【发布时间】:2018-12-28 02:16:08
【问题描述】:
我使用了以下代码,我认为它可以提取任何存入智能合约的以太币。你能帮忙解释一下为什么这可能行不通吗?
function withdraw() public {
require(owner == msg.sender);
msg.sender.transfer(address(this).balance);
}
我在提取以太币时遇到问题,想知道代码的哪一部分阻止我这样做。
【问题讨论】:
-
您能否发布整个智能合约以及您用来调用合约
withdraw()函数的代码? -
你得到什么样的错误?
标签: ethereum solidity smartcontracts erc20