Skip to content
LogoLogo

AcrossV4BridgeEncoder

Git Source

Inherits: AccessManagedUpgradeable, IAcrossV4BridgeEncoder

Constants

acrossV4SpokePool

Address of the Across SpokePool.

address public immutable acrossV4SpokePool;

Returns

NameTypeDescription
<none>address

State Variables

_foreignTokens

mapping(address localToken => mapping(uint256 chainId => EnumerableSet.AddressSet foreignTokens)) private
        _foreignTokens;

Functions

constructor

constructor(address _acrossV4SpokePool);

Parameters

NameTypeDescription
_acrossV4SpokePooladdress

initialize

function initialize(address initialAuthority) external initializer;

Parameters

NameTypeDescription
initialAuthorityaddress

isRouteRegistered

Returns whether a bridge transfer route is registered.

function isRouteRegistered(address inputToken, uint256 foreignChainId, address outputToken)
        public
        view
        override
        returns (bool);

Parameters

NameTypeDescription
inputTokenaddressThe token to be sent from the source chain.
foreignChainIduint256The destination chain ID.
outputTokenaddressThe token to be received on the destination chain.

Returns

NameTypeDescription
<none>boolTrue if the route is registered, false otherwise.

getBridgeTransferData

Returns targets, value, and calldata to execute a bridge transfer.

Intended to be called only by a MakinaXModule instance, from which implementations may read caller state via msg.sender.

function getBridgeTransferData(IBridgeComponent.BridgeOrder calldata order)
        external
        view
        override
        returns (address, address, uint256, bytes memory);

Parameters

NameTypeDescription
orderIBridgeComponent.BridgeOrderThe bridge transfer params.

Returns

NameTypeDescription
<none>addressThe address of the approval target.
<none>addressThe address of the execution target.
<none>uint256The value to pass along with the calldata.
<none>bytesThe calldata to execute.

addRoute

Registers a transfer route.

function addRoute(address inputToken, uint256 foreignChainId, address outputToken) external override restricted;

Parameters

NameTypeDescription
inputTokenaddressThe token to be sent from the source chain.
foreignChainIduint256The destination chain ID.
outputTokenaddressThe token to be received on the destination chain.

removeRoute

Unregisters a transfer route.

function removeRoute(address inputToken, uint256 foreignChainId, address outputToken) external override restricted;

Parameters

NameTypeDescription
inputTokenaddressThe token to be sent from the source chain.
foreignChainIduint256The destination chain ID.
outputTokenaddressThe token to be received on the destination chain.