The Snow token is designed to allow users to earn one free token per week, or buy tokens at any time during the farming period.
The buySnow function incorrectly resets the s_earnTimer variable, which is used to enforce the once-per-week free earning limit. This prevents users from earning free tokens for a week after purchasing tokens, even if they were already eligible to earn.
Likelihood:
When someone uses buySnow() function the timer is reset and users who waited 1 week wont be able to claim, even if they were previously eligible to earn free tokens.
This occurs on every purchase transaction, affecting all users.
Impact:
Users are have to hope that noone is going to purchase the token so they can claim their free snow.
The protocol's stated functionality of allowing users to earn free tokens once per week is compromised.
Add this test in TestSnow.t.sol
Don't reset the timer when someone buys snow
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.