Normal behavior:
The buySnow() function should mint tokens in exchange for ETH or WETH provided by the caller, with a positive amount.
Issue:
There is no check that the amount passed to buySnow() is greater than zero. As a result, a user can call buySnow(0) and trigger a transfer of 0 ETH or WETH, and emit a SnowBought event. This pollutes logs and introduces minor overhead. If additional logic is added later, it may be abused for gas griefing or triggering time-based restrictions unnecessarily.
Likelihood:
Low — This occurs when a user intentionally (or mistakenly) calls buySnow(0) to pollute logs or trigger state changes.
Reproducibility: This behavior can be consistently reproduced in every environment.
Ease of exploitation: The cost is minimal (<0.001 ETH), and requires no special permissions or conditions.
Impact:
Log pollution: Emits events without meaningful token minting.
Unnecessary state updates: s_earnTimer is updated pointlessly.
Potential griefing: Future logic tied to cooldowns or analytics can be gamed.
Misleading analytics: Off-chain systems may misrepresent minting activity.
Explanation:
User calls buySnow(0) with 0 ETH.
Event SnowBought is emitted even though nothing meaningful happened.
State s_earnTimer is reset unnecessarily.
Impact accumulates if this action is spammed to pollute logs or reset timers.
Add a check to revert if the passed amount is zero, ensuring that every mint action corresponds to an actual value transfer.
Explanation:
Solution: Enforces that zero-value transactions are rejected.
Security: Prevents event pollution and gas griefing attacks.
Efficiency: Saves gas by avoiding pointless state writes and logs.
Compatibility: Non-breaking change that improves consistency.
This fix addresses a low-severity vulnerability. While the issue does not directly affect token balances or user funds, it weakens the protocol’s consistency and exposes surfaces for griefing, spam, or future misbehavior. Ensuring amount > 0 upholds clean logs, proper state transitions, and aligns behavior with the principle of meaningful value exchange.
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.