Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drandreaskrueger/65a063b0135633c9e050316b8398a8bf to your computer and use it in GitHub Desktop.
Save drandreaskrueger/65a063b0135633c9e050316b8398a8bf to your computer and use it in GitHub Desktop.
Scanning Live Ethereum Contracts for the "Unchecked-Send" Bug - suggestion for listing 3
/*** Listing 3 - would this be an improvement? ***/
/*** ***/
/*** inspired by excellent article ***/
/*** http://hackingdistributed.com/2016/06/16/scanning-live-ethereum-contracts-for-bugs ***/
if (gameHasEnded && !( prizePaidOutToWinner ) ) {
if (winner.send(1000))
prizePaidOutToWinner = True;
}
if (gameHasEnded && !( prizePaidOutToLooser ) ) {
if (loser.send(10))
prizePaidOutToLooser = True;
}
if !(prizePaidOutToWinner && prizePaidOutToLooser){
throw;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment