ERCs
ERC-4626 — Tokenized Vault Standard
Standardized API for yield-bearing vaults. Users deposit an asset (an ERC-20), receive shares (also an ERC-20). The vault accrues yield; shares appreciate.
import {
asset,
totalAssets,
deposit,
withdraw,
convertToShares,
convertToAssets,
maxDeposit,
maxWithdraw,
previewDeposit,
previewWithdraw,
} from "@ethernauta/erc/4626";
void asset;
void totalAssets;
void deposit;
void withdraw;
void convertToShares;
void convertToAssets;
void maxDeposit;
void maxWithdraw;
void previewDeposit;
void previewWithdraw; Core methods
| Method | Shape | Purpose |
|---|---|---|
asset() | Callable<Address> | The underlying ERC-20. |
totalAssets() | Callable<Uint256> | Total assets managed. |
convertToShares({ assets }) | Callable<Uint256> | Asset amount → share amount. |
convertToAssets({ shares }) | Callable<Uint256> | Share amount → asset amount. |
maxDeposit({ owner }) | Callable<Uint256> | Per-user deposit cap. |
previewDeposit({ assets }) | Callable<Uint256> | Shares the deposit would mint. |
deposit({ assets, receiver }) | Signable<Hash32> | Deposit. |
withdraw({ assets, receiver, owner }) | Signable<Hash32> | Withdraw. |
redeem({ shares, receiver, owner }) | Signable<Hash32> | Redeem by share amount. |
mint({ shares, receiver }) | Signable<Hash32> | Mint a specific share amount. |
The full method list mirrors the spec; full coverage in the generated bindings.
See also
- ERC-20 — both the underlying asset and the share token are ERC-20.