The if/else logic in buySnow is flawed. If the user sends an amount of ETH that does not exactly match the fee, the contract enters the else block.
If a user sends $0.5$ ETH when the fee is $1$ ETH, the if fails. The contract then attempts to pull $1$ full WETH from the user via safeTransferFrom. The original $0.5$ ETH sent remains stuck in the contract, effectively double-charging the user or losing their funds.
Pase in TestSnow.t.sol file
Ensure the function only accepts one form of payment at a time or explicitly refunds excess msg.value.
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.