The buySnow function is designed to accept payment in either ETH (if msg.value equals the exact required amount) or WETH (if msg.value does not equal the required amount).
The function fails to validate that msg.value == 0 when using the WETH payment path, allowing users to send both ETH and WETH simultaneously, resulting in overpayment and ETH being stuck in the contract.
It should be EITHER ETH OR WETH, never both.
Likelihood:
Users will accidentally send ETH when intending to pay with WETH, especially if they send an incorrect ETH amount
The function logic is confusing as it doesn't clearly separate ETH and WETH payment methods
Impact:
Users lose additional ETH on top of their WETH payment, resulting in financial loss
ETH becomes permanently stuck in the contract (until collector calls collectFee())
// User sends wrong ETH amount (not exact), so it uses WETH path
// But msg.value is not validated to be 0, so user pays both
// Send 0.5 ETH + 1 WETH for 1 token
// User got tokens but paid both ETH and WETH
add a check "require(msg.value == 0"
This fix adds a guard clause that says:
"If you're not paying the exact ETH amount..."
"...then you MUST send 0 ETH to use the WETH path"
"If you send any ETH at all, I'll reject the transaction"
This prevents the double payment because:
ETH path: msg.value == exact_amount → takes ETH only
WETH path: msg.value == 0 → takes WETH only
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.