Normal behavior:
When a user cancels participation before the event starts, their deposited assets are refunded, their vault shares are burned, and all related accounting should be updated so that their participation no longer affects totals or winner calculations.
Issue:
Currently, cancelParticipation() refunds assets and burns the user’s ERC20 shares, but does not reset userSharesToCountry mapping. The user’s shares remain associated with their country in the userSharesToCountry mapping. This causes:
Shares to remain effectively “stuck” in the contract.
Distorted calculations of totalWinnerShares and eventual payout distributions.
Users who canceled can reduce rewards for other participants unintentionally.
Likelihood:
Occurs whenever a participant cancels after joining an event and before it starts.
Particularly relevant in multi-user events where some participants withdraw early.
Impact:
Remaining users receive incorrect or reduced rewards, since the canceled user’s shares are still counted in userSharesToCountry.
Locked shares remain in the contract, making assets partially unrecoverable.
Misleading accounting for totalWinnerShares and overall vault state.
This PoC shows that when a user cancels participation, their deposit is refunded and shares are burned, but their userSharesToCountry entry remains unchanged. As a result, those shares are still counted in global calculations, causing leftover assets to remain locked in the contract and reducing rewards for remaining participants. *
Introduce a mapping userToCountryId to track the country ID for each user. When user join event, store the countryID of user and When a user cancels participation, clear their shares from userSharesToCountry using this mapping.
With this fix, canceled users no longer contribute to country-specific or total shares, preventing locked funds and ensuring correct reward distributions for remaining participants.
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.