Inside the Snow::buySnow() function, the s_earnTimer is updated to the current time at the end of the function.
The s_earnTimer acts as a flag for keeping track of the time the last earni has been taken place.
Updating the variable while buying the token will result in the reste of the timer, and now the user has to wait a week for earning a token
This is not the expected behaviour, as users can buy tokens anytime and earn once a week.
A "Denial of Service" can be performed by calling this function repeatedly every 1 week so that nobody is able to earn tokens
Likelihood:
Whenever someone buys the token
Impact:
Nobody will be able to earn tokens
Add the following test case to the test suite of Snow
Now run the following command:
Remove the timer updation logic in buySnow(). Now the timer will not be updated by buying the token and the timer won't be reset while buying.
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.