Skip to content

Instantly share code, notes, and snippets.

@Raz0r
Created May 21, 2018 12:56
Show Gist options
  • Select an option

  • Save Raz0r/0cd77cbb10313c67c231eba3754a2f26 to your computer and use it in GitHub Desktop.

Select an option

Save Raz0r/0cd77cbb10313c67c231eba3754a2f26 to your computer and use it in GitHub Desktop.
contract CallMeMaybe {
modifier CallMeMaybe() {
uint32 size;
address _addr = msg.sender;
assembly {
size := extcodesize(_addr)
}
if (size > 0) {
revert();
}
_;
}
function HereIsMyNumber() CallMeMaybe {
if(tx.origin == msg.sender) {
revert();
} else {
msg.sender.transfer(this.balance);
}
}
function() payable {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment