$120 tested Claude codes · real before/after data · Full tier $15 one-timebuy --sheet=15 →
$Free 40-page Claude guide — setup, 120 prompt codes, MCP servers, AI agents. download --free →
clskills.sh — terminal v2.4 — 2,347 skills indexed● online
[CL]Skills_
Web3 & BlockchainadvancedNew

NFT Contract

Share

Create ERC-721/1155 NFT smart contract

Works with OpenClaude

You are a Solidity smart contract developer specializing in NFT standards. The user wants to create a production-ready ERC-721 or ERC-1155 NFT smart contract with minting, burning, and metadata capabilities.

What to check first

  • Verify you have @openzeppelin/contracts installed: npm list @openzeppelin/contracts
  • Confirm Solidity compiler version is 0.8.0 or higher in hardhat.config.js or truffle-config.js
  • Check if you need batch operations (ERC-1155) or single NFTs per token ID (ERC-721)

Steps

  1. Import the correct OpenZeppelin contract: ERC721 for single NFTs or ERC1155 for multi-supply tokens
  2. Inherit from ERC721URIStorage (for ERC-721) or ERC1155 to handle token metadata/URIs
  3. Add a _tokenIdCounter state variable (for ERC-721) or track balances automatically (ERC-1155)
  4. Implement mint() function that calls _safeMint() with recipient address, token ID, and URI
  5. Set the baseURI in constructor or via setter function for consistent metadata paths
  6. Add access control using Ownable to restrict minting to contract owner
  7. Implement burn() function with proper token ownership verification
  8. Include supportsInterface() for ERC-721 metadata or ERC-1155 compatibility checks

Code

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";

contract MyNFT is ERC721, ERC721URIStorage, ERC721Burnable, Ownable {
    using Counters for Counters.Counter;
    
    Counters.Counter private _tokenIdCounter;
    string private _baseTokenURI;
    
    event TokenMinted(address indexed to, uint256 indexed tokenId, string uri);
    event BaseURIUpdated(string newBaseURI);
    
    constructor(string memory baseURI) ERC721("MyNFT", "MNFT") {
        _baseTokenURI = baseURI;
    }
    
    function mint(address to, string memory uri) public onlyOwner returns (uint256) {
        uint256 tokenId = _tokenIdCounter.current();
        _tokenIdCounter.increment();
        
        _safeMint

Note: this example was truncated in the source. See the GitHub repo for the latest full version.

Common Pitfalls

  • Treating this skill as a one-shot solution — most workflows need iteration and verification
  • Skipping the verification steps — you don't know it worked until you measure
  • Applying this skill without understanding the underlying problem — read the related docs first

When NOT to Use This Skill

  • When a simpler manual approach would take less than 10 minutes
  • On critical production systems without testing in staging first
  • When you don't have permission or authorization to make these changes

How to Verify It Worked

  • Run the verification steps documented above
  • Compare the output against your expected baseline
  • Check logs for any warnings or errors — silent failures are the worst kind

Production Considerations

  • Test in staging before deploying to production
  • Have a rollback plan — every change should be reversible
  • Monitor the affected systems for at least 24 hours after the change

Quick Info

Difficultyadvanced
Version1.0.0
AuthorClaude Skills Hub
web3nfterc721

Install command:

curl -o ~/.claude/skills/nft-contract.md https://claude-skills-hub.vercel.app/skills/web3/nft-contract.md

Related Web3 & Blockchain Skills

Other Claude Code skills in the same category — free to download.

Want a Web3 & Blockchain skill personalized to YOUR project?

This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.