Snow::s_earnTimer
is global for all users. This prevents multiple users from earning Snow tokens independently once per week.
Normal Behavior:
Each user should be able to claim 1 Snow token via the earnSnow()
function once per week, independently of other users' activity.
Issues:
In the Snow
contract, the s_earnTimer
variable is global and is updated both in buySnow()
and earnSnow()
. This causes that, even if 7 days have passed, only one user can claim a Snow token per week. When a user buys or claims, the timer is reset for everyone, blocking others.
Likelihood: Medium
Reason 1
There is no direct risk of loss of funds, but there is a clear disruption in protocol functionality.
If the goal is to distribute weekly rewards fairly, this logic is completely broken. Any interaction (buy or earn) resets the global timer, blocking other users from claiming. This makes the expected system behavior (weekly farm per user) impossible.
Impact: Medium
Impact 1
This limitation prevents almost all users from receiving the token for free, forcing them to use the paid function (buySnow) to obtain it.
This barrier can negatively affect trust, participation, and usability of the protocol, as only one user can receive the token weekly for free.
Alice makes the first earnSnow()
and her balance is checked.
s_earnTimer
is updated for everyone.
Bob immediately tries to call earnSnow()
and it reverts.
Advance time by 1 week.
Clara can claim a Snow token.
This change ensures that each user has their own timer to claim tokens, maintaining the individual weekly farm logic.
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.