Deposit to ERC20 Vaults
This section explains how to deposit ERC20 tokens into any Byzantine ERC20-compatible vault, including SymByzVaults and EigenByzVaults.
Step-by-Step Process
1. Approve Token Transfer
Before depositing, the user must approve the vault to transfer tokens on their behalf:
2. Call deposit()
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.
3. Important Considerations
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.
Last updated