这个水笼头合Demo,编译不过去。哪里有错,怎么改。

contract Faucet{

    //Give out ether to anyone who asks  

    function withdraw(unit withdraw_amount)public{

    //limit withdrawal amount

    require (withdraw_amount<=1000000000000000000);

    //Send the amout to the adress that requested it

    msg.sender.transfer(withdraw_amount);

    }

    //Accept any incoming amount

    function() public payable{}

}

老师,这个 Demo 有错嘛,怎么编译不过去[撇嘴]

请先 登录 后评论

最佳答案 2020-04-13 20:19

function withdraw(unit withdraw_amount)public{

参数类型是uint而不是unit 修改后,在0.4.24版本编译通过

请先 登录 后评论

其它 1 个回答

Tiny熊 - 布道者
  擅长:智能合约,以太坊
请先 登录 后评论