Vault

The Core Vault contract adheres to the ERC-4626 and ERC-20 standards, implementing the essential functionalities required by the vault. However, it's important to note that the Core Vault contract cannot be used independently; it needs to be inherited and have other internal functions implemented before it can be utilized. This contract is capable of receiving and managing user deposits, and it mints LazyOtter Vault tokens as withdrawal vouchers. LazyOtter Vault tokens also represent the share held in the vault, which is used to calculate the funds that users can withdraw.

Methods

decimals

Returns the decimals of the underlying asset.

function decimals() public view override returns (uint8)

totalAssets

Returns the total amount of underlying assets managed by the Vault.

function totalAssets() public view virtual returns (uint256)

maxDeposit

Returns the maximum amount of underlying assets that can be deposited into the Vault.

function maxDeposit(address) public view virtual returns (uint256)

maxMint

Returns the maximum amount of Vault Tokens that can be minted.

function maxMint(address receiver) public view returns (uint256)

maxWithdraw

Returns the maximum amount of underlying assets that can be withdrawn from the Vault.

maxRedeem

Returns the maximum amount of Vault Tokens that can be redeemed.

convertToShares

Returns the amount of Vault Tokens that can be exchanged for the underlying assets.

convertToAssets

Returns the amount of underlying assets that can be exchanged for Vault Tokens.

previewDeposit

Returns the amount of Vault Tokens that can be obtained when depositing a specified amount of underlying assets.

previewMint

Returns the amount of underlying assets needed to mint a specified amount of Vault Tokens.

previewWithdraw

Returns the amount of Vault Tokens needed to withdraw a specified amount of underlying assets.

previewRedeem

Returns the amount of underlying assets needed to redeem a specified amount of Vault Tokens.

deposit

Deposits the specified amount of underlying assets and mints Vault Tokens for the receiver based on the deposit amount.

mint

Mints the specified amount of Vault Tokens for the receiver and collects the required underlying assets from the caller.

withdraw

Withdraws the specified amount of underlying assets and burn the required Vault Tokens.

redeem

Redeems the specified amount of Vault Tokens and sends the corresponding amount of underlying assets to the receiver.

harvest

Harvests the currently earned rewards.

permit

Implements the EIP-2612 permit function.

pause

Pauses accepting deposits into the Vault.

unpause

Unpauses accepting deposits into the Vault.

emergencyWithdraw

Withdraws the underlying assets from the external protocol in case of an emergency.

Last updated