Snowman Merkle Airdrop

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

Missing Zero Address Validation for Receiver in Snowman.sol::mintSnowman

Root + Impact

Root: The mintSnowman function accepts a receiver parameter without validating that it's not the zero address, allowing NFTs to be minted to address(0).

Impact: NFTs minted to the zero address are effectively burned and permanently lost, wasting gas and potentially causing loss of intended airdrop rewards for legitimate users.

Description

  • Normal Behavior: NFT minting functions should validate that the recipient address is valid and not the zero address to prevent accidental token burning.

  • Specific Issue: Calling mintSnowman(address(0), amount) will successfully mint NFTs to the zero address, making them unrecoverable and reducing the total supply without any benefit.

Risk

Likelihood: Medium

  • Integration errors or frontend bugs could accidentally pass zero address as receiver

  • Malicious actors could intentionally burn NFTs by minting to zero address

  • No validation exists to prevent this wasteful operation

Impact: Low

  • Token Loss: NFTs minted to zero address are permanently lost and unrecoverable

  • Gas Waste: Unnecessary gas consumption for operations that provide no value

  • Supply Confusion: Reduces effective NFT supply without clear tracking of burned tokens

Recommended Mitigation

Add a zero address validation check in the mintsnowman function to validate address.

function mintSnowman(address receiver, uint256 amount) external {
+ if (receiver == address(0)) {
+ revert(); // Add appropriate error
+ }
for (uint256 i = 0; i < amount; i++) {
_safeMint(receiver, s_TokenCounter);
emit SnowmanMinted(receiver, s_TokenCounter);
s_TokenCounter++;
}
}
Updates

Lead Judging Commences

yeahchibyke Lead Judge
5 months ago
yeahchibyke Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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