Root: The collectFee function uses i_weth.transfer, ignoring its return value, instead of SafeERC20.safeTransfer
;
Impact: Silent failure of WETH transfer could leave funds uncollected, risking loss or exploitation.
The collectFee
function transfers all WETH to s_collector
using i_weth.transfer
, which does not revert on failure and lacks return value checking. This could result in funds remaining in the contract if the transfer fails (e.g., collector’s balance cap or reentrancy guard), unlike safeTransfer which would revert.
** Likelihood**:
When the collector’s contract rejects WETH transfers or has a balance limit.
During fee collection with untrusted collector implementations.
Impact:
Leaves WETH in the contract, reducing collected fees.
Medium severity due to potential fund loss.
Silent Failure Test:
Deploy a Snow contract with a mock WETH that reverts on transfer.
Call collectFee and verify no revert occurs, with WETH remaining.
Steps:
Mint 100 WETH to the Snow contract.
Set a mock WETH to fail transfer.
Call collectFee as the collector.
Check that the contract still holds WETH, proving silent failure.
Replace transfer with safeTransfer to ensure proper reversion on failure.
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.