Skip to main content

VaultRegistry.sol

All vaults are created through this contract

Methods

BEACON_CREATOR()

Solidity

function BEACON_CREATOR() external view returns (bytes32)

Returns

NameTypeDescription
_0bytes32undefined

DEFAULT_ADMIN_ROLE()

Solidity

function DEFAULT_ADMIN_ROLE() external view returns (bytes32)

Returns

NameTypeDescription
_0bytes32undefined

GOVERNANCE_ROLE()

Solidity

function GOVERNANCE_ROLE() external view returns (bytes32)

Returns

NameTypeDescription
_0bytes32undefined

PAUSER_ROLE()

Solidity

function PAUSER_ROLE() external view returns (bytes32)

Returns

NameTypeDescription
_0bytes32undefined

_linkedVaultsCounts(uint256)

Solidity

function _linkedVaultsCounts(uint256) external view returns (uint256)

Parameters

NameTypeDescription
_0uint256undefined

Returns

NameTypeDescription
_0uint256undefined

beaconAddresses(bytes32)

Solidity

function beaconAddresses(bytes32) external view returns (address)

Parameters

NameTypeDescription
_0bytes32undefined

Returns

NameTypeDescription
_0addressundefined

createVault(string,string,bytes,uint256,bytes32,uint256,bytes)

Creates a new vault with the given strategy

Solidity

function createVault(string _name, string _symbol, bytes _params, uint256 _tokenId, bytes32 _beaconName, uint256 _vaultType, bytes _strategyEncodedData) external nonpayable returns (address)
Details

Registers an execution bundle, mints an NFT and mappings it to execution bundle and it's details.owner is set as msg.sender.

Parameters

NameTypeDescription
_namestringThe name of the strategy. Auto-generate this using exec bundle and tokens?
_symbolstringthe symbol of the strategy.
_paramsbytesis extra parameters in vault.
_tokenIduint256is the NFT of the execution bundle this vault will be using.
_beaconNamebytes32beacon identifier of vault type to be created
_vaultTypeuint256undefined
_strategyEncodedDatabytesundefined

Returns

NameTypeDescription
_0addressundefined

deployAndRegisterBeacon(address,bytes32)

Deploy new beacon for a new vault type AND register it

Solidity

function deployAndRegisterBeacon(address _address, bytes32 _name) external nonpayable returns (address)

Parameters

NameTypeDescription
_addressaddressThe address of the implementation for the beacon
_namebytes32The name of the beacon (identifier)

Returns

NameTypeDescription
_0addressundefined

deregisterBeacon(bytes32)

Removes a beacon associated with a vault type

Solidity

function deregisterBeacon(bytes32 _name) external nonpayable
Details

This will stop the creation of more vaults of the type provided

Parameters

NameTypeDescription
_namebytes32The name of the beacon (identifier)

getRoleAdmin(bytes32)

Solidity

function getRoleAdmin(bytes32 role) external view returns (bytes32)
Details

Returns the admin role that controls role. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.

Parameters

NameTypeDescription
rolebytes32undefined

Returns

NameTypeDescription
_0bytes32undefined

getStrategyCreatorForVault(address)

Retrieves the creator of a given vault

Solidity

function getStrategyCreatorForVault(address _vault) external view returns (address)

Parameters

NameTypeDescription
_vaultaddressThe address of the vault

Returns

NameTypeDescription
_0addressThe address of the creator

getVaultByStrategyAndIndex(uint256,uint256)

Retrieves the vault by vault token id and vault index

Solidity

function getVaultByStrategyAndIndex(uint256 _tokenId, uint256 _vaultId) external view returns (struct IVaultRegistry.VaultData)

Parameters

NameTypeDescription
_tokenIduint256The token id of the vault
_vaultIduint256The index of the vault

Returns

NameTypeDescription
_0IVaultRegistry.VaultDataVault details

getVaultCountByStrategyId(uint256)

Retrieves the vault count by vault token id

Solidity

function getVaultCountByStrategyId(uint256 _tokenId) external view returns (uint256)

Parameters

NameTypeDescription
_tokenIduint256The token id of the vault

Returns

NameTypeDescription
_0uint256The count of the vault

getVaultDetails(address)

Retrieves the details of a given vault by address

Solidity

function getVaultDetails(address _address) external view returns (struct IVaultRegistry.VaultData)

Parameters

NameTypeDescription
_addressaddressThe address of the vault

Returns

NameTypeDescription
_0IVaultRegistry.VaultDataThe details of the vault

grantRole(bytes32,address)

Solidity

function grantRole(bytes32 role, address account) external nonpayable
Details

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

NameTypeDescription
rolebytes32undefined
accountaddressundefined

hasRole(bytes32,address)

Solidity

function hasRole(bytes32 role, address account) external view returns (bool)
Details

Returns true if account has been granted role.

Parameters

NameTypeDescription
rolebytes32undefined
accountaddressundefined

Returns

NameTypeDescription
_0boolundefined

initialize(address,address,bytes32,address)

intializes the vault registry

Solidity

function initialize(address payable _orchestrator, address _strategyRegistry, bytes32 _beaconName, address _beacon) external nonpayable

Parameters

NameTypeDescription
_orchestratoraddress payableThe address of the orchestrator
_strategyRegistryaddressThe address of the strategy registry
_beaconNamebytes32The name of the beacon (identifier)
_beaconaddressThe address of the upgrade beacon

isVaultTypeCreated(bytes)

Solidity

function isVaultTypeCreated(bytes) external view returns (bool)

Parameters

NameTypeDescription
_0bytesundefined

Returns

NameTypeDescription
_0boolundefined

orchestrator()

Solidity

function orchestrator() external view returns (contract Orchestrator)

Returns

NameTypeDescription
_0contract Orchestratorundefined

owner()

Solidity

function owner() external view returns (address)
Details

Returns the address of the current owner.

Returns

NameTypeDescription
_0addressundefined

pause()

Pauses the minting of the ERC721 tokens for the vault

Solidity

function pause() external nonpayable
Details

This function is only available to the pauser role

paused()

Solidity

function paused() external view returns (bool)
Details

Returns true if the contract is paused, and false otherwise.

Returns

NameTypeDescription
_0boolundefined

registerBeacon(bytes32,address)

Registers a beacon associated with a new vault type

Solidity

function registerBeacon(bytes32 _name, address _address) external nonpayable
Details

This function is only available to the beacon creator

Parameters

NameTypeDescription
_namebytes32The name of the vault type this beacon will be using
_addressaddressThe address of the upgrade beacon

renounceOwnership()

Solidity

function renounceOwnership() external nonpayable
Details

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)

Solidity

function renounceRole(bytes32 role, address account) external nonpayable
Details

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

NameTypeDescription
rolebytes32undefined
accountaddressundefined

revokeRole(bytes32,address)

Solidity

function revokeRole(bytes32 role, address account) external nonpayable
Details

Revokes role from account. If account had been granted role, emits a {RoleRevoked} event. Requirements: - the caller must have role's admin role.

Parameters

NameTypeDescription
rolebytes32undefined
accountaddressundefined

strategyRegistry()

Solidity

function strategyRegistry() external view returns (contract IStrategyRegistry)

Returns

NameTypeDescription
_0contract IStrategyRegistryundefined

supportsInterface(bytes4)

Solidity

function supportsInterface(bytes4 interfaceId) external view returns (bool)
Details

See {IERC165-supportsInterface}.

Parameters

NameTypeDescription
interfaceIdbytes4undefined

Returns

NameTypeDescription
_0boolundefined

transferOwnership(address)

Solidity

function transferOwnership(address newOwner) external nonpayable
Details

Transfers ownership of the contract to a new account (newOwner). Can only be called by the current owner.

Parameters

NameTypeDescription
newOwneraddressundefined

updateVaultState(address,uint8)

Updates the vault state and emits a VaultStateChanged event

Solidity

function updateVaultState(address _vault, enum IVaultRegistry.VaultState _newState) external nonpayable
Details

This function is only available to the registry owner

Parameters

NameTypeDescription
_vaultaddressThe address of the vault
_newStateenum IVaultRegistry.VaultStateThe new state of the vault

upgradeTo(address)

Solidity

function upgradeTo(address newImplementation) external nonpayable
Details

Upgrade the implementation of the proxy to newImplementation. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.

Parameters

NameTypeDescription
newImplementationaddressundefined

upgradeToAndCall(address,bytes)

Solidity

function upgradeToAndCall(address newImplementation, bytes data) external payable
Details

Upgrade the implementation of the proxy to newImplementation, and subsequently execute the function call encoded in data. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.

Parameters

NameTypeDescription
newImplementationaddressundefined
databytesundefined

vaults(address)

Solidity

function vaults(address) external view returns (enum IVaultRegistry.VaultState state, uint256 vaultType, uint256 tokenID, uint256 vaultID, bytes strategyInfo, address vaultAddress)

Parameters

NameTypeDescription
_0addressundefined

Returns

NameTypeDescription
stateenum IVaultRegistry.VaultStateundefined
vaultTypeuint256undefined
tokenIDuint256undefined
vaultIDuint256undefined
strategyInfobytesundefined
vaultAddressaddressundefined

Events

AdminChanged

Solidity

event AdminChanged(address previousAdmin, address newAdmin)

Parameters

NameTypeDescription
previousAdminaddressundefined
newAdminaddressundefined

BeaconUpgraded

Solidity

event BeaconUpgraded(address indexed beacon)

Parameters

NameTypeDescription
beacon indexedaddressundefined

OwnershipTransferred

Solidity

event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)

Parameters

NameTypeDescription
previousOwner indexedaddressundefined
newOwner indexedaddressundefined

Paused

Solidity

event Paused(address account)

Parameters

NameTypeDescription
accountaddressundefined

RoleAdminChanged

Solidity

event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)

Parameters

NameTypeDescription
role indexedbytes32undefined
previousAdminRole indexedbytes32undefined
newAdminRole indexedbytes32undefined

RoleGranted

Solidity

event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)

Parameters

NameTypeDescription
role indexedbytes32undefined
account indexedaddressundefined
sender indexedaddressundefined

RoleRevoked

Solidity

event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)

Parameters

NameTypeDescription
role indexedbytes32undefined
account indexedaddressundefined
sender indexedaddressundefined

Unpaused

Solidity

event Unpaused(address account)

Parameters

NameTypeDescription
accountaddressundefined

Upgraded

Solidity

event Upgraded(address indexed implementation)

Parameters

NameTypeDescription
implementation indexedaddressundefined

VaultCreated

Vault creation event

Solidity

event VaultCreated(address deployer, address vault, uint256 indexed tokenID, string name)

Parameters

NameTypeDescription
deployeraddressThe address of the deployer
vaultaddressThe address of the vault
tokenID indexeduint256ERC721 token id for the vault
namestringThe name of the vault

VaultStateChanged

Vault state change event

Solidity

event VaultStateChanged(address vault, enum IVaultRegistry.VaultState newState)

Parameters

NameTypeDescription
vaultaddressThe address of the vault
newStateenum IVaultRegistry.VaultStateThe new state of the vault