Snow.earnSnow
due to a globally set s_earnTimer variable, blocking most users from earning snow tokens.The s_earnTimer is a global variable that applies to all users. Thus, one user's call to earnSnow resets the timer for all users. This only allows one user per week to call earnSnow and earn snow tokens.
Likelihood: HIGH
This will occur with 99% of users attempting to call earnSnow, as only one user per week will be able to call earnSnow.
Impact: MEDIUM
This limitation severely and detrimentally affects the intended use of the overall protocol functionality. While funds aren't directly at risk, most users will be unable to participate in earning snow tokens.
Add and run this test testGlobalEarnTimerBlocksUserB
in the TestSnow.t.sol file.
Initialize s_earnTimers as a private mapping at the top of the contract. In the snow.earnSnow
function itself, remove each instance of s_earnTimer and replace it with s_earnTimers[msg.sender].
Here is how the s_earnTimer variable should be handled:
Here is how the snow.earnSnow
function should be edited:
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.