In joinEvent(); function, any participant who has alraedy deposited assets can call this function multiple times causing multiple entries in the userSharesToCountry state variable (as there are 48 countries, participant can create entries for all of them in this state variable). So at the end of the betting round, when the owner sets the winner, _getWinnerShares(); function is called which updates the totalWinnerShares state variable. totalWinnerShares is used to calculate the percentage ownership of the current winner in withdraw(); function and accordingly the winner gets his reward. (totalWinnerShares - also count such dummy entires causing lose in the rewards amount to the users)
Likelihood:
When the participant has already deposited his assets using the deposit(); function, he can call joinEvent any number of times (countryId is also used to update, and there are 48 counties only so apparently 48 times).
Impact:
Loss in reward amount to the actual winners.
Refactoring of the code is required such that, the last countryId should be taken into consideration. There should be only one entry in the userSharesToCountry state variable and for only one countryId.
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.