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;
}
Field
Type
Description

An instance of the BridgeType enum that specifies the type of the bridge.

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;
}
Field
Type
Description

An unsigned 16-bit integer that represents the ID of the recipient network.

An instance of the BridgeArgs struct that contains the bridge arguments.

A uint256 value that represents the amount being bridged.

An address that specifies the address of the asset on the recipient network.

An instance of the TransferKey struct that represents a transfer key for the bridge operation.

BridgeOutArgs

struct BridgeOutArgs {
    BridgeArgs bridgeArgs;
    Transaction transaction;
    TransferKey transferKey;
}
Field
Type
Description

An instance of the BridgeArgs struct that contains the bridge arguments.

An instance of the Transaction struct that represents the transaction for the bridge-out operation.

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;
}
Field
Type
Description

An unsigned 16-bit integer that represents the ID of the recipient network.

A uint256 value that represents the amount being refunded.

An address that specifies the address of the asset on the recipient network.

An instance of the TransferKey struct that represents a transfer key for the bridge operation.

An instance of the BridgeArgs struct that contains the bridge arguments.

The bytes that contain some message which are required while bridging.

Last updated