Snowman Merkle Airdrop

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

Unused Error Declaration Increases Deployment Costs in Snowman.sol

Root + Impact

Root: The contract declares error SM__NotAllowed(); but this error is never used anywhere in the Snowman contract code, creating dead code that serves no functional purpose.

Impact: Unnecessary bytecode increases deployment gas costs and adds confusion for developers and auditors who may expect the error to be used somewhere in the contract logic.

Description

  • Normal Behavior: Error declarations should only be included when they are actually used in the contract to maintain clean, efficient code and accurate deployment costs.

  • Specific Issue: The SM__NotAllowed() error exists in the contract but has no corresponding revert SM__NotAllowed() statements, making it completely unused dead code that adds to contract size without providing any value.

Risk

Likelihood: High

  • Every deployment includes this unused error declaration, making the inefficiency constant

  • The dead code is permanent once deployed and cannot be removed without redeployment

Impact: Low

  • Increased Deployment Costs: Unnecessary bytecode slightly increases gas costs for contract deployment

  • Code Confusion: Developers and auditors may waste time looking for where this error is supposed to be used

  • Maintenance Issues: Dead code can mislead future developers about intended functionality

Recommended Mitigation

Remove the unused error declaration to clean up dead code and reduce deployment costs.

// >>> ERROR
error ERC721Metadata__URI_QueryFor_NonExistentToken();
- error SM__NotAllowed();
Updates

Lead Judging Commences

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