Skip to Content

ISLAYRouterV2

Interface for the SLAYRouterV2 contract, which serves as the central point for managing interactions with SLAYVaults.

Functions

getMaxVaultsPerOperator

This limit prevents a single operator from controlling too many vaults.

function getMaxVaultsPerOperator() external view returns (uint8);

Returns

NameTypeDescription
<none>uint8The maximum number of vaults allowed per operator.

setMaxVaultsPerOperator

The new value must be greater than the previous value to prevent existing operators from exceeding the limit. Only callable by the owner.

function setMaxVaultsPerOperator(uint8 count) external;

Parameters

NameTypeDescription
countuint8The new maximum number of vaults per operator.

setVaultWhitelist

This allows the contract owner to control which vaults can be interacted with through the router. For non-granular state control, use the pause functionality to pause all vaults. When a vault is whitelisted, it can be interacted with through the router. The function will revert if the vault is already in the desired state.

function setVaultWhitelist(address vault_, bool isWhitelisted) external;

Parameters

NameTypeDescription
vault_addressThe address of the vault to set the whitelist status for. This should be a SLAYVault contract address but isn’t “strictly checked” (it is not possible to enforce this) to allow for flexible un-whitelisting of vaults for emergency purposes. Importantly: VaultFactory is not used to create vaults using the beacon pattern. Vaults are NOT automatically whitelisted when created to allow for vaults flexibility. This might change in the future.
isWhitelistedboolThe whitelist status to set (true to whitelist, false to un-whitelist).

isVaultWhitelisted

Check if a vault is whitelisted.

function isVaultWhitelisted(address vault_) external view returns (bool);

Parameters

NameTypeDescription
vault_addressThe address of the vault to check.

Returns

NameTypeDescription
<none>boolA boolean indicating whether the vault is whitelisted (true) or not (false).

setGuardrail

Set the guardrail address. Only callable by the owner.

function setGuardrail(address guardrail) external;

Parameters

NameTypeDescription
guardrailaddressThe address of the new guardrail contract.

getOperatorVaults

Get the list of vaults addresses managed by the operator.

This function copies all vaults addresses into memory bounded by the maximum number of vaults per operator.

function getOperatorVaults(address operator) external view returns (address[] memory);

Parameters

NameTypeDescription
operatoraddressThe address of the operator for which to retrieve the vaults.

Returns

NameTypeDescription
<none>address[]The list of vault addresses managed by the operator.

Events

VaultWhitelisted

Emitted when the vault whitelist status is updated.

event VaultWhitelisted(address indexed operator, address vault, bool whitelisted);

Parameters

NameTypeDescription
operatoraddressThe address of the operator associated with the vault.
vaultaddressThe address of the vault whose whitelist status was updated.
whitelistedboolThe new whitelist status of the vault.

MaxVaultsPerOperatorUpdated

Emitted when the maximum number of vaults per operator is updated.

event MaxVaultsPerOperatorUpdated(uint8 oldCount, uint8 count);

Parameters

NameTypeDescription
oldCountuint8The previous maximum number of vaults allowed per operator.
countuint8The new maximum number of vaults allowed per operator.

GuardrailUpdated

Emitted when the guardrail address is updated.

event GuardrailUpdated(address indexed oldGuardrail, address indexed guardrail);

Parameters

NameTypeDescription
oldGuardrailaddressThe address of the previous guardrail contract.
guardrailaddressThe address of the new guardrail contract.
Last updated on