Non-Fungible token

Contract Summary

A complete implementation of a SIP-009 compliant non-fungible token (NFT) contract with minting capabilities and collection limits. This contract serves as a foundational template for creating NFT collections on the Stacks blockchain.

What this contract does:

  • Implements the full SIP-009 NFT standard trait

  • Creates a limited NFT collection (1000 tokens maximum)

  • Enables the contract owner to mint NFTs to recipients

  • Tracks the last minted token ID for sequential minting

  • Provides NFT ownership queries and transfers

  • Stores metadata URI pointing to off-chain JSON

  • Prevents minting beyond the collection limit

  • Restricts minting to the contract deployer only

  • Ensures only token owners can transfer their NFTs

What developers can learn:

  • How to implement the SIP-009 non-fungible token trait correctly

  • Defining NFTs with define-non-fungible-token using uint identifiers

  • Built-in Clarity functions for NFT operations (nft-mint?, nft-transfer?, nft-get-owner?)

  • Sequential ID generation pattern for minting

  • Collection size limits and sold-out prevention

  • Owner-only minting access control

  • Token ownership verification before transfers

  • Metadata URI management for off-chain content

  • Using data variables to track minting state

  • Returning standardized responses for trait compliance

  • Filter annotations for security (#[filter(sender)])

Was this helpful?