Skip to main content

ICaliberMailbox

Git Source

Inherits: IMachineEndpoint

Functions

initialize

Initializer of the contract.

function initialize(
IMakinaGovernable.MakinaGovernableInitParams calldata mgParams,
uint256 initialCooldownDuration,
address hubMachine
) external;

Parameters

NameTypeDescription
mgParamsIMakinaGovernable.MakinaGovernableInitParamsThe makina governable initialization parameters.
initialCooldownDurationuint256The duration of the cooldown period for outgoing bridge transfers.
hubMachineaddressThe foreign address of the hub machine.

caliber

Address of the associated caliber.

function caliber() external view returns (address);

cooldownDuration

Duration of the cooldown period for outgoing bridge transfers.

function cooldownDuration() external view returns (uint256);

getHubBridgeAdapter

Returns the foreign address of the Hub bridge adapter for a given bridge ID.

function getHubBridgeAdapter(uint16 bridgeId) external view returns (address);

Parameters

NameTypeDescription
bridgeIduint16The ID of the bridge.

hubChainId

Chain ID of the hub.

function hubChainId() external view returns (uint256);

getSpokeCaliberAccountingData

Returns the accounting data of the associated caliber.

function getSpokeCaliberAccountingData() external view returns (SpokeCaliberAccountingData memory);

Returns

NameTypeDescription
<none>SpokeCaliberAccountingDatadata The accounting data.

setCaliber

Sets the associated caliber address.

function setCaliber(address caliber) external;

Parameters

NameTypeDescription
caliberaddressThe address of the associated caliber.

setCooldownDuration

Sets the duration of the cooldown period for outgoing bridge transfers.

function setCooldownDuration(uint256 newCooldownDuration) external;

Parameters

NameTypeDescription
newCooldownDurationuint256The new duration in seconds.

setHubBridgeAdapter

Registers a hub bridge adapter.

function setHubBridgeAdapter(uint16 bridgeId, address adapter) external;

Parameters

NameTypeDescription
bridgeIduint16The ID of the bridge.
adapteraddressThe foreign address of the bridge adapter.

Events

CaliberSet

event CaliberSet(address indexed caliber);

CooldownDurationChanged

event CooldownDurationChanged(uint256 oldDuration, uint256 newDuration);

HubBridgeAdapterSet

event HubBridgeAdapterSet(uint256 indexed bridgeId, address indexed adapter);

Structs

SpokeCaliberAccountingData

Accounting data of the caliber.

struct SpokeCaliberAccountingData {
uint256 netAum;
bytes[] positions;
bytes[] baseTokens;
bytes[] bridgesIn;
bytes[] bridgesOut;
}

Properties

NameTypeDescription
netAumuint256The net AUM expresses in caliber's accounting token.
positionsbytes[]The list of positions of the caliber, each encoded as abi.encode(positionId, value, isDebt).
baseTokensbytes[]The list of base tokens of the caliber, each encoded as abi.encode(token, value).
bridgesInbytes[]The list of incoming bridge amounts, each encoded as abi.encode(token, amount).
bridgesOutbytes[]The list of outgoing bridge amounts, each encoded as abi.encode(token, amount).