The EVault
contract is a modular vault system designed to manage assets, facilitate borrowing, and handle liquidations while ensuring compliance with governance rules. It utilizes a delegation mechanism to interact with various modules, allowing for flexible and extensible functionality. Key features include the ability to deposit, withdraw, borrow, and manage fees, all while maintaining strict access controls and reentrancy protections.
Vault Management:
initialize
: Sets up the vault with the necessary parameters and module addresses.checkVaultStatus
: Verifies the vault's status and updates its state, including interest rates and borrowing limits.setCaps
: Configures the supply and borrow caps for the vault, ensuring governance compliance.setConfigFlags
: Updates configuration flags for the vault, also requiring governance approval.Token Operations:
approve
: Grants permission to a spender to withdraw a specified amount of tokens.transferFrom
: Facilitates the transfer of tokens from one address to another, ensuring proper checks and balances.mint
: Allows users to mint new tokens, sending them to a designated receiver.redeem
: Enables users to redeem tokens for underlying assets.Borrowing and Liquidation:
borrow
: Allows users to borrow assets, directing the call to the appropriate module for processing.liquidate
: Facilitates the liquidation of collateral from a violator, ensuring compliance with liquidation parameters.Fee Management:
setFeeReceiver
: Updates the address of the fee receiver, requiring governance approval.accumulatedFees
: Retrieves the total accumulated fees from the vault.protocolFeeReceiver
: Gets the address of the protocol fee receiver.View Functions:
LTVBorrow
, LTVFull
, LTVLiquidation
: Retrieve loan-to-value metrics for specified collateral assets.accountLiquidity
, accountLiquidityFull
: Assess the liquidity status of specified accounts.totalAssets
, totalBorrows
, totalSupply
: Provide insights into the vault's total assets, borrows, and supply.