LibCommon
It contains an enum and structs that define the data structures for passing arguments and information related to bridge operations, including bridge types, payload data, recipient network IDs, amounts, asset addresses, and transfer keys. The purpose of these data structures is to provide a standardized format for handling bridge operations and their associated parameters in the contract or system that uses them.
BridgeType
This is an enumeration that defines two values: Wormhole
and Stargate
. It is used to represent different bridge types.
enum BridgeType {
Wormhole,
Stargate,
Celer
}
BridgeArgs
struct BridgeArgs {
BridgeType bridgeType;
bytes payload;
}
bridgeType
BridgeType
An instance of the BridgeType
enum that specifies the type of the bridge.
payload
bytes
A bytes
field that contains additional payload data for the bridge operation.
BridgeInArgs
struct BridgeInArgs {
uint16 recipientNetworkId;
BridgeArgs bridgeArgs;
uint256 amount;
address toAssetAddress;
TransferKey transferKey;
}
recipientNetworkId
uint16
An unsigned 16-bit integer that represents the ID of the recipient network.
bridgeArgs
BridgeArgs
An instance of the BridgeArgs
struct that contains the bridge arguments.
amount
uint256
A uint256
value that represents the amount being bridged.
toAssetAddress
address
An address
that specifies the address of the asset on the recipient network.
transferKey
TransferKey
An instance of the TransferKey
struct that represents a transfer key for the bridge operation.
BridgeOutArgs
struct BridgeOutArgs {
BridgeArgs bridgeArgs;
Transaction transaction;
TransferKey transferKey;
}
bridgeArgs
BridgeArgs
An instance of the BridgeArgs
struct that contains the bridge arguments.
transaction
Transaction
An instance of the Transaction
struct that represents the transaction for the bridge-out operation.
transferKey
TransferKey
An instance of the TransferKey
struct that represents a transfer key for the bridge operation.
RefundArgs
struct RefundArgs {
uint16 recipientNetworkId;
uint256 amount;
address toAssetAddress;
TransferKey transferKey;
BridgeArgs bridgeArgs;
bytes payload;
}
recipientNetworkId
uint16
An unsigned 16-bit integer that represents the ID of the recipient network.
amount
uint256
A uint256
value that represents the amount being refunded.
toAssetAddress
address
An address
that specifies the address of the asset on the recipient network.
transferKey
TransferKey
An instance of the TransferKey
struct that represents a transfer key for the bridge operation.
bridgeArgs
BridgeArgs
An instance of the BridgeArgs
struct that contains the bridge arguments.
payload
bytes
The bytes that contain some message which are required while bridging.
Last updated