The withdrawWinnings()
function violates the Checks-Effects-Interactions (CEI) pattern by updating state after the external call instead of before
While the function has a nonReentrant
modifier that prevents reentrancy, the pattern violation represents poor security practices and could cause issues if the modifier is ever removed or bypassed
Likelihood: High
Every withdrawal transaction violates the CEI pattern
Pattern violation is consistent and always present
Impact: Low
Currently mitigated by nonReentrant
modifier
Represents poor security practices and code quality
Could become vulnerable if modifier is removed or has bugs
Makes code review and audit more difficult
The test demonstrates the correct CEI pattern implementation:
Explanation: The test verifies that the withdrawal works correctly and demonstrates what the proper CEI pattern should achieve.
Explanation: Follow the proper CEI pattern by updating state before making external calls, even when protected by reentrancy guards, to maintain best security practices.
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.