AeraV2Factory

AeraV2Factory

Inherits: IAeraV2Factory, Sweepable

Used to create new vaults and deploy modules.

Only one instance of the factory will be required per chain.

State Variables

wrappedNativeToken

The address of wrapped native token.

address public immutable wrappedNativeToken;

parameters

STORAGE ///

Vault parameters for vault deployment.

Parameters public override parameters;

Functions

constructor

FUNCTIONS ///

Initialize the factory contract.

constructor(address wrappedNativeToken_) Ownable;

Parameters

create

Create V2 vault.

function create(
    bytes32 saltInput,
    string calldata description,
    VaultParameters calldata vaultParameters,
    AssetRegistryParameters calldata assetRegistryParameters,
    HooksParameters calldata hooksParameters
)
    external
    override
    onlyOwner
    returns (
        address deployedVault,
        address deployedAssetRegistry,
        address deployedHooks
    );

Parameters

Returns

computeVaultAddress

Calculate deployment address of V2 vault.

function computeVaultAddress(
    bytes32 saltInput,
    string calldata description,
    VaultParameters calldata vaultParameters
) external view override returns (address);

Parameters

_deployAssetRegistry

INTERNAL FUNCTIONS ///

Deploy asset registry.

function _deployAssetRegistry(
    bytes32 salt,
    address vault,
    AssetRegistryParameters memory assetRegistryParameters
) internal returns (address deployed);

Parameters

Returns

_deployHooks

Deploy hooks.

function _deployHooks(
    bytes32 salt,
    address vault,
    HooksParameters memory hooksParameters
) internal returns (address deployed);

Parameters

Returns

_deployVault

Deploy V2 vault.

function _deployVault(
    bytes32 salt,
    address assetRegistry,
    address hooks,
    string calldata description,
    VaultParameters memory vaultParameters
) internal returns (address deployed);

Parameters

Returns

_computeVaultAddress

Calculate deployment address of V2 vault.

function _computeVaultAddress(bytes32 salt) internal view returns (address);

Parameters

Returns

_calculateSalt

Calculate salt from vault parameters.

function _calculateSalt(
    bytes32 saltInput,
    VaultParameters memory vaultParameters,
    string calldata description
) internal pure returns (bytes32);

Parameters

Events

VaultCreated

EVENTS ///

Emitted when the vault is created.

event VaultCreated(
    address indexed vault,
    address assetRegistry,
    address hooks,
    address indexed owner,
    address indexed guardian,
    address feeRecipient,
    uint256 fee,
    string description,
    address wrappedNativeToken
);

Errors

Aera__DescriptionIsEmpty

ERRORS ///

error Aera__DescriptionIsEmpty();

Aera__WrappedNativeTokenIsZeroAddress

error Aera__WrappedNativeTokenIsZeroAddress();

Aera__InvalidWrappedNativeToken

error Aera__InvalidWrappedNativeToken();

Aera__VaultAddressMismatch

error Aera__VaultAddressMismatch(address deployed, address computed);

Aera__GuardianIsAssetRegistryOwner

error Aera__GuardianIsAssetRegistryOwner();

Aera__GuardianIsHooksOwner

error Aera__GuardianIsHooksOwner();

Last updated