General ERC-4626 Vault Interface
Generic interface for ERC-4626 vaults.
Contract Interface
Events
Deposit
Withdraw
Functions
asset
The address of the underlying token used by the Vault for valuing, depositing, and withdrawing.
totalAssets
Total amount of the underlying asset that is “managed” by vault.
convertToShares
The amount of shares that the Vault would exchange for the amount of assets provided, in an ideal scenario where all the conditions are met.
Parameters
assets
uint256
The amount of underlying assets to be convert to vault shares.
Return Values
shares
uint256
The amount of vault shares converted from the underlying assets.
convertToAssets
The amount of assets that the Vault would exchange for the amount of shares provided, in an ideal scenario where all the conditions are met.
Parameters
shares
uint256
The amount of vault shares to be converted to the underlying assets.
Return Values
assets
uint256
The amount of underlying assets converted from the vault shares.
maxDeposit
The maximum number of underlying assets that caller can deposit.
Parameters
caller
address
Account that the assets will be transferred from.
Return Values
maxAssets
uint256
The maximum amount of underlying assets the caller can deposit.
previewDeposit
Allows an on-chain or off-chain user to simulate the effects of their deposit at the current transaction, given current on-chain conditions.
Parameters
assets
uint256
The amount of underlying assets to be transferred.
Return Values
shares
uint256
The amount of vault shares that will be minted.
deposit
Mint vault shares to receiver by transferring exact amount of underlying asset tokens from the caller.
Parameters
assets
uint256
The amount of underlying assets to be transferred to the vault.
receiver
address
The account that the vault shares will be minted to.
Return Values
shares
uint256
The amount of vault shares that were minted.
maxMint
The maximum number of vault shares that caller can mint.
Parameters
caller
address
Account that the underlying assets will be transferred from.
Return Values
maxShares
uint256
The maximum amount of vault shares the caller can mint.
previewMint
Allows an on-chain or off-chain user to simulate the effects of their mint at the current transaction, given current on-chain conditions.
Parameters
shares
uint256
The amount of vault shares to be minted.
Return Values
assets
uint256
The amount of underlying assests that will be transferred from the caller.
mint
Mint exact amount of vault shares to the receiver by transferring enough underlying asset tokens from the caller.
Parameters
shares
uint256
The amount of vault shares to be minted.
receiver
address
The account the vault shares will be minted to.
Return Values
assets
uint256
The amount of underlying assets that were transferred from the caller.
maxWithdraw
The maximum number of underlying assets that owner can withdraw.
Parameters
owner
address
Account that owns the vault shares.
Return Values
maxAssets
uint256
The maximum amount of underlying assets the owner can withdraw.
previewWithdraw
Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current transaction, given current on-chain conditions.
Parameters
assets
uint256
The amount of underlying assets to be withdrawn.
Return Values
shares
uint256
The amount of vault shares that will be burnt.
withdraw
Burns enough vault shares from owner and transfers the exact amount of underlying asset tokens to the receiver.
Parameters
assets
uint256
The amount of underlying assets to be withdrawn from the vault.
receiver
address
The account that the underlying assets will be transferred to.
owner
address
Account that owns the vault shares to be burnt.
Return Values
shares
uint256
The amount of vault shares that were burnt.
maxRedeem
The maximum number of shares an owner can redeem for underlying assets.
Parameters
owner
address
Account that owns the vault shares.
Return Values
maxShares
uint256
The maximum amount of shares the owner can redeem.
previewRedeem
Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current transaction, given current on-chain conditions.
Parameters
shares
uint256
The amount of vault shares to be burnt.
Return Values
assets
uint256
The amount of underlying assests that will transferred to the receiver.
redeem
Burns exact amount of vault shares from owner and transfers the underlying asset tokens to the receiver.
Parameters
shares
uint256
The amount of vault shares to be burnt.
receiver
address
The account the underlying assets will be transferred to.
owner
address
The account that owns the vault shares to be burnt.
Return Values
assets
uint256
The amount of underlying assets that were transferred to the receiver.
Last updated