A comprehensive decentralized application (DApp) for managing cross-chain fungible tokens built with React, TypeScript, and Web3 technologies. This platform enables seamless token transfers across multiple blockchain networks using LayerZero V2 OFT (Omnichain Fungible Token) standard.
- Cross-Chain Token Management: Transfer tokens seamlessly across Ethereum Sepolia, Optimism Sepolia, Arbitrum Sepolia, and Base Sepolia
- Web3 Wallet Integration: Connect with popular wallets using RainbowKit
- Real-Time Balance Tracking: Monitor token balances across all supported networks
- Bridge Functionality: Intuitive interface for cross-chain token transfers
- Token Purchase Interface: Buy tokens directly through the platform
- Responsive Design: Modern UI built with shadcn/ui and Tailwind CSS
- Dark Theme Support: Built-in dark mode with next-themes
- Type-Safe Development: Full TypeScript support throughout the application
- React 18 - Modern React with hooks and concurrent features
- TypeScript - Type-safe development environment
- Vite - Fast build tool and development server
- Tailwind CSS - Utility-first CSS framework
- shadcn/ui - High-quality, accessible UI components
- React Router - Client-side routing
- Wagmi - React hooks for Ethereum
- RainbowKit - Wallet connection interface
- Ethers.js - Ethereum library for blockchain interactions
- Viem - TypeScript interface for Ethereum
- LayerZero V2 OFT - Cross-chain token standard
- Foundry - Smart contract development framework
- OpenZeppelin - Secure smart contract libraries
- Node.js 18+ and npm
- Git
- A Web3 wallet (MetaMask, WalletConnect, etc.)
- Test ETH on supported networks
-
Clone the repository
git clone <YOUR_GIT_URL> cd <YOUR_PROJECT_NAME>
-
Install dependencies
npm install
-
Start the development server
npm run dev
-
Open your browser Navigate to
http://localhost:8080
The project includes a complete smart contract setup in the contracts/ directory. See the Smart Contract Documentation for detailed deployment instructions.
βββ src/
β βββ components/ # Reusable UI components
β β βββ ui/ # shadcn/ui components
β β βββ Navbar.tsx # Navigation component
β β βββ Footer.tsx # Footer component
β βββ pages/ # Application pages
β β βββ Index.tsx # Home page
β β βββ Balance.tsx # Balance tracking page
β β βββ Bridge.tsx # Cross-chain bridge interface
β β βββ Buy.tsx # Token purchase page
β β βββ Documentation.tsx # Documentation page
β βββ hooks/ # Custom React hooks
β βββ lib/ # Utility libraries and configurations
β β βββ wagmi.ts # Wagmi configuration
β βββ constants/ # Application constants
β βββ main.tsx # Application entry point
βββ contracts/ # Smart contract code (Foundry project)
β βββ src/ # Solidity contracts
β βββ script/ # Deployment scripts
β βββ test/ # Contract tests
β βββ foundry.toml # Foundry configuration
βββ public/ # Static assets
βββ package.json # Project dependencies and scripts
npm run dev- Start development server with hot reloadnpm run build- Build production bundlenpm run build:dev- Build development bundlenpm run lint- Run ESLint for code qualitynpm run preview- Preview production build locally
| Network | Chain ID | LayerZero Endpoint ID | Status |
|---|---|---|---|
| Ethereum Sepolia | 11155111 | 40161 | β Active |
| Optimism Sepolia | 11155420 | 40232 | β Active |
| Arbitrum Sepolia | 421614 | 40231 | β Active |
| Base Sepolia | 84532 | 40245 | β Active |
- React (^18.3.1) - UI library
- TypeScript (^5.8.3) - Type safety
- Vite (^5.4.19) - Build tool
- @rainbow-me/rainbowkit (^2.2.9) - Wallet connection
- wagmi (^2.19.2) - React hooks for Ethereum
- ethers (^6.15.0) - Ethereum library
- viem (^2.38.6) - TypeScript Ethereum interface
- @radix-ui/react-* - Accessible UI primitives
- tailwindcss (^3.4.17) - CSS framework
- lucide-react (^0.462.0) - Icon library
- next-themes (^0.3.0) - Theme management
- @tanstack/react-query (^5.90.7) - Server state management
- react-hook-form (^7.61.1) - Form handling
- zod (^3.25.76) - Schema validation
The application uses shadcn/ui components built on top of Radix UI primitives:
- Navigation: Responsive navbar with wallet connection
- Forms: Type-safe forms with validation
- Dialogs & Modals: Accessible overlay components
- Data Display: Tables, cards, and charts for token information
- Feedback: Toast notifications and loading states
- Type Safety: Full TypeScript coverage prevents runtime errors
- Input Validation: Zod schemas for all user inputs
- Secure Wallet Integration: Industry-standard wallet connection patterns
- Smart Contract Security: OpenZeppelin libraries and LayerZero standards
- Environment Variables: Secure configuration management
- Build the project:
npm run build - Deploy the
dist/folder to your hosting provider - Configure environment variables for production
- Start the dev server:
npm run dev - Make changes: Edit files in
src/ - Hot reload: Changes appear instantly in browser
- Type checking: TypeScript provides real-time error checking
- ESLint: Automated code quality checks
- TypeScript: Compile-time error detection
- Prettier: Code formatting (configured in editor)
- Smart Contracts: Use Foundry for contract testing
- Frontend: Add React Testing Library for component tests
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Run linting:
npm run lint - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
- Use TypeScript for all new code
- Follow existing component patterns
- Add proper type definitions
- Include JSDoc comments for complex functions
- LayerZero V2 Documentation
- Wagmi Documentation
- RainbowKit Documentation
- shadcn/ui Documentation
- Vite Documentation
- Smart Contract README
Wallet Connection Issues
- Ensure you're on a supported network
- Check that your wallet has test ETH
- Try refreshing the page and reconnecting
Build Errors
- Clear node_modules:
rm -rf node_modules && npm install - Check TypeScript errors:
npx tsc --noEmit - Verify all dependencies are installed
Cross-Chain Transfer Issues
- Ensure smart contracts are properly deployed
- Check LayerZero message status on LayerZero Scan
- Verify you have sufficient gas on both chains
This project is licensed under the MIT License - see the LICENSE file for details.
- UI components from shadcn/ui
- Cross-chain functionality powered by LayerZero
- Web3 integration via RainbowKit and Wagmi