Users deposit tokens and call joinEvent() to register for a country. The numberOfParticipants counter is incremented on every joinEvent() call to track total participants.
When a user calls cancelParticipation() to withdraw their deposit before the event starts, the counter is not decremented, leaving numberOfParticipants permanently inflated.
Likelihood: Medium
Users who deposit and later cancel participation trigger the inconsistency.
Impact: Low
numberOfParticipants becomes inaccurate and misleading.
UI or future logic added that is relying on this value will be incorrect.
Add the following test function to BriVaultTest.t.sol and run forge test --mt testCancelDoesNotDecrementParticipants
Simply decrement the value of numberOfParticipantsafter the user calls cancelParticipation()
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.