This project provides a template for deploying NFTs on Base Sepolia using the Coinbase Developer Platform (CDP) SDK and Pinata IPFS storage.
You can find the live version of this tool here: Replit Template
- Main application logic and UI
- Handles metadata creation and file preparation
- Manages Pinata IPFS uploads via
pinata.upload.fileArray() - Creates proper token URI structure for NFT contracts
- Flask server implementation
- Integrates CDP SDK for contract deployment
- Handles wallet creation and funding
- Manages contract deployment and token minting
- Processes both ERC-721 and ERC-1155 deployments
utils/pinataConfig.ts: Pinata SDK setup and type definitions.env: Environment variables for both frontend and backendnext.config.ts: Next.js configuration including API routes
- Deploy ERC-721 and ERC-1155 NFT smart contracts
- Upload and manage token metadata through IPFS via Pinata
- Support for both single and multi-token collections
- Proper token URI structure with
<base-uri>/<token-id>format - Automatic token minting post-deployment
- Real-time deployment progress tracking
- Testnet ETH funding via CDP faucet
- Located in:
app/page.tsx(metadata creation and Pinata upload) - Files are uploaded using Pinata's
fileArray()function - Each token's metadata file is named numerically (e.g.,
1,2,3) - No file extensions are used as per IPFS best practices
- Located in:
api/index.py(CDP SDK integration) - Base URI format:
ipfs://<hash>/ - Token URIs are automatically constructed as
<base-uri>/<token-id> - ERC-721: Single token minted with ID 1
- ERC-1155: Sequential tokens minted based on collection size
-
Clone the Repo: Click “Use Template” or “Fork” this repository to your Replit account.
-
Provision API Keys:
- CDP API Key: Create an API key on the Coinbase Developer Platform.
- Pinata API Keys: Obtain your JWT and gateway settings from Pinata.
-
Set Environment Variables:
-
Open the Secrets panel in Replit.
-
Add the following secrets:
CDP_API_KEY_NAME: Your CDP API key nameCDP_API_PRIVATE_KEY: Your CDP private keyNEXT_PUBLIC_PINATA_JWT: Your Pinata JWT tokenNEXT_PUBLIC_PINATA_GATEWAY: Your Pinata gateway URL
-
-
Install Dependencies:
- Run the following in the Replit shell or ensure they’re in the
replit.nixfile if needed:
npm install # or yarn # or pnpm install
- Run the following in the Replit shell or ensure they’re in the
-
Run Development Server:
- Start the server with:
npm run dev # or yarn dev # or pnpm dev
NEXT_PUBLIC_PINATA_JWT=Your Pinata JWT token
NEXT_PUBLIC_PINATA_GATEWAY=Your Pinata gateway URL
CDP_API_KEY_NAME=Your CDP API key name
CDP_API_PRIVATE_KEY=Your CDP private key
- Enter metadata for one or more tokens (name, description, image URL, attributes)
- Select contract type (ERC-721 for single tokens or ERC-1155 for multi-token collections)
- Deploy contract - this will:
- Upload metadata to IPFS with proper token ID structure
- Create and fund a testnet wallet
- Deploy the contract with correct base URI
- Mint tokens automatically
- View deployed contract and token metadata on BaseScan/IPFS
Feel free to submit issues or pull requests. For feature requests specific to the CDP SDK, use the CDP SDK Discord Channel.
- Coinbase Developer Platform Documentation
- Pinata Documentation
- Project GitHub Repository
- Replit Template
Disclaimer: This application is for educational purposes. Adapt and secure before production use.