Snow::buySnow
function s_earnTimer
is set, allowing attackers to Make DoSIn Snow
contract users are allowed to buy or earn a token with in a week. but setting s_earnTimer
in Snow::buySnow
will allow attackers to send some to little values to block other people from earning free token once a week. In addition there is no checks for input amount
in Snow::buySnow
so attacker could cause deniel of service without sending anything.
Impact: Deniel of Service
Add this test suit to TestSnow.t.sol
In this test function victory is the attacker
victory buy zero amount of token so no one can't earn anything until after a week
and he keep doing the same thing every week the moment 1 week passed
One could say since any one can buy any amount of token not setting s_earnTimer
in Snow::buySnow
can avoid this
Or you could make a d/t variable for buySnow like s_buyTimer
and limit how much a person can mint to control inflation
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.