Skip to content
LogoLogo

IBridgeComponent

Git Source

Functions

getMaxBridgeLossBps

Bridge ID => Max allowed value loss in basis points for transfers via this bridge while in FENCED or WALLED mode.

function getMaxBridgeLossBps(uint16 bridgeId) external view returns (uint256);

Parameters

NameTypeDescription
bridgeIduint16

Returns

NameTypeDescription
<none>uint256

isWhitelistedRecipient

Foreign Chain ID => Recipient => Whitelisting status while in FENCED or WALLED mode.

function isWhitelistedRecipient(uint256 foreignChainId, address recipient) external view returns (bool);

Parameters

NameTypeDescription
foreignChainIduint256
recipientaddress

Returns

NameTypeDescription
<none>bool

bridgeCooldownDuration

Cooldown duration (in seconds) for bridge transfers while in FENCED or WALLED mode.

function bridgeCooldownDuration() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256

sendOutBridgeTransfer

Executes an outgoing bridge transfer.

function sendOutBridgeTransfer(BridgeOrder calldata order) external;

Parameters

NameTypeDescription
orderBridgeOrderThe bridge transfer params.

setMaxBridgeLossBps

Sets the maximum allowed relative value loss for transfers via this bridge while in FENCED or WALLED mode.

function setMaxBridgeLossBps(uint16 bridgeId, uint256 newMaxBridgeLossBps) external;

Parameters

NameTypeDescription
bridgeIduint16The ID of the bridge.
newMaxBridgeLossBpsuint256The new maximum value loss in basis points.

setBridgeCooldownDuration

Sets the cooldown duration for bridge transfers while in FENCED or WALLED mode.

function setBridgeCooldownDuration(uint256 newBridgeCooldownDuration) external;

Parameters

NameTypeDescription
newBridgeCooldownDurationuint256The new cooldown duration in seconds.

addRecipient

Adds a whitelisted recipient for bridge transfer to a given foreign chain while in FENCED or WALLED mode.

function addRecipient(uint256 foreignChainId, address recipient) external;

Parameters

NameTypeDescription
foreignChainIduint256The foreign chain ID.
recipientaddressThe address of the recipient.

removeRecipient

Removes a whitelisted recipient for bridge transfer to a given foreign chain while in FENCED or WALLED mode.

function removeRecipient(uint256 foreignChainId, address recipient) external;

Parameters

NameTypeDescription
foreignChainIduint256The foreign chain ID.
recipientaddressThe address of the recipient.

Events

BridgeTransferRecipientAdded

event BridgeTransferRecipientAdded(uint256 indexed foreignChainId, address indexed recipient);

Parameters

NameTypeDescription
foreignChainIduint256
recipientaddress

BridgeTransferRecipientRemoved

event BridgeTransferRecipientRemoved(uint256 indexed foreignChainId, address indexed recipient);

Parameters

NameTypeDescription
foreignChainIduint256
recipientaddress

BridgeCooldownDurationChanged

event BridgeCooldownDurationChanged(uint256 oldBridgeCooldownDuration, uint256 newBridgeCooldownDuration);

Parameters

NameTypeDescription
oldBridgeCooldownDurationuint256
newBridgeCooldownDurationuint256

MaxBridgeLossBpsChanged

event MaxBridgeLossBpsChanged(
        uint16 indexed bridgeId, uint256 indexed oldMaxBridgeLossBps, uint256 indexed newMaxBridgeLossBps
    );

Parameters

NameTypeDescription
bridgeIduint16
oldMaxBridgeLossBpsuint256
newMaxBridgeLossBpsuint256

Structs

BridgeOrder

Generic bridge transfer params.

struct BridgeOrder {
        uint16 bridgeId;
        uint256 destinationChainId;
        address recipient;
        address inputToken;
        uint256 inputAmount;
        uint256 minOutputAmount;
        bytes extraData;
    }

Properties

NameTypeDescription
bridgeIduint16The ID of the bridge.
destinationChainIduint256The destination EVM chain ID.
recipientaddressThe address of the recipient.
inputTokenaddressThe address of the input token.
inputAmountuint256The amount of input token to bridge.
minOutputAmountuint256The minimum amount of output token expected.
extraDatabytesExtra data specific to each bridge integration.