The protocol documentation states that users can deposit an ERC20 asset to bet on a team. After the tournament concludes, winners will share the prize pool proportionally based on their deposited amount.
However, when no user guesses the winning team, users have no way of knowing from the rules that they can retrieve their funds.
Notably, this vulnerability is predicated on the protocol having already fixed the loophole that allowed users to withdraw funds at any time (i.e., directly using the original ERC4626 withdraw and redeem functions).
Likelihood:
Once the event ends with no user guessing the winning team, this issue will inevitably occur.
Impact:
Permanent locking of user funds.
Severe damage to protocol credibility.
Add the following function to test/BriVaultTest.t.sol and run forge test --mt test__whenNoWinner -vv:
Console output:
Implement a simple mechanism to track the number of times each national team index is selected.
After the winning team is announced, if the winning team index has zero selections, allow any user to retrieve their funds.
When no one bet on the winning team, making totalWinnerShares = 0, causing division by zero in withdraw and preventing any withdrawals.
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.