Snowman Merkle Airdrop

AI First Flight #10
Beginner FriendlyFoundrySolidityNFT
EXP
View results
Submission Details
Impact: low
Likelihood: low
Invalid

### [L-3] `Snow::collectFee` ignores the `transfer` return value

Description

collectFee sweeps the contract's WETH to the collector, but calls transfer without checking the boolean return value. With a WETH-like token that returns false on failure instead of reverting, the sweep can silently no-op while the transaction still succeeds.

function collectFee() external onlyCollector {
uint256 collection = i_weth.balanceOf(address(this));
@> i_weth.transfer(s_collector, collection); // return value ignored
(bool collected,) = payable(s_collector).call{value: address(this).balance}("");
require(collected, "Fee collection failed!!!");
}

Risk

Likelihood: Low

  • Only manifests with a non-standard token that returns false rather than reverting; the collector is a trusted role.

Impact: Low

  • Fees can silently fail to move and remain stranded in the contract with no error signal. Robustness gap; flagged by the compiler.

Proof of Concept

forge build reports the issue on the exact line:

warning[erc20-unchecked-transfer]: ERC20 'transfer' and 'transferFrom' calls should check the return value
--> src/Snow.sol:103:9
i_weth.transfer(s_collector, collection);

(No runtime test is included; a repro requires a deliberately misbehaving WETH mock. The defect is the missing return-value check, evidenced by the compiler lint on the exact line.)

Recommended Mitigation

Use the already-imported SafeERC20:

- i_weth.transfer(s_collector, collection);
+ i_weth.safeTransfer(s_collector, collection);
Updates

Lead Judging Commences

ai-first-flight-judge Lead Judge about 2 hours ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!