Root Cause: Usage of transfer()
which has a hard gas limit of 2300 gas
Impact: Funds could be permanently locked if the owner is a smart contract (e.g., Gnosis Safe, other smart wallets)
https://github.com/Cyfrin/2024-10-trick-or-treat/blob/main/src/TrickOrTreat.sol#L146-L150
The withdrawFees()
function uses the transfer()
method to send ETH to the owner, However it is problematic because:
transfer()
has a hard gas limit of 2300 gas
Smart contract wallets (like Gnosis Safe) typically require more than 2300 gas to process incoming ETH
Modern smart wallets commonly used as multi-sigs would fail to receive funds
The operation would revert, effectively locking the fees in the contract
Funds will be locked in contract if owner is a smart wallet or contract that requires more than 2300 gas to receive ether
Manual Review
Replace transfer()
with the recommended call()
pattern:
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.