collectFee() is meant to send the collector only the WETH fees the contract has genuinely accrued from buySnow() purchases.
The WETH leg uses the raw IERC20.transfer instead of SafeERC20.safeTransfer, even though the contract already declares using SafeERC20 for IERC20. Separately, the ETH leg forwards the contract's entire address(this).balance, not a tracked "fees owed" amount — so any ETH sitting in the contract for other reasons (e.g. the overpaid ETH trapped by the issue in buySnow) gets swept to the collector as if it were fee revenue.
Likelihood:
Occurs on every real-world call to collectFee() once any non-fee ETH/WETH has ever landed in the contract (e.g. an overpaid buySnow call, or WETH sent to the contract by mistake) — no special attacker action is needed, only a normal collector call.
Impact:
A non-standard ERC20 that returns false instead of reverting on failure would let collectFee() mark itself successful (via the unchecked .transfer) while actually transferring nothing — an accounting desync between "fee collected" and "fee actually received."
Any ETH that reached the contract for reasons other than a completed fee (most notably the trapped overpayment from the buySnow equality bug) is swept to the collector with no way for the original payer to recover it.
The test below first reproduces the overpayment from buySnow (6 ETH trapped, per the corrected fork trace) and mints 5 extra WETH directly to the Snow contract to simulate stray tokens. It then shows a single collectFee() call sweeps both — the trapped user ETH and the unrelated stray WETH — entirely to the collector, with no distinction between real fees and incidental balance.
Use the already-imported SafeERC20 wrapper for the WETH leg so a non-standard token's failed transfer reverts instead of silently "succeeding":
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.