Snowman Merkle Airdrop

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

No Check for Zero amount in buySnow()

Summary

The buySnow() function allows purchasing zero tokens, unnecessarily minting zero supply while still emitting events.

Description

If amount is set to zero, no tokens are minted but events are still emitted.
This bloats logs and may confuse indexers.

POC

function testCanBuy0SnowTokensPOC() public {
vm.prank(victory);
snow.buySnow{value:0}(0);
}

Impact

Wasted gas.
Event log pollution.

Severity

MEDIUM

Likelihood

MEDIUM

Recommendation

Add input validation:
require(amount > 0, "Cannot buy zero tokens");

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.