IRebalancer

Git Source

Functions

nonce

returns current nonce

function nonce() external view returns (uint256);

isBridgeWhitelisted

returns if a bridge implementation is whitelisted

function isBridgeWhitelisted(address bridge) external view returns (bool);

isDestinationWhitelisted

returns if a destination is whitelisted

function isDestinationWhitelisted(uint32 dstId) external view returns (bool);

sendMsg

sends a bridge message

function sendMsg(address bridge, address _market, uint256 _amount, Msg calldata msg) external payable;

Parameters

NameTypeDescription
bridgeaddressthe whitelisted bridge address
_marketaddressthe market to rebalance from address
_amountuint256the amount to rebalance
msgMsgthe message data

Events

BridgeWhitelistedStatusUpdated

event BridgeWhitelistedStatusUpdated(address indexed bridge, bool status);

MsgSent

event MsgSent(
    address indexed bridge, uint32 indexed dstChainId, address indexed token, bytes message, bytes bridgeData
);

EthSaved

event EthSaved(uint256 amount);

MaxTransferSizeUpdated

event MaxTransferSizeUpdated(uint32 indexed dstChainId, address indexed token, uint256 newLimit);

MinTransferSizeUpdated

event MinTransferSizeUpdated(uint32 indexed dstChainId, address indexed token, uint256 newLimit);

DestinationWhitelistedStatusUpdated

event DestinationWhitelistedStatusUpdated(uint32 indexed dstChainId, bool status);

AllowedListUpdated

event AllowedListUpdated(address[] list, bool status);

Errors

Rebalancer_NotAuthorized

error Rebalancer_NotAuthorized();

Rebalancer_MarketNotValid

error Rebalancer_MarketNotValid();

Rebalancer_RequestNotValid

error Rebalancer_RequestNotValid();

Rebalancer_AddressNotValid

error Rebalancer_AddressNotValid();

Rebalancer_BridgeNotWhitelisted

error Rebalancer_BridgeNotWhitelisted();

Rebalancer_TransferSizeExcedeed

error Rebalancer_TransferSizeExcedeed();

Rebalancer_TransferSizeMinNotMet

error Rebalancer_TransferSizeMinNotMet();

Rebalancer_DestinationNotWhitelisted

error Rebalancer_DestinationNotWhitelisted();

Structs

Msg

struct Msg {
    uint32 dstChainId;
    address token;
    bytes message;
    bytes bridgeData;
}