Overview
TheVaultConfigurator contract provides a streamlined and modular deployment mechanism for setting up a new Vault instance and its associated managers. It orchestrates the creation and initialization of the following components:
VaultShareManagerFeeManagerRiskManagerOracle
Purpose
This contract is designed to be used by an actor that need to deploy and configure fully functional vaults in a deterministic and upgradeable way, using versioned module factories.Contract Structure
State Variables
Constructor
InitParams Struct
Fields:
version: Version of theVaultimplementation to deploy.proxyAdmin: Address to be set asProxyAdminfor upgradeable proxies.vaultAdmin: Address to be set as the vault’s owner (admin)._Version: Specific implementation version to use for each module (used in the corresponding factory)._Params: ABI-encoded initialization parameters for each module.defaultDepositHook: Address of the default deposit hook to attach to queues.defaultRedeemHook: Address of the default redeem hook to attach to queues.queueLimit: Maximum number of queued operations per deposit/redeem queue.roleHolders: List of role assignments for vault-level access control.
External Functions
create
Description:
Creates and initializes a new vault instance along with all dependent modules using the provided factory addresses and parameters.Steps:
- Deploy ShareManager:
- Uses
shareManagerFactoryto deploy a versionedShareManagerproxy.
- Uses
- Deploy FeeManager:
- Uses
feeManagerFactoryto deploy a versionedFeeManager.
- Uses
- Deploy RiskManager:
- Uses
riskManagerFactoryto deploy a versionedRiskManager.
- Uses
- Deploy Oracle:
- Uses
oracleFactoryto deploy a versionedOracle.
- Uses
- Deploy Vault:
- Prepares encoded initialization calldata and calls
vaultFactory.create()with the version and proxy admin.
- Prepares encoded initialization calldata and calls
- Post-deployment Wiring:
- Sets the
vaultaddress in each of the deployed components using:IShareManager(shareManager).setVault(vault)IRiskManager(riskManager).setVault(vault)IOracle(oracle).setVault(vault)
- Sets the
Returns:
shareManager: Address of the deployed share manager contractfeeManager: Address of the deployed fee manager contractriskManager: Address of the deployed risk manager contractoracle: Address of the deployed oracle contractvault: Address of the newly created vault