为什么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
答案 0 :(得分:1)
您的代码很好(我自己也尝试过)。从我上面看到的,您还与部署一起发送了一个值。由于您自己尚未定义构造函数,因此将调用默认的构造函数,该构造函数不可用。如果要在部署合同时发送以太币,则还应该定义一个应付款构造函数。