Skip to content
Lattice

ERC4626Init

Git Source

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

NameTypeDescription
asset_addressThe underlying ERC-20 asset the vault holds.
name_stringThe vault share token name.
symbol_stringThe vault share token symbol.
decimalsOffset_uint8Virtual-share decimals offset for inflation-attack mitigation (usually 0).