LibDataTransfer
This is a Solidity smart contract library that provides functions related to data transfer between different blockchain networks or layers.
getOriginalPayload()
this function is responsible for extracting the original payload from the extended payload by slicing the extendedPayload
from the 42nd byte to the end. It removes the extended part of the payload and returns the original payload.
Input
Field | Type | Description |
---|---|---|
Payload + extra information like which data transfer type has been used |
Output
Field | Type | Description |
---|---|---|
payload | the original payload |
dataTransfer()
this function is responsible for executing data transfer operations based on the specified protocols. It increments the core sequence, creates a transfer key, generates the extended payload, and processes each protocol in dataTransferInArgs.protocols
. Depending on the protocol's dataTransferType
, either the Wormhole or LayerZero data transfer function is called. If an unrecognised dataTransferType
is encountered, the function reverts with an error.
Input
Field | Type | Description |
---|---|---|
Output
Field | Type | Description |
---|---|---|
getPayload()
this function is responsible for obtaining the transfer key and payload based on the specified data transfer type. Depending on the dataTransferType
in dataTransferOutArgs
, either the Wormhole or LayerZero library functions are called to obtain the payload.
Input
Field | Type | Description |
---|---|---|
Output
Field | Type | Description |
---|---|---|
The data necessary for swapping. |
Last updated