The Snowman Merkle Airdrop allow users to claim one free snow token once a week by checking if one week has passed since the token have been claimed. The issue is this variable is global and not user-specific. Only one user can claim the token.
Likelihood:
High:
Anyone user can invoke the function, no special permissions required.
Impact:
Medium:
It denies other users from claiming their free weekly snow token. Whenever someone calls the earnSnow
or buySnow
functions, the timer is reset for everyone. Meaning legitimate users essentially lose their free weekly token and may abandon the protocol.
The following code calls the function earnSnow
from the contract Snow.sol
as "ashley" and then as "jerry". The balance of "Ashley" increases by one whereas jerry's balance remains 0.
Replace the "testCanEarnSnow()" function in TestSnow.t.sol with this code. Then run forge test --match-contract TestSnow -vvv
Change the type of s_earnTimer from uint256
to mapping(address => uint256)
so the timer is set for each user individually instead of one global variable that resets for everyone once someone executes the earnSnow
function or buys a snow token.
Snow.sol:30
Snow.sol:88
Snow.sol:93-100
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.
The contest is complete and the rewards are being distributed.