A simple dApp for creating ERC-20 tokens on the Polygon network.
- Create a
.env.localfile in the root directory of your project. - Add the following environment variables:
NEXT_PUBLIC_POLYGON_RPC_URL=https://polygon-rpc.com/ NEXT_PUBLIC_PROJECT_ID=your_walletconnect_project_id
-
NEXT_PUBLIC_POLYGON_RPC_URL: You can as well replace this with the Polygon RPC URL connet your own(e.g., from Alchemy or Infura or Quicknode) -
NEXT_PUBLIC_PROJECT_ID: Obtain your WalletConnect Project ID by creating an account at WalletConnect Cloud.
-
Run the following command to install the required dependencies:
npm install
# or
yarn To run the application locally, use:
npm run dev
# or
yarn dev- The app will be available at http://localhost:3000 or http://localhost:3001.
- Connect Your Wallet: Ensure your wallet (e.g., MetaMask) is connected to the Polygon network.
- Check Gas Fees: Make sure you have enough POL (Polygon's native token) in your wallet to cover gas fees.
- Create a Token: Fill in the token details (name, symbol, supply) and click "Create Token."
- Install the Vercel CLI if you haven’t already:
npm install -g vercel # or yarn global add vercel
-
Login to Vercel: Run the following command and follow the prompts to log in:
vercel login
-
Deploy Your Project: Navigate to your project's root directory and run:
vercel
- Follow the prompts to link your project to Vercel.
- If this is your first deployment, Vercel will guide you through the setup process.
-
Deploy to Production: Once the initial deployment is complete, you can deploy to production using:
vercel --prod
-
Environment Variables:
- If you haven’t added your environment variables to Vercel, you can do so via the Vercel dashboard or the CLI:
vercel env add
- Add the same variables you used in
.env.local(NEXT_PUBLIC_POLYGON_RPC_URLandNEXT_PUBLIC_PROJECT_ID).
- If you haven’t added your environment variables to Vercel, you can do so via the Vercel dashboard or the CLI:
-
Access Your Deployed App:
- After deployment, Vercel will provide you with a live URL for your app.
- Ensure your wallet is configured for the Polygon network before using the dApp.
- For production deployments, consider using a secure RPC provider and managing your environment variables securely.