Snow::buySnow()
Updates Shared s_earnTimer
Variable Causing Denial Of Service Within Snow::earnSnow()
Snow::buySnow()
should allow Snow tokens to be bought at anytime, while Snow::earnSnow()
should allow users to earn Snow tokens for free once a week.
The issue here is that Snow::buySnow()
updates the s_earnTimer
variable which is also used within Snow::earnSnow()
to check if a week has passed before allowing users to earn Snow tokens. This results in a Denial Of Service for users to call Snow::earnSnow()
Likelihood: High
Snow::buySnow()
is an advertised component which would be used often by users
Impact: High
Users will not be able to earn Snow tokens which is an advertised component of the airdrop.
The following test added to TestSnow.t.sol
demonstrates the Denial Of Service for the earnSnow()
function when buySnow()
is called by anyone.
This issue can be mitigated by removing the line that updates s_earnTimer
within Snow::buySnow()
.
When buySnow is successfully called, the global timer is reset. This inadvertently affects the earning of snow as that particular action also depends on the global timer.
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.