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
  • updateLayerZeroSettings
  • addLayerZeroChainIds
  • addLayerZeroNetworkIds
  • updateWormholeSettings
  • addWormholeNetworkIds
  • getWormholeCoreSequence
  • lzReceive
  • dataTransferIn():
  • dataTransferOut():
  1. Developers
  2. Deprecated Magpie Contracts
  3. MagpieAggregator Diamond Proxy
  4. Data Transfer

DataTransferFacet

This is a Solidity contract implementing the IDataTransfer interface. It contains several functions related to updating settings and receiving data transfers.

updateLayerZeroSettings

allows the contract owner to update the LayerZeroSettings struct, which contains settings for Layer 0 networks.

Input

Field
Type
Description

addLayerZeroChainIds

allow the contract owner to add LayerZero chain IDs.

Input

Field
Type
Description

An array of network identifier for each blockchain. These are defined by the magpie team.

An array of blockchain identifiers

addLayerZeroNetworkIds

allows the contract owner to add LayerZero network IDs.

Input

Field
Type
Description

An array of blockchain identifiers

An array of network identifier for each blockchain. These are defined by the layerzero team.

updateWormholeSettings

allows the contract owner to update the WormholeSettings struct, which contains settings for the Wormhole bridge.

Input

Field
Type
Description

addWormholeNetworkIds

allows the contract owner to add mappings between Wormhole chain IDs and network IDs.

Input

Field
Type
Description

An array of blockchain identifiers

An array of network identifier for each blockchain. These are defined by the wormhole team.

getWormholeCoreSequence

this function provides a way to obtain the core sequence from a transfer key's core sequence by calling the getCoreSequence function from the LibWormhole library. It allows external callers to retrieve the core sequence without modifying the contract's state.

Input

Field
Type
Description

The sequence provide by magpie team for the data transfer

lzReceive

called by LayerZero to initiate a data transfer. It enforces that the function is called by a LayerZero contract and then calls the lzReceive function in the LibLayerZero library, which handles the actual data transfer.

Input

Field
Type
Description

The chain id of the source chain

The address which will receive the data

random or pseudo-random number that is used only once.

Payload + extra information like which data transfer type has been used

dataTransferIn():

It calls the dataTransfer function from the LibDataTransfer library, passing the dataTransferInArgs as an argument.

Input:

Field
Type
Description

dataTransferOut():

It calls the getPayload function from the LibDataTransfer library, passing the dataTransferOutArgs as an argument.

Input:

Field
Type
Description

Last updated 1 year ago

👩‍💻
layerZeroSettings
LayerZeroSettings
struct LayerZeroSettings {
    address routerAddress;
}
networkIds
uint16[]
chainIds
uint16[]
chainIds
uint16[]
networkIds
uint16[]
wormholeSettings
WormholeSettings
struct WormholeSettings {
    address bridgeAddress;
    uint8 consistencyLevel;
}
chainIds
uint16[]
networkIds
uint16[]
transferKeyCoreSequence
uint64
senderChainId
uint16
localAndRemoteAddresses
bytes
nonce
uint64
extendedPayload
bytes
dataTransferInArgs
DataTransferInArgs
struct DataTransferInArgs {
    DataTransferInProtocol protocol;
    TransferKey transferKey;
    bytes payload;
}
dataTransferOutArgs
DataTransferOutArgs
struct DataTransferOutArgs {
    DataTransferType dataTransferType;
    bytes payload;
}