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
src/Nft.sol: Minimal ERC-721 withmint(tokenUri)and an on-chain token URI mappingscript/DeployNft.s.sol: Deploy script (Foundryforge script)script/Interactions.s.sol: Example mint script (usesfoundry-devopsto load last deployment)frontend/: Next.js app (wallet connect + mint form +/api/uploadfor Pinata uploads)
- Foundry (
forge,anvil,cast): https://book.getfoundry.sh/getting-started/installation - Node.js (LTS recommended) + npm
- Git
If you cloned without submodules:
git submodule update --init --recursiveCreate local env files from the examples:
cp .env.example .env
cp frontend/.env.example frontend/.envmake anvil
make deploy-anvilUpdate the deployed contract address in frontend/src/lib/contractAddresses.js (chain id 31337 for Anvil), then:
cd frontend
npm install
npm run devOpen http://localhost:3000.
- Set
SEPOLIA_RPC_URL+ETHERSCAN_API_KEYin.env - Ensure you have a Foundry keystore account named
sepkey(the Makefile uses--account sepkey) - Deploy + verify:
make deploy-sepolia- Contracts:
forge build,forge test,forge fmt - Make targets:
make build,make test,make format,make deploy-anvil,make mint-nft
- Do not commit real secrets:
.env,frontend/.env, API keys, private keys, JWTs. - This repo includes
.env.examplefiles for reproducible setup without exposing credentials.
src/: Solidity contractsscript/: Foundry scripts (deploy + interactions)test/: Foundry testsfrontend/: Next.js dApp