Snowman Merkle Airdrop

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

Redundant Error Declaration `Snowman.sol::SM__NotAllowed` (Unused Code + Extra Bytecode Size)

[Low] Redundant Error Declaration Snowman.sol::SM__NotAllowed (Unused Code + Extra Bytecode Size)


Description

The custom error SM__NotAllowed() is declared within the Snowman.sol contract but is never invoked or reverted by any function throughout the contract's codebase.

Risk

While not a direct security vulnerability, unused code, including error declarations, contributes to a marginally larger contract bytecode size. This incurs a minor, unnecessary gas cost during contract deployment. Additionally, it can reduce code clarity, potentially misleading auditors or developers into searching for its usage or assuming an unimplemented access control check.


Proof of Concept

A static analysis or a simple search within the Snowman.sol file confirms that SM__NotAllowed() is declared but has no corresponding revert statement anywhere in the contract logic.

// File: contracts/Snowman.sol
error SM__NotAllowed(); // ❌ Declared but never used
// ... no usage anywhere in the contract:
// ❌ No: revert SM__NotAllowed();
// ❌ No conditional check referencing this error

Recommended Mitigation

Remove the unused error declaration to improve code clarity, reduce the contract's bytecode size, and streamline the codebase.

- error SM__NotAllowed(); // Remove this unused error declaration
Updates

Lead Judging Commences

yeahchibyke Lead Judge 3 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.