I use these codes(@Lauri Peltonen ) however I tried 5 ether
and 500
, but I found it had an error in remix " like I need to add payable to constructor, but I already added". What does that mean?
pragma solidity ^0.5.1;
contract MyContr {
function transfer(address payable receiver, uint amount) public {
require(address(this).balance >= amount);
receiver.transfer(amount);
}
}