Snow::buySnow strands ETH and double-charges in WETH when msg.value is not exactly the pricebuySnow is meant to accept payment in either native ETH or WETH.
It only treats the payment as ETH when msg.value is exactly s_buyFee * amount. Any other msg.value (including slightly too much) falls through to the WETH branch, which charges the buyer again in WETH while keeping the ETH they sent.
Likelihood: Low
Sending an inexact ETH amount is a common user mistake; amount == 0 also passes silently and just updates state.
Impact: Medium
The buyer is double-charged (WETH on top of the ETH already sent) and the sent ETH is stranded in the contract, recoverable only by the collector via collectFee — a direct loss of user funds.
Scenario: a user is set up to pay in WETH (funded + approved) but also sends ETH that is not exactly s_buyFee * amount (here, off by 1 wei). Because the if requires an exact match, execution falls into the else branch: the contract pulls the full price in WETH and keeps the ETH the user sent. The user pays twice for one token, and the ETH is stranded (only collectFee can ever move it).
Drop this into test/PoC_Lows.t.sol (uses the project's MockWETH):
Run: forge test --mt test_L1_buySnowStrandsEthAndDoubleCharges -vv
Result:
The user paid price WETH and price + 1 ETH for a single token; the ETH is locked in the contract.
Make the payment path explicit: if any ETH is sent, require it to equal the exact price and use the ETH path; otherwise use WETH. Reject zero amounts.
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.