Skip to content

Instantly share code, notes, and snippets.

@cipherzzz
Created March 22, 2018 10:30
Show Gist options
  • Save cipherzzz/80a5e6d5c35db8127994f4251641e062 to your computer and use it in GitHub Desktop.
Save cipherzzz/80a5e6d5c35db8127994f4251641e062 to your computer and use it in GitHub Desktop.
Re-Entrancy Security Vulnerability
...
function payout() public payable {
checkPermissions(msg.sender);
if (game.originator.status == STATUS_TIE && game.taker.status == STATUS_TIE) {
game.originator.addr.transfer(game.betAmount);
game.taker.addr.transfer(game.betAmount);
} else {
if (game.originator.status == STATUS_WINNER) {
game.originator.addr.transfer(game.betAmount*2);
} else if (game.taker.status == STATUS_WINNER) {
game.taker.addr.transfer(game.betAmount*2);
} else {
game.originator.addr.transfer(game.betAmount);
game.taker.addr.transfer(game.betAmount);
}
}
resetGame();
getBetOutcome();
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment