Deposit to ERC20 Vaults
Last updated
Last updated
This section explains how to deposit ERC20 tokens into any Byzantine ERC20-compatible vault, including SymByzVaults and EigenByzVaults.
Before depositing, the user must approve the vault to transfer tokens on their behalf:
deposit()
Use the following function to deposit ERC20 tokens into the vault:
assets
: the amount of ERC20 tokens to deposit.
receiver
: the address that will receive the newly minted vault shares.
The function returns the number of shares minted for the receiver
, which represent a proportional claim on the vault’s assets.
Choose the method that best suits your setup to deposit in a vault:
If the vault is permissioned (isPrivateVault = true
), the caller must be whitelisted.
If a deposit limit is enabled (isDepositLimit = true
), the total deposits must remain within the configured limit.
The vault uses the convertToShares()
function to determine how many shares are minted.
Choose the method that best suits your setup to read those datas: