Root: Missing Validation/Refund of msg.value
Impact: Loss of Funds
The buySnow() function determines the payment method using strict equality.
If the user sends an incorrect msg.value, execution falls into the else branch, where WETH is transferred using safeTransferFrom.
However, the contract does not:
validate incorrect ETH amounts
revert the transaction
refund any ETH sent
As a result, any ETH sent is accepted and retained by the contract, while the user is still charged the full amount in WETH.
Likelihood:**** Medium
Reason: Requires the user to send an incorrect ETH amount, which is likely due to UI issues, miscalculations, or user error.
Impact:
Users may unintentionally pay both ETH and WETH for a single purchase
ETH sent is permanently locked in the contract
Results in unintended loss of funds due to incorrect payment handling
The following test demonstrates that a user can lose both ETH and WETH when sending an incorrect ETH amount.
Step-by-step:
Setup
A user is funded with both ETH and WETH
The user approves the contract to spend WETH
Incorrect Payment
The user calls buySnow() with an incorrect msg.value (slightly less than required)
Execution Flow
The equality check fails (msg.value != required)
The contract enters the WETH branch
WETH is transferred from the user
ETH Handling
The ETH sent with the transaction is not refunded
The transaction does not revert
Result
The user loses both ETH and WETH
Validate ETH input and revert on incorrect values:
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.