This is a Next.js project bootstrapped with create-next-app
.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx
. The page auto-updates as you edit the file.
This project uses next/font
to automatically optimize and load Geist, a new font family for Vercel.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.
This project supports multiple networks including both mainnet and testnet environments:
- Ethereum
- Arbitrum One
- Base
- Arbitrum Sepolia
- Visual Indicators: Clear testnet indicator in the navbar when using test networks
- Network-Specific Balances: Displays MOR token balances for the appropriate networks
- Contract Address Management: Centralized contract address configuration in
config/networks.ts
- Type Safety: Fully typed with TypeScript for better developer experience
The network functionality is implemented using:
- Configuration: A centralized configuration system in
config/networks.ts
that defines all networks and contract addresses - Wagmi Integration: Uses wagmi hooks for blockchain interactions and network state management
- UI Components:
mor-balance.tsx
: Displays MOR token balances for relevant networkstestnet-indicator.tsx
: Shows a clear visual indicator when on testnet
To access network state and contract addresses in your components:
import { useChainId } from 'wagmi'
import { morTokenContracts } from '@/lib/contracts'
function MyComponent() {
const chainId = useChainId()
const isTestnet = chainId === 421614 // Arbitrum Sepolia
// Use the network state in your component
// ...
}
- Always check the current chainId before making transactions
- Use the contract addresses from config instead of hardcoding addresses
- Handle both mainnet and testnet cases in your components
- Test thoroughly on testnets before deploying to mainnet