The _setFinallizedVaultBalance() function can theoretically be called multiple times, recalculating the vault balance and potentially allowing manipulation of the critical finalizedVaultAsset value.
Normal behavior expects finalizedVaultAsset to be immutably set when the winner is determined, capturing the exact vault balance at that moment for fair distribution.
The current implementation recalculates from balanceOf() every time without checking if already set. While currently only called from setWinner() which has a guard, the function itself is not defensive.
Likelihood:
Currently protected by _setWinner flag in parent function
However, future refactoring could expose this function
Internal functions should be self-defensive
Owner could call this from an upgrade or new function
Impact:
If vault receives additional tokens after setWinner() (accidental transfers, rewards, etc.)
Second call to _setFinallizedVaultBalance() increases finalizedVaultAsset
Winners receive more than they should
Contract becomes insolvent if balance later decreases
Conversely, if balance decreases (somehow), winners receive less
Breaks the fairness guarantee of locked-in distribution
Alternative: Make it truly immutable
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.