HasNoEther
contract HasNoEther
is Ownable
This tries to block incoming ether to prevent accidental loss of Ether. Should Ether end up in the contract, it will allow the owner to reclaim this ether., Ether can still be send to this contract by: calling functions labeled `payable` `selfdestruct(contract_address)` mining directly to the contract address.
Reference
Functions
HasNoEther
function HasNoEther() public payable
The `payable` flag is added so we can access `msg.value` without compiler warning. If we leave out payable, then Solidity will allow inheriting contracts to implement a payable constructor. By doing it this way we prevent a payable constructor from working. Alternatively we could use assembly to access msg.value.
fallback
function () external
Disallows direct send by settings a default function without the `payable` flag.
reclaimEther
function reclaimEther() external
Transfer all Ether held by the contract to the owner.
- Modifiers:
- onlyOwner