A user should be able to register once for a single country, ensuring each participant's shares are counted once and per-country totals remain accurate, enabling fair distribution of rewards at event finalization.
However, the joinEvent function allows the same user to call it multiple times for any or all countries, inflating accounting values and corrupting per-country reward distribution.
Likelihood: High
Any user who has deposited can repeatedly call joinEvent for one or multiple countries, as there are no checks to restrict multiple entries.
Impact: High
The impact is multi-faced:
Accounting Inflation: The numberOfParticipants and totalParticipantShares are artificially inflated corrupting internal metrics.
Reward Manipulation: Duplicate entrics overcount totalWinnerShares reducing payout per share for legitimate winners.
Gas DoS: Excessive repeated calls bloat usersAddress, making setWinner() potentially run out of gas.
The following test case show cases participant entries on all countries with one deposit, and the impact on contract's state.
Prevent multiple joins by the same user
The _getWinnerShares() function is intended to iterate through all users and sum their shares for the winning country, returning the total.
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.