The claimSnowman flow converts 1 Snow token into 1 Snowman NFT. When a user claims, SnowmanAirdrop calls i_snowman.mintSnowman(receiver, amount) where amount equals the user's Snow balance. The mintSnowman function in Snowman.sol iterates in an unbounded loop, performing one ERC721 _safeMint per iteration. Each mint involves storage writes, event emission, and potentially an onERC721Received callback. With ~50k–100k+ gas per mint and a block gas limit of ~30M, users with roughly 300+ Snow tokens will exceed the block gas limit and their claim transaction will revert. They permanently lose the ability to claim their allocation.
Likelihood (high):
Users acquire Snow via buySnow(amount) with arbitrary amounts, or via transfers from others.
Merkle tree and snapshot can include large allocations for whales or early participants.
No cap on Snow balance or claim amount; large holders are expected in normal operation.
Impact (high):
Users with large Snow balances cannot claim; transaction reverts with out-of-gas.
Snow is already transferred to the contract before mint; on revert the full tx rolls back, but the user remains permanently unable to claim.
Loss of airdrop entitlement for high-value participants.
Severity (high):
Alice has 500 Snow (e.g. bought via buySnow or received via transfer).
Alice calls claimSnowman with valid Merkle proof and signature.
Snow is transferred from Alice to the airdrop contract.
mintSnowman(alice, 500) is invoked. The loop runs 500 iterations.
Each _safeMint costs ~50k–100k+ gas. Total gas exceeds block limit (~30M).
Transaction reverts with out-of-gas. Alice cannot claim.
Option 1: Use ERC1155 — Replace ERC721 Snowman with ERC1155. Use _mintBatch to mint multiple tokens in a single, gas-efficient operation.
Option 2: Batched minting — Allow partial claims. Add a claimAmount parameter and cap per transaction. Users with large allocations claim in multiple transactions.
Track claimedSoFar[receiver] and allow multiple claims until the full Merkle allocation is exhausted.
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.