The missing timing restriction in BriVault.sol::setCountry() will cause permanent loss of funds for users as the owner will change the teams array after users have joined, creating a mismatch between name-based and index-based bet tracking that prevents withdrawals.
In BriVault.sol:106-111, the setCountry() function has no timing restrictions or checks for existing participants:
Likelihood:
Owner needs to call setCountry() to initialize teams array
At least one user needs to call deposit() and joinEvent(countryId) to bet on a team
Owner needs to call setCountry() again with modified teams array
Event must end and owner must call setWinner() with an index whose team name changed
The affected user suffers a 100% loss of their deposited funds, which become permanently locked in the contract.
Additionally, if other users legitimately bet on the winning team:
Their payouts are reduced because totalWinnerShares includes the locked user's shares
Payout formula: assetToWithdraw = (userShares * vaultBalance) / totalWinnerShares
The difference remains permanently locked in the contract
Owner changes teams array after user joins, creating mismatch between name-based (userToCountry) and index-based (userSharesToCountry) tracking.
User's shares are counted in totalWinnerShares but they cannot withdraw.
Add a timing restriction to setCountry() to prevent modifications after users have joined:
Alternatively, store the complete team configuration when users join to prevent inconsistency:
This is owner action.
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.