ImToken
Inherits: ImTokenMinimal
Functions
rolesOperator
Roles manager
function rolesOperator() external view returns (IRoles);
admin
Administrator for this contract
function admin() external view returns (address payable);
pendingAdmin
Pending administrator for this contract
function pendingAdmin() external view returns (address payable);
operator
Contract which oversees inter-mToken operations
function operator() external view returns (address);
interestRateModel
Model which tells what the current interest rate should be
function interestRateModel() external view returns (address);
reserveFactorMantissa
Fraction of interest currently set aside for reserves
function reserveFactorMantissa() external view returns (uint256);
accrualBlockTimestamp
Block timestamp that interest was last accrued at
function accrualBlockTimestamp() external view returns (uint256);
borrowIndex
Accumulator of the total earned interest rate since the opening of the market
function borrowIndex() external view returns (uint256);
totalBorrows
Total amount of outstanding borrows of the underlying in this market
function totalBorrows() external view returns (uint256);
totalReserves
Total amount of reserves of the underlying held in this market
function totalReserves() external view returns (uint256);
sameChainFlowStateDisabled
Returns true/false for same chain flow state disable status
function sameChainFlowStateDisabled() external view returns (bool);
transfer
Transfers amount
tokens to the dst
address
function transfer(address dst, uint256 amount) external returns (bool);
Parameters
Name | Type | Description |
---|---|---|
dst | address | The address of the recipient |
amount | uint256 | The number of tokens to transfer |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | Whether the transfer was successful or not |
transferFrom
Transfers amount
tokens from the src
address to the dst
address
function transferFrom(address src, address dst, uint256 amount) external returns (bool);
Parameters
Name | Type | Description |
---|---|---|
src | address | The address from which tokens are transferred |
dst | address | The address to which tokens are transferred |
amount | uint256 | The number of tokens to transfer |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | Whether the transfer was successful or not |
approve
Approves spender
to spend amount
tokens on behalf of the caller
function approve(address spender, uint256 amount) external returns (bool);
Parameters
Name | Type | Description |
---|---|---|
spender | address | The address authorized to spend tokens |
amount | uint256 | The number of tokens to approve |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | Whether the approval was successful or not |
allowance
Returns the current allowance the spender
has from the owner
function allowance(address owner, address spender) external view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
owner | address | The address of the token holder |
spender | address | The address authorized to spend the tokens |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The current remaining number of tokens spender can spend |
balanceOf
Returns the balance of tokens held by owner
function balanceOf(address owner) external view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
owner | address | The address to query the balance for |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The balance of tokens owned by owner |
balanceOfUnderlying
Returns the underlying asset balance of the owner
function balanceOfUnderlying(address owner) external returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
owner | address | The address to query the balance of underlying assets for |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The balance of underlying assets owned by owner |
getAccountSnapshot
Returns the snapshot of account details for the given account
function getAccountSnapshot(address account) external view returns (uint256, uint256, uint256);
Parameters
Name | Type | Description |
---|---|---|
account | address | The address to query the account snapshot for |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | (token balance, borrow balance, exchange rate) |
<none> | uint256 | |
<none> | uint256 |
borrowRatePerBlock
Returns the current borrow rate per block
function borrowRatePerBlock() external view returns (uint256);
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The current borrow rate per block, scaled by 1e18 |
supplyRatePerBlock
Returns the current supply rate per block
function supplyRatePerBlock() external view returns (uint256);
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The current supply rate per block, scaled by 1e18 |
totalBorrowsCurrent
Returns the total amount of borrows, accounting for interest
function totalBorrowsCurrent() external returns (uint256);
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The total amount of borrows |
borrowBalanceCurrent
Returns the current borrow balance for account
, accounting for interest
function borrowBalanceCurrent(address account) external returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
account | address | The address to query the borrow balance for |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The current borrow balance |
borrowBalanceStored
Returns the stored borrow balance for account
, without accruing interest
function borrowBalanceStored(address account) external view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
account | address | The address to query the stored borrow balance for |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The stored borrow balance |
exchangeRateCurrent
Returns the current exchange rate, with interest accrued
function exchangeRateCurrent() external returns (uint256);
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The current exchange rate |
exchangeRateStored
Returns the stored exchange rate, without accruing interest
function exchangeRateStored() external view returns (uint256);
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The stored exchange rate |
getCash
Returns the total amount of available cash in the contract
function getCash() external view returns (uint256);
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The total amount of cash |
accrueInterest
Accrues interest on the contract's outstanding loans
function accrueInterest() external;
seize
Transfers collateral tokens (this market) to the liquidator.
Will fail unless called by another mToken during the process of liquidation. Its absolutely critical to use msg.sender as the borrowed mToken and not a parameter.
function seize(address liquidator, address borrower, uint256 seizeTokens) external;
Parameters
Name | Type | Description |
---|---|---|
liquidator | address | The account receiving seized collateral |
borrower | address | The account having collateral seized |
seizeTokens | uint256 | The number of mTokens to seize |
reduceReserves
Accrues interest and reduces reserves by transferring to admin
function reduceReserves(uint256 reduceAmount) external;
Parameters
Name | Type | Description |
---|---|---|
reduceAmount | uint256 | Amount of reduction to reserves |