Normal behavior: Once the event is started or finalized, game parameters (like the list of countries) should be immutable so that past selections and winner verification cannot be manipulated.
Issue: The owner can call setCountry at any time, even during the game or after the winner is set. The contract verifies withdrawals using string equality between userToCountry[msg.sender] and winner. By modifying country names post-finalization, the owner can create or influence string matches, enabling previously losing users to withdraw or otherwise causing confusion/inconsistency.
Likelihood: Low
Requires owner action post-finalization, but there is no on-chain restriction preventing it.
Impact: Medium
Allows out-of-sync states where users picked countries that cannot be selected as winners.
Allows post-finalization manipulation of outcome verification via mutable country names.
Description:
owner sets initial countries
user1 joins and picks country 7
owner changes the name of country 7
country 7 is picked as a winner
user1 cannot claim any rewards
Disallow changing countries after event start or once a winner is set.
Prefer verifying by immutable indices rather than mutable strings (i.e., store and compare country IDs, not names) for withdrawals.
Index-based verification alternative (avoid string equality):
This is owner action.
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.