Magpie Protocol
  • Magpie Protocol
    • What is Magpie solving?
      • What is DeFi?
    • Magpies Key Features
      • Use Cases
    • FLY
      • xFLY & FLY33
  • 📶Supported Networks
  • Guides
    • 📖Glossary of DeFi Terms
    • 👜Connect Wallet
    • 🔄On-Chain Swap
    • 🔀Cross-Chain Swap
    • 🔂Swap configuration
    • 🥚Magpie Boosts
    • 📒Transaction History
    • 💲Portfolio
  • Media Kit
  • 👩‍💻Developers
    • Magpie Contracts
      • MagpieCCTPBridge
      • MagpieCelerBridgeV2
      • MagpieRouterV3
      • MagpieStargateBridgeV3
      • LibAsset
      • LibBridge
      • LibRouter
    • Smart Contracts Audit
    • Deployments
    • API Reference
      • On chain swap
      • Cross chain swap
      • Requesting and Using API Key
Powered by GitBook
On this page
  • updateSetting():
  • addCelerChainIds():
  • addMagpieCelerBridgeAddresses():
  • decodeBridgeInPayload():
  • bridgeIn():
  • bridgeOut():
  • Events:
  1. Developers
  2. Deprecated Magpie Contracts
  3. MagpieAggregator Diamond Proxy
  4. Bridge

LibCeler

These functions manage the configuration, addition, and execution of Celer bridge transactions. They handle the interaction with the Celer bridge and logs events related to their actions. Additionally, they decode payload data and perform the necessary transaction actions for both inbound and outbound asset transfers between Celer networks and other networks. The functions include validations to ensure the Celer bridge is active and functional before executing these transactions.

updateSetting():

Updates the Celer bridge settings in the application storage.

Input

Field
Type
Description

addCelerChainIds():

Adds Celer chain IDs to the application storage.

Input

Field
Type
Description

An array containing identifiers for networks.

An array containing chain identifiers corresponding to the networks in networkIds.

addMagpieCelerBridgeAddresses():

Adds Magpie Celer bridge addresses to the application storage.

Input

Field
Type
Description

An array containing identifiers for networks.

An array containing chain identifiers corresponding to the networks in networkIds.

decodeBridgeInPayload():

Decodes the payload used in a Celer bridge transaction.

Input

Field
Type
Description

A bytes array that represents the input payload.

Output

Field
Type
Description

bridgeIn():

Executes the bridge in operation for a Celer bridge, facilitating the transfer from one network to another.

Input

Field
Type
Description

bridgeOut():

Performs the bridge out operation, transferring assets from the Celer network back to the original network.

Input

Field
Type
Description

Output

Field
Type
Description

The amount received after the bridgining

Events:

event UpdateCelerBridgeSettings(address indexed sender, CelerBridgeSettings celerBridgeSettings);
event AddCelerChainIds(address indexed sender, uint16[] networkIds, uint64[] chainIds);
event AddMagpieCelerBridgeAddresses(
        address indexed sender,
        uint16[] networkIds,
        bytes32[] magpieCelerBridgeAddresses
    );

Last updated 1 year ago

👩‍💻
celerBridgeSettings
CelerBridgeSettings
struct CelerBridgeSettings {
    address messageBusAddress;
}
networkIds
uint16[]
chainIds
uint64[]
networkIds
uint16[] 
magpieCelerBridgeAddresses
bytes32[]
bridgeInPayload
bytes
bridgeInData
CelerBridgeInData
struct CelerBridgeInData {
    uint32 slippage;
    uint256 fee;
}
bridgeInArgs
BridgeInArgs
struct BridgeInArgs {
    uint16 recipientNetworkId;
    BridgeArgs bridgeArgs;
    uint256 amount;
    address toAssetAddress;
    TransferKey transferKey;
}
bridgeOutArgs
BridgeOutArgs
struct BridgeOutArgs {
    BridgeArgs bridgeArgs;
    Transaction transaction;
    TransferKey transferKey;
}
amount
uint256