General ERC-4626 Vault Interface
Last updated
Was this helpful?
Last updated
Was this helpful?
Generic interface for vaults.
The address of the underlying token used by the Vault for valuing, depositing, and withdrawing.
Total amount of the underlying asset that is “managed” by vault.
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.
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.
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.
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.
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.
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.
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 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.
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.
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.
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.
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.
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.
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.