joinEvent() Inflate Participant Counters and Corrupt Share AccountingThe joinEvent() function does not restrict a user from joining multiple times before eventStartDate.
Each call appends the user’s address to usersAddress, increments numberOfParticipants, and adds balanceOf(msg.sender) to totalParticipantShares, regardless of whether the user was already registered.
Because there is no check to prevent duplicates, a single user can call joinEvent() repeatedly, causing inflated participant statistics and distorting the pool’s internal accounting.
When _getWinnerShares() is executed later, it loops through usersAddress and adds up each entry’s shares.
This means duplicate entries for the same address will cause the same user’s shares to be counted multiple times, inflating totalWinnerShares and reducing the payout for legitimate winners.
Likelihood:
Can be triggered easily by any participant before eventStartDate without restrictions.
Impact:
Manipulates reward distribution ratios and corrupts event statistics. Winners receive less than their fair payout, and funds remain stuck in the vault.
A user deposits and joins a country.
Before the event starts, they repeatedly call joinEvent(countryId) multiple times.
Each call adds their address to usersAddress and increases totalParticipantShares.
When the event ends, _getWinnerShares() iterates over all entries in usersAddress, counting the same user’s shares multiple times.
This inflates totalWinnerShares, diluting all payouts proportionally.
Paste the following test to briVault.t.sol
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.