The bug occurs because the buySnow()
function resets the s_earnTimer
to the current block.timestamp
every time someone purchases snow tokens.
Unfair token distribution.
One should be able to earnSnow after 1 week + s_earnTimer in earnSnow()
function
Each time someone buy a snow , it reset the s_earnTimer for each user.
Likelihood: High
Impact:
Anyone who buys earnSnow reset the s_earnTimer to block.timestamp.
It will stop other user to earn weekly snow in earnSnow() function as it requires block.timestamp < (s_earnTimer + 1 weeks))
User A claim earnSnow() , which set s_earnTimer = t.
User B buy snow at t+2 days which again reset s_earnTimer = t+2.
User A try to earnSnow() after t+1 week and it failed because t+1 week < (t+2)+1 week.
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.