Skip to content

bridgeContract-web3Project-1/bridge_backend-indexer

Repository files navigation

image

🛠️ Backend / Indexer Role

The backend acts as a bridge coordinator — it verifies Ethereum transactions and triggers minting on Avalanche.

  • Receives a call from the frontend after ETH is locked
  • Scans Ethereum logs from currentBlock - 1 to currentBlock + 1
  • Finds and verifies the event emitted by the ETH contract
  • Generates a unique lockId from the transaction
  • Calls Avalanche contract's backend_confirmation() function
  • Avalanche contract checks the mapping:
    mapping(bytes32 => mapping(address => mapping(uint256 => uint8)))
  • If valid, it increases confirmation count
  • Once confirmations reach 2, Avalanche contract calls mint() to mint wrapped ETH

🔐 Why It’s Important

  • Verifies on-chain logs to prevent fraud or spoofing
  • Triggers cross-chain mint securely only when ETH is truly received
  • Ensures confirmations are tracked before minting

This backend flow makes the bridge secure, verifiable, and ensures the wrapped tokens are minted only after a valid ETH deposit.

About

this is the backend of my bridge contract , whenever a user on our dapp lock some ether on our contract , it will emit an event and our backend will catch that event by listening the logs .

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors