Minor: No known exploit with current tokens, but violates CEI pattern
Could become Medium if used with untrusted ERC20s in future or if contract is forked
In the withdrawFees()
function, the contract performs an external call to iUSDC.safeTransfer()
before updating the totalFees
state variable to zero This violates the Checks-Effects-Interactions (CEI) pattern and introduces a theoretical risk window for reentrancy especially if USDC is ever replaced with a custom or malicious ERC20 token.
Even though USDC is generally safe and reentrancy is unlikely here, following CEI is a security best practice and protects against unexpected behavior in future token changes or proxy upgrades.
Likelihood:
The external call could re-enter the contract
totalFees
is still non-zero during that call
Impact:
Minor: No known exploit with current tokens, but violates CEI pattern
Could become Medium if used with untrusted ERC20s in future or if contract is forked
chances of reentrancy
Apply the CEI pattern by updating state before the external call:
`withdrawFees()` function performs an external transfer using `iUSDC.safeTransfer()` before resetting totalFees. This breaks the `Checks-Effects-Interactions (CEI)` pattern and can lead to incorrect internal state if the transfer fails for any reason.
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.