When a user cancels before eventStartDate, the vault should fully undo their participation: remove/deduct their shares from any per‑country totals, clear their userToCountry / userSharesToCountry snapshot(s), deduplicate the participants list, and adjust aggregate counters (e.g., numberOfParticipants, totalParticipantShares) so finalization and payouts remain correct.
cancelParticipation() only burns the caller’s shares and refunds stakedAsset[msg.sender]. It does not (a) remove the caller from usersAddress, (b) decrement numberOfParticipants, (c) reduce totalParticipantShares, or (d) clear their userSharesToCountry entry / userToCountry mapping. It also does not adjust any running totals (e.g., countryShares if you added that mitigation). These stale entries are later consumed by _getWinnerShares() and other logic, producing overcounted denominators, skewed payouts, and possible DoS due to bloated arrays.
Likelihood: High
Users commonly test/join and later cancel before the event starts; UIs may attempt multiple joins/cancels (retries).
A griefer can join many times (inflating usersAddress) and then cancel, leaving stale entries that still get counted during finalization.
Impact: High
Incorrect winner denominator / under‑payments: Stale userSharesToCountry snapshots (and duplicate usersAddress entries) inflate totalWinnerShares, causing winners to receive less and leaving residual assets stuck.
Finalize DoS risk: setWinner() loops over usersAddress in the current design; stale duplicates from canceled users bloat the loop, increasing gas and risking out‑of‑gas at finalize.
Misleading analytics/state: numberOfParticipants and totalParticipantShares become inaccurate, undermining integrity of the event.
The test shows that after canceling, the user remains represented in state, causing inflated accounting at finalize.
Implement full unwind on cancel and guard participation to avoid duplicates.
CancelParticipation burns shares but leaves the address inside usersAddress and keeps userSharesToCountry populated.
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.