Skip to content
LogoLogo

IMachine

Git Source

Inherits: IMachineEndpoint, ISpokeSnapshotConsumer

Functions

initialize

Initializer of the contract.

function initialize(
        MachineInitParams calldata mParams,
        MakinaGovernableInitParams calldata mgParams,
        SpokeSnapshotConsumerInitParams calldata sscParams,
        address _preDepositVault,
        address _shareToken,
        address _accountingToken,
        address _hubCaliber
    ) external;

Parameters

NameTypeDescription
mParamsMachineInitParamsThe machine initialization parameters.
mgParamsMakinaGovernableInitParamsThe makina governable initialization parameters.
sscParamsSpokeSnapshotConsumerInitParamsThe spoke snapshot consumer initialization parameters.
_preDepositVaultaddressThe address of the pre-deposit vault.
_shareTokenaddressThe address of the share token.
_accountingTokenaddressThe address of the accounting token.
_hubCaliberaddressThe address of the hub caliber.

depositor

Address of the depositor.

function depositor() external view returns (address);

Returns

NameTypeDescription
<none>address

redeemer

Address of the redeemer.

function redeemer() external view returns (address);

Returns

NameTypeDescription
<none>address

shareToken

Address of the share token.

function shareToken() external view returns (address);

Returns

NameTypeDescription
<none>address

accountingToken

Address of the accounting token.

function accountingToken() external view returns (address);

Returns

NameTypeDescription
<none>address

hubCaliber

Address of the hub caliber.

function hubCaliber() external view returns (address);

Returns

NameTypeDescription
<none>address

feeManager

Address of the fee manager.

function feeManager() external view returns (address);

Returns

NameTypeDescription
<none>address

caliberStaleThreshold

Maximum duration a caliber can remain unaccounted for before it is considered stale.

function caliberStaleThreshold() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256

maxFixedFeeAccrualRate

Maximum fixed fee accrual rate per second used to compute an upper bound on shares to be minted, 1e18 = 100%.

function maxFixedFeeAccrualRate() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256

maxPerfFeeAccrualRate

Maximum performance fee accrual rate per second used to compute an upper bound on shares to be minted, 1e18 = 100%.

function maxPerfFeeAccrualRate() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256

feeMintCooldown

Minimum time that must elapse between two fee minting events.

function feeMintCooldown() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256

shareLimit

Share token supply limit that cannot be exceeded by new deposits.

function shareLimit() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256

maxSharePriceChangeRate

Maximum relative share price change rate per second during total AUM updates, 1e18 = 100%.

function maxSharePriceChangeRate() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256

maxMint

Maximum amount of shares that can currently be minted through asset deposits.

function maxMint() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256

maxWithdraw

Maximum amount of accounting tokens that can currently be withdrawn through share redemptions.

function maxWithdraw() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256

lastTotalAum

Last total machine AUM.

function lastTotalAum() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256

lastGlobalAccountingTime

Timestamp of the last global machine accounting.

function lastGlobalAccountingTime() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256

isIdleToken

Token => Is the token registered as an idle token in this machine.

function isIdleToken(address token) external view returns (bool);

Parameters

NameTypeDescription
tokenaddress

Returns

NameTypeDescription
<none>bool

getIdleTokensLength

Length of the idle tokens list.

function getIdleTokensLength() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256

getIdleToken

Idle token index => Idle token address.

There are no guarantees on the ordering of values inside the idle tokens list, and it may change when values are added or removed.

function getIdleToken(uint256 idx) external view returns (address);

Parameters

NameTypeDescription
idxuint256

Returns

NameTypeDescription
<none>address

getSpokeCalibersLength

Number of calibers associated with the machine.

function getSpokeCalibersLength() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256

getSpokeChainId

Spoke caliber index => Spoke chain ID.

function getSpokeChainId(uint256 idx) external view returns (uint256);

Parameters

NameTypeDescription
idxuint256

Returns

NameTypeDescription
<none>uint256

getSpokeCaliberNetAum

Spoke chain ID => Spoke caliber's net AUM and accounting timestamp.

function getSpokeCaliberNetAum(uint256 chainId) external view returns (uint256, uint256);

Parameters

NameTypeDescription
chainIduint256

Returns

NameTypeDescription
<none>uint256
<none>uint256

getSpokeCaliberMailbox

Spoke chain ID => Spoke caliber mailbox address.

function getSpokeCaliberMailbox(uint256 chainId) external view returns (address);

Parameters

NameTypeDescription
chainIduint256

Returns

NameTypeDescription
<none>address

isSpokeCaliberEnabled

Spoke chain ID => Whether the spoke caliber is enabled.

function isSpokeCaliberEnabled(uint256 chainId) external view returns (bool);

Parameters

NameTypeDescription
chainIduint256

Returns

NameTypeDescription
<none>bool

getSpokeBridgeAdapter

Spoke chain ID => Spoke bridge ID => Spoke bridge adapter.

function getSpokeBridgeAdapter(uint256 chainId, uint16 bridgeId) external view returns (address);

Parameters

NameTypeDescription
chainIduint256
bridgeIduint16

Returns

NameTypeDescription
<none>address

convertToShares

Returns the amount of shares that the machine would exchange for the amount of accounting tokens provided.

function convertToShares(uint256 assets) external view returns (uint256);

Parameters

NameTypeDescription
assetsuint256The amount of accounting tokens.

Returns

NameTypeDescription
<none>uint256shares The amount of shares.

convertToAssets

Returns the amount of accounting tokens that the machine would exchange for the amount of shares provided.

function convertToAssets(uint256 shares) external view returns (uint256);

Parameters

NameTypeDescription
sharesuint256The amount of shares.

Returns

NameTypeDescription
<none>uint256assets The amount of accounting tokens.

transferToHubCaliber

Initiates a token transfer to the hub caliber.

function transferToHubCaliber(address token, uint256 amount) external;

Parameters

NameTypeDescription
tokenaddressThe address of the token to transfer.
amountuint256The amount of token to transfer.

transferToSpokeCaliber

Initiates a token transfer to the spoke caliber.

function transferToSpokeCaliber(
        uint16 bridgeId,
        uint256 chainId,
        address token,
        uint256 amount,
        uint256 minOutputAmount
    ) external;

Parameters

NameTypeDescription
bridgeIduint16The ID of the bridge to use for the transfer.
chainIduint256The chain ID of the spoke caliber.
tokenaddressThe address of the token to transfer.
amountuint256The amount of token to transfer.
minOutputAmountuint256The minimum output amount expected from the transfer.

updateTotalAum

Updates the total AUM of the machine.

function updateTotalAum() external returns (uint256);

Returns

NameTypeDescription
<none>uint256totalAum The updated total AUM.

deposit

Deposits accounting tokens into the machine and mints shares to the receiver.

function deposit(uint256 assets, address receiver, uint256 minShares, bytes32 referralKey)
        external
        returns (uint256);

Parameters

NameTypeDescription
assetsuint256The amount of accounting tokens to deposit.
receiveraddressThe receiver of minted shares.
minSharesuint256The minimum amount of shares to be minted.
referralKeybytes32The optional identifier used to track a referral source.

Returns

NameTypeDescription
<none>uint256shares The amount of shares minted.

redeem

Redeems shares from the machine and transfers accounting tokens to the receiver.

function redeem(uint256 shares, address receiver, uint256 minAssets) external returns (uint256);

Parameters

NameTypeDescription
sharesuint256The amount of shares to redeem.
receiveraddressThe receiver of the accounting tokens.
minAssetsuint256The minimum amount of accounting tokens to be transferred.

Returns

NameTypeDescription
<none>uint256assets The amount of accounting tokens transferred.

setSpokeCaliber

Registers a spoke caliber mailbox and related bridge adapters.

function setSpokeCaliber(
        uint256 chainId,
        address spokeCaliberMailbox,
        uint16[] calldata bridges,
        address[] calldata adapters
    ) external;

Parameters

NameTypeDescription
chainIduint256The chain ID of the spoke caliber.
spokeCaliberMailboxaddressThe address of the spoke caliber mailbox.
bridgesuint16[]The list of bridges supported with the spoke caliber mailbox.
adaptersaddress[]The list of corresponding spoke adapters for each bridge. Must be the same length as bridges.

disableSpokeCaliber

Disables a spoke caliber.

function disableSpokeCaliber(uint256 chainId) external;

Parameters

NameTypeDescription
chainIduint256The chain ID of the spoke caliber to disable.

enableSpokeCaliber

Re-enables a spoke caliber.

function enableSpokeCaliber(uint256 chainId) external;

Parameters

NameTypeDescription
chainIduint256The chain ID of the spoke caliber to enable.

setSpokeBridgeAdapter

Registers a spoke bridge adapter.

function setSpokeBridgeAdapter(uint256 chainId, uint16 bridgeId, address adapter) external;

Parameters

NameTypeDescription
chainIduint256The chain ID of the spoke bridge adapter.
bridgeIduint16The ID of the bridge.
adapteraddressThe address of the spoke bridge adapter.

setDepositor

Sets the depositor address.

function setDepositor(address newDepositor) external;

Parameters

NameTypeDescription
newDepositoraddressThe address of the new depositor.

setRedeemer

Sets the redeemer address.

function setRedeemer(address newRedeemer) external;

Parameters

NameTypeDescription
newRedeemeraddressThe address of the new redeemer.

setFeeManager

Sets the fee manager address.

function setFeeManager(address newFeeManager) external;

Parameters

NameTypeDescription
newFeeManageraddressThe address of the new fee manager.

setCaliberStaleThreshold

Sets the caliber accounting staleness threshold.

function setCaliberStaleThreshold(uint256 newCaliberStaleThreshold) external;

Parameters

NameTypeDescription
newCaliberStaleThresholduint256The new threshold in seconds.

setMaxFixedFeeAccrualRate

Sets the maximum fixed fee accrual rate.

function setMaxFixedFeeAccrualRate(uint256 newMaxAccrualRate) external;

Parameters

NameTypeDescription
newMaxAccrualRateuint256The new maximum fixed fee accrual rate per second, 1e18 = 100%.

setMaxPerfFeeAccrualRate

Sets the maximum performance fee accrual rate.

function setMaxPerfFeeAccrualRate(uint256 newMaxAccrualRate) external;

Parameters

NameTypeDescription
newMaxAccrualRateuint256The new maximum performance fee accrual rate per second, 1e18 = 100%.

setFeeMintCooldown

Sets the minimum time to be elapsed between two fee minting events.

function setFeeMintCooldown(uint256 newFeeMintCooldown) external;

Parameters

NameTypeDescription
newFeeMintCooldownuint256The new cooldown in seconds.

setShareLimit

Sets the new share token supply limit that cannot be exceeded by new deposits.

function setShareLimit(uint256 newShareLimit) external;

Parameters

NameTypeDescription
newShareLimituint256The new share limit.

setMaxSharePriceChangeRate

Sets the new maximum relative share price change rate per second during total AUM updates, 1e18 = 100%.

function setMaxSharePriceChangeRate(uint256 newMaxSharePriceChangeRate) external;

Parameters

NameTypeDescription
newMaxSharePriceChangeRateuint256The new maximum relative share price change rate.

Events

CaliberStaleThresholdChanged

event CaliberStaleThresholdChanged(uint256 indexed oldThreshold, uint256 indexed newThreshold);

Parameters

NameTypeDescription
oldThresholduint256
newThresholduint256

Deposit

event Deposit(
        address indexed sender, address indexed receiver, uint256 assets, uint256 shares, bytes32 indexed referralKey
    );

Parameters

NameTypeDescription
senderaddress
receiveraddress
assetsuint256
sharesuint256
referralKeybytes32

DepositorChanged

event DepositorChanged(address indexed oldDepositor, address indexed newDepositor);

Parameters

NameTypeDescription
oldDepositoraddress
newDepositoraddress

FeeManagerChanged

event FeeManagerChanged(address indexed oldFeeManager, address indexed newFeeManager);

Parameters

NameTypeDescription
oldFeeManageraddress
newFeeManageraddress

FeeMintCooldownChanged

event FeeMintCooldownChanged(uint256 indexed oldFeeMintCooldown, uint256 indexed newFeeMintCooldown);

Parameters

NameTypeDescription
oldFeeMintCooldownuint256
newFeeMintCooldownuint256

FeesMinted

event FeesMinted(uint256 shares);

Parameters

NameTypeDescription
sharesuint256

MaxFixedFeeAccrualRateChanged

event MaxFixedFeeAccrualRateChanged(uint256 indexed oldMaxAccrualRate, uint256 indexed newMaxAccrualRate);

Parameters

NameTypeDescription
oldMaxAccrualRateuint256
newMaxAccrualRateuint256

MaxPerfFeeAccrualRateChanged

event MaxPerfFeeAccrualRateChanged(uint256 indexed oldMaxAccrualRate, uint256 indexed newMaxAccrualRate);

Parameters

NameTypeDescription
oldMaxAccrualRateuint256
newMaxAccrualRateuint256

MaxSharePriceChangeRateChanged

event MaxSharePriceChangeRateChanged(uint256 indexed oldMaxChangeRate, uint256 indexed newMaxChangeRate);

Parameters

NameTypeDescription
oldMaxChangeRateuint256
newMaxChangeRateuint256

Redeem

event Redeem(address indexed owner, address indexed receiver, uint256 assets, uint256 shares);

Parameters

NameTypeDescription
owneraddress
receiveraddress
assetsuint256
sharesuint256

RedeemerChanged

event RedeemerChanged(address indexed oldRedeemer, address indexed newRedeemer);

Parameters

NameTypeDescription
oldRedeemeraddress
newRedeemeraddress

ShareLimitChanged

event ShareLimitChanged(uint256 indexed oldShareLimit, uint256 indexed newShareLimit);

Parameters

NameTypeDescription
oldShareLimituint256
newShareLimituint256

SpokeBridgeAdapterSet

event SpokeBridgeAdapterSet(uint256 indexed chainId, uint256 indexed bridgeId, address indexed adapter);

Parameters

NameTypeDescription
chainIduint256
bridgeIduint256
adapteraddress

SpokeCaliberDisabled

event SpokeCaliberDisabled(uint256 indexed chainId);

Parameters

NameTypeDescription
chainIduint256

SpokeCaliberEnabled

event SpokeCaliberEnabled(uint256 indexed chainId);

Parameters

NameTypeDescription
chainIduint256

SpokeCaliberMailboxSet

event SpokeCaliberMailboxSet(uint256 indexed chainId, address indexed caliberMailbox);

Parameters

NameTypeDescription
chainIduint256
caliberMailboxaddress

TotalAumUpdated

event TotalAumUpdated(uint256 totalAum);

Parameters

NameTypeDescription
totalAumuint256

TransferToCaliber

event TransferToCaliber(uint256 indexed chainId, address indexed token, uint256 amount);

Parameters

NameTypeDescription
chainIduint256
tokenaddress
amountuint256

Structs

MachineInitParams

Initialization parameters.

struct MachineInitParams {
        address initialDepositor;
        address initialRedeemer;
        address initialFeeManager;
        uint256 initialCaliberStaleThreshold;
        uint256 initialMaxFixedFeeAccrualRate;
        uint256 initialMaxPerfFeeAccrualRate;
        uint256 initialFeeMintCooldown;
        uint256 initialShareLimit;
        uint256 initialMaxSharePriceChangeRate;
    }

Properties

NameTypeDescription
initialDepositoraddressThe address of the initial depositor.
initialRedeemeraddressThe address of the initial redeemer.
initialFeeManageraddressThe address of the initial fee manager.
initialCaliberStaleThresholduint256The caliber accounting staleness threshold in seconds.
initialMaxFixedFeeAccrualRateuint256The maximum fixed fee accrual rate per second, 1e18 = 100%.
initialMaxPerfFeeAccrualRateuint256The maximum performance fee accrual rate per second, 1e18 = 100%.
initialFeeMintCooldownuint256The minimum time that must elapse between two fee minting events in seconds.
initialShareLimituint256The share cap value.
initialMaxSharePriceChangeRateuint256The maximum relative share price change rate per second during total AUM updates, 1e18 = 100%.

SpokeCaliberData

State data for each spoke caliber.

struct SpokeCaliberData {
        address mailbox;
        mapping(uint16 bridgeId => address adapter) bridgeAdapters;
        uint256 timestamp;
        uint256 netAum;
        bytes[] deprecated_4;
        bytes[] deprecated_5;
        EnumerableMap.AddressToUintMap caliberBridgesIn;
        EnumerableMap.AddressToUintMap caliberBridgesOut;
        EnumerableMap.AddressToUintMap machineBridgesIn;
        EnumerableMap.AddressToUintMap machineBridgesOut;
        bool disabled;
    }

Properties

NameTypeDescription
mailboxaddressThe address of the spoke caliber mailbox.
bridgeAdaptersmapping(uint16 bridgeId => address adapter)The mapping of bridge IDs to their corresponding adapters.
timestampuint256The timestamp of the last accounting.
netAumuint256The net AUM of the spoke caliber.
deprecated_4bytes[]Deprecated field.
deprecated_5bytes[]Deprecated field.
caliberBridgesInEnumerableMap.AddressToUintMapThe mapping of spoke caliber incoming bridge amounts.
caliberBridgesOutEnumerableMap.AddressToUintMapThe mapping of spoke caliber outgoing bridge amounts.
machineBridgesInEnumerableMap.AddressToUintMapThe mapping of machine incoming bridge amounts.
machineBridgesOutEnumerableMap.AddressToUintMapThe mapping of machine outgoing bridge amounts.
disabledboolWhether the spoke caliber is disabled (ignored in AUM calculations and ineligible for machine transfers until re-enabled).