NFTServer Wallet v1
This solutions guide explains how to deploy ERC-721 and ERC-1155 NFTs on the Base Sepolia network using the Coinbase Developer Platform (CDP) SDK and Pinata’s IPFS storage. The app includes a Next.js frontend and Flask backend to manage token metadata, collection deployment, and automatic minting.
Complete Implementation
For a full implementation including:
- IPFS metadata management with Pinata
- React frontend interface
- Token collection management
- Our working demo in the Replit template
- Or the source code in GitHub
This sample app is for demonstration purposes only. Make sure to persist your private keys, and to use testnet. Secure your wallet using best practices. In production, you should use the 2-of-2 CDP Server-Signer with IP whitelisting for your Secret API key for increased security.
Features
- Deploy both ERC-721 and ERC-1155 NFT contracts
- Support for collections with multiple tokens
- Automatic token minting after deployment
- Real-time deployment progress tracking
- Upload and manage token metadata through IPFS via Pinata
- Automatic wallet creation and funding with testnet ETH
Prerequisites
Before you begin, make sure you have the following:- Installed the CDP SDK
- Provision a CDP API Key and Secret API Key.
- Create a Pinata account and get API key, JWT, and Gateway URL for IPFS storage
- Node.js, npm, and Python installed on your system
Step-by-Step Guide
Step 1: Set Up Environment Variables
Define environment variables for both frontend and backend configurations. Frontend.env.local
:
.env
:
Step 2: CDP SDK Implementation
Here’s how to use the CDP SDK to deploy NFT contracts:Step 3: Adding Pinata integration on the frontend
First, configure Pinata SDK in your frontend by creating a configuration file:- Create metadata files for each token
- Upload files to IPFS using Pinata
- Construct proper token URIs
Conclusion
The CDP SDK provides a powerful way to deploy and interact with NFT contracts on Base Sepolia. While this guide focuses on the core contract deployment functionality, the complete implementation in our Replit template shows how to integrate this with IPFS metadata storage and a user interface. If you have any questions or need assistance, feel free to reach out to us in the CDP Discord.This sample app is for demonstration purposes only. Make sure to secure your wallets and use testnet for testing to minimize risks.
Helpful Tips
- Pinata Documentation: Refer to Pinata’s Documentation for details on configuring IPFS storage, setting up your API keys, and optimizing your metadata and file storage processes. Pinata also offers best practices for uploading and managing IPFS files.
- NFT Metadata Standards: To ensure your NFT metadata is compatible across platforms, follow the OpenSea Metadata Standards. These standards cover essential metadata fields (name, description, image) and additional properties that will make your NFTs display correctly on marketplaces like OpenSea.
- CDP Documentation: The CDP SDK Documentation provides a comprehensive guide on wallet and contract interactions. It also covers key aspects like
invoke_contract
for calling arbitrary contracts and read for retrieving state from smart contracts. - IPFS Gateway: For faster access to your IPFS-hosted files, use the Pinata Gateway or consider setting up your own IPFS gateway to reduce potential rate limiting and improve file retrieval times. This can be especially helpful for high-traffic applications