How to Create an NFT Collection on Ethereum - Complete Guide 2026
DevTools StoreHow to Create an NFT Collection on Ethereum (2026)
Complete guide from contract to mint page. Step by step.
Step 1: Write the Smart Contract
Use OpenZeppelin ERC-721 as base. Add mint function, max supply, mint price, per-wallet limit.
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract MyNFT is ERC721, Ownable {
uint256 public nextTokenId;
uint256 public maxSupply = 10000;
uint256 public mintPrice = 0.01 ether;
bool public mintActive;
constructor() ERC721("MyNFT", "MNFT") Ownable(msg.sender) {}
function mint(uint256 qty) external payable {
require(mintActive);
require(nextTokenId + qty <= maxSupply);
require(msg.value == mintPrice * qty);
for (uint i = 0; i < qty; i++) {
_safeMint(msg.sender, nextTokenId++);
}
}
function toggleMint() external onlyOwner {
mintActive = !mintActive;
}
}Step 2: Upload Metadata to IPFS
Use Pinata or nft.storage. Upload images and JSON metadata. Set baseURI to ipfs://CID/
Step 3: Deploy
forge create --rpc-url $RPC MyNFT
Step 4: Verify on Etherscan
forge verify-contract $RPC MyNFT --etherscan-api-key $KEY
Step 5: Build Mint Page
Use React + ethers.js. Connect MetaMask, call mint function.
Want the complete NFT collection template with whitelist, reveal, royalties, and React mint page? Get all 15+ templates: https://rentry.co/w9gngnqt ($1+)
Free NFT template: https://telegra.ph/Free-NFT-Smart-Contract-Template---ERC-721-2026-05-13