An interactive frame viewer with smart contract integration, wallet connection, and gasless transactions using Privy and Pimlico.
- 🎬 Interactive frame viewer (162 frames)
- 💰 Smart contract integration with MON token deposits
- 🔗 Wallet connection via Privy
- ⛽ Gasless transactions via Pimlico
- 🎯 Account Abstraction (ERC-4337) support
npm installCreate a .env.local file in the root directory:
# Pimlico API Key - Get from https://console.pimlico.io/
NEXT_PUBLIC_PIMLICO_API_KEY=your_pimlico_api_key_here
# Privy App ID - Get from https://console.privy.io/
NEXT_PUBLIC_PRIVY_APP_ID=your_privy_app_id_here
# Enable Monad Games ID cross-app login (Provider App ID)
NEXT_PUBLIC_MONAD_GAMES_CROSS_APP_ID=cmd8euall0037le0my79qpz42
# Server wallet private key (game submitter, never expose on client)
SERVER_SUBMITTER_PRIVATE_KEY=your_hex_private_key_without_0x
# Monad Games ID contract
MONAD_GAMES_ID_CONTRACT=0xceCBFF203C8B6044F52CE23D914A1bfD997541A4- Go to Pimlico Console
- Sign up/Login
- Create a new project
- Copy your API key
- Add it to
.env.local
- Go to Privy Console
- Create a new app
- Copy your App ID
- Add it to
.env.local
Deploy the NewFrameViewer.sol contract to Monad testnet and update the contract address in pages/index.js.
npm run devCause: Gas limits are set to 0 or Pimlico API key is invalid.
Solutions:
- Check your Pimlico API key is correct
- Ensure you have sufficient funds in your wallet
- Check browser console for detailed error messages
Cause: Missing dependencies or incorrect configuration.
Solutions:
- Run
npm installto install all dependencies - Check your environment variables are set correctly
- Ensure you're connected to Monad testnet
Cause: Contract address is incorrect or contract is not deployed.
Solutions:
- Verify the contract address in
pages/index.js - Ensure the contract is deployed to Monad testnet
- Check you have MON tokens in your wallet
-
Check Console Logs: Open browser dev tools and check the console for detailed error messages.
-
Test Smart Account: Use the "Test Smart Account" button to verify the setup.
-
Verify Environment Variables: Ensure your API keys are correctly set in
.env.local. -
Check Network: Make sure you're connected to Monad testnet (chain ID: 10143).
-
Verify Contract: Ensure your smart contract is deployed and the address is correct.
If you encounter gas estimation problems:
- The app includes fallback gas prices for Monad testnet
- Check that Pimlico supports Monad testnet
- Try with smaller transaction amounts first
The NewFrameViewer.sol contract allows users to:
- Deposit MON tokens
- View frames (costs 0.001 MON per frame)
- Batch view multiple frames
- Withdraw deposited tokens
- Frontend: Next.js, React
- Wallet: Privy (embedded wallets)
- Smart Account: Pimlico (Account Abstraction)
- Blockchain: Monad testnet
- Smart Contracts: Solidity, OpenZeppelin
├── contracts/ # Smart contracts
├── pages/ # Next.js pages
├── public/ # Static assets (frames)
├── styles/ # CSS styles
├── utils/ # Utility functions
└── package.json # Dependencies
pages/index.js- Main applicationutils/pimlico.js- Pimlico smart account setuputils/chains.js- Chain configurationcontracts/NewFrameViewer.sol- Smart contract
If you encounter issues:
- Check the browser console for error messages
- Verify all environment variables are set
- Ensure you have MON tokens in your wallet
- Check that the smart contract is deployed correctly
ISC