为什么Remix不能部署简单合约(简化自精通以太一书https://github.com/ethereumbook/ethereumbook/blob/develop/code/Solidity/Faucet2.sol )?
pragma solidity ^0.4.19;
contract Faucet {
function withdraw(uint withdraw_amount) public {
require(withdraw_amount <= 100000000000000000);
msg.sender.transfer(withdraw_amount);
}
function () external payable {}
}无论我如何提升gasLimit和/或gasPrice

发布于 2019-03-02 18:15:48
你的代码没问题(我自己也试过了)。从我上面看到的情况看,您还在随deploy一起发送一个值。因为您自己还没有定义一个构造函数,所以默认的构造函数被调用,这是不需要支付的。如果你想在部署合同时发送,你也应该定义一个payable构造函数。
https://stackoverflow.com/questions/54940788
复制相似问题