Normally, when withdrawing collected fees, the function should first update the contract’s internal state before making any external token transfers. This ensures the contract remains consistent even if the external call fails.
In this case, the 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.
Likelihood - Medium:
This issue can appear if the external token contract (iUSDC) fails or reverts during transfer, such as in cases of misconfiguration, insufficient allowance, paused tokens, or non-standard ERC20 behavior.
Impact:
Even though iUSDC may work as expected now, skipping the CEI pattern increases the chance of bugs during future changes
`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.