EVCUtil
Author: Euler Labs (https://www.eulerlabs.com/)
This contract is an abstract base contract for interacting with the Ethereum Vault Connector (EVC). It provides utility functions for authenticating the callers in the context of the EVC, a pattern for enforcing the contracts to be called through the EVC.
State Variables
evc
IEVC internal immutable evc;
Functions
constructor
constructor(address _evc);
EVC
Returns the address of the Ethereum Vault Connector (EVC) used by this contract.
function EVC() external view returns (address);
Returns
Name | Type | Description |
---|---|---|
<none> | address | The address of the EVC contract. |
callThroughEVC
Ensures that the msg.sender is the EVC by using the EVC callback functionality if necessary.
Optional to use for functions requiring account and vault status checks to enforce predictable behavior.
If this modifier used in conjuction with any other modifier, it must appear as the first (outermost) modifier of the function.
modifier callThroughEVC() virtual;
onlyEVCWithChecksInProgress
Ensures that the caller is the EVC in the appropriate context.
Should be used for checkAccountStatus and checkVaultStatus functions.
modifier onlyEVCWithChecksInProgress() virtual;
_msgSender
Retrieves the message sender in the context of the EVC.
This function returns the account on behalf of which the current operation is being performed, which is either msg.sender or the account authenticated by the EVC.
function _msgSender() internal view virtual returns (address);
Returns
Name | Type | Description |
---|---|---|
<none> | address | The address of the message sender. |
_msgSenderForBorrow
Retrieves the message sender in the context of the EVC for a borrow operation.
This function returns the account on behalf of which the current operation is being performed, which is either msg.sender or the account authenticated by the EVC. This function reverts if this contract is not enabled as a controller for the account on behalf of which the operation is being executed.
function _msgSenderForBorrow() internal view virtual returns (address);
Returns
Name | Type | Description |
---|---|---|
<none> | address | The address of the message sender. |
Errors
EVC_InvalidAddress
error EVC_InvalidAddress();
NotAuthorized
error NotAuthorized();
ControllerDisabled
error ControllerDisabled();