VaultRegistry.sol
All vaults are created through this contract
Methods
BEACON_CREATOR()
function BEACON_CREATOR() external view returns (bytes32)
Returns
Name | Type | Description |
---|---|---|
_0 | bytes32 | undefined |
DEFAULT_ADMIN_ROLE()
function DEFAULT_ADMIN_ROLE() external view returns (bytes32)
Returns
Name | Type | Description |
---|---|---|
_0 | bytes32 | undefined |
GOVERNANCE_ROLE()
function GOVERNANCE_ROLE() external view returns (bytes32)
Returns
Name | Type | Description |
---|---|---|
_0 | bytes32 | undefined |
PAUSER_ROLE()
function PAUSER_ROLE() external view returns (bytes32)
Returns
Name | Type | Description |
---|---|---|
_0 | bytes32 | undefined |
_linkedVaultsCounts(uint256)
function _linkedVaultsCounts(uint256) external view returns (uint256)
Parameters
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
beaconAddresses(bytes32)
function beaconAddresses(bytes32) external view returns (address)
Parameters
Name | Type | Description |
---|---|---|
_0 | bytes32 | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | address | undefined |
createVault(string,string,bytes,uint256,bytes32,uint256,bytes)
Creates a new vault with the given strategy
function createVault(string _name, string _symbol, bytes _params, uint256 _tokenId, bytes32 _beaconName, uint256 _vaultType, bytes _strategyEncodedData) external nonpayable returns (address)
Registers an execution bundle, mints an NFT and mappings it to execution bundle and it's details.owner is set as msg.sender.
Parameters
Name | Type | Description |
---|---|---|
_name | string | The name of the strategy. Auto-generate this using exec bundle and tokens? |
_symbol | string | the symbol of the strategy. |
_params | bytes | is extra parameters in vault. |
_tokenId | uint256 | is the NFT of the execution bundle this vault will be using. |
_beaconName | bytes32 | beacon identifier of vault type to be created |
_vaultType | uint256 | undefined |
_strategyEncodedData | bytes | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | address | undefined |
deployAndRegisterBeacon(address,bytes32)
Deploy new beacon for a new vault type AND register it
function deployAndRegisterBeacon(address _address, bytes32 _name) external nonpayable returns (address)
Parameters
Name | Type | Description |
---|---|---|
_address | address | The address of the implementation for the beacon |
_name | bytes32 | The name of the beacon (identifier) |
Returns
Name | Type | Description |
---|---|---|
_0 | address | undefined |
deregisterBeacon(bytes32)
Removes a beacon associated with a vault type
function deregisterBeacon(bytes32 _name) external nonpayable
This will stop the creation of more vaults of the type provided
Parameters
Name | Type | Description |
---|---|---|
_name | bytes32 | The name of the beacon (identifier) |
getRoleAdmin(bytes32)
function getRoleAdmin(bytes32 role) external view returns (bytes32)
Returns the admin role that controls role
. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.
Parameters
Name | Type | Description |
---|---|---|
role | bytes32 | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | bytes32 | undefined |
getStrategyCreatorForVault(address)
Retrieves the creator of a given vault
function getStrategyCreatorForVault(address _vault) external view returns (address)
Parameters
Name | Type | Description |
---|---|---|
_vault | address | The address of the vault |
Returns
Name | Type | Description |
---|---|---|
_0 | address | The address of the creator |
getVaultByStrategyAndIndex(uint256,uint256)
Retrieves the vault by vault token id and vault index
function getVaultByStrategyAndIndex(uint256 _tokenId, uint256 _vaultId) external view returns (struct IVaultRegistry.VaultData)
Parameters
Name | Type | Description |
---|---|---|
_tokenId | uint256 | The token id of the vault |
_vaultId | uint256 | The index of the vault |
Returns
Name | Type | Description |
---|---|---|
_0 | IVaultRegistry.VaultData | Vault details |
getVaultCountByStrategyId(uint256)
Retrieves the vault count by vault token id
function getVaultCountByStrategyId(uint256 _tokenId) external view returns (uint256)
Parameters
Name | Type | Description |
---|---|---|
_tokenId | uint256 | The token id of the vault |
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | The count of the vault |
getVaultDetails(address)
Retrieves the details of a given vault by address
function getVaultDetails(address _address) external view returns (struct IVaultRegistry.VaultData)
Parameters
Name | Type | Description |
---|---|---|
_address | address | The address of the vault |
Returns
Name | Type | Description |
---|---|---|
_0 | IVaultRegistry.VaultData | The details of the vault |
grantRole(bytes32,address)
function grantRole(bytes32 role, address account) external nonpayable
Grants role
to account
. If account
had not been already granted role
, emits a {RoleGranted} event. Requirements: - the caller must have role
's admin role.
Parameters
Name | Type | Description |
---|---|---|
role | bytes32 | undefined |
account | address | undefined |
hasRole(bytes32,address)
function hasRole(bytes32 role, address account) external view returns (bool)
Returns true
if account
has been granted role
.
Parameters
Name | Type | Description |
---|---|---|
role | bytes32 | undefined |
account | address | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | bool | undefined |
initialize(address,address,bytes32,address)
intializes the vault registry
function initialize(address payable _orchestrator, address _strategyRegistry, bytes32 _beaconName, address _beacon) external nonpayable
Parameters
Name | Type | Description |
---|---|---|
_orchestrator | address payable | The address of the orchestrator |
_strategyRegistry | address | The address of the strategy registry |
_beaconName | bytes32 | The name of the beacon (identifier) |
_beacon | address | The address of the upgrade beacon |
isVaultTypeCreated(bytes)
function isVaultTypeCreated(bytes) external view returns (bool)
Parameters
Name | Type | Description |
---|---|---|
_0 | bytes | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | bool | undefined |
orchestrator()
function orchestrator() external view returns (contract Orchestrator)
Returns
Name | Type | Description |
---|---|---|
_0 | contract Orchestrator | undefined |
owner()
function owner() external view returns (address)
Returns the address of the current owner.
Returns
Name | Type | Description |
---|---|---|
_0 | address | undefined |
pause()
Pauses the minting of the ERC721 tokens for the vault
function pause() external nonpayable
This function is only available to the pauser role
paused()
function paused() external view returns (bool)
Returns true if the contract is paused, and false otherwise.
Returns
Name | Type | Description |
---|---|---|
_0 | bool | undefined |
registerBeacon(bytes32,address)
Registers a beacon associated with a new vault type
function registerBeacon(bytes32 _name, address _address) external nonpayable
This function is only available to the beacon creator
Parameters
Name | Type | Description |
---|---|---|
_name | bytes32 | The name of the vault type this beacon will be using |
_address | address | The address of the upgrade beacon |
renounceOwnership()
function renounceOwnership() external nonpayable
Leaves the contract without owner. It will not be possible to call onlyOwner
functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.
renounceRole(bytes32,address)
function renounceRole(bytes32 role, address account) external nonpayable
Revokes role
from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked role
, emits a {RoleRevoked} event. Requirements: - the caller must be account
.
Parameters
Name | Type | Description |
---|---|---|
role | bytes32 | undefined |
account | address | undefined |
revokeRole(bytes32,address)
function revokeRole(bytes32 role, address account) external nonpayable
Revokes role
from account
. If account
had been granted role
, emits a {RoleRevoked} event. Requirements: - the caller must have role
's admin role.
Parameters
Name | Type | Description |
---|---|---|
role | bytes32 | undefined |
account | address | undefined |
strategyRegistry()
function strategyRegistry() external view returns (contract IStrategyRegistry)
Returns
Name | Type | Description |
---|---|---|
_0 | contract IStrategyRegistry | undefined |
supportsInterface(bytes4)
function supportsInterface(bytes4 interfaceId) external view returns (bool)
See {IERC165-supportsInterface}.
Parameters
Name | Type | Description |
---|---|---|
interfaceId | bytes4 | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | bool | undefined |
transferOwnership(address)
function transferOwnership(address newOwner) external nonpayable
Transfers ownership of the contract to a new account (newOwner
). Can only be called by the current owner.
Parameters
Name | Type | Description |
---|---|---|
newOwner | address | undefined |
updateVaultState(address,uint8)
Updates the vault state and emits a VaultStateChanged event
function updateVaultState(address _vault, enum IVaultRegistry.VaultState _newState) external nonpayable
This function is only available to the registry owner
Parameters
Name | Type | Description |
---|---|---|
_vault | address | The address of the vault |
_newState | enum IVaultRegistry.VaultState | The new state of the vault |
upgradeTo(address)
function upgradeTo(address newImplementation) external nonpayable
Upgrade the implementation of the proxy to newImplementation
. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.
Parameters
Name | Type | Description |
---|---|---|
newImplementation | address | undefined |
upgradeToAndCall(address,bytes)
function upgradeToAndCall(address newImplementation, bytes data) external payable
Upgrade the implementation of the proxy to newImplementation
, and subsequently execute the function call encoded in data
. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.
Parameters
Name | Type | Description |
---|---|---|
newImplementation | address | undefined |
data | bytes | undefined |
vaults(address)
function vaults(address) external view returns (enum IVaultRegistry.VaultState state, uint256 vaultType, uint256 tokenID, uint256 vaultID, bytes strategyInfo, address vaultAddress)
Parameters
Name | Type | Description |
---|---|---|
_0 | address | undefined |
Returns
Name | Type | Description |
---|---|---|
state | enum IVaultRegistry.VaultState | undefined |
vaultType | uint256 | undefined |
tokenID | uint256 | undefined |
vaultID | uint256 | undefined |
strategyInfo | bytes | undefined |
vaultAddress | address | undefined |
Events
AdminChanged
event AdminChanged(address previousAdmin, address newAdmin)
Parameters
Name | Type | Description |
---|---|---|
previousAdmin | address | undefined |
newAdmin | address | undefined |
BeaconUpgraded
event BeaconUpgraded(address indexed beacon)
Parameters
Name | Type | Description |
---|---|---|
beacon indexed | address | undefined |
OwnershipTransferred
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
Parameters
Name | Type | Description |
---|---|---|
previousOwner indexed | address | undefined |
newOwner indexed | address | undefined |
Paused
event Paused(address account)
Parameters
Name | Type | Description |
---|---|---|
account | address | undefined |
RoleAdminChanged
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)
Parameters
Name | Type | Description |
---|---|---|
role indexed | bytes32 | undefined |
previousAdminRole indexed | bytes32 | undefined |
newAdminRole indexed | bytes32 | undefined |
RoleGranted
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)
Parameters
Name | Type | Description |
---|---|---|
role indexed | bytes32 | undefined |
account indexed | address | undefined |
sender indexed | address | undefined |
RoleRevoked
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)
Parameters
Name | Type | Description |
---|---|---|
role indexed | bytes32 | undefined |
account indexed | address | undefined |
sender indexed | address | undefined |
Unpaused
event Unpaused(address account)
Parameters
Name | Type | Description |
---|---|---|
account | address | undefined |
Upgraded
event Upgraded(address indexed implementation)
Parameters
Name | Type | Description |
---|---|---|
implementation indexed | address | undefined |
VaultCreated
Vault creation event
event VaultCreated(address deployer, address vault, uint256 indexed tokenID, string name)
Parameters
Name | Type | Description |
---|---|---|
deployer | address | The address of the deployer |
vault | address | The address of the vault |
tokenID indexed | uint256 | ERC721 token id for the vault |
name | string | The name of the vault |
VaultStateChanged
Vault state change event
event VaultStateChanged(address vault, enum IVaultRegistry.VaultState newState)
Parameters
Name | Type | Description |
---|---|---|
vault | address | The address of the vault |
newState | enum IVaultRegistry.VaultState | The new state of the vault |