Snow::buySnow()
Expects Exact Amount Of Ether, Resulting In Unexpected Reverts / WETH TransferThis protocol should allow users to clearly choose between paying with ether or weth.
The same function however, is being used. The function determines whether a user chooses ether or weth by checking if the msg.value
is exactly equal to the amount required. If users estimate the amount wrongly, their transaction would revert or would accidentally trigger a weth transfer if the user has approved the protocol from spending their weth previously.
Likelihood: Medium
Assuming that the s_buyFee
is a whole number, users should not have difficulty calculating the price exactly.
Impact: Low
Most likely the protocol would revert, unless user has approved the protocol from spending weth previously. Thus there would be minimal impact on the user, besides usability issues.
NA
A good practice would be to have separate functions, and return excess ether to the user if msg.value
> amount required.
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.