Skip to content

Commit

Permalink
+ updateProfits
Browse files Browse the repository at this point in the history
  • Loading branch information
cNoveron committed Feb 1, 2020
1 parent bfa3253 commit e33a60a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions contracts/SportsBook.sol
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ contract SportsBook is WhitelistAdminRole, ReentrancyGuard {
: winningTeam = Team.KANSAS_CITY_CHIEFS;
gameEnded = true;
}

function updateProfits() public onlyWhitelistAdmin {
profit_for_SAN_FRANCISCO_49ERS_bettors = totalPool.mul(precision).div(SAN_FRANCISCO_49ERS_pool);
profit_for_KANSAS_CITY_CHIEFS_bettors = totalPool.mul(precision).div(KANSAS_CITY_CHIEFS_pool);
}

function howMuchHaveIBet() public view returns (uint256) {
return depositsOf(msg.sender);
Expand Down Expand Up @@ -130,7 +135,5 @@ contract SportsBook is WhitelistAdminRole, ReentrancyGuard {
: KANSAS_CITY_CHIEFS_pool = KANSAS_CITY_CHIEFS_pool.add(betAmount);
totalPool = totalPool.add(betAmount);
deposit(msg.sender,betAmount);
profit_for_SAN_FRANCISCO_49ERS_bettors = totalPool.mul(precision).div(SAN_FRANCISCO_49ERS_pool);
profit_for_KANSAS_CITY_CHIEFS_bettors = totalPool.mul(precision).div(KANSAS_CITY_CHIEFS_pool);
}
}

0 comments on commit e33a60a

Please sign in to comment.