buySnow is meant to let a user pay for Snow with either native ETH or WETH.
It mints via ETH only when msg.value == s_buyFee * amount exactly; otherwise it falls through to pull the full WETH price. A buyer who sends a partial/incorrect msg.value therefore pays the full amount in WETH and loses the ETH they sent — it stays in the contract with no refund.
Likelihood: Low
Requires the buyer to send a non-exact msg.value while also having WETH approved; a UX slip rather than an attacker path.
Impact: Low
The buyer is charged twice (full WETH + the stray ETH), and the stray ETH is only recoverable by the fee collector. User fund loss, bounded by the amount of ETH mistakenly sent.
The attacker has WETH approved and sends 1 wei of ETH with the buy; the contract charges full WETH and traps the 1 wei.
Run forge test --mt test_L2_buySnow_double_pay_stuck_eth -vvv:
Result: PASS — buyer paid full WETH and the 1 wei ETH is trapped in the contract.
Branch on explicit intent and reject unexpected value:
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.