Participants expect fair winner selection, which is possible if only a winner is set randomly, but the setWinner function takes a countryIndex, which is specified by the owner only.
The owner may reset countries later in order for him to choose a winner country with the smallest amount of totalWinnerShares, join the event with the winner countryId and withdraw all deposits.
Likelihood: HIGH
This will occur every time the owner sets the winner. The owner may set any countryIndex of his choice.
Impact: LOW
An owner may choose a winner countryId with the fewest amount of totalWinnerShares, join the event with that countryId, call the withdraw function and receive more assets because of the high share price.
setCountry for the event
Make deposits from 4 participants.
Only 2 participants joinEvent with the same countryId, so that there are 47 countries without participants and any index of that 47 countries may be used by an owner to joinEvent and be the only shareholder there and withdraw all funds.
It is even easier for an owner to not setCountry at all, so participants will joinEvent without countries set for them, and the owner may choose any countryId from 0 to 47.
The owner may reset countries at any moment, so it doesn't even matter what countryId was chosen by participants to joinEvent.
Check vault balance - all deposits minus the fee from 4 users are in the balance.
Once there is some balance in the vault, sufficient for an attacker, the owner deposits and joins with countryId where no shareholders exist. If there is no such countryId, the owner may reset the countries.
The owner sets the winner after eventEndDate.
The owner withdraws all the vault balance.
Select a winner randomly using Chainlink VRF.
Do not allow resetting countries:
Set teams once in a constructor only, and remove the public function setCountry:
Alternatively, add a check on `teams.length` when `setCountry` is called and revert once `teams` are already set:
This is owner action and the owner is assumed to be trusted and to provide correct input arguments.
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.