Lucid
  • USING LUCID
    • Welcome to Lucid
    • Homepage
    • Explore Page
    • Organisation Summary Page
    • Sidebar Navigation
  • Organisation Creation Page
  • Creating an Organisation
    • 1. Setup Organisation Details
    • 2. Module Selection
    • 3. Module Configuration
    • 4. Safe and Protocol Upgrades Configuration
    • 5. Governor Configuration
    • 6. Veto and Multi-Bridge Configuration
    • 7. Token Configuration
    • 8. Asset Transfer Portals Configuration
    • 9. Review and Deploy Organisation
    • 10. Lucid Post-Deployment Integration
  • Editing an Organisation
  • Modules and integrations
    • Multi-Bridge
      • Multi-Bridge Asset Transfers
      • Multi-Bridge Message and Asset Transfers
      • Resend Transaction
    • Bridge Portals
    • Vested Emission Offerings (VEOs)
      • VEO Purchase Flow
        • Purchase Strategic Asset VEOs
        • Purchase Liquidity VEOs
        • Purchase TVL VEOs
      • VEO Creation Flow
      • VEO Removal Flow
      • Claiming Vested Tokens
    • Wizard | Protocol Upgrades
  • Lucid Bridged Stablecoins
    • L-USDC & L-USDT Overview
      • L-USDC Deep Dive
      • L-USDT Deep Dive
  • Points Program
    • Season 1
  • Developer Reference
    • Message Bridging
      • Sending a Message
      • Message Execution
      • Admin Functions
    • Asset Bridging
      • Bridging Assets
      • Admin Functions
    • Adapters
      • Axelar Adapter
      • CCIP Adapter
      • Connext Adapter
      • Hyperlane Adapter
      • LayerZero Adapter
      • Polymer Adapter
      • Wormhole Adapter
    • Deployed Contracts
      • Multibridge Contracts
      • VEO Contracts
  • API Reference
  • RESOURCES
    • About
    • Fees
      • Lucid Pricing and Fee Structure
      • Fee Estimates for Bridges
    • Frequently Asked Questions
    • Key Terms and Explanations
    • Contact
Powered by GitBook
On this page
  • Overview
  • Functionality
  • Fees
  • Interfaces
  1. Modules and integrations
  2. Multi-Bridge
  3. Multi-Bridge Message and Asset Transfers

Adapters

Overview

Adapters are smart contracts that integrate with a specific bridge and are used by other contracts (such as Message Controllers, Asset Controllers, etc.) that need to communicate with the bridge. Lucid develops and deploys these adapter contracts across all the chains supported by both Lucid and the bridge. Adapter contracts are permissionless, meaning anyone can call them to relay a message to a supported chain, provided an adapter contract exists for that chain.

Functionality

An adapter's primary function is to relay and receive messages to and from the bridge. These messages are typically sent by a contract, such as the Message Controller on the same chain. The adapter repackages the message to include the original msg.sender (the Message Controller) and the destination address (the Message Controller's address on the destination chain). The adapter does not process or inspect the content of the message; it supports any bytes[] message format.

The adapter uses the bridge to relay the message to the corresponding adapter on the destination chain. Once the destination adapter receives the message, it unpacks it to identify the real msg.sender on the source chain and the intended recipient on the destination chain. The adapter then forwards the unpacked, original message to the destination address.

Fees

The system charges a protocol fee for relaying messages between chains. The fee is calculated as a percentage of the value being sent (bridge fee). However, the protocol fee is currently set to 0% by default, meaning no additional charge is applied beyond the base bridge fee.

Additionally, each adapter enforces a minimum gas requirement for message relay. This is controlled by the minGas variable. If the calling contract does not provide at least the minimum gas value, the transaction will revert.

Interfaces

Each adapter implements the following view functions:

isChainSupported

function isChainIdSupported(uint256 chainId) public view returns (bool);

Checks if a given chain ID is supported by the adapter.


trustedAdapters()

function trustedAdapters(uint256) external view returns (address);

Returns the contract address of the Adapter for a given chain id. Will return address(0) if an adapter doesn't exist on that chain.

Last updated 4 months ago