[I-4] Game::withdrawWinnings
should follow CEI
The Game::withdrawWinnings
function does have the nonReentrant
modifier to avoid reentrancy attacks, which provide security for the function execution.
Still, it's best to keep code clean and follow CEI (Checks, Effects, Interactions).
Likelihood: Low
Impact: None
The Game::withdrawWinnings
function is currently written as follows:
Move the pendingWinnings[msg.sender] = 0;
before transfering the winnings. This ensures that the pendingWinnings
is updated before any further operations are performed.
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.