Inherits: OperatorStoragearrow-up-right , ImTokenOperationTypesarrow-up-right , OwnableUpgradeable
Note: oz-upgrades-unsafe-allow: constructor
Copy function initialize ( address _rolesOperator , address _rewardDistributor , address _admin ) public initializer ;
Copy modifier onlyAllowedUser ( address user ); Sets user whitelist status
Copy function setWhitelistedUser ( address user , bool state ) external onlyOwner ; Parameters
Enable user whitelist
Disable user whitelist
Sets a new Operator for the market
Admin function to set a new operator
Sets a new price oracle
Admin function to set a new price oracle
Sets the closeFactor used when liquidating borrows
Admin function to set closeFactor
Parameters
New close factor, scaled by 1e18
Sets the collateralFactor for a market
Admin function to set per-market collateralFactor
Parameters
The market to set the factor on
newCollateralFactorMantissa
The new collateral factor, scaled by 1e18
Sets liquidationIncentive
Admin function to set liquidationIncentive
Parameters
newLiquidationIncentiveMantissa
New liquidationIncentive scaled by 1e18
Add the market to the markets mapping and set it as listed
Admin function to set isListed and add support for the market
Parameters
The address of the market (token) to list
Sets outflow volume time window
Parameters
The new reset time window
Sets outflow volume limit
when 0, it means there's no limit
Parameters
Resets outflow volume
Verifies outflow volule limit
Parameters
Set the given borrow caps for the given mToken markets. Borrowing that brings total borrows to or above borrow cap will revert.
Parameters
The addresses of the markets (tokens) to change the borrow caps for
The new borrow cap values in underlying to be set. A value of 0 corresponds to unlimited borrowing.
Set the given supply caps for the given mToken markets. Supplying that brings total supply to or above supply cap will revert.
Parameters
The addresses of the markets (tokens) to change the supply caps for
The new supply cap values in underlying to be set. A value of 0 corresponds to unlimited supplying.
Set pause for a specific operation
Parameters
ImTokenOperationTypes.OperationType
The pause operation status
Admin function to change the Reward Distributor
Parameters
The address of the new Reward Distributor
Should return true
Returns if operation is paused
Parameters
ImTokenOperationTypes.OperationType
Returns the assets an account has entered
Parameters
The address of the account to pull assets for
Returns
A dynamic list with the assets the account has entered
Returns whether the given account is entered in the given asset
Parameters
The address of the account to check
Returns
True if the account is in the asset, otherwise false.
A list of all markets
Returns true if the given mToken market has been deprecated
All borrows in a deprecated mToken market can be immediately liquidated
Parameters
The market to check if deprecated
Returns true/false
Determine the current account liquidity wrt collateral requirements
Returns
account liquidity in excess of collateral requirements, account shortfall below collateral requirements)
Determine what the account liquidity would be if the given amounts were redeemed/borrowed
Parameters
The account to determine liquidity for
The market to hypothetically redeem/borrow in
The number of tokens to hypothetically redeem
The amount of underlying to hypothetically borrow
Returns
hypothetical account liquidity in excess of collateral requirements, hypothetical account shortfall below collateral requirements)
Calculate number of tokens of collateral asset to seize given an underlying amount
Used in liquidation (called in mTokenBorrowed.liquidate)
Parameters
The address of the borrowed mToken
The address of the collateral mToken
The amount of mTokenBorrowed underlying to convert into mTokenCollateral tokens
Returns
number of mTokenCollateral tokens to be seized in a liquidation
Add assets to be included in account liquidity calculation
Parameters
The list of addresses of the mToken markets to be enabled
Add asset (msg.sender) to be included in account liquidity calculation
Parameters
Removes asset from sender's account liquidity calculation
Sender must not have an outstanding borrow balance in the asset, or be providing necessary collateral for an outstanding borrow.
Parameters
The address of the asset to be removed
Claim all the MALDA accrued by holder in all markets
Parameters
The address to claim MALDA for
Claim all the MALDA accrued by holder in the specified markets
Parameters
The address to claim MALDA for
The list of markets to claim MALDA in
Claim all MALDA accrued by the holders
Parameters
The addresses to claim MALDA for
The list of markets to claim MALDA in
Whether or not to claim MALDA earned by borrowing
Whether or not to claim MALDA earned by supplying
Returns USD value for all markets
Checks whitelist status on withdrawOnExtension
Parameters
Checks whitelist status on borrowOnExtension
Parameters
Checks if the account should be allowed to rebalance tokens
Parameters
The market to verify the transfer against
Checks if the account should be allowed to transfer tokens in the given market
Parameters
The market to verify the transfer against
The account which sources the tokens
The account which receives the tokens
The number of mTokens to transfer
Checks if the account should be allowed to mint tokens in the given market
Parameters
The market to verify the mint against
The account which would get the minted tokens
Validates mint and reverts on rejection. May emit logs.
Parameters
Checks if the account should be allowed to redeem tokens in the given market
Parameters
The market to verify the redeem against
The account which would redeem the tokens
The number of mTokens to exchange for the underlying asset in the market
Checks if the account should be allowed to borrow the underlying asset of the given market
Parameters
The market to verify the borrow against
The account which would borrow the asset
The amount of underlying the account would borrow
Checks if the account should be allowed to repay a borrow in the given market
Parameters
The market to verify the repay against
The account which would borrowed the asset
Checks if the liquidation should be allowed to occur
Parameters
Asset which was borrowed by the borrower
Asset which was used as collateral and will be seized
The address of the borrower
The amount of underlying being repaid
Checks if the seizing of assets should be allowed to occur
Parameters
Asset which was used as collateral and will be seized
Asset which was borrowed by the borrower
The address repaying the borrow and seizing the collateral
The address of the borrower
Notify reward distributor for supply index update
Parameters
The market whose supply index to update
Notify reward distributor for borrow index update
Parameters
The market whose borrow index to update
Notify reward distributor for supplier update
Parameters
The market in which the supplier is interacting
The address of the supplier to distribute MALDA to
Notify reward distributor for borrower update
Borrowers will not begin to accrue until after the first interaction with the protocol.
Parameters
The market in which the borrower is interacting
The address of the borrower to distribute MALDA to
Git Sourcearrow-up-right
Inherits: IOperatorarrow-up-right , IOperatorDefenderarrow-up-right , ExponentialNoErrorarrow-up-right
Roles manager
Oracle which gives the price of any given asset
Multiplier used to calculate the maximum repayAmount when liquidating a borrow
Multiplier representing the discount on collateral that a liquidator receives
Per-account mapping of "assets you are in", capped by maxAssets
Official mapping of mTokens -> Market metadata
Used e.g. to determine if a market is supported
A list of all markets
Borrow caps enforced by borrowAllowed for each mToken address. Defaults to zero which corresponds to unlimited borrowing.
Supply caps enforced by supplyAllowed for each mToken address. Defaults to zero which corresponds to unlimited supplying.
Reward Distributor to markets supply and borrow (including protocol token)
Should return outflow limit
Should return outflow volume
Should return last reset time for outflow check
Should return the outflow volume time window
Returns true/false for user
Emitted when user whitelist status is changed
Emitted when pause status is changed
Emitted when reward distributor is changed
Emitted when borrow cap for a mToken is changed
Emitted when supply cap for a mToken is changed
Emitted when an admin supports a market
Emitted when an account enters a market
Emitted when an account exits a market
Emitted Emitted when close factor is changed by admin
Emitted when a collateral factor is changed by admin
Emitted when liquidation incentive is changed by admin
Emitted when price oracle is changed
Event emitted when rolesOperator is changed
Event emitted when outflow limit is updated
Event emitted when outflow reset time window is updated
Event emitted when outflow volume has been reset
Local vars for avoiding stack-depth limits in calculating account liquidity. Note that mTokenBalance is the number of mTokens the account owns in the market, whereas borrowBalance is the amount of underlying that the account has borrowed.