Description:
The withdrawWinnings function conducts the external ETH transfer before resetting the caller’s pendingWinnings. While the function is protected by a nonReentrant modifier, this ordering violates the Checks–Effects–Interactions pattern and could introduce reentrancy risks if the modifier is ever removed or bypassed.
Impact:
Reentrancy Vulnerability (if guard removed): An attacker could reenter withdrawWinnings during the external call and drain their pendingWinnings multiple times.
Best Practice Violation: Deviating from Checks–Effects–Interactions makes the contract more fragile and prone to future bugs if the reentrancy guard is altered.
Mitigation:
Apply Checks–Effects–Interactions by zeroing the state before the external call:
We only audit the current code in scope. We cannot make speculation with respect to how this codebase will evolve in the future. For now there is a nonReentrant modifier which mitigates any reentrancy. CEI is a good practice, but it's not mandatory. Informational
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.