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;
}bridgeTypeBridgeTypeAn instance of the BridgeType enum that specifies the type of the bridge.
payloadbytesA bytes field that contains additional payload data for the bridge operation.
BridgeInArgs
struct BridgeInArgs {
uint16 recipientNetworkId;
BridgeArgs bridgeArgs;
uint256 amount;
address toAssetAddress;
TransferKey transferKey;
}recipientNetworkIduint16An unsigned 16-bit integer that represents the ID of the recipient network.
bridgeArgsBridgeArgsAn instance of the BridgeArgs struct that contains the bridge arguments.
amountuint256A uint256 value that represents the amount being bridged.
toAssetAddressaddressAn address that specifies the address of the asset on the recipient network.
transferKeyTransferKeyAn instance of the TransferKey struct that represents a transfer key for the bridge operation.
BridgeOutArgs
struct BridgeOutArgs {
BridgeArgs bridgeArgs;
Transaction transaction;
TransferKey transferKey;
}bridgeArgsBridgeArgsAn instance of the BridgeArgs struct that contains the bridge arguments.
transactionTransactionAn instance of the Transaction struct that represents the transaction for the bridge-out operation.
transferKeyTransferKeyAn 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;
}recipientNetworkIduint16An unsigned 16-bit integer that represents the ID of the recipient network.
amountuint256A uint256 value that represents the amount being refunded.
toAssetAddressaddressAn address that specifies the address of the asset on the recipient network.
transferKeyTransferKeyAn instance of the TransferKey struct that represents a transfer key for the bridge operation.
bridgeArgsBridgeArgsAn instance of the BridgeArgs struct that contains the bridge arguments.
payloadbytesThe bytes that contain some message which are required while bridging.
Last updated