Currently, a single global variable s_earnTimer
is used to track the last snow-related activity. This causes unintended side effects because:
Every time any user calls buySnow()
, s_earnTimer
is updated globally.
This interferes with the logic in earnSnow()
, which uses s_earnTimer
to enforce a 1-week cooldown per user.
As a result, one user's buySnow()
call can block another user's ability to earnSnow()
Likelihood:
High
This will occur every time multiple users interact with buySnow()
and earnSnow()
.
Particularly problematic on live systems with many users, or bots triggering buys rapidly.
Impact:
The use of a global timer:
Breaks user-isolated reward logic.
Allows one user to unintentionally or maliciously delay others from earning rewards.
Prevents accurate tracking of per-user activity for cooldown enforcement, loyalty rewards, or future reward scaling.
Example of the Problem:
Any user's buySnow()
delays every user's ability to earnSnow()
again.
Replace the single global s_earnTimer
with per-user mappings and update both functions buySnow() and earnSnow().
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.