Snowman Merkle Airdrop

First Flight #42
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Severity: low
Valid

### [M-4] Missing ```s_claimers``` State Update in ```SnowmanAirdrop::claimSnowman``` Function.

[M-4] Missing s_claimers State Update in SnowmanAirdrop::claimSnowman Function.

Description

The s_claimers State was Declared to update the address of users who has claimed their airdrop.
but it is not being updated in claimSnowman Function .This results in protocol difficulty
to track how much users has claims their airdrop.

Impact:

1.Lack of tracking of users who has claim their airdrops.

2.Reduces visibility into the claim process for users and administrators.

Proof of Concept

1.100 users calls the claimsnowman function to stake their snow tokens and mint the nfts.
2.Expected: The claiming user’s address is added to s_claimers.
3.Actual: The s_claimers array remains empty.

Recommended Mitigation

function claimSnowman(
address receiver,
bytes32[] calldata merkleProof,
uint8 v,
bytes32 r,
bytes32 s
) external nonReentrant {
if (receiver == address(0)) {
revert SA__ZeroAddress();
}
if (i_snow.balanceOf(receiver) == 0) {
revert SA__ZeroAmount();
}
if (!_isValidSignature(receiver, getMessageHash(receiver), v, r, s)) {
revert SA__InvalidSignature();
}
uint256 amount = i_snow.balanceOf(receiver);
bytes32 leaf = keccak256(
bytes.concat(keccak256(abi.encode(receiver, amount)))
);
if (!MerkleProof.verify(merkleProof, i_merkleRoot, leaf)) {
revert SA__InvalidProof();
}
i_snow.safeTransferFrom(receiver, address(this), amount); // send tokens to contract... akin to burning
s_hasClaimedSnowman[receiver] = true;
+s_claimers.push(receiver)
emit SnowmanClaimedSuccessfully(receiver, amount);
i_snowman.mintSnowman(receiver, amount);
Updates

Lead Judging Commences

yeahchibyke Lead Judge 3 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Lack of claim check

The claim function of the Snowman Airdrop contract doesn't check that a recipient has already claimed a Snowman. This poses no significant risk as is as farming period must have been long concluded before snapshot, creation of merkle script, and finally claiming.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.