VaultRegistry.sol
All vaults are created through this contract
Methods
DEFAULT_ADMIN_ROLE()
function DEFAULT_ADMIN_ROLE() external view returns (bytes32)
Returns
| Name | Type | Description |
|---|---|---|
| _0 | bytes32 | undefined |
beaconAddresses(string)
function beaconAddresses(string) external view returns (address)
Parameters
| Name | Type | Description |
|---|---|---|
| _0 | string | undefined |
Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined |
beaconTypes(address)
function beaconTypes(address) external view returns (string)
Parameters
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined |
Returns
| Name | Type | Description |
|---|---|---|
| _0 | string | undefined |
createVault(bytes,uint256,string,address,string)
function createVault(bytes _params, uint256 _tokenId, string _beaconName, address _vaultManager, string _payloadIpfs) external nonpayable returns (address)
Creates a new vault with the given strategyRegisters 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 |
|---|---|---|
| _params | bytes | is extra parameters in vault. |
| _tokenId | uint256 | is the NFT of the execution bundle this vault will be using. Note that if the given tokenID does not yet exist, the vault will remain inactive. |
| _beaconName | string | beacon identifier of vault type to be created |
| _vaultManager | address | is the address which will manage the vault being created |
| _payloadIpfs | string | undefined |
Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined |
deployAndRegisterBeacon(address,string,string)
function deployAndRegisterBeacon(address _address, string _name, string _ipfsConfigForBeacon) external nonpayable returns (address)
Deploy new beacon for a new vault type AND register it
Parameters
| Name | Type | Description |
|---|---|---|
| _address | address | The address of the implementation for the beacon |
| _name | string | The name of the beacon (identifier) |
| _ipfsConfigForBeacon | string | IPFS hash for the config of this beacon note that the contract registered as a beacon should not be used as a vault, to avoid confusion. |
Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined |
deregisterBeacon(string)
function deregisterBeacon(string _name) external nonpayable
Removes a beacon associated with a vault typeThis will stop the creation of more vaults of the type provided
Parameters
| Name | Type | Description |
|---|---|---|
| _name | string | The name of the beacon (identifier) |
doISupportInterface(bytes4)
function doISupportInterface(bytes4 interfaceId) external view returns (bool)
check whether msg.sender supports a given interface id. Used to support ERC165 from a central location.
Parameters
| Name | Type | Description |
|---|---|---|
| interfaceId | bytes4 | the interface id to check |
Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined |
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)
function getStrategyCreatorForVault(address _vault) external view returns (address)
Retrieves the creator of a given vault
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)
function getVaultByStrategyAndIndex(uint256 _tokenId, uint256 _vaultId) external view returns (struct VaultRegistry.VaultData)
Retrieves the vault by vault token id and vault index
Parameters
| Name | Type | Description |
|---|---|---|
| _tokenId | uint256 | The token id of the vault |
| _vaultId | uint256 | The index of the vault |
Returns
| Name | Type | Description |
|---|---|---|
| _0 | VaultRegistry.VaultData | Vault details |
getVaultCountByStrategyId(uint256)
function getVaultCountByStrategyId(uint256 _tokenId) external view returns (uint256)
Retrieves the vault count by vault token id
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)
function getVaultDetails(address _address) external view returns (struct VaultRegistry.VaultData)
Retrieves the details of a given vault by address
Parameters
| Name | Type | Description |
|---|---|---|
| _address | address | The address of the vault |
Returns
| Name | Type | Description |
|---|---|---|
| _0 | VaultRegistry.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,address)
function initialize(address _strategyRegistry, address _internalGovernance, address _whitelistRegistry) external nonpayable
intializes the vault registry
Parameters
| Name | Type | Description |
|---|---|---|
| _strategyRegistry | address | The address of the strategy registry |
| _internalGovernance | address | The address of Internal Governance |
| _whitelistRegistry | address | Address of whitelist registry which keeps track of whitelist managers and members of whitelisted vaults |
interfaceImplementations(string,bytes4)
function interfaceImplementations(string, bytes4) external view returns (bool)
Parameters
| Name | Type | Description |
|---|---|---|
| _0 | string | undefined |
| _1 | bytes4 | undefined |
Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined |
linkedVaults(uint256,uint256)
function linkedVaults(uint256, uint256) external view returns (address)
Parameters
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined |
| _1 | uint256 | undefined |
Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined |
owner()
function owner() external view returns (address)
Returns the address of the current owner.
Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined |
pause()
function pause() external nonpayable
Pauses the minting of the ERC721 tokens for the vaultThis 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(string,address,string)
function registerBeacon(string _name, address _address, string _ipfsConfigForBeacon) external nonpayable
Registers a beacon associated with a new vault typeThis function is only available to the beacon creatorRegisters any address as a new beacon. Useful for alternative beacon types (i.e. a contract which will use a proxy structure other than the standard beacon).
Parameters
| Name | Type | Description |
|---|---|---|
| _name | string | The name of the vault type this beacon will be using |
| _address | address | The address of the beacon contract |
| _ipfsConfigForBeacon | string | IPFS hash for the config of this 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 |
totalVaultCount()
function totalVaultCount() external view returns (uint256)
Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | 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 |
unpause()
function unpause() external nonpayable
updateBeaconConfig(string,string)
function updateBeaconConfig(string _name, string _newIPFSConfigForBeacon) external nonpayable
Updates the ipfs link storing the beaconConfig
Parameters
| Name | Type | Description |
|---|---|---|
| _name | string | The name of the beacon (identifier) |
| _newIPFSConfigForBeacon | string | IPFS hash for the config of this beacon |
updateInterfaceImplementations(string,bytes4[],bool[])
function updateInterfaceImplementations(string beaconName, bytes4[] selectors, bool[] isImplemented) external nonpayable
add interface info to given beacon
Parameters
| Name | Type | Description |
|---|---|---|
| beaconName | string | undefined |
| selectors | bytes4[] | undefined |
| isImplemented | bool[] | undefined |
updateVaultState(address,uint8)
function updateVaultState(address _vault, enum VaultRegistry.VaultState _newState) external nonpayable
Updates the vault state and emits a VaultStateChanged eventThis function is only available to the registry owner.
Parameters
| Name | Type | Description |
|---|---|---|
| _vault | address | The address of the vault |
| _newState | enum VaultRegistry.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 |
whitelistRegistry()
function whitelistRegistry() external view returns (address)
Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined |
Events
AdminChanged
event AdminChanged(address previousAdmin, address newAdmin)
Parameters
| Name | Type | Description |
|---|---|---|
| previousAdmin | address | undefined |
| newAdmin | address | undefined |
BeaconConfigUpdated
event BeaconConfigUpdated(string _name, string _ipfsHash)
Parameters
| Name | Type | Description |
|---|---|---|
| _name | string | undefined |
| _ipfsHash | string | undefined |
BeaconDeregistered
event BeaconDeregistered(string _name)
Parameters
| Name | Type | Description |
|---|---|---|
| _name | string | undefined |
BeaconRegistered
event BeaconRegistered(string _name, address _address, string _ipfsHash)
Parameters
| Name | Type | Description |
|---|---|---|
| _name | string | undefined |
| _address | address | undefined |
| _ipfsHash | string | 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
event VaultCreated(address deployer, address vault, string beaconName, uint256 indexed tokenId, address vaultManager)
Vault creation event
Parameters
| Name | Type | Description |
|---|---|---|
| deployer | address | The address of the deployer |
| vault | address | The address of the vault |
| beaconName | string | undefined |
tokenId indexed | uint256 | ERC721 token id for the vault |
| vaultManager | address | is the address which will manage the vault being created |
VaultStateChanged
event VaultStateChanged(address indexed vault, enum VaultRegistry.VaultState newState)
Vault state change event
Parameters
| Name | Type | Description |
|---|---|---|
vault indexed | address | The address of the vault |
| newState | enum VaultRegistry.VaultState | The new state of the vault |
Errors
IncorrectArrayLengths
error IncorrectArrayLengths(uint256 selectorLength, uint256 isImplementedLength)
Parameters
| Name | Type | Description |
|---|---|---|
| selectorLength | uint256 | undefined |
| isImplementedLength | uint256 | undefined |