collectFee ignores WETH transfer return valueLow
Low
Snow.collectFee() transfers WETH to the collector using i_weth.transfer() and ignores the returned boolean:
Some ERC20 tokens return false instead of reverting on failed transfers. The contract already imports SafeERC20 and declares:
but does not use safeTransfer() in collectFee().
Affected code:
src/Snow.sol:101
src/Snow.sol:103
If the configured WETH-like token returns false, collectFee() may continue as if the WETH transfer succeeded. This can cause fee collection to appear successful even though WETH was not transferred.
Impact:
failed WETH collection may be missed,
accounting and operational assumptions can become incorrect,
collector may only receive native ETH while WETH remains in the contract.
The following PoC shows that collectFee() can complete successfully even when the WETH transfer reports failure.
Add this test to test/AuditFuzz.t.sol:
Run:
Result:
The test proves that the collector can call collectFee() without a revert, while the full WETH balance remains in the Snow contract and the collector receives no WETH.
Use SafeERC20.safeTransfer() instead of raw transfer().
Example fix:
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.