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.

function maxWithdraw(address owner) public view virtual returns (uint256)

maxRedeem

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

function maxRedeem(address owner) public view returns (uint256)

convertToShares

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

function convertToShares(uint256 assets) public view returns (uint256)

convertToAssets

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

 function convertToAssets(uint256 shares) public view returns (uint256)

previewDeposit

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

function previewDeposit(uint256 assets) public view returns (uint256) 

previewMint

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

function previewMint(uint256 shares) public view returns (uint256)

previewWithdraw

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

function previewWithdraw(uint256 assets) public view returns (uint256)

previewRedeem

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

function previewRedeem(uint256 shares) public view returns (uint256)

deposit

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

function deposit(uint256 assets, address receiver) external nonReentrant whenNotPaused returns (uint256)

mint

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

function mint(uint256 shares, address receiver) external nonReentrant whenNotPaused returns (uint256)

withdraw

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

function withdraw(uint256 assets, address receiver, address owner) external nonReentrant returns (uint256)

redeem

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

function redeem(uint256 shares, address receiver, address owner) external nonReentrant returns (uint256)

harvest

Harvests the currently earned rewards.

function harvest(address caller) external nonReentrant returns (uint256)

permit

Implements the EIP-2612 permit function.

function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)

pause

Pauses accepting deposits into the Vault.

function pause() external 

unpause

Unpauses accepting deposits into the Vault.

function unpause() external

emergencyWithdraw

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

function emergencyWithdraw() external

Last updated