Bridge Contracts

Every chain supported by Router Protocol will have a bridge contract deployed on it. On the source chain, the bridge contract locks users’ assets and broadcasts an event that can be picked up by listeners associated with Router nodes. On the destination chain, the bridge contract aggregates votes from Router nodes on proposals relayed from the source chain. When the voting quorum is achieved, the bridge contract unlocks/mints tokens on the destination chain. Whenever a transaction is submitted on the source chain, a deposit function is initiated on the bridge contract, which takes in three parameters: destinationChainID, resourceID, and calldata. The bridge contract generates a nonce for every deposit transaction, and depending on the resourceID, delegates the call to a separate handler contract.

  • Calldata: This field includes the parameters required by the handler. Calldata differs based on the nature of the transaction, e.g., ERC20 transfer, arbitrary message passing, etc.

  • Deposit Nonce: It is an unsigned 64-bit integer that is generated by ParaRouters for all cross-chain transfers. All router nodes track a sequential nonce for all possible target chains.

Last updated