IVaultFactory
Interface for a factory contract that allows anyone to reliably deploy a new IVault
contract
VaultCreated
A new Vault is deployed
MUST be triggered on a successful deployment
Parameters
Name | Type | Description |
---|---|---|
vaultOwner | address | The vault owner |
vault | address | The vault address |
deploy
Deploys a new Vault contract
This function creates a new Vault instance It MUST emit a VaultCreated event upon successful creation An IVault type object is returned because Vault implementations are specific to each implementation but have to follow the IVault interface
Parameters
Name | Type | Description |
---|---|---|
data | bytes | For any additional initialization |
Return Values
Name | Type | Description |
---|---|---|
[0] | contract IVault | IVault The created Vault contract following IVault interface |
deployDeterministic
Deploys a new Vault contract at a deterministic address
This function creates a new Vault instance at a deterministic address, we recommend using the Create2 opcode It MUST emit a VaultCreated event upon successful creation An IVault type object is returned because Vault implementations are specific to each implementation but have to follow the IVault interface
Parameters
Name | Type | Description |
---|---|---|
salt | bytes32 | A unique value to ensure the deterministic address is unique |
data | bytes | For any additional initialization |
Return Values
Name | Type | Description |
---|---|---|
[0] | contract IVault | IVault The created Vault contract following IVault interface |
computeVaultAddress
Computes the deterministic address of a Vault contract
This function calculates the address where a Vault contract will be deployed we recommend the use of Create2 opcode, given the deployer's address and a salt
Parameters
Name | Type | Description |
---|---|---|
deployer | address | The address of the deployer |
salt | bytes32 | A unique value to ensure the deterministic address is unique |
data | bytes | For any additional initialization |
Return Values
Name | Type | Description |
---|---|---|
[0] | address | address The computed deterministic address of the Vault contract |