ERCs

ERC-4626 — Tokenized Vault Standard

eips.ethereum.org/EIPS/eip-4626

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,
  total_assets,
  deposit,
  withdraw,
  convert_to_shares,
  convert_to_assets,
  max_deposit,
  max_withdraw,
  preview_deposit,
  preview_withdraw,
} from "@ethernauta/erc/4626";

Core methods

MethodShapePurpose
asset()Callable<Address>The underlying ERC-20.
total_assets()Callable<Uint256>Total assets managed.
convert_to_shares({ assets })Callable<Uint256>Asset amount → share amount.
convert_to_assets({ shares })Callable<Uint256>Share amount → asset amount.
max_deposit({ owner })Callable<Uint256>Per-user deposit cap.
preview_deposit({ 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.