Created
July 21, 2018 19:50
-
-
Save vasa-develop/1ae4173cca15d71d9b551b33b0dae773 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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
function cash(uint roundIndex, uint subpotIndex){ //line 80 | |
var subpotsCount = getSubpotsCount(roundIndex); | |
if(subpotIndex>=subpotsCount) | |
return; | |
var decisionBlockNumber = getDecisionBlockNumber(roundIndex,subpotIndex); | |
if(decisionBlockNumber>block.number) | |
return; | |
if(rounds[roundIndex].isCashed[subpotIndex]) | |
return; | |
//Subpots can only be cashed once. This is to prevent double payouts | |
var winner = calculateWinner(roundIndex,subpotIndex); | |
var subpot = getSubpot(roundIndex); | |
winner.send(subpot); | |
rounds[roundIndex].isCashed[subpotIndex] = true; | |
//Mark the round as cashed | |
} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment