A modern React-based frontend for the Omakase cross-chain staking protocol, built with Next.js 14, TypeScript, and Tailwind CSS. This interface enables seamless staking operations across Ethereum Sepolia, Base Sepolia, and Arbitrum Sepolia testnets using LayerZero and Circle CCTP technologies.
Omakase Protocol is an MVP demonstration of a cross-chain staking protocol that leverages LayerZero's OFT (Omnichain Fungible Token) standard and Circle's Cross-Chain Transfer Protocol (CCTP) to enable unified staking experiences across multiple blockchain networks. The protocol uses Base Sepolia as its hub chain for centralized processing while supporting staking operations on Ethereum Sepolia and Arbitrum Sepolia.
-
LayerZero Integration:
- OFT (Omnichain Fungible Token) Standard for cross-chain token transfers
- Message Compose for reliable cross-chain communication
- Secure message passing between testnets for staking operations
-
Circle CCTP & Gas Master:
- USDC reward distribution across all supported testnets
- Gas Master integration for USDC-based transaction fees
- Unified reward system regardless of staking origin chain
-
Hub-Chain Architecture:
- Base Sepolia serves as the central hub for all staking logic
- Cross-chain state management across all supported networks
- Efficient reward calculations and message orchestration
- Supported Networks: Ethereum Sepolia, Base Sepolia, Arbitrum Sepolia
- Flexible Staking: No fixed staking periods, stake and unstake anytime
- Cross-Chain Rewards: Claim USDC rewards on any supported network
- Real-Time Updates: Live reward calculations and balance updates
- Network Switching: Seamless switching between supported testnets
- Responsive Design: Mobile-first approach with modern UI components
- Transaction Tracking: LayerZero Scan integration for cross-chain message monitoring
- Stake: Lock OMA tokens to earn continuous USDC rewards
- Unstake: Initiate withdrawal with configurable lock period (15 seconds for demo)
- Withdraw: Retrieve staked tokens after lock period expires
- Claim Rewards: Collect accumulated USDC rewards on any supported chain
- Cancel Unstake: Option to cancel unstake requests by staking additional tokens
- Next.js 14: App Router with React Server Components
- TypeScript: Full type safety throughout the application
- Tailwind CSS: Utility-first CSS framework for styling
- Wagmi v2: React hooks for Ethereum interactions
- Viem: TypeScript interface for Ethereum
- RainbowKit: Wallet connection and management
- React Query: Data fetching and caching for blockchain data
- Radix UI: Headless component primitives
- Lucide React: Beautiful SVG icons
- React Hot Toast: Toast notifications
- Custom Components: Purpose-built UI components for staking operations
- React Hooks: Custom hooks for staking operations and contract interactions
- Wagmi State: Blockchain state management and caching
- Local State: Component-level state for UI interactions
- Node.js 18+ and npm/yarn
- MetaMask or compatible Ethereum wallet
- Access to supported testnets:
- Ethereum Sepolia
- Base Sepolia
- Arbitrum Sepolia
# Clone the repository
git clone <repository-url>
cd omakase-frontend-v1
# Install dependencies
npm install
# or
yarn install
# Set up environment variables
cp .env.example .env.local
Create a .env.local
file with the following variables:
# RPC URLs
NEXT_PUBLIC_ETHEREUM_SEPOLIA_RPC=your_ethereum_sepolia_rpc
NEXT_PUBLIC_ARBITRUM_SEPOLIA_RPC=your_arbitrum_sepolia_rpc
NEXT_PUBLIC_BASE_SEPOLIA_RPC=your_base_sepolia_rpc
# Contract Addresses
NEXT_PUBLIC_ETHEREUM_SEPOLIA_WAITER_ADDRESS=your_waiter_contract_address
NEXT_PUBLIC_ARBITRUM_SEPOLIA_WAITER_ADDRESS=your_waiter_contract_address
NEXT_PUBLIC_BASE_SEPOLIA_CHEF_ADDRESS=your_chef_contract_address
First, run the development server:
npm run 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.
# Build for production
npm run build
# or
yarn build
# Start production server
npm start
# or
yarn start
The frontend interacts with the following smart contracts:
- Omakase Token (ERC20):
0x2dA943A5E008b9A85aA0E80F0d7d8d53a4945b2D
- Native token - LayerZero Adapter:
0x5132f64f01140C4EfCdEbfcFe769c69E023cd694
- Cross-chain bridge adapter - Waiter Contract:
0xCccBc8e303E254c854bC132A5c9e4d477b6288c8
- Cross-chain message handler
- Omakase OFT:
0x3b6Be820c586B7235e19c7956e9408879A0F6065
- LayerZero OFT token - Waiter Contract:
0xCccBc8e303E254c854bC132A5c9e4d477b6288c8
- Cross-chain message handler
- Omakase OFT:
0x3b6Be820c586B7235e19c7956e9408879A0F6065
- LayerZero OFT token - Chef Contract:
0xcaa8340AA4a760cF83D9e712597AD045fA1b3C50
- Main staking logic contract
- Ethereum Sepolia: Native ERC20 token + Waiter for cross-chain operations
- Arbitrum Sepolia: OFT token + Waiter for cross-chain operations
- Base Sepolia: OFT token + Chef contract (central staking hub)
- Staking Data: Always queries Chef contract on Base Sepolia (regardless of current chain)
- Token Balances: Queries native ERC20 on Ethereum Sepolia, OFT contracts on other chains
- Cross-chain Operations: Uses appropriate Waiter contracts on source chains
- Ethereum Sepolia:
40161
- Arbitrum Sepolia:
40231
- Base Sepolia:
40245
(Hub Chain)
useStaking
(src/hooks/useStaking.ts
): Main staking operations and state managementuseContract
(src/hooks/useContract.ts
): Contract interaction utilitiesuseUnstakeCountdown
: Real-time countdown for unstake lock periodsuseRealtimeRewards
: Live reward calculations
StakeForm
(src/components/stakeForm.tsx
): Staking interface with amount input and validationStakingDashboard
(src/components/stakingDashboard.tsx
): Current position and reward displayNetworkSelector
(src/components/networkSelector.tsx
): Network switching functionalityLayerZeroScanButton
(src/components/LayerZeroScanButton.tsx
): Cross-chain message tracking
- Token Utils (
src/lib/tokenUtils.ts
): Token amount formatting and parsing - Constants (
src/lib/constants.ts
): Network configurations and staking parameters - Error Handling (
src/lib/error.ts
): Comprehensive error management
- User connects wallet and selects network
- Approves OMA token spending (if needed)
- Calls stake function on Waiter contract
- LayerZero message sent to Chef contract on Base Sepolia
- Tokens locked and reward calculation begins
- User initiates unstake on any supported network
- Unstake message sent to Chef contract via LayerZero
- 15-second lock period begins (configurable)
- Reward calculation stops for the position
- User claims rewards on any supported network
- Claim message sent to Chef contract
- USDC rewards distributed via Circle CCTP
- USDC minted to user's wallet on claim network
- No Lock Periods: Stake and unstake anytime
- Cross-Chain Claims: Claim rewards on any supported network
- Unstake Cancellation: Cancel unstake requests by staking additional tokens
- Real-Time Rewards: Continuous reward calculation (100 BP/second)
- USDC Rewards: All rewards paid in stable USDC
- APR Calculation: Dynamic APR based on current staking parameters
- Compound Growth: Rewards automatically compound over time
- Instant Claims: Claim accumulated rewards without affecting stake
- Cross-Chain Messages: View all LayerZero messages via integrated scanner
- Transaction Tracking: Real-time status updates for cross-chain operations
- Error Handling: Comprehensive error messages and recovery options
- Console Logging: Detailed logs for debugging contract interactions
- Type Safety: Full TypeScript coverage for better development experience
- Hot Reload: Instant updates during development
- Ethereum Sepolia: Native OMA token with LayerZero adapter
- Arbitrum Sepolia: OFT implementation for cross-chain functionality
- Base Sepolia: Hub chain with central Chef contract
- Automatic network detection and switching prompts
- Network-specific token information and contract addresses
- Cross-chain operation support regardless of current network
- Type-Safe Contracts: Full TypeScript interfaces for all contract interactions
- Error Boundaries: Comprehensive error handling for failed transactions
- Transaction Validation: Pre-flight checks for all operations
- Amount Validation: Input validation for all staking amounts
- Balance Checks: Automatic balance verification before operations
- Confirmation Dialogs: User confirmation for critical operations
- Gas Estimation: Automatic gas estimation for transactions
- 1inch Integration: Direct token swapping within the interface
- Advanced Analytics: Detailed staking history and performance metrics
- Mobile App: React Native application for mobile users
- Governance: Token holder voting and protocol governance
- Performance Optimization: Advanced caching and state management
- Additional Networks: Support for more blockchain networks
- Enhanced UI: Advanced charting and visualization components
To learn more about the technologies used in this project:
- Next.js Documentation - learn about Next.js features and API
- Wagmi Documentation - React hooks for Ethereum
- LayerZero Docs - Cross-chain infrastructure
- Circle CCTP - Cross-chain USDC transfers
This project uses next/font
to automatically optimize and load Geist, a new font family for Vercel.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit changes (
git commit -m 'Add amazing feature'
) - Push to branch (
git push origin feature/amazing-feature
) - Open a Pull Request
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 is licensed under the MIT License - see the LICENSE file for details.
- LayerZero Labs: For the innovative cross-chain infrastructure
- Circle: For CCTP and Gas Master technologies
- Base: For efficient hub chain infrastructure
- Open Source Community: For the amazing tools and libraries
Built with β€οΈ by the Omakase Team in Cannes
For questions, issues, or contributions, please visit our GitHub repository or contact our team.