The s_earnTimer state variable is globally shared across all users, meaning that once any user calls buySnow() or earnSnow(), it prevents all other users from earning Snow for at least 1 week.
s_earnTimer is updated every time buySnow() or earnSnow() is called.
The earnSnow() function requires that 1 week has passed since the last time s_earnTimer was updated.
As a result, one user can grief all other users by repeatedly calling buySnow() or earnSnow() and resetting the timer.
DoS (Denial of Service) on legitimate users trying to call earnSnow().
Prevents intended fair access.
Encourages monopolization by bots or whales.
HIGH
HIGH
Each user should have an independent cooldown.
Replace global timer with per-user timers, e.g. map address to timestamp:
mapping(address => uint256) public userEarnTimer;
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.