earnSnow is expected to enforce a 1-week cooldown before allowing users to mint Snow tokens, ensuring rewards are distributed at controlled intervals.
The cooldown check is bypassed on the first call because s_earnTimer is initialized to 0.
When s_earnTimer == 0, the condition that reverts is skipped, allowing the first caller to mint Snow immediately and without any waiting period and without calling buySnow function.
Likelihood:
Always occurs for the first caller after deployment
Requires no special conditions or privileges
Impact:
First caller gains an unfair advantage
Breaks expected reward timing and fairness assumptions
add this function in testSnow.t.sol
Initialize the earning timer at deployment or explicitly enforce a minimum delay before the first claim.
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.