The protocol documentation and intended design state that users can acquire Snow tokens in two ways:
By buying them (paying ETH or WETH).
By earning 1 free token per week during the 12-week farming period — independently of buying.
However, the current implementation uses a single global variable s_earnTimer to track the last earn/buy timestamp, which is initialized as 0, considering that it will be replaced with the per user track using a mapping. If the user don't buy one or more token than he can also not earn the token for free every week as intended
solidity
The critical issue is the s_earnTimer != 0 check:
At deployment, s_earnTimer is initialized to 0.
It only becomes non-zero when any user calls buySnow() (or earnSnow() after it's been set).
Until the first buy occurs globally, every call to earnSnow() reverts because s_earnTimer == 0.
This creates a permanent lockout for the free earning feature until someone buys tokens.
Contradicts documented design: Users expecting to earn free Snow weekly are completely blocked if no one has ever bought.
Chicken-and-egg problem: New users cannot earn for free → low incentive to participate → fewer buyers → feature remains locked.
Centralization of activation: The free earning mechanic is effectively gated behind a single global action (first buy).
Unfair distribution: Early adopters who buy unlock the earn feature for everyone, including those who never paid.
Potential permanent disable: If no one ever buys (e.g., due to high fee or lack of interest), the weekly earn is permanently unavailable.
This significantly undermines the fairness and accessibility of the farming mechanism.
solidity
Test Result: The test passes, confirming that even after more than 100 weeks, a user who has never bought (and no one else has) is unable to call earnSnow() successfully. The transaction reverts due to the s_earnTimer == 0 condition.
Replace the global s_earnTimer with a per-user mapping to allow independent weekly earning, and remove the non zero check in the earnsnow function:
solidity
Optional: If desired, buySnow() can also update the user's s_lastEarnTime to reset their weekly cooldown.
This change ensures:
Every user can earn 1 Snow per week starting immediately after deployment.
No dependency on global buy activity.
Full alignment with intended "buy or earn weekly" design.
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.