ImToken

Git Source

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

NameTypeDescription
dstaddressThe address of the recipient
amountuint256The number of tokens to transfer

Returns

NameTypeDescription
<none>boolWhether 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

NameTypeDescription
srcaddressThe address from which tokens are transferred
dstaddressThe address to which tokens are transferred
amountuint256The number of tokens to transfer

Returns

NameTypeDescription
<none>boolWhether 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

NameTypeDescription
spenderaddressThe address authorized to spend tokens
amountuint256The number of tokens to approve

Returns

NameTypeDescription
<none>boolWhether 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

NameTypeDescription
owneraddressThe address of the token holder
spenderaddressThe address authorized to spend the tokens

Returns

NameTypeDescription
<none>uint256The 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

NameTypeDescription
owneraddressThe address to query the balance for

Returns

NameTypeDescription
<none>uint256The balance of tokens owned by owner

balanceOfUnderlying

Returns the underlying asset balance of the owner

function balanceOfUnderlying(address owner) external returns (uint256);

Parameters

NameTypeDescription
owneraddressThe address to query the balance of underlying assets for

Returns

NameTypeDescription
<none>uint256The 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

NameTypeDescription
accountaddressThe address to query the account snapshot for

Returns

NameTypeDescription
<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

NameTypeDescription
<none>uint256The current borrow rate per block, scaled by 1e18

supplyRatePerBlock

Returns the current supply rate per block

function supplyRatePerBlock() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256The current supply rate per block, scaled by 1e18

totalBorrowsCurrent

Returns the total amount of borrows, accounting for interest

function totalBorrowsCurrent() external returns (uint256);

Returns

NameTypeDescription
<none>uint256The total amount of borrows

borrowBalanceCurrent

Returns the current borrow balance for account, accounting for interest

function borrowBalanceCurrent(address account) external returns (uint256);

Parameters

NameTypeDescription
accountaddressThe address to query the borrow balance for

Returns

NameTypeDescription
<none>uint256The current borrow balance

borrowBalanceStored

Returns the stored borrow balance for account, without accruing interest

function borrowBalanceStored(address account) external view returns (uint256);

Parameters

NameTypeDescription
accountaddressThe address to query the stored borrow balance for

Returns

NameTypeDescription
<none>uint256The stored borrow balance

exchangeRateCurrent

Returns the current exchange rate, with interest accrued

function exchangeRateCurrent() external returns (uint256);

Returns

NameTypeDescription
<none>uint256The current exchange rate

exchangeRateStored

Returns the stored exchange rate, without accruing interest

function exchangeRateStored() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256The stored exchange rate

getCash

Returns the total amount of available cash in the contract

function getCash() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256The 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

NameTypeDescription
liquidatoraddressThe account receiving seized collateral
borroweraddressThe account having collateral seized
seizeTokensuint256The number of mTokens to seize

reduceReserves

Accrues interest and reduces reserves by transferring to admin

function reduceReserves(uint256 reduceAmount) external;

Parameters

NameTypeDescription
reduceAmountuint256Amount of reduction to reserves