Introduction

NFTs have become one of the most exciting parts of the Web3 world. And now, thanks to Base, deploying your own NFT collection is easier and cheaper than ever. Base is built on the OP Stack and is fully compatible with Ethereum tools, so you can use everything you already know, just faster and with lower fees.

In this article, we will cover

Let’s get started!

Step 1. Project Setup

Tools you will need:

Initialize the project

mkdir base-nft-collection
cd base-nft-collection
npm init -y
npm install --save-dev hardhat
npx hardhat

Choose “Create a basic sample project.”

Step 2. Install NFT Dependencies

npm install @openzeppelin/contracts dotenv @nomicfoundation/hardhat-toolbox

These give you

Step 3. Create Your NFT Contract

In the /contracts folder, create a file: MyNFT.sol

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

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

contract MyNFT is ERC721URIStorage, Ownable {
    uint256 public tokenCounter;

    constructor(address initialOwner) ERC721("MyBaseNFT", "MBNFT") Ownable(initialOwner) {
        tokenCounter = 0;
    }

    function mintNFT(address to, string memory tokenURI) public onlyOwner {
        _safeMint(to, tokenCounter);
        _setTokenURI(tokenCounter, tokenURI);
        tokenCounter++;
    }
}

This smart contract lets the owner mint ERC-721 NFTs with a custom URI for each one. It's perfect for creating a small NFT collection where the owner controls all minting.

Step 4. Upload Metadata to IPFS

Use Pinata or NFT.Storage to upload

{
  "name": "Base NFT #1",
  "description": "This is my first NFT on Base",
  "image": "ipfs://Qm...yourImageHash"
}

Upload and copy the IPFS CID (link) for each file.

Pinata

Step 5. Write Deployment Script

Create a file scripts/deploy.js

async function main() {
  const [deployer] = await ethers.getSigners();

  const NFT = await ethers.getContractFactory("MyNFT");
  const contract = await NFT.deploy(deployer.address);
  await contract.waitForDeployment();

  console.log("✅ Contract deployed by:", deployer.address);
  console.log("📍 Contract deployed to:", await contract.getAddress());
}

main().catch((error) => {
  console.error(error);
  process.exitCode = 1;
});

Step 6. Hardhat Configuration

In your hardhat.config.js

require("@nomicfoundation/hardhat-toolbox");

module.exports = {
  solidity: {
    version: "0.8.20",
    settings: {
      optimizer: {
        enabled: true,
        runs: 200,
      },
    },
  },
  networks: {
    baseSepolia: {
      url: "https://sepolia.base.org", // Use your correct RPC here
      accounts: ["72c32e19f598a84a5083e124f627a48d33fe4181af00392cff9a90d7f438bb3e"]  // Don't forget to replace this
    }
  }
};

Make sure you have .env with

PRIVATE_KEY=your_wallet_private_key

Step 7. Get Test ETH on Base

Go to the Base Sepolia Faucet, connect your wallet, and get test ETH

Base Sepolia Faucet

Step 8. Deploy Your NFT Contract

npx hardhat run scripts/deploy.js --network baseSepolia

Here, you can see that the contract is successfully deployed.

Deploy

Step 9. Mint Your NFTs

You can now mint NFTs by calling mintNFT() with:

Use Hardhat console or write another script like scripts/mint.js.

Example

const contract = await ethers.getContractAt("MyNFT", "YOUR_CONTRACT_ADDRESS");
await contract.mintNFT("YOUR_WALLET_ADDRESS", "ipfs://...yourMetadataLink");

Step 10. List NFTs on a Marketplace

After deployment and minting, you can list your NFTs on Base-supported marketplaces like:

If you want, you can also sell your NFT like this

NFT-Sale

Final Thoughts

Creating and launching an NFT collection on Base is easier, faster, and cheaper than on Ethereum. With tools like Hardhat, OpenZeppelin, and IPFS, you don’t need to be a blockchain expert to build something great. This article gave you everything you need to write an NFT smart contract, upload metadata, Mint your collection, and prepare for public sales.