Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌉 OmniBridge | Cross-Chain Interoperability PoC

Solidity Node.js Next.js Ethers.js License: MIT

OmniBridge is a Full-Stack Web3 Proof-of-Concept (PoC) demonstrating decentralized cross-chain asset transfers. It utilizes a Lock-and-Mint architecture to bridge tokens from Ethereum to Polygon seamlessly.

This repository contains the complete infrastructure: Solidity Smart Contracts, an Event-Driven Node.js Relayer, and a modern Next.js DApp interface.

📐 System Architecture

The bridge operates via three decoupled layers communicating in real-time:

  1. Layer 1 (Ethereum Vault): User locks OMNI tokens in the EthBridge.sol contract. The contract securely holds the assets and emits a TokensLocked cryptographic event.
  2. Off-Chain Relayer (Node.js): A backend daemon constantly indexing the Ethereum blockchain. It catches the TokensLocked event, verifies the transaction, and signs a payload.
  3. Layer 2 (Polygon Minter): The Relayer broadcasts a transaction to PolyBridge.sol on the Polygon network, minting a 1:1 wrapped representation (pOMNI) directly to the user's wallet.
[User / Next.js DApp] 
       │
       ▼ (1. Lock OMNI)
[Ethereum Smart Contract] ──► Emits `TokensLocked` Event
                                      │
                                      ▼ (2. Listen & Verify)
                              [Node.js Relayer Service]
                                      │
                                      ▼ (3. Execute Mint)
[Polygon Smart Contract] ◄─── Mints `pOMNI` 1:1 to User


📂 Repository Structure
/smart-contracts - Hardhat environment containing Solidity contracts (EthBridge.sol, PolyBridge.sol), deployment scripts, and the Node.js Relayer daemon.
/frontend - Next.js 14 frontend utilizing Tailwind CSS v4 and Ethers.js for wallet connection and UI state management.
🚀 Quick Start
1. Smart Contracts & Relayer
Navigate to the contracts directory, install dependencies, and compile the Solidity code:

bash

cd smart-contracts
npm install
npx hardhat compile


To run the backend relayer service (simulates the cross-chain listening event):

bash

$ cd /workspaces/ethereum-polygon-interoperability/smart-contracts
npm install
npx hardhat run scripts/relayer.js

2. Web3 Frontend DApp
Open a new terminal tab, navigate to the frontend directory, and start the development server:

bash
cd frontend
npm install
npm run dev
Navigate to http://localhost:3000 in your browser. Connect your MetaMask wallet to interact with the Glassmorphism Bridge UI.

🛠️ Technology Stack
Smart Contracts: Solidity ^0.8.20, Hardhat, OpenZeppelin
Off-Chain Backend: Node.js, Ethers.js v6
Frontend: React, Next.js (App Router), Tailwind CSS v4
⚠️ Disclaimer
This project was developed for academic and demonstration purposes to showcase cross-chain interoperability mechanisms. The smart contracts have not been audited. Do not use in production with real mainnet funds.

Built by [Your Hanumagouda/  https://github.com/hanumagoudabanakar5-hash] - Exploring the future of decentralized infrastructure.

About

Cross-Chain Token Bridging between ethereum and polygon

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages