VaultFactoryDeployment

Git Source

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

NameTypeDescription
bytecode_bytesThe bytecode of the contract to be deployed.

Returns

NameTypeDescription
address_addressReturns 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

NameTypeDescription
vaultDeploymentLogic_addressThe address of the vault deployment logic contract.
vaultDeploymentData_bytesThe data to be used for vault deployment.

Returns

NameTypeDescription
vault_addressReturns 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

NameTypeDescription
vaultId_uint256The ID of the vault.

Returns

NameTypeDescription
vault_addressReturns 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

NameTypeDescription
vault_addressThe vault address to check.

Returns

NameTypeDescription
<none>boolReturns 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

NameTypeDescription
<none>uint256Returns the total number of vaults.