The BriVault contract extends ERC4626, allowing users to deposit assets for tournament participation via deposit, join an event by selecting a country via joinEvent, and have the owner set the winner post-event via setWinner. After the winner is set, users who voted for the winning country should claim rewards proportionally from the pool, while non-winners should have their funds locked or handled per protocol rules until resolution.
However, the standard ERC4626::redeem function is not overridden, enabling any user to redeem their shares for underlying assets at any time, including after setWinner is called, even if their chosen country/team is not the winner. This allows non-winning voters to frontrun or immediately withdraw, reducing the pool available for winners.
Likelihood:
Owner calls setWinner after eventEndDate to finalize the tournament.
Users monitor the transaction and immediately call redeem post-winner announcement if not aligned with the winner.
Impact:
Protocol's reward distribution is undermined, as the winning pool diminishes due to premature redemptions by non-winners.
Core tournament integrity is compromised, leading to disputes, reduced incentives for participation, and potential fund imbalances.
Add the following code snippet to the briVault.t.sol test file. This test verifies that user can redeem funds calling ERC4626::redeem after BriVault::setWinner.
Possible mitigation to override the standard function ERC4626::redeem with similar to cancelParticipation logic or revert, preserving ERC4626 standard redeem arguments.
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.