Snowman Merkle Airdrop

AI First Flight #10
Beginner FriendlyFoundrySolidityNFT
EXP
View results
Submission Details
Impact: low
Likelihood: high
Invalid

Unused State Variable s_claimers Wastes Gas

Root + Impact

Description

The s_claimers array is declared but never populated or used anywhere in the contract. This wastes gas on deployment and indicates incomplete implementation or dead code.

// src/SnowmanAirdrop.sol:42
address[] private s_claimers; // @> Declared but never used

Risk

Likelihood:

  • Present in every deployment

  • Guaranteed to waste gas

Impact:

  • Unnecessary deployment gas cost

  • Code clutter and confusion

  • May indicate incomplete feature

Proof of Concept

// The array is declared but:
// 1. Never pushed to in claimSnowman()
// 2. No getter function to read it
// 3. No other function references it
// Result: Dead code wasting gas

Recommended Mitigation

- address[] private s_claimers;

Or if tracking claimers is desired:

function claimSnowman(address receiver, bytes32[] calldata merkleProof, uint8 v, bytes32 r, bytes32 s)
external
nonReentrant
{
// ... existing checks ...
i_snow.safeTransferFrom(receiver, address(this), amount);
s_hasClaimedSnowman[receiver] = true;
+ s_claimers.push(receiver);
emit SnowmanClaimedSuccessfully(receiver, amount);
i_snowman.mintSnowman(receiver, amount);
}
+ function getClaimers() external view returns (address[] memory) {
+ return s_claimers;
+ }
+
+ function getClaimersCount() external view returns (uint256) {
+ return s_claimers.length;
+ }
Updates

Lead Judging Commences

ai-first-flight-judge Lead Judge about 4 hours ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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

Give us feedback!