ERC-4626 Tokenized Vault Standard
Introduction
ERC-4626 is a standard to optimize and unify the technical parameters of yield-bearing vaults. It provides a standard API for tokenized yield-bearing vaults that represent shares of a single underlying ERC-20 token. ERC-4626 also outlines an optional extension for tokenized vaults utilizing ERC-20, offering basic functionality for depositing, withdrawing tokens and reading balances.
The role of ERC-4626 in yield-bearing vaults
Lending markets, aggregators, and intrinsically interest-bearing tokens help users find the best yield on their crypto tokens by executing different strategies. These strategies are done with slight variation, which might be error-prone or waste development resources.
ERC-4626 in yield-bearing vaults will lower the integration effort and unlock access to yield in various applications with little specialized effort from developers by creating more consistent and robust implementation patterns.
The ERC-4626 token is described fully in EIP-4626(opens in a new tab).
Prerequisites
To better understand this page, we recommend you first read about token standards and ERC-20.
ERC-4626 Functions and Features:
Methods
asset
1function asset() public view returns (address)2નકલ કરો
This function returns the address of the underlying token used for the vault for accounting, depositing, withdrawing.
totalAssets
1function totalAssets() public view returns (uint256)2નકલ કરો
This function returns the total amount of underlying assets held by the vault.
convertToShares
1function convertToShares(uint256 assets) public view returns (uint256 shares)2નકલ કરો
This function returns the amount of shares
that would be exchanged by the vault for the amount of assets
provided.
convertToAssets
1function convertToAssets(uint256 shares) public view returns (uint256 assets)2નકલ કરો
This function returns the amount of assets
that would be exchanged by the vault for the amount of shares
provided.
maxDeposit
1function maxDeposit(address receiver) public view returns (uint256)2નકલ કરો
This function returns the maximum amount of underlying assets that can be deposited in a single deposit
call by the receiver
.
previewDeposit
1function previewDeposit(uint256 assets) public view returns (uint256)2