Frontend application for the Wrapped cCOP (wcCOP) cross-chain bridge. For general project information, see the main README.
cd dapp
pnpm install
pnpm dev- Framework: Next.js 15.3.0 with App Router
- Language: TypeScript
- Wallet: Reown AppKit v1.7.10
- Blockchain: Wagmi v2.12.31, Viem v2.21.44
- Farcaster: @farcaster/miniapp-sdk (setup guide)
src/
├── app/ # Next.js App Router
│ ├── layout.tsx # Root layout with providers
│ ├── page.tsx # Main bridge interface
│ └── api/webhook/ # Farcaster webhook endpoint
├── components/ # UI components
│ ├── ConnectButton.tsx
│ ├── WrapperComponent.tsx
│ ├── UnwrapperComponent.tsx
│ └── TokenMenu.tsx
├── config/ # AppKit & wagmi config
├── constants/ # Contract addresses & ABIs
├── context/ # React contexts
│ ├── BalanceContext.tsx
│ └── FarcasterContext.tsx
├── hooks/ # Custom hooks
└── utils/ # Utilities
└── farcaster.ts # Farcaster integration
pnpm dev # Start dev server
pnpm build # Production build
pnpm start # Start production server
pnpm lint # ESLintWallet connection with Farcaster auto-connect support when running as miniapp.
Token wrapping interface with:
- Amount validation
- Chain selection (Base, Arbitrum, Optimism, Avalanche)
- Allowance approval flow
- Gas estimation
Token unwrapping with:
- Balance checking
- Destination address input
- Cross-chain transaction monitoring
Toggle between wrap/unwrap modes with live balance updates.
# .env.local
NEXT_PUBLIC_PROJECT_ID= # Reown project ID (pre-configured)
NEXT_PUBLIC_ENABLE_TESTNETS=Located in src/constants/address.tsx. Automatically selected based on connected network.
- Farcaster Miniapp: See farcaster.md for setup
- Divvi Referral: See divvi-integration.md for details
- Uses CSS Modules for styling
- All providers wrapped in
layout.tsx - Balance context shared across components
- Responsive design for mobile/desktop
- Toast notifications for user feedback
Build Errors: Ensure Node.js ≥18
Wallet Issues: Clear cache, refresh page
Network Issues: Check RPC endpoints
Farcaster: See farcaster.md troubleshooting
For general issues, see main README.