mTokenConfiguration

Git Source

Inherits: mTokenStorage

Title: mTokenConfiguration

Author: Merge Layers Inc.

Configuration helpers for mToken markets

Functions

onlyAdmin

modifier onlyAdmin() ;

setOperator

Sets a new Operator for the market

function setOperator(address _operator) external onlyAdmin;

Parameters

NameTypeDescription
_operatoraddressThe new operator address

setRolesOperator

Sets a new Roles operator for the market

function setRolesOperator(address _roles) external onlyAdmin;

Parameters

NameTypeDescription
_rolesaddressThe roles contract address

setInterestRateModel

Accrues interest and updates the interest rate model using _setInterestRateModelFresh

function setInterestRateModel(address newInterestRateModel) external onlyAdmin;

Parameters

NameTypeDescription
newInterestRateModeladdressThe new interest rate model to use

setBorrowRateMaxMantissa

Sets the maximum borrow rate mantissa

function setBorrowRateMaxMantissa(uint256 maxMantissa) external onlyAdmin;

Parameters

NameTypeDescription
maxMantissauint256The new max mantissa

setReserveFactor

Accrues interest and sets a new reserve factor for the protocol using _setReserveFactorFresh

Admin function to accrue interest and set a new reserve factor

function setReserveFactor(uint256 newReserveFactorMantissa) external onlyAdmin;

Parameters

NameTypeDescription
newReserveFactorMantissauint256The new reserve factor mantissa

setPendingAdmin

Begins transfer of admin rights. The newPendingAdmin must call _acceptAdmin to finalize the transfer.

Admin function to begin change of admin. The newPendingAdmin must call _acceptAdmin to finalize the transfer.

function setPendingAdmin(address payable newPendingAdmin) external onlyAdmin;

Parameters

NameTypeDescription
newPendingAdminaddress payableNew pending admin.

acceptAdmin

Accepts transfer of admin rights. msg.sender must be pendingAdmin

Admin function for pending admin to accept role and update admin

function acceptAdmin() external;

_setInterestRateModel

Updates the interest rate model (*requires fresh interest accrual)

Admin function to update the interest rate model

function _setInterestRateModel(address newInterestRateModel) internal;

Parameters

NameTypeDescription
newInterestRateModeladdressThe new interest rate model to use

_setOperator

Sets the Operator contract address

function _setOperator(address _operator) internal;

Parameters

NameTypeDescription
_operatoraddressThe operator address