Overview
TheVault contract is the central entry point in the Flexible Vault system. It composes three foundational modules:
ACLModule: Role-based access control.ShareModule: Management of user-facing shares, including deposit and redemption processes.VaultModule: Subvault management.
Factory or VaultConfigurator and initialized with all the required components and role assignments in a single atomic transaction.
Inheritance Structure
ACLModule: Admin and permission managementShareModule: Deposits, redemptions, share managementVaultModule: Subvault delegation control
IFactoryEntity interface for standard factory-based deployment patterns.
Constructor
Parameters:
name_: Unique name identifier for the vault instanceversion_: Configuration version of the vaultdepositQueueFactory_: Address of the factory used to deploy deposit queuesredeemQueueFactory_: Address of the factory used to deploy redemption queuessubvaultFactory_: Address of the factory used to deploy subvaultsverifierFactory_: Address of the factory for deploying verifier contracts
Behavior:
Passes these arguments to the parent module constructors:ACLModule(name_, version_)ShareModule(name_, version_, depositQueueFactory_, redeemQueueFactory_)VaultModule(name_, version_, subvaultFactory_, verifierFactory_)
Structs
RoleHolder
External Functions
initialize
initializer modifier.
initParams structure (ABI-encoded):
Initialization Logic:
- Calls
__ACLModule_init(admin_)to configure the default admin. - Calls
__ShareModule_init(...)to link share management and hook modules. - Calls
__VaultModule_init(riskManager_)to initialize risk management. - Iterates over
roleHoldersand grants each role using_grantRole(...). - Emits
Initialized(initParams).
Design Notes
- Modular Composition: The vault is composed by inheriting three upgradeable modules, enabling reuse and flexible configuration.
- Factory-Compatible: The contract is factory-deployable and supports atomic configuration during creation.
- Centralized Control Layer: Acts as a trusted coordinator for hooks, queues, shares, and strategy logic.
- Role Assignment: Enables full delegation of operational control via batched
RoleHolderentries. - Upgradeable and Isolated: Each module manages its own storage via deterministic slots (
SlotLibrary) to support safe upgrades.