LZBridge

Git Source

Inherits: BaseBridge, IBridge

Functions

constructor

constructor(address _roles) BaseBridge(_roles);

getFee

computes fee for bridge operation

use getOptionsData for _bridgeData

function getFee(uint32 _dstChainId, bytes memory _message, bytes memory _composeMsg) external view returns (uint256);

Parameters

NameTypeDescription
_dstChainIduint32destination chain id
_messagebytesoperation message data
_composeMsgbytes

sendMsg

rebalance through bridge

function sendMsg(
    uint256 _extractedAmount,
    address _market,
    uint32 _dstChainId,
    address _token,
    bytes memory _message,
    bytes memory _composeMsg
) external payable onlyRebalancer;

Parameters

NameTypeDescription
_extractedAmountuint256extracted amount for rebalancing
_marketaddressdestination address
_dstChainIduint32destination chain id
_tokenaddressthe token to rebalance
_messagebytesoperation message data
_composeMsgbytes

_getFee

function _getFee(uint32 dstEid, bytes memory _message, bytes memory _composeMsg)
    private
    view
    returns (MessagingFee memory fees, SendParam memory lzSendParams);

Events

MsgSent

event MsgSent(uint32 indexed dstChainId, address indexed market, uint256 amountLD, uint256 minAmountLD, bytes32 guid);

Errors

LZBridge_NotEnoughFees

error LZBridge_NotEnoughFees();

LZBridge_ChainNotRegistered

error LZBridge_ChainNotRegistered();

LZBridge_DestinationMismatch

error LZBridge_DestinationMismatch();