The earnSnow() function uses a single shared timer (s_earnTimer) for all users, which can be indefinitely reset by any call to buySnow(). This creates a Denial-of-Service (DoS) blocking users from earningSnow.
Any user (or attacker) can prevent all others from earning snow by repeatedly calling buySnow(), resetting s_earnTimer to the latest block.timestamp. Legitimate users may never claim rewards within the 12-week farming period due to constant resets.
The issue persists whether the reset is malicious (intentional attacks) or accidental (normal user activity).
Key Issues:
A single storage variable (s_earnTimer) controls rewards for all users, creating a central point of failure.
The timer resets for everyone when any user calls buySnow(), violating the principle of fair reward distribution.
Likelihood: HIGH
Every time a user buys snow, the timer will be reset.
Every time a user earnSnow, the timer will be reset.
Impact:
User can be temporarily DoS, reducing their ability to claim snow.
User can be completely DoS, if the timer is repeatedly reset until the deadline.
Replace the shared timer with a per-user mapping to isolate earning schedules:
When buySnow is successfully called, the global timer is reset. This inadvertently affects the earning of snow as that particular action also depends on the global timer.
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.