Administrative token withdrawals should be performed using safe transfer patterns that revert on failure across both standard and non‑standard ERC‑20 implementations. This ensures that the contract does not silently continue after a failed transfer (e.g., tokens that return false instead of reverting).
The withdrawTokens function uses a raw IERC20(token).transfer(to, amount) and ignores the return value. For ERC‑20 tokens that return false (instead of reverting) or have non‑standard behavior, this can result in silent failure—no tokens moved while the contract emits a success event and continues execution.
Likelihood: Low
Arises during routine treasury operations whenever the hook holds and withdraws ERC‑20 tokens that are non‑standard or malleable (e.g., tokens that return false on failure, require additional checks, or implement fee‑on‑transfer semantics).
Common in heterogeneous DeFi environments where third‑party tokens may not strictly adhere to the ERC‑20 spec.
Impact: Medium
Silent loss of funds movement / accounting mismatch: The contract may emit TokensWithdrawn and proceed as if the transfer succeeded, while the recipient receives no tokens. Off‑chain accounting and monitoring are then corrupted.
Operational confusion & incident risk: Treasury scripts and dashboards relying on events will show successful withdrawals, complicating incident response and reconciliation.
A conceptual test illustrating silent failure with a mock token that returns false (rather than reverting):
Use SafeERC20.safeTransfer (OpenZeppelin) to revert on failure and prevent silent misbehavior. Also fix the event parameter order while you’re here.
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.