Consider that two users are betting the same amount on a specific team to win and upon winning both of them will receive equal amount of assets from the pooled assets as they both bet the same amount on the winning team.
In this scenario user1 enter the tournament and places the bet on a team lets say 2 ethers then user2 enter and places his bet on a different team lets say he places 5 ethers then he changes his mind and places the bet on the winning team and he also places 2 ethers for the winning team.
as per the rules when the tournament is over both users should receive equal amount of assets because they both places same amount of bet on the winning team but since the user2 has already placed 5 ethers on a losing team and the calculation of the asset to withdraw uses balanceOf(msg.sender) which would eventually increase the number of shares for user2 instead of just the 2 shares he placed on the winning asset.
Likelihood:
there is a chance of user changing his mind and depositing on the winning team even though they intially placed the bet on a different team - they will actually be able to minimize the loss or retrive most of the misplaced bet by betting on the winning team.
Impact:
user1 will recieve less amount of assets even though they bet the same as user2 on the same team.
Three users enter the tournament and places bets of 2 ethers each. users 1 and 2 places the bets on the winning team and user 3 places bet on the losing team.
Upon the end of tournament both users 1 and 2 will receive equal amount of split which would be around 3 ethers each. This is the normal scenerio.
In the exploit scenario - user 1 places bet on the winning team whereas the user 2 places a bet on a losing team first and due to change of mind he places a bet on the winning team after the intial bet.
in this case upon tournament end user2 will actually recieve more assets as the asset to be withdrawn is calculated using balanceOf(msg.sender) instead of userSharesToCountry[msg.sender][winnerCountryId]. This will also decrease the amount of assets received by the user1 as well.
use userSharesToCountry[msg.sender][winnerCountryId] instead of the balanceOf(msg.sender) calculate the winning shares by the user.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.