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
  • updateSettings()
  • addWormholeNetworkIds()
  • dataTransfer()
  • getPayload()
  • getCoreSequence()
  • Events:
  1. Developers
  2. Deprecated Magpie Contracts
  3. MagpieAggregator Diamond Proxy
  4. Data Transfer

LibWormhole

Contains several functions for interacting with a Wormhole bridge, which is a cross-chain communication protocol that allows tokens and other data to be transferred between different blockchains.

updateSettings()

updates the wormholeSettings variable in the AppStorage struct with the provided wormholeSettings input parameter. The new settings are emitted in an UpdateWormholeSettings event.

Input

Field
Type
Description

addWormholeNetworkIds()

adds multiple chainIds and networkIds to the wormholeNetworkIds mapping in AppStorage. The new mappings are emitted in an AddWormholeNetworkIds event.

Input

Field
Type
Description

An array of wormhole chain identifiers

An array of network identifiers provided by magpie team.

dataTransfer()

transfers data across the Wormhole bridge by calling the publishMessage function on a Wormhole core contract with a given payload, timestamp, and consistency level.

Input

Field
Type
Description

Payload that contains the data which will be transferred over the blockchains

getPayload()

verifies and returns the payload of a Wormhole message. It uses the parseAndVerifyVM function on a Wormhole core contract to check the validity of the message, and then extracts and returns the payload of the message..

Input

Field
Type
Description

payload required for receiving the data

Output

Field
Type
Description

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

getCoreSequence()

this function is responsible for retrieving the core sequence value from the s.wormholeCoreSequences mapping based on the provided transferKeyCoreSequence.

Input

Field
Type
Description

The core sequence provided by magpie for data transfer

Output

Field
Type
Description

The sequence received by the wormhole core bridge.

Events:

event UpdateWormholeSettings(address indexed sender, WormholeSettings wormholeSettings);
event AddWormholeNetworkIds(address indexed sender, uint16[] chainIds, uint16[] networkIds);

Last updated 1 year ago

👩‍💻
wormholeSettings
WormholeSettings
struct WormholeSettings {
    address bridgeAddress;
    uint8 consistencyLevel;
}
chainIds
uint16[]
networkIds
uint16[]
payload
bytes
dataTransferOutPayload
bytes
extendedPayload
bytes
transferKeyCoreSequence
uint64
s.wormholeCoreSequences[transferKeyCoreSequence]
uint64