();
The internal function _setFinallizedVaultBalance() contains an inverted time check that verifies the event has not started (block.timestamp <= eventStartDate), which is intended to run only after the event has already ended. This check is logically inconsistent and rendered entirely redundant by the stricter time validation in its external caller (setWinner()).
The _setFinallizedVaultBalance() function is called exclusively by setWinner(). The check in setWinner() ensures the event has ended (block.timestamp > eventEndDate). Since eventStartDate is always less than eventEndDate, if the setWinner() check passes, the check inside the internal function is logically inconsistent and unnecessary.
Likelihood: Very Low (Non-Exploitable)
• Reason 1: The _setFinallizedVaultBalance() function is only callable via setWinner(), which requires block.timestamp > eventEndDate. The eventEndDate is strictly later than eventStartDate. Therefore, any successful call to setWinner() will automatically bypass the condition block.timestamp <= eventStartDate inside the internal function, meaning the revert is never triggered.
Impact:
Minimal
• Code Quality: Introduces misleading logic and confusion for future developers maintaining the codebase.
• Gas: Increases bytecode size and consumes unnecessary gas for a redundant state check on every execution path of setWinner()
Since the bug is non-exploitable, the proof focuses on demonstrating the redundancy by observing the call trace.
The trace shows that when setWinner is called (which requires the time to be well past eventEndDate), the check in _setFinallizedVaultBalance is passed without issue, proving its irrelevance.
Explanation
1. The test fast-forwards time well past eventEndDate.
2. setWinner() is called and succeeds, proving block.timestamp > eventEndDate.
3. The trace confirms the call enters _setFinallizedVaultBalance().
4. The internal function proceeds without reverting, confirming the check against eventStartDate is ineffective.
\
The internal check is entirely redundant and should be removed.
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.