Snowman Merkle Airdrop

First Flight #42
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Impact: low
Likelihood: low
Invalid

Unused Storage Variable: `s_claimers` in `SnowmanAirdrop`

Root + Impact

Unused Variable: s_claimers

A state variable s_claimers is declared in SnowmanAirdrop but never read or written anywhere. This wastes a small amount of storage and may indicate missing tracking logic or confuse future maintainers. It’s a low-severity, code-quality issue. Remove it if not needed, or implement its intended use (e.g., push claimers on successful claims) and add appropriate getters or events.

Likelihood

  • The code is compiled and deployed with s_claimers present, but never used.

  • This is obvious on code review or static analysis since no references to s_claimers appear beyond the declaration.

Impact

  • Gas/Wasted Storage: Declaring but not using a dynamic array causes unnecessary storage slot allocation, increasing deployment cost slightly and incurring a small ongoing storage cost (though an empty array has minimal footprint until items are added).

  • Maintainability: Future readers may be confused about intended behavior. It suggests that tracking claimers was planned but never implemented.

  • Potential Missing Logic: The presence of s_claimers may indicate that the author intended to record addresses that successfully claimed, but forgot to implement it. If tracking of claimers is desired (e.g., to list or prevent double claims beyond the existing mapping), this is a logic gap.

Proof of Concept

There is no active exploit. Instead, code inspection shows:

contract SnowmanAirdrop is EIP712, ReentrancyGuard {
using SafeERC20 for Snow;
// >>> VARIABLES
address[] private s_claimers; // array to store addresses of claimers
bytes32 private immutable i_merkleRoot;
...
// No subsequent references to s_claimers in the contract.
}

Recommended Mitigation

Remove s_claimers if tracking of claimers is not needed:

- address[] private s_claimers; // array to store addresses of claimers

Or Implement Intended Tracking if it was meant to record claim events. For example:

  • Add in claimSnowman after a successful claim:

s_claimers.push(receiver);
  • Provide a getter or enumeration function (be mindful of gas cost if the array grows large).

  • Or use an event (the existing SnowmanClaimedSuccessfully event already logs receiver and amount, which often suffices). If an on-chain list is required, fully flesh out how and why, and consider pagination or off-chain indexing.

Updates

Lead Judging Commences

yeahchibyke Lead Judge about 2 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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