IDstSwapper

Git Source

Author: Zeropoint Labs

SPDX-License-Identifier: Apache-2.0

all write functions can only be accessed by superform keepers.

handles all destination chain swaps.

Functions

processTx

would interact with liquidity bridge contract to process multi-tx transactions and move the funds into destination contract.

function processTx(uint256 payloadId_, uint256 index_, uint8 bridgeId_, bytes calldata txData_) external;

Parameters

NameTypeDescription
payloadId_uint256represents the id of the payload
index_uint256represents the index of the superformid in the payload
bridgeId_uint8represents the id of liquidity bridge used
txData_bytesrepresents the transaction data generated by liquidity bridge API.

batchProcessTx

would interact with liquidity bridge contract to process multi-tx transactions and move the funds into destination contract.

function batchProcessTx(
    uint256 payloadId_,
    uint256[] calldata indices_,
    uint8[] calldata bridgeIds_,
    bytes[] calldata txDatas_
)
    external;

Parameters

NameTypeDescription
payloadId_uint256represents the array of payload ids used
indices_uint256[]represents the index of the superformid in the payload
bridgeIds_uint8[]represents the array of ids of liquidity bridges used
txDatas_bytes[]represents the array of transaction data generated by liquidity bridge API

swappedAmount

FIMXE: add natspec

function swappedAmount(uint256 payloadId_, uint256 index_) external view returns (uint256 amount_);

Events

SuperRegistryUpdated

is emitted when the super registry is updated.

event SuperRegistryUpdated(address indexed superRegistry);

SwapProcessed

is emitted when a dst swap transaction is processed

event SwapProcessed(uint256 payloadId, uint256 index, uint256 bridgeId, uint256 finalAmount);