Skip to content
Business logic Audit finding Intermediate

NFT can be minted for free after sale ended

After the sale ended, the price function returned zero, allowing anyone to mint the remaining NFTs for free. An attacker could deploy a contract to claim all remaining NFTs ahead of regular users.

Larva Labs Meebits

Originally disclosed on Code4rena

The getPrice() function returned 0 after the sale ended and (SALE_LIMIT - numSales) NFT can be minted for free.

Without documentation, it’s not clear if this is the expected behavior or not. If it’s unexpected, it is recommended to revert instead of returning 0. If it’s expected behavior, it’s possible to create a smart contract and claim all the remaining NFT front-running the regular users.

The original report as published on Code4rena. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the price calculation returns zero once the sale has ended instead of blocking further minting.

Impact

The remaining NFTs could be minted for free, and a contract could front-run regular users to take them all.

What the attacker needed

Sale has ended; no payment required

The fix

The contract should revert once the sale has ended rather than returning a zero price.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A smart contract is a program on a blockchain that runs automatically. This one had a function that calculates the price of an NFT, and after the sale period it returned zero instead of stopping sales. That meant anyone could keep minting NFTs without paying anything.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More from Larva Labs Meebits

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.