The buySnow function uses a confusing if-else logic to determine payment method, which could lead to users accidentally paying with both ETH and WETH, or using the wrong payment method.
Given a user execute the buySnow function with 1 wei overprice, the contract will accpet the msg.value AND do the weth safeTransferFrom. Causing double spend issue
Likelihood:
High as it's hard to calculate the exact price given the gas consumtion and MEV environment.
Impact:
Double spend - User spend both native token and weth token on 1 purchase.
User wants to buy Snow tokens with WETH
User accidentally sends some ETH with the transaction
If the ETH amount is not exactly s_buyFee * amount, the transaction will:
First try to use the ETH (which will be lost)
Then try to transfer WETH
User ends up paying with both ETH and WETH
Split the function into two separate functions for different payment methods:
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.