Skip to content

Instantly share code, notes, and snippets.

@nachinius
Created January 31, 2019 19:16
Show Gist options
  • Select an option

  • Save nachinius/2a2cae697640431ff77844c77f48ac71 to your computer and use it in GitHub Desktop.

Select an option

Save nachinius/2a2cae697640431ff77844c77f48ac71 to your computer and use it in GitHub Desktop.
/** * Can receive money. * Can be stolen. * Payable at address. */
pragma solidity 0.5.3;
/**
* Can receive money.
* Can be stolen.
* Payable at address.
*/
contract Beta {
function stealMyEth() public {
address myAddress = address(this);
msg.sender.transfer(myAddress.balance);
}
event Received(uint amount, address benefactor);
function () payable external {
emit Received(msg.value, msg.sender);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment