Snow::s_earnTimer Prevents Multiple Users from Claiming earnSnow Independently once a week.Description: The Snow::earnSnow() function uses a single uint256 private Snow::s_earnTimer state variable to enforce a cooldown period for earning Snow tokens. However, this timer is global, meaning once any user calls Snow::earnSnow(), no other user can call it again until 1 week has passed, regardless of their individual activity. This introduces severe limitations in a multi-user environment.
Impact:
Only one user can call Snow::earnSnow() every 7 days.
All other users will be reverted with Snow::S__Timer() even if they never called the function before.
This breaks the expected functionality of a decentralized system where users should act independently.
Severely restricts adoption and usability.
Proof of Concept: Add this into your TestSnow.t.sol
Here, jerry is prevented from calling Snow::earnSnow() immediately after ashley, even though jerry has never interacted before.
Recommended Mitigation: Change Snow::s_earnTimer from a single global variable to a per-user mapping:
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.