A 🌐 cross-chain 💳 token bridge enabling seamless 🚪 transfers between the 🌋 Avalanche and 💎 BNB networks. The project consists of ⚖️ smart contracts, an 📊 indexer, and a 💃 React-based frontend, designed for robust and user-friendly cross-chain interactions.
- ⚖️ Smart Contracts: The
BridgeContract.sol
handles token 🔒 locking on one network and 🔓 unlocking on the other. - 📊 Indexer: Monitors contract 📊 events, ⏳ queues and retries transactions, and ensures reliable 🚪 token transfers.
- 💃 Frontend: A React 🖥️ application with
wagmi
integration for user-friendly interaction with the bridge.
- 🌐 Cross-Chain Transfers: 🔒 Lock tokens on 🌋 Avalanche to release equivalents on 💎 BNB, and vice versa.
- 📊 Event Indexing: Monitors ⚖️ smart contract 📊 events for accurate and timely token 🚪 transfers.
- 🕹️ Intuitive UI: Built with 💃 React and
wagmi
, providing both 🔍 read and 🖋 write capabilities for a seamless experience.
Click the thumbnail above to see the 🔒🔊 Token Bridge in action.
Before proceeding, ensure you have the following installed:
- 💾 Node.js (with 🔄 npm or 🎨 yarn)
- ⚖️ Solidity Compiler (e.g., via 📦 Hardhat or 🌄 Truffle)
- 🌋 Avalanche and 💎 BNB Networks (configured in your 🔑 wallet)
-
🔑 Clone the Repository:
git clone https://github.com/iamnas/token-bridge.git cd token-bridge
-
📋 Install Dependencies:
- For the 📊 Indexer:
cd indexer npm install
- For the 💃 Frontend:
cd frontend npm install
- For the 📊 Indexer:
-
⚖️ Deploy the Smart Contract:
- ✏️ Compile and deploy
BridgeContract.sol
on both 🌋 Avalanche and 💎 BNB networks using your preferred tool (e.g., 📦 Hardhat, 🔜 Remix). - Save the deployed 📝 contract addresses for use in the 📊 indexer and 💃 frontend configuration.
- ✏️ Compile and deploy
-
📊 Configure the Indexer:
- Update the environment 🎨 variables or configuration files in the
indexer
directory with the deployed 📝 contract addresses and ⚖️ RPC URLs.
- Update the environment 🎨 variables or configuration files in the
-
🚪 Run the Indexer:
- Start the 📊 indexer to monitor 📊 events and manage cross-chain 🚪 token transfers.
cd indexer npm run dev
- Start the 📊 indexer to monitor 📊 events and manage cross-chain 🚪 token transfers.
-
🔄 Start the Frontend:
- Launch the 🕹️ user interface for interacting with the bridge.
cd frontend npm run dev
- Launch the 🕹️ user interface for interacting with the bridge.
The 🔒🔊 Token Bridge leverages the following 🌐 technologies:
- 🌐 Blockchain: 🌋 Avalanche and 💎 BNB
- ⚖️ Smart Contracts: 🕹️ Solidity
- 💻 Backend: 📦 Node.js (📊 Indexer)
- 💃 Frontend: 🕹️ React with
wagmi
- 🌐 Support for Additional Networks: Expand compatibility to other 🌐 blockchains.
- ⚖️ Improved Security: Introduce additional safeguards against potential 🔧 exploits.
- 📈 Advanced User Features: Add detailed 📊 transaction histories and enhanced 🔄 analytics.