ERC4626Init
Title: ERC4626Init
Author: David Dada <daveproxy80@gmail.com> (https://github.com/dadadave80)
One-shot initializer for an ERC-4626 tokenized-vault diamond. The vault's shares ARE an ERC-20
token, so this seeds BOTH modules in a single initializing window: __ERC20_init (share
name/symbol) then __ERC4626_init (underlying asset + virtual-share decimals offset, which also
registers IERC4626 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. Companion to the ERC20Init pattern — a first-class production deploy
artifact shared by run --broadcast and the facet tests.
Functions
init
Seeds the ERC-20 share metadata and the ERC-4626 vault parameters.
function init(address asset_, string memory name_, string memory symbol_, 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. |
| decimalsOffset_ | uint8 | Virtual-share decimals offset for inflation-attack mitigation (usually 0). |