In file Snow.sol - The s_earnTimer is a global variable instead of a per-user mapping. When any user calls buySnow(), it resets the s_earnTimer to the current timestamp. This affects all users' ability to claim free tokens through earnSnow() since they share the same timer.
Likelihood:
High as everytime a user trigger buySnow triggers a new s_earnTimer
Impact:
High as it breaking the invariant The Snow token can either be earned for free onece a week
User A calls earnSnow() and gets a free token
User B calls buySnow() which resets s_earnTimer
User A cannot call earnSnow() again for another week, even though they should be able to
Use per-user mappings for time-based restrictions
Consider adding events for timer resets
Add more test cases to verify time-based functionality
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.