IBridgeController
Functions
isBridgeSupported
Bridge ID => Is bridge adapter deployed.
function isBridgeSupported(uint16 bridgeId) external view returns (bool);Parameters
| Name | Type | Description |
|---|---|---|
| bridgeId | uint16 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bool |
isOutTransferEnabled
Bridge ID => Is outgoing transfer enabled.
function isOutTransferEnabled(uint16 bridgeId) external view returns (bool);Parameters
| Name | Type | Description |
|---|---|---|
| bridgeId | uint16 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bool |
getBridgeAdapter
Bridge ID => Address of the associated bridge adapter.
function getBridgeAdapter(uint16 bridgeId) external view returns (address);Parameters
| Name | Type | Description |
|---|---|---|
| bridgeId | uint16 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | address |
getMaxBridgeLossBps
Bridge ID => Max allowed value loss in basis points for transfers via this bridge.
function getMaxBridgeLossBps(uint16 bridgeId) external view returns (uint256);Parameters
| Name | Type | Description |
|---|---|---|
| bridgeId | uint16 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
setBridgeAdapter
Sets a bridge adapter instance for a given bridge ID.
function setBridgeAdapter(uint16 bridgeId, address bridgeAdapter, uint256 initialMaxBridgeLossBps) external;Parameters
| Name | Type | Description |
|---|---|---|
| bridgeId | uint16 | The ID of the bridge. |
| bridgeAdapter | address | The address of the new bridge adapter instance. |
| initialMaxBridgeLossBps | uint256 | The initial maximum allowed value loss in basis points for transfers via this bridge. |
setMaxBridgeLossBps
Sets the maximum allowed value loss in basis points for transfers via this bridge.
function setMaxBridgeLossBps(uint16 bridgeId, uint256 maxBridgeLossBps) external;Parameters
| Name | Type | Description |
|---|---|---|
| bridgeId | uint16 | The ID of the bridge. |
| maxBridgeLossBps | uint256 | The maximum allowed value loss in basis points. |
disableOutTransfer
Disables outgoing transfers for a bridge.
function disableOutTransfer(uint16 bridgeId) external;Parameters
| Name | Type | Description |
|---|---|---|
| bridgeId | uint16 | The ID of the bridge. |
enableOutTransfer
Enables outgoing transfers for a bridge.
function enableOutTransfer(uint16 bridgeId) external;Parameters
| Name | Type | Description |
|---|---|---|
| bridgeId | uint16 | The ID of the bridge. |
sendOutBridgeTransfer
Executes a scheduled outgoing bridge transfer.
function sendOutBridgeTransfer(uint16 bridgeId, uint256 transferId, bytes calldata data) external;Parameters
| Name | Type | Description |
|---|---|---|
| bridgeId | uint16 | The ID of the bridge. |
| transferId | uint256 | The ID of the transfer to execute. |
| data | bytes | The optional data needed to execute the transfer. |
authorizeInBridgeTransfer
Registers a message hash as authorized for an incoming bridge transfer.
function authorizeInBridgeTransfer(uint16 bridgeId, bytes32 messageHash) external;Parameters
| Name | Type | Description |
|---|---|---|
| bridgeId | uint16 | The ID of the bridge. |
| messageHash | bytes32 | The hash of the message to authorize. |
claimInBridgeTransfer
Transfers a received bridge transfer out of the corresponding bridge adapter.
function claimInBridgeTransfer(uint16 bridgeId, uint256 transferId) external;Parameters
| Name | Type | Description |
|---|---|---|
| bridgeId | uint16 | The ID of the bridge. |
| transferId | uint256 | The ID of the transfer to claim. |
cancelOutBridgeTransfer
Cancels an outgoing bridge transfer.
function cancelOutBridgeTransfer(uint16 bridgeId, uint256 transferId) external;Parameters
| Name | Type | Description |
|---|---|---|
| bridgeId | uint16 | The ID of the bridge. |
| transferId | uint256 | The ID of the transfer to cancel. |
resetBridgingState
Resets internal bridge counters for a given token, and withdraws token balances held by all bridge adapters.
This function is intended to be used by the DAO to realign bridge accounting state and maintain protocol consistency, typically in response to operator deviations, external bridge discrepancies, or unbounded counter growth.
function resetBridgingState(address token) external;Parameters
| Name | Type | Description |
|---|---|---|
| token | address | The address of the token. |
Events
BridgeAdapterSet
event BridgeAdapterSet(uint16 indexed bridgeId, address indexed adapter);Parameters
| Name | Type | Description |
|---|---|---|
| bridgeId | uint16 | |
| adapter | address |
MaxBridgeLossBpsChanged
event MaxBridgeLossBpsChanged(
uint16 indexed bridgeId, uint256 indexed oldMaxBridgeLossBps, uint256 indexed newMaxBridgeLossBps
);Parameters
| Name | Type | Description |
|---|---|---|
| bridgeId | uint16 | |
| oldMaxBridgeLossBps | uint256 | |
| newMaxBridgeLossBps | uint256 |
BridgingStateReset
event BridgingStateReset(address indexed token);Parameters
| Name | Type | Description |
|---|---|---|
| token | address |
OutTransferDisabled
event OutTransferDisabled(uint16 indexed bridgeId);Parameters
| Name | Type | Description |
|---|---|---|
| bridgeId | uint16 |
OutTransferEnabled
event OutTransferEnabled(uint16 indexed bridgeId);Parameters
| Name | Type | Description |
|---|---|---|
| bridgeId | uint16 |