VaultCoreInit
Title: VaultCoreInit
Author: David Dada <daveproxy80@gmail.com> (https://github.com/dadadave80)
One-shot initializer for a VaultCore diamond — an ERC-4626 vault extended with strategy hooks. Runs
the module initializers in dependency order inside a single initializing window: AccessControl
(grants DEFAULT_ADMIN_ROLE to admin, gating strategy-manager changes), ERC-20 (share metadata),
ERC-4626 (underlying asset + offset), then VaultCore (registers IVaultCore and IVaultCoreRecovery via ERC-165).
Delegatecalled by Diamond.initialize inside the initializing window — it must NOT open its own
pre/postInitializer; each __*_init guard passes because the window is already open.
Functions
init
Seeds access control, the ERC-20 share metadata, the ERC-4626 vault params, and VaultCore.
function init(address asset_, string memory name_, string memory symbol_, address admin_, uint8 decimalsOffset_)
external;Parameters
| Name | Type | Description |
|---|---|---|
| asset_ | address | The underlying ERC-20 asset the vault holds. |
| name_ | string | The vault share token name. |
| symbol_ | string | The vault share token symbol. |
| admin_ | address | The account granted DEFAULT_ADMIN_ROLE (may set the strategy manager). |
| decimalsOffset_ | uint8 | Virtual-share decimals offset for inflation-attack mitigation (usually 0). |