Book a free call

ERC-721 Best Practices: Mint and Manage NFTs Safely

ERC-721 best practices cover metadata, royalties, contract security and gas. Follow them and your collection stays tradable, honest, and cheaper to run.

Hertiv engineering teamReviewed by a senior engineer
6 min read
ERC-721 Best Practices: Mint and Manage NFTs Safely
On this page

Short answer

ERC-721 best practices are the working habits that keep an NFT collection safe and honest: store metadata where it cannot silently change, write royalties and ownership rules clearly, audit the contract before minting, and keep gas costs visible. They matter because an NFT is a permanent record on a public chain, and a flaw in the contract or the metadata follows every token it creates.

What are ERC-721 best practices?

ERC-721 best practices are the working habits that keep an NFT collection safe, honest and tradable. They cover four areas: how the token and its metadata are designed, how royalties and listings work, which security checks the contract must pass, and how minting costs are kept down.

They matter because an NFT is a permanent record on a public chain. Once a token is minted, its history, its metadata link and its contract rules follow it through every sale. A flaw in any of those is hard to fix after buyers have paid.

AreaWhat good looks likeWhat goes wrong if skipped
MetadataStored where it cannot silently changeArtwork or traits change after sale
RoyaltiesRules written in the contractCreators earn nothing on resale
SecurityAudited contract with access controlFunds or tokens are stolen
GasEfficient minting and batchingMinting costs more than the token

The practices below apply to any ERC-721 collection, whether it is art, tickets, memberships or game items. The details differ, but the four areas stay the same. For the basics, see what ERC-721 is and how it works.

How do you design the token and its metadata?

You design the token and its metadata by deciding what the token represents and where its data lives before you write the contract. A token that represents a ticket needs different metadata from one that represents a piece of art, and that choice shapes the contract.

Store metadata where it cannot silently change. A common choice is content-addressed storage, where the link itself is derived from the file, so changing the file breaks the link. Avoid pointing metadata at a server you control, because buyers cannot tell whether the image they saw is the image they will keep.

Keep the metadata simple and complete: name, description, image and the traits that matter for the use case. A ticket needs a date and a seat; a membership needs an expiry. Test the metadata on a testnet and view it in two different wallets before minting, because wallets display traits differently.

Freeze the metadata when the collection is finished, or say clearly that it can change and why. A collection that changes traits after sale breaks trust, while one that says so up front lets buyers decide with open eyes.

How do you handle royalties and marketplace listings?

You handle royalties by writing the royalty rule into the contract and by telling buyers where it applies. The common standard for on-chain royalties lets marketplaces read the rate and the recipient, but not every marketplace enforces it, so the rule is a request rather than a guarantee.

Set one royalty rate for the whole collection and keep it modest. A rate that is too high pushes sales to marketplaces that ignore royalties, while a clear, modest rate is more likely to be honoured. State the rate in the listing and in the collection description so buyers see it before they bid.

List on marketplaces your buyers already use, and check how each one handles your standard. Some marketplaces support the royalty standard and some do not, and the difference shows up in what creators actually receive. Test a listing and a sale on a testnet or with a low-value token before the main launch.

Do not promise royalty income you cannot control. A collection page that claims guaranteed royalties misleads buyers when a marketplace skips them. Say what the contract sets and which marketplaces honour it, and let the buyer decide.

What security checks should every ERC-721 contract pass?

Every ERC-721 contract should pass four security checks before it mints: access control, reentrancy protection, safe transfers and tested minting limits. These are the checks that catch the most expensive bugs, and they cost little to run.

Access control means only the right addresses can mint, pause or change settings. A mint function that anyone can call will be found quickly, and a settings function without a guard is an open door. Use the standard ownership and role patterns rather than writing your own.

Reentrancy protection matters wherever the contract sends funds or calls another contract, such as during a sale or a royalty payout. A reentrancy guard blocks the pattern where a buyer calls back into the contract before the first call finishes. Safe transfer functions also check that the receiver can actually hold an NFT, which stops tokens from being lost to contracts that cannot handle them.

Test the minting limits: a maximum supply, a per-wallet cap and a pause switch. Then get an independent review if the collection holds real value. An audit does not guarantee safety, but it catches the patterns one team misses. For the comparison with the fungible standard, see ERC-20 vs ERC-721.

How do you keep minting costs down?

You keep minting costs down by doing as little work as possible on-chain and by choosing when to mint. Store the heavy data off-chain, keep the contract logic short, and mint in batches where the standard allows it.

Use lazy minting where it fits: the token is created only when a buyer purchases it, so unsold tokens never cost gas. This works well for open collections, though it shifts the minting cost to the buyer, so say so in the listing.

Watch gas prices before a large mint. A mint that can wait a few hours often costs far less than the same mint at a busy hour, and a batch mint on a quiet day can save a meaningful share of the budget. Set a gas budget for the launch and stop if the price passes it.

Consider a layer 2 chain for large or low-price collections, where fees are usually much lower than on mainnet. The trade-off is that buyers need a wallet and funds on that chain, so weigh the saving against the friction for your buyers.

Example (hypothetical): a small gallery plans 500 NFT tickets for an exhibition, each priced at $20. It expects to sell all 500 over two weeks, and each ticket grants entry plus a digital artwork.

The team stores the artwork and ticket metadata in content-addressed storage and freezes it before minting, so no ticket can change after sale. It sets a maximum supply of 500, a cap of 4 tickets per wallet, and a 5 percent royalty written into the contract.

The numbers add up. At $20 each, 500 tickets bring in $10,000. A 5 percent royalty on a $40 resale is $2 per ticket, so if 100 tickets resell, the gallery earns $200 in royalties. Minting in batches of 50 keeps the gas bill in check, and the per-wallet cap stops one buyer from taking the whole run.

After the exhibition, the team checks the contract: 500 minted, no failed transfers, and the metadata links still resolve. The launch works because the team fixed the supply, the metadata and the royalty rules before the first ticket was sold.

What are the common mistakes?

The most common ERC-721 mistakes are changeable metadata, missing access control, and promising royalties the contract cannot enforce. Each one is cheap to prevent and hard to fix after buyers have paid.

  • Pointing metadata at a server you control, so the artwork can change after sale.
  • Leaving the mint function open, so anyone can mint tokens you did not plan.
  • Skipping the reentrancy guard on sales and payouts, which is the most common contract exploit.
  • Promising guaranteed royalties when marketplaces can choose to ignore them.
  • Minting everything at a busy hour and paying more in gas than the tokens are worth.

Avoid these with a short pre-launch checklist: metadata frozen, access control tested, royalty rules stated honestly, and a gas budget set. Run the checklist on a testnet first. For where buyers will trade the tokens, see NFT marketplaces on Ethereum.

Key takeaways

  • Store metadata where it cannot silently change, and freeze it when done
  • Write royalty rules into the contract and state them honestly
  • Check access control, reentrancy and minting limits before launch
  • Use lazy minting, batching and quiet hours to keep gas down
  • A pre-launch checklist on a testnet catches the costliest mistakes

Frequently asked questions

Is ERC-721 only for art NFTs?

No. The standard fits anything unique: event tickets, memberships, game items, certificates and property records. Art was the first popular use, but the same contract pattern works wherever one token must differ from every other token in the collection.

Where should NFT metadata live?

In content-addressed storage, where the link is derived from the file itself, so changing the file breaks the link. Avoid a server you control, because buyers cannot verify that the image they saw is the image they will keep.

Do marketplaces always pay royalties?

No. The common royalty standard lets marketplaces read the rate, but not every marketplace enforces it. Set a clear, modest rate, state it in the listing, and do not promise income the contract cannot guarantee.

What is lazy minting?

Lazy minting creates the token only when a buyer purchases it, so unsold tokens never cost gas. It suits open collections, though it shifts the minting cost to the buyer, so the listing should say so.

How much does it cost to mint an NFT?

It depends on gas prices and the contract. Minting at a busy hour costs far more than minting when the network is quiet, and batching or a layer 2 chain cuts the cost further. Set a gas budget for the launch and check prices before you mint.

Do I need an audit for an NFT contract?

An audit is worth it when the collection holds real value. It finds the patterns one team misses, such as access control gaps and reentrancy risks. Combine it with testnet testing: test first, fix what you find, then get the review.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: blockchain systems in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Planning an NFT collection and want the contract checked? Talk to Hertiv.

A senior engineer replies within one business day. Or see our Smart Contract Development service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to [email protected].

Prefer email? Write to [email protected]
Estimate costBook a call