BaseRouter

Git Source

Inherits: IBaseRouter

Author: Zeropoint Labs.

SPDX-License-Identifier: Apache-2.0

Routes users funds and action information to a remote execution chain.

abstract implementation that allows inheriting routers to implement their own logic

State Variables

STATE_REGISTRY_TYPE

uint8 public immutable STATE_REGISTRY_TYPE;

ROUTER_TYPE

uint8 public immutable ROUTER_TYPE;

CHAIN_ID

uint64 public immutable CHAIN_ID;

superRegistry

ISuperRegistry public immutable superRegistry;

Functions

constructor

constructor(address superRegistry_, uint8 stateRegistryType_, uint8 routerType_);

Parameters

NameTypeDescription
superRegistry_addressthe superform registry contract
stateRegistryType_uint8the state registry type
routerType_uint8the router type

receive

receive enables processing native token transfers into the smart contract.

liquidity bridge fails without a native receive function.

receive() external payable;

multiDstMultiVaultDeposit

Performs multi destination x multi vault deposits

function multiDstMultiVaultDeposit(MultiDstMultiVaultStateReq calldata req_) external payable virtual override;

Parameters

NameTypeDescription
req_MultiDstMultiVaultStateReqis the request object containing all the necessary data for the action

multiDstSingleVaultDeposit

Performs multi destination x single vault deposits

function multiDstSingleVaultDeposit(MultiDstSingleVaultStateReq calldata req_) external payable virtual override;

Parameters

NameTypeDescription
req_MultiDstSingleVaultStateReqis the request object containing all the necessary data for the action

singleXChainMultiVaultDeposit

Performs single destination x multi vault deposits

function singleXChainMultiVaultDeposit(SingleXChainMultiVaultStateReq memory req_) external payable virtual override;

Parameters

NameTypeDescription
req_SingleXChainMultiVaultStateReqis the request object containing all the necessary data for the action

singleXChainSingleVaultDeposit

Performs single xchain destination x single vault deposits

function singleXChainSingleVaultDeposit(SingleXChainSingleVaultStateReq memory req_)
    external
    payable
    virtual
    override;

Parameters

NameTypeDescription
req_SingleXChainSingleVaultStateReqis the request object containing all the necessary data for the action

singleDirectMultiVaultDeposit

Performs single direct x multi vault deposits

function singleDirectMultiVaultDeposit(SingleDirectMultiVaultStateReq memory req_) external payable virtual override;

Parameters

NameTypeDescription
req_SingleDirectMultiVaultStateReqis the request object containing all the necessary data for the action

singleDirectSingleVaultDeposit

Performs single direct x single vault deposits

function singleDirectSingleVaultDeposit(SingleDirectSingleVaultStateReq memory req_)
    external
    payable
    virtual
    override;

Parameters

NameTypeDescription
req_SingleDirectSingleVaultStateReqis the request object containing all the necessary data for the action

multiDstMultiVaultWithdraw

Performs multi destination x multi vault withdraws

function multiDstMultiVaultWithdraw(MultiDstMultiVaultStateReq calldata req_) external payable virtual override;

Parameters

NameTypeDescription
req_MultiDstMultiVaultStateReqis the request object containing all the necessary data for the action

multiDstSingleVaultWithdraw

Performs multi destination x single vault withdraws

function multiDstSingleVaultWithdraw(MultiDstSingleVaultStateReq calldata req_) external payable virtual override;

Parameters

NameTypeDescription
req_MultiDstSingleVaultStateReqis the request object containing all the necessary data for the action

singleXChainMultiVaultWithdraw

Performs single destination x multi vault withdraws

function singleXChainMultiVaultWithdraw(SingleXChainMultiVaultStateReq memory req_) external payable virtual override;

Parameters

NameTypeDescription
req_SingleXChainMultiVaultStateReqis the request object containing all the necessary data for the action

singleXChainSingleVaultWithdraw

Performs single xchain destination x single vault withdraws

function singleXChainSingleVaultWithdraw(SingleXChainSingleVaultStateReq memory req_)
    external
    payable
    virtual
    override;

Parameters

NameTypeDescription
req_SingleXChainSingleVaultStateReqis the request object containing all the necessary data for the action

singleDirectMultiVaultWithdraw

Performs single direct x multi vault withdraws

function singleDirectMultiVaultWithdraw(SingleDirectMultiVaultStateReq memory req_) external payable virtual override;

Parameters

NameTypeDescription
req_SingleDirectMultiVaultStateReqis the request object containing all the necessary data for the action

singleDirectSingleVaultWithdraw

Performs single direct x single vault withdraws

function singleDirectSingleVaultWithdraw(SingleDirectSingleVaultStateReq memory req_)
    external
    payable
    virtual
    override;

Parameters

NameTypeDescription
req_SingleDirectSingleVaultStateReqis the request object containing all the necessary data for the action