VaultDataObject
Data Object to interact with vault factories, generic vaults and the information of managed vaults
The VaultFactory is a external contract that MUST implement the IVaultFactory interface and deploys vaults that MUST implement the IVault interface
UnknownVault
Error thrown when the vault is unknown
UnknownSalt
Error thrown when the salt is not associated with any vault
UnknownDataPoint
Error thrown when the DataPoint is not associated with any data
DeployedVaultAlreadyRegistered
Error thrown when the vault is already registered NOTE: This should not normally happen, but faulty VaultFactory can return wrong address
SignatureVerificationData
Data structure to store the valid signers for a given vault
Parameters
Name | Type | Description |
---|
DpData
Data structure for Vault Data Object
Parameters
Name | Type | Description |
---|
_vaultsToDataPoints
Mapping of Vault to DataPoint identifier
isValidSignature
Should return whether the signature provided is valid for the provided data
Parameters
Name | Type | Description |
---|---|---|
hash | bytes32 | Hash of the data to be signed |
signature | bytes | Signature byte array associated with hash |
computeDeterministicVaultAddress
Function used to get the deterministic vault address for a given salt
Parameters
Name | Type | Description |
---|---|---|
dp | DataPoint | DataPoint identifier |
factory | address | The vault factory address |
salt | bytes32 | A unique value to ensure the deterministic address is unique |
data | bytes | Data for any additional initialization |
datapointOfVault
Function used to get the DataPoint associated with a vault address
Parameters
Name | Type | Description |
---|---|---|
vault | address | The vault address |
Return Values
Name | Type | Description |
---|---|---|
[0] | DataPoint | The DataPoint identifier |
_dispatchRead
_dispatchWrite
_vaultForSalt
Function used to get the deterministic vault address for a given salt
Parameters
Name | Type | Description |
---|---|---|
dp | DataPoint | DataPoint identifier |
salt | bytes32 | The salt used to deploy the deterministic vault |
Return Values
Name | Type | Description |
---|---|---|
[0] | address | The vault address NOTE: Reverts if the vault does not exist The salt is the one provided by the DM, not the deploymentSalt calculated by _buildDeterministicDeploymentSalt() in DataObject |
_allVaults
Function used to get all vaults associated to given data point
Parameters
Name | Type | Description |
---|---|---|
dp | DataPoint | DataPoint identifier |
Return Values
Name | Type | Description |
---|---|---|
[0] | address[] | The list of vault addresses |
_deployVault
Function used to deploy a new vault
Parameters
Name | Type | Description |
---|---|---|
dp | DataPoint | DataPoint identifier |
factory | address | The factory address |
data | bytes | Data for any additional initialization |
Return Values
Name | Type | Description |
---|---|---|
[0] | address | The vault address NOTE: Reverts if the vault is already registered |
_deployDeterministicVault
Function used to deploy a new deterministic vault
Parameters
Name | Type | Description |
---|---|---|
dp | DataPoint | DataPoint identifier |
factory | address | The factory address |
salt | bytes32 | A unique value to ensure the deterministic address is unique |
data | bytes | Data for any additional initialization |
Return Values
Name | Type | Description |
---|---|---|
[0] | address | The vault address NOTE: Reverts if the vault is already registered The salt used in the deploy is calculated by _buildDeterministicDeploymentSalt() with the salt provided here and the DataPoint |
_addSignatureValidationData
Operation used to add a valid signer for a vault for a specific hash
Parameters
Name | Type | Description |
---|---|---|
dp | DataPoint | DataPoint identifier |
vault | address | The vault address to add the signer to |
hash | bytes32 | The hash to add the signer to |
signer | address | The signer address |
_revokeSignatureValidationData
Operation used to revoke a valid signer for a vault for a specific hash
Parameters
Name | Type | Description |
---|---|---|
dp | DataPoint | DataPoint identifier |
vault | address | The vault address to revoke the signer from |
hash | bytes32 | The hash to revoke the signer from |
signer | address | The signer address |
_vaultExecute
Function used to execute a call on a vault
Parameters
Name | Type | Description |
---|---|---|
dp | DataPoint | DataPoint identifier |
vault | address | The vault address |
target | address | The target address |
data | bytes | The call data |
value | uint256 | The call value |
_buildDeterministicDeploymentSalt
Calculates deployment salt
Parameters
Name | Type | Description |
---|---|---|
dp | DataPoint | DataPoint for the Vault |
salt | bytes32 | Salt provided by DataManager on Vault deployment |
Return Values
Name | Type | Description |
---|---|---|
[0] | bytes32 | deployment salt which is sent to the VaultFactory NOTE: This function can be used to calculate deploymentSalt sent to the Factory |