Skip to content

Instantly share code, notes, and snippets.

@vasa-develop
Last active July 21, 2018 18:37
Show Gist options
  • Save vasa-develop/21cc35d8a48d7768ab6acaff28b5a445 to your computer and use it in GitHub Desktop.
Save vasa-develop/21cc35d8a48d7768ab6acaff28b5a445 to your computer and use it in GitHub Desktop.
DO NOT USE THIS CODE. THIS CODE IS USED TO DEMONSTRATE A VULNERABILITY IN A SOLIDITY CODE.
contract HashForEther {
function withdrawWinnings() {
// Winner if the last 8 hex characters of the address are 0.
require(uint32(msg.sender) == 0);
_sendWinnings();
}
function _sendWinnings() {
msg.sender.transfer(this.balance);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment