Skip to content

A full-stack custom NFT minter: ERC‑721 contract built with Foundry + a Next.js UI that uploads metadata to IPFS (Pinata) and mints on chain.

Notifications You must be signed in to change notification settings

abubakar-tq/MintLab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Custom NFT Minting dApp (Foundry + Next.js)

End-to-end NFT minting project:

  • Smart contracts: ERC-721 written in Solidity and tested/deployed with Foundry
  • Frontend: Next.js UI that uploads NFT media + metadata to IPFS via Pinata and mints on-chain via wagmi

What’s Included

  • src/Nft.sol: Minimal ERC-721 with mint(tokenUri) and an on-chain token URI mapping
  • script/DeployNft.s.sol: Deploy script (Foundry forge script)
  • script/Interactions.s.sol: Example mint script (uses foundry-devops to load last deployment)
  • frontend/: Next.js app (wallet connect + mint form + /api/upload for Pinata uploads)

Quick Start (Local)

Prerequisites

1) Clone with submodules

If you cloned without submodules:

git submodule update --init --recursive

2) Environment variables

Create local env files from the examples:

cp .env.example .env
cp frontend/.env.example frontend/.env

3) Run a local chain + deploy

make anvil
make deploy-anvil

4) Run the frontend

Update the deployed contract address in frontend/src/lib/contractAddresses.js (chain id 31337 for Anvil), then:

cd frontend
npm install
npm run dev

Open http://localhost:3000.

Sepolia Deployment (Optional)

  1. Set SEPOLIA_RPC_URL + ETHERSCAN_API_KEY in .env
  2. Ensure you have a Foundry keystore account named sepkey (the Makefile uses --account sepkey)
  3. Deploy + verify:
make deploy-sepolia

Useful Commands

  • Contracts: forge build, forge test, forge fmt
  • Make targets: make build, make test, make format, make deploy-anvil, make mint-nft

Security Notes

  • Do not commit real secrets: .env, frontend/.env, API keys, private keys, JWTs.
  • This repo includes .env.example files for reproducible setup without exposing credentials.

Repo Structure

  • src/: Solidity contracts
  • script/: Foundry scripts (deploy + interactions)
  • test/: Foundry tests
  • frontend/: Next.js dApp

About

A full-stack custom NFT minter: ERC‑721 contract built with Foundry + a Next.js UI that uploads metadata to IPFS (Pinata) and mints on chain.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published