LensExtension
Inherits: ILensExtension
Author: Morpho Labs.
This contract is an extension of the Lens. It should be deployed before the Lens, as the Lens depends on its address to extends its functionalities.
State Variables
morpho
STORAGE ///
IMorpho public immutable morpho;
comptroller
IComptroller internal immutable comptroller;
rewardsManager
IRewardsManager internal immutable rewardsManager;
Functions
constructor
CONSTRUCTOR ///
Constructs the contract.
constructor(address _morpho);
Parameters
Name | Type | Description |
---|---|---|
_morpho | address | The address of the main Morpho contract. |
getUserUnclaimedRewards
EXTERNAL ///
Returns the unclaimed COMP rewards for the given cToken addresses.
function getUserUnclaimedRewards(address[] calldata _poolTokens, address _user)
external
view
returns (uint256 unclaimedRewards);
Parameters
Name | Type | Description |
---|---|---|
_poolTokens | address[] | The cToken addresses for which to compute the rewards. |
_user | address | The address of the user. |
getAccruedSupplierComp
PUBLIC ///
Returns the accrued COMP rewards of a user since the last update.
function getAccruedSupplierComp(address _supplier, address _poolToken) public view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
_supplier | address | The address of the supplier. |
_poolToken | address | The cToken address. |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The accrued COMP rewards. |
getAccruedBorrowerComp
Returns the accrued COMP rewards of a user since the last update.
function getAccruedBorrowerComp(address _borrower, address _poolToken) public view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
_borrower | address | The address of the borrower. |
_poolToken | address | The cToken address. |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The accrued COMP rewards. |
getAccruedSupplierComp
Returns the accrued COMP rewards of a user since the last update.
function getAccruedSupplierComp(address _supplier, address _poolToken, uint256 _balance)
public
view
returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
_supplier | address | The address of the supplier. |
_poolToken | address | The cToken address. |
_balance | uint256 | The user balance of tokens in the distribution. |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The accrued COMP rewards. |
getAccruedBorrowerComp
Returns the accrued COMP rewards of a user since the last update.
function getAccruedBorrowerComp(address _borrower, address _poolToken, uint256 _balance)
public
view
returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
_borrower | address | The address of the borrower. |
_poolToken | address | The cToken address. |
_balance | uint256 | The user balance of tokens in the distribution. |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The accrued COMP rewards. |
getCurrentCompSupplyIndex
Returns the updated COMP supply index.
function getCurrentCompSupplyIndex(address _poolToken) public view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
_poolToken | address | The cToken address. |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The updated COMP supply index. |
getCurrentCompBorrowIndex
Returns the updated COMP borrow index.
function getCurrentCompBorrowIndex(address _poolToken) public view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
_poolToken | address | The cToken address. |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The updated COMP borrow index. |
Errors
InvalidCToken
ERRORS ///
Thrown when an invalid cToken address is passed to claim rewards.
error InvalidCToken();