The function should check the return value of ERC-20 transfers and revert if the transfer fails, ensuring successful transfers or clear failure notifications.
The function ignores the boolean return value from ERC-20 transfer() calls, allowing withdrawals to silently fail while still emitting success events, which can permanently trap tokens in the contract.
Likelihood:
Because withdrawTokens does not inspect the return value, Solidity considers the external call succeeded (no revert) even though the token contract signaled failure. The caller (the owner) will assume tokens were transferred out while the token balance remains in the hook, making future withdrawals of that token impossible and causing permanent loss of withdraw capability for that token.
Impact:
There is no way for owner to know that the withdraw failed
Events indicate successful withdrawal when it actually failed
Add following mock contract below the test file RebateFiHookTest.t.sol
Add the below function in the test file RebateFiHookTest.t.sol and then run forge test --match-test test_WithdrawTokens_SilentFailure_Vulnerability -vvv
This can be improved by adding the return value that either success or transfer failed and also by modifying the event emission.
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.