Skip to content

Instantly share code, notes, and snippets.

@skmgoldin
Created November 12, 2017 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skmgoldin/f0805a9d3dc5d69bf849b640aaba7897 to your computer and use it in GitHub Desktop.
Save skmgoldin/f0805a9d3dc5d69bf849b640aaba7897 to your computer and use it in GitHub Desktop.
function challengeWinnerReward(Data storage _self) public constant returns (uint) {
// Edge case, nobody voted, give all tokens to the challenger.
if (_self.voting.getTotalNumberOfTokensForWinningOption(_self.challengeID) == 0) {
return 2 * _self.stake;
}
return (2 * _self.stake) - _self.rewardPool;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment