LZBridge
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
Name | Type | Description |
---|---|---|
_dstChainId | uint32 | destination chain id |
_message | bytes | operation message data |
_composeMsg | bytes |
sendMsg
rebalance through bridge
function sendMsg(
uint256 _extractedAmount,
address _market,
uint32 _dstChainId,
address _token,
bytes memory _message,
bytes memory _composeMsg
) external payable onlyRebalancer;
Parameters
Name | Type | Description |
---|---|---|
_extractedAmount | uint256 | extracted amount for rebalancing |
_market | address | destination address |
_dstChainId | uint32 | destination chain id |
_token | address | the token to rebalance |
_message | bytes | operation message data |
_composeMsg | bytes |
_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();