DesThe mintSnowman function is intended to mint a specified number of Snowman NFTs to a given receiver. Under normal usage, a user can mint a small number of NFTs in a single transaction, updating ownership and token counters without exceeding gas limits.
The function allows the caller to specify an arbitrarily large amount. Because each NFT is minted inside a for loop using _safeMint, very large values cause the transaction to consume excessive gas, potentially exceeding the block gas limit. This results in the transaction failing and effectively creates a Denial-of-Service (DoS) condition, preventing the minting of Snowman NFTs in a single call and disrupting expected contract functionality.
Likelihood:
This will occur when a user attempts to mint a very large number of Snowman NFTs in a single transaction, causing the for-loop to exceed the block gas limit.
This will occur because the contract places no upper bound on the amount parameter, allowing any caller to submit arbitrarily large values.
Impact:
Large mint transactions fail due to gas exhaustion, preventing users from minting Snowman NFTs in a single call.
Automated scripts or batch airdrops that rely on bulk minting may fail, causing delays or interruption in planned distributions.
Users submitting large transactions may lose gas fees for failed transactions, resulting in wasted funds.
Repeated failed transactions and disrupted airdrops could harm user trust in the protocol.
Add this piece of code in your TestSnowman.t.sol file. and then run `forge test --mt test_mintUnlimitedAmount -vvv`
Set a limit on the number of NFT that can be minted
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.