Comptroller
Properties
sdk
sdk
The sdk instance used by the comptroller.
Type: MarketSDK
contract
contract
The raw web3 contract instance for the comptroller.
Type: web3.eth.Contract
address
address
Contract address of the comptroller.
Type: string
Methods
_become
_become
Change the unitroller for the comptroller implementation.
Parameters:
unitroller: string
- The new unitroller's address.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
_borrowGuardianPaused
_borrowGuardianPaused
Returns whether borrow guardian is paused.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<boolean>
_mintGuardianPaused
_mintGuardianPaused
Returns whether mint guardian is paused.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<boolean>
_setBorrowPaused
_setBorrowPaused
Sets the borrowing status for a cToken.
Parameters:
cToken:
CToken
| string
- The cToken to pause/resume the borrowing for.state: boolean
- Whether borrowing should be pausedtx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
_setCloseFactor
_setCloseFactor
Sets the close factor used when liquidating borrows.
Parameters:
newCloseFactorMantissa: number | string | BN
- New close factor, scaled by 1e18.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
_setCollateralFactor
_setCollateralFactor
Sets the collateral factor for a market.
Parameters:
cToken:
CToken
| string
- The market to set the factor on.newCollateralFactorMantissa: number | string | BN
- The new collateral factor, scaled by 1e18.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
_setLiquidationIncentive
_setLiquidationIncentive
Sets liquidation incentive.
Parameters:
newLiquidationIncentiveMantissa: number | string | BN
- New liquidationIncentive scaled by 1e18tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
_setMaxAssets
_setMaxAssets
Sets maxAssets which controls how many markets can be entered.
Parameters:
newMaxAssets: number | string | BN
- New max assets.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
_setMintPaused
_setMintPaused
Sets the mint status for a cToken.
Parameters:
cToken:
CToken
| string
- The cToken to pause/resume minting for.state: boolean
- Whether minting should be paused for cToken.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
_setPauseGuardian
_setPauseGuardian
Admin function to change the Pause Guardian.
Parameters:
newPauseGuardian: string
- The address of the new Pause Guardian.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
_setPriceOracle
_setPriceOracle
Sets a new price oracle for the comptroller.
Parameters:
newOracle: string
- New price oracle to use.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
_setSeizePaused
_setSeizePaused
Change the seize status for the comptroller.
Parameters:
state: boolean
- True for pause.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
_setTransferPaused
_setTransferPaused
Parameters:
state: boolean
- True for pause.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
_setWhitelistEnforcement
_setWhitelistEnforcement
Sets the whitelist enforcement for the comptroller.
Parameters:
enforce: boolean
- Whether to enforce the whitelist.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
_setWhitelistStatuses
_setWhitelistStatuses
Sets the whitelist statuses
for suppliers.
Parameters:
suppliers: string[]
- Array of supplies to update the statuses of.statuses: boolean[]
- New statuses for the suppliers.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
_supportMarket
_supportMarket
Add the market to the markets mapping and set it as listed.
Parameters:
cToken:
CToken
| string
- The address of the market (token) to list.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
_supportMarketAndSetCollateralFactor
_supportMarketAndSetCollateralFactor
Add the market to the markets mapping and set it as listed and set the collateral factor.
Parameters:
cToken:
CToken
| string
- The address of the market (token) to list.newCollateralFactorMantissa: number | string | BN
- The new collateral factor, scaled by 1e18.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
_unsupportMarket
_unsupportMarket
Removed a market from the markets mapping and sets it as unlisted.
Parameters:
cToken:
CToken
| string
- The address of the market (token) to unlisttx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
accountAssets
accountAssets
Per-account mapping of "assets you are in", capped by maxAssets.
Parameters:
account: string
-cTokenIndex: number | string | BN
-tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
admin
admin
Returns the contract admin.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
adminHasRights
adminHasRights
Returns whether or not the admin has admin rights.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<boolean>
allBorrowers
allBorrowers
A list of all borrowers who have entered markets.
Parameters:
index: number | string | BN
- Borrower index.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
allMarkets
allMarkets
Returns a CToken address based on the index.
Parameters:
index: number | string | BN
- Index of the market to fetch.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
borrowAllowed
borrowAllowed
Checks if the account should be allowed to borrow the underlying asset of the given market.
Parameters:
cToken:
CToken
| string
- The market to verify the borrow against.borrower: string
- The account which would borrow the asset.borrowAmount: number | string | BN
- The amount of underlying the account would borrow.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
borrowGuardianPaused
borrowGuardianPaused
Returns whether borrow guardian is paused for the cToken or not.
Parameters:
cToken:
CToken
| string
- The cToken to fetch the guardian status of.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<boolean>
borrowVerify
borrowVerify
Validates borrow and reverts on rejection. May emit logs.
Parameters:
cToken:
CToken
| string
- Asset whose underlying is being borrowed.
borrower: string
- The address borrowing the underlying.borrowAmount: nnumber | string | BN
- The amount of the underlying asset requested to borrow.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
borrowWithinLimits
borrowWithinLimits
Checks if the account should be allowed to borrow the underlying asset of the given market.
Parameters:
cToken:
CToken
| string
- Asset whose underlying is being borrowed.accountBorrowNew: number | string | BN
- The user's new borrow balance of the underlying asset.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
cTokensUnderlying
cTokensUnderlying
Parameters:
underlying: string
-tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
checkMembership
checkMembership
Returns whether the given account is entered in the given asset.
Parameters:
account: string
- The address of the account to check.cToken:
CToken
| string
- The cToken to check.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
closeFactorMantissa
closeFactorMantissa
Returns the close factor mantissa for the pool.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
comptrollerImplementation
comptrollerImplementation
Returns the comptroller implementation address for the unitroller.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
enforceWhitelist
enforceWhitelist
Returns whether or not the supplier whitelist is enforced.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<boolean>
enterMarkets
enterMarkets
Add assets to be included in account liquidity calculation.
Parameters:
cTokens: (
CToken
| string)[]
- The list of addresses of the cToken markets to be enabledtx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
exitMarket
exitMarket
Removes asset from sender's account liquidity calculation.
Parameters:
cToken:
CToken
| string
- The address of the asset to be removed.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
fuseAdminHasRights
fuseAdminHasRights
Returns whether or not the Fuse admin has admin rights.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
getAccountLiquidity
getAccountLiquidity
Returns the current account liquidity wrt collateral requirements.
Parameters:
account: string
- The account to return the liquidity for.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<[string, string, string]>
getAllBorrowers
getAllBorrowers
Return all of the borrowers.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string[]>
getAllMarkets
getAllMarkets
Return all of the markets.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string[]>
getAssetsIn
getAssetsIn
Returns the assets an account has entered.
Parameters:
account: string
- The address of the account to pull assets for.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string[]>
getHypotheticalAccountLiquidity
getHypotheticalAccountLiquidity
Determine what the account liquidity would be if the given amounts were redeemed/borrowed.
Parameters:
account: string
- The account to determine liquidity for.cTokenModify:
CToken
| string
- The market to hypothetically redeem/borrow in.redeemTokens: number | string | BN
- The number of tokens to hypothetically redeem.borrowAmount: number | string | BN
- The amount of underlying to hypothetically borrow.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<[string, string, string]>
getMaxBorrow
getMaxBorrow
Determine the maximum borrow amount of a cToken.
Parameters:
account: string
- The account to determine liquidity for.cTokenModify:
CToken
| string
- The market to hypothetically borrow in.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<[string, string]>
getMaxRedeem
getMaxRedeem
Determine the maximum redeem amount of a cToken.
Parameters:
account: string
- The account to determine liquidity for.cTokenModify:
CToken
| string
- The market to hypothetically redeem in.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<[string, string]>
getWhitelist
getWhitelist
Return all of the whitelist.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string[]>
isComptroller
isComptroller
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<boolean>
liquidateBorrowAllowed
liquidateBorrowAllowed
Checks if the liquidation should be allowed to occur.
Parameters:
cTokenBorrowed:
CToken
| string
- Asset which was borrowed by the borrower.cTokenCollateral:
CToken
| string
- Asset which was used as collateral and will be seized.liquidator: string
- The address repaying the borrow and seizing the collateral.borrower: string
- The address of the borrower,repayAmount: number | string | BN
- The amount of underlying being repaid.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
liquidateBorrowVerify
liquidateBorrowVerify
Parameters:
cTokenBorrowed:
CToken
| string
- Asset which was borrowed by the borrower.cTokenCollateral:
CToken
| string
- Asset which was used as collateral and will be seized.liquidator: string
- The address repaying the borrow and seizing the collateral.borrower: string
- The address of the borrower.actualRepayAmount: number | string | BN
- The amount of underlying being repaid.seizeTokens: number | string | BN
-tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
liquidateCalculateSeizeTokens
liquidateCalculateSeizeTokens
Calculate number of tokens of collateral asset to seize given an underlying amount.
Parameters:
cTokenBorrowed:
CToken
| string
- The address of the borrowed cToken.cTokenCollateral:
CToken
| string
- The address of the collateral cToken.accountRepayAmount: number | string | BN
- The amount of cTokenBorrowed underlying to convert into cTokenCollateral tokens.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
liquidationIncentiveMantissa
liquidationIncentiveMantissa
Returns the liquidation incentive mantissa.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
markets
markets
M
apping of cTokens -> Market metadata
Parameters:
cToken:
CToken
| string
- The cToken to get the Market for.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<{
isListed: boolean;
collateralFactorMantissa: string
}>
maxAssets
maxAssets
Returns the max number of assets a single account can participate in (borrow or use as collateral).
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
mintAllowed
mintAllowed
Checks if the account should be allowed to mint tokens in the given market.
Parameters:
cToken:
CToken
| string
- The market to verify the mint against.minter: string
- The account which would get the minted tokens.mintAmount: number | string | BN
- The amount of underlying being supplied to the market in exchange for tokens.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
mintGuardianPaused
mintGuardianPaused
Returns whether the mint guardian is paused for a market.
Parameters:
cToken:
CToken
| string
- The cToken to check the mint guardian for.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<boolean>
mintVerify
mintVerify
Validates mint and reverts on rejection.
Parameters:
cToken:
CToken
| string
- Asset being minted.minter: string
- The address minting the tokens.actualMintAmount: number | string | BN
- The amount of the underlying asset being minted.mintTokens: number | string | BN
- The number of tokens being minted.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
mintWithinLimits
mintWithinLimits
Checks if the account should be allowed to borrow the underlying asset of the given market.
Parameters:
cToken:
CToken
| string
- Asset whose underlying is being borrowed.minter: string
-actualMintAmount: number | string | BN
-mintTokens: number | string | BN
-tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
oracle
oracle
Returns the price oracle used by the comptroller.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
pauseGuardian
pauseGuardian
Returns the current pause guardian.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
pendingAdmin
pendingAdmin
Returns the pending admin for this contract.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
pendingComptrollerImplementation
pendingComptrollerImplementation
Returns the pending comptroller implementation for the unitroller.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
redeemAllowed
redeemAllowed
Checks if the account should be allowed to redeem tokens in the given market.
Parameters:
cToken:
CToken
| string
- The market to verify the redeem against.redeemer: string
- The account which would redeem the tokens.redeemTokens: number | string | BN
- The number of cTokens to exchange for the underlying asset in the market.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
redeemVerify
redeemVerify
Validates redeem and reverts on rejection. May emit logs.
Parameters:
cToken:
CToken
| string
- Asset being redeemed.redeemer: string
- The address redeeming the tokens.redeemAmount: number | string | BN
- The amount of the underlying asset being redeemed.redeemTokens: number | string | BN
- The number of tokens being redeemed.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
repayBorrowAllowed
repayBorrowAllowed
Checks if the account should be allowed to repay a borrow in the given market.
Parameters:
cToken:
CToken
| string
- The market to verify the repay against.payer: string
- The account which would repay the asset.borrower: string
- The account which would borrowed the asset.repayAmount: number | string | BN
- The amount of the underlying asset the account would repay.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
repayBorrowVerify
repayBorrowVerify
Validates repayBorrow and reverts on rejection.
Parameters:
cToken:
CToken
| string
- Asset being repaid.payer: string
-borrower: string
-actualRepayAmount: number | string | BN
-borrowerIndex: number | string | BN
-tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
seizeAllowed
seizeAllowed
Checks if the seizing of assets should be allowed to occur.
Parameters:
cTokenBorrowed:
CToken
| string
- Asset which was used as collateral and will be seized.cTokenCollateral:
CToken
| string
- Asset which was borrowed by the borrower.liquidator: string
- The address repaying the borrow and seizing the collateral.borrower: string
- The address of the borrower.seizeTokens: number | string | BN
- The number of collateral tokens to seize.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
seizeGuardianPaused
seizeGuardianPaused
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<boolean>
seizeVerify
seizeVerify
Validates seize and reverts on rejection.
Parameters:
cTokenBorrowed:
CToken
| string
- Asset which was borrowed by the borrower.cTokenCollateral:
CToken
| string
- Asset which was used as collateral and will be seized.liquidator: string
- The address repaying the borrow and seizing the collateral.borrower: string
- The address of the borrower.seizeTokens: number | string | BN
- The number of collateral tokens to seize.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
suppliers
suppliers
Returns whether a supplier has ever supplied to any market.
Parameters:
supplier: string
- The supplier to check.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<boolean>
transferAllowed
transferAllowed
Checks if the account should be allowed to transfer tokens in the given market.
Parameters:
cToken:
CToken
| string
- The market to verify the transfer against.src: string
- The account which sources the tokens.dst: string
- The account which receives the tokens.transferTokens: number | string | BN
- The number of cTokens to transfer.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
transferGuardianPaused
transferGuardianPaused
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<boolean>
transferVerify
transferVerify
Validates transfer and reverts on rejection.
Parameters:
cToken:
CToken
| string
- Asset being transferred.src: string
- The account which sources the tokens.dst: string
- The account which receives the tokens.transferTokens: number | string | BN
- The number of cTokens to transfer.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
whitelist
whitelist
Returns whether an account is allowed to supply assets or not.
Parameters:
account: string
- The account to check the whitelist status for.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<boolean>
whitelistArray
whitelistArray
An array of all whitelisted accounts.
Parameters:
index: number | string | BN
- Index of the account to fetch.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
Last updated