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
Name | Type | Description |
---|---|---|
<none> | uint8 | The 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
Name | Type | Description |
---|---|---|
count | uint8 | The 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
Name | Type | Description |
---|---|---|
vault_ | address | The 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. |
isWhitelisted | bool | The 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
Name | Type | Description |
---|---|---|
vault_ | address | The address of the vault to check. |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | A 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
Name | Type | Description |
---|---|---|
guardrail | address | The 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
Name | Type | Description |
---|---|---|
operator | address | The address of the operator for which to retrieve the vaults. |
Returns
Name | Type | Description |
---|---|---|
<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
Name | Type | Description |
---|---|---|
operator | address | The address of the operator associated with the vault. |
vault | address | The address of the vault whose whitelist status was updated. |
whitelisted | bool | The 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
Name | Type | Description |
---|---|---|
oldCount | uint8 | The previous maximum number of vaults allowed per operator. |
count | uint8 | The 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
Name | Type | Description |
---|---|---|
oldGuardrail | address | The address of the previous guardrail contract. |
guardrail | address | The address of the new guardrail contract. |