Expected : The buySnow
function should enforce strict payment requirements — either ETH or WETH — to ensure liquidity is properly managed and avoid fund loss.
Bug : The function checks msg.value == (s_buyFee * amount)
but does not validate whether WETH was transferred when msg.value == 0
. This creates a discrepancy where users can pay ETH while the contract expects WETH, leading to frozen ETH balances in the contract.
Likelihood :
Medium : Users may accidentally send ETH instead of WETH, especially if interface instructions are unclear.
Medium : Contracts interacting with buySnow
may misconfigure payment types, leading to unintended ETH deposits.
Impact :
Medium : ETH sent to the contract cannot be processed or withdrawn, locking liquidity.
Low : Users lose access to their ETH, but WETH payments remain functional.
Explanation :
By sending ETH directly to buySnow
, the contract accepts the payment (msg.value == s_buyFee * amount
) but does not verify if WETH is intended . The ETH remains stuck in the contract, as there is no logic to handle or refund it.
Steps :
Add Payment Type Flag : Introduce a bool isEth parameter to explicitly distinguish between ETH and WETH payments.
Validate ETH/WETH Separately : Ensure msg.value == 0 for WETH payments and reject mismatched transfers.
Rationale :
This prevents accidental ETH deposits when WETH is required, ensuring liquidity is handled correctly and avoiding fund loss.
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.
The contest is complete and the rewards are being distributed.