VaultFactoryDeployment
Inherits:VaultFactoryCore, VaultFactoryAuth
implements VaultFactory deploy vault related methods.
Functions
_deploy
Deploys a contract using the CREATE opcode with the provided bytecode (bytecode_
).
This is an internal function, meant to be used within the contract to facilitate the deployment of other contracts.
function _deploy(bytes memory bytecode_) internal returns (address address_);
Parameters
Name | Type | Description |
---|---|---|
bytecode_ | bytes | The bytecode of the contract to be deployed. |
Returns
Name | Type | Description |
---|---|---|
address_ | address | Returns the address of the deployed contract. |
deployVault
Deploys a new vault using the specified deployment logic vaultDeploymentLogic_
and data vaultDeploymentData_
.
Only accounts with deployer access or the owner can deploy a new vault.
function deployVault(address vaultDeploymentLogic_, bytes calldata vaultDeploymentData_)
external
returns (address vault_);
Parameters
Name | Type | Description |
---|---|---|
vaultDeploymentLogic_ | address | The address of the vault deployment logic contract. |
vaultDeploymentData_ | bytes | The data to be used for vault deployment. |
Returns
Name | Type | Description |
---|---|---|
vault_ | address | Returns the address of the newly deployed vault. |
getVaultAddress
Computes the address of a vault based on its given ID (vaultId_
).
function getVaultAddress(uint256 vaultId_) public view returns (address vault_);
Parameters
Name | Type | Description |
---|---|---|
vaultId_ | uint256 | The ID of the vault. |
Returns
Name | Type | Description |
---|---|---|
vault_ | address | Returns the computed address of the vault. |
isVault
Checks if a given address (vault_
) corresponds to a valid vault.
function isVault(address vault_) public view returns (bool);
Parameters
Name | Type | Description |
---|---|---|
vault_ | address | The vault address to check. |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | Returns true if the given address corresponds to a valid vault, otherwise false . |
totalVaults
Returns the total number of vaults deployed by the factory.
function totalVaults() external view returns (uint256);
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | Returns the total number of vaults. |