Normal behavior: A withdrawal function should update internal state before interacting with an external address to avoid reentrancy.
Issue: In both withdrawWinnings() and withdrawPlatformFees(), the contract calls call{value: amount} before resetting the corresponding balances:
This violates the Checks-Effects-Interactions pattern
Likelihood:
Although a custom nonReentrant modifier is used, if another function is added without the guard or if the guard is accidentally removed, reentrancy becomes possible.
The risk exists every time a user withdraws funds, so the likelihood is moderate.
Impact:
Inconsistent State or Theft: A malicious contract could reenter before the state is reset and attempt multiple withdrawals.
Future Extendibility: If new functions or external calls are added, forgetting the guard could reintroduce reentrancy.
.
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.