Skip to main content

ERC-721 NFT Contract

A simple non-fungible token (NFT) contract with minting functionality. A simple non-fungible token (NFT) contract with minting functionality.

Explanation

This contract creates a basic NFT collection. How it works:
  • Uses a Counters library to auto-increment token IDs.
  • Each mint() call creates a new unique token assigned to recipient.
  • Inherits all ERC-721 standard behavior from OpenZeppelin.
In production, you’d add token URI management (metadata), mint price, and supply limits.

Code


Canonical knowledge ID: code-example:erc-721-nft-contract