CToken
The sdk instance used by the cToken.
The raw web3 contract instance for the cToken.
Contract address of the cToken.
Type:
string
Accepts transfer of admin rights. msg.sender must be pendingAdmin
.
Parameters:
Accrues interest and reduces reserves by transferring to admin.
Parameters:
reduceAmount: number | string | BN
- Amount of reduction to reserves.
Parameters:
Renounce admin rights.
Parameters:
Renounce the Fuse admin rights.
Parameters:
Accrues interest and sets a new admin fee for the protocol using _setAdminFeeFresh
.
Parameters:
newAdminFeeMantissa: number | string | BN
-
Sets a new comptroller for the market.
Parameters:
Accrues interest and sets a new Fuse fee for the protocol using _setFuseFeeFresh.
Parameters:
Updates the interest rate model (*requires fresh interest accrual)
Parameters:
newInterestRateModel: string
- The new interest rate model to use.
Begins transfer of admin rights. The newPendingAdmin must call
_acceptAdmin
to finalize the transfer.Parameters:
newPendingAdmin: string
- New pending admin.
Accrues interest and sets a new reserve factor for the protocol using _setReserveFactorFresh.
Parameters:
newReserveFactorMantissa: number | string | BN
- New reserve factor.
Accrues interest and reduces admin fees by transferring to admin.
Parameters:
withdrawAmount: number | string | BN
- Amount of fees to withdraw.
Accrues interest and reduces Fuse fees by transferring to Fuse.
Parameters:
withdrawAmount: number | string | BN
- Amount of fees to withdraw.
Returns the block number that interest was last accrued at.
Parameters:
Returns:
Promise<string>
Parameters:
Returns:
Promise<string>
Parameters:
Returns:
Promise<string>
Returns the fraction of interest currently set aside for admin fees.
Parameters:
Returns:
Promise<string>
Returns whether or not the admin has admin rights.
Parameters:
Returns:
Promise<boolean>
Returns the allowance for spender by owner.
Parameters:
owner: string
- Owner of the allowance account.spender: string
- Spender of the allowance.
Returns:
Promise<string>
Gives allowance to
spender
.Parameters:
spender: string
- Account to give allowance to.amount: number | string | BN
- Amount of allowance.
Returns the balance of an account.
Parameters:
owner: string
- The account address to get the balance of.
Returns:
Promise<string>
Returns the balance of the underlying token for a given account.
Parameters:
owner: string
- The account to get the balance of.
Borrows an asset.
Parameters:
borrowAmount: number | string | BN
- Amount to borrow.
Returns the borrow balance for an account.
Parameters:
account: string
- The account to get the borrow balance of.
Returns:
Promise<string>
Returns the stored borrow balance for an account.
Parameters:
account: string
- The account to get thee balance of.
Returns:
Promise<string>
Returns the borrow Index for the cToken. Borrow index is the accumulator of total earned interest rate since the opening of the market.
Parameters:
Returns:
Promise<string>
Returns the borrow rate per block.
Parameters:
Returns:
Promise<string>
EIP-20 token decimals for this token.
Parameters:
Returns:
Promise<string>
Returns the current exchange rate for the cToken.
Parameters:
Returns:
Promise<string>
Returns the stored exchange rate for the cToken.
Parameters:
Returns:
Promise<string>
Returns whether or not the Fuse admin has admin rights
Parameters:
Returns:
Promise<boolean>
Returns the fuse fee.
Parameters:
Returns:
Promise<string>
Returns a snapshot of the account's balances, and the cached exchange rate.
Parameters:
account: string
- Address of the account to snapshot.
Returns:
Promise<[string, string, string, string]>
Returns cash balance of the cToken in the underlying asset
Parameters:
Returns:
Promise<string>
Parameters:
Returns:
Promise<string>
Returns whether this is a
CEther
contract (for inspection).Parameters:
Returns:
Promise<boolean>
Returns whether this is a
CToken
contract (for inspection).Parameters:
Returns:
Promise<boolean>
Liquidates the borrowers' collateral.
Parameters:
borrower: string
- The borrower of this cToken to be liquidatedrepayAmount: number | string | BN
- The amount of the underlying borrowed asset to repay.
Supplies assets into the market, receiving cTokens in exchange
Parameters:
mintAmount: number | string | BN
- The amount of the underlying asset to supply.
Returns ERC-20 name of this token.
Parameters:
Returns:
Promise<string>
Returns the pending admin for this contract.
Parameters:
Returns:
Promise<string>
Redeems cTokens in exchange for the underlying asset.
Parameters:
redeemTokens: number | string | BN
- The number of cTokens to redeem into underlying.
Redeems cTokens in exchange for a specified amount of underlying asset.
Parameters:
redeemAmount: number | string | BN
-
Parameters:
redeemAmount: number | string | BN
- The amount of underlying to redeem.
Repays a borrow belonging to borrower.
Parameters:
borrower: string
- The account with the debt being payed off.repayAmount: number | string | BN
- The amount to repay.
Parameters:
Returns:
Promise<string>
Transfers collateral tokens (this market) to the liquidator.
Parameters:
liquidator: string
- The account receiving seized collateral.borrower: string
- The account having collateral seized.seizeTokens: number | string | BN
- The number of cTokens to seize.
Returns the current per-block supply interest rate for this cToken.
Parameters:
Returns:
Promise<string>
Returns the EIP-20 symbol of this token.
Parameters:
Returns:
Promise<string>
Returns the total amount of admin fees of the underlying held in this market.
Parameters:
Returns:
Promise<string>
Returns the total amount of outstanding borrows of the underlying in this market.
Parameters:
Returns:
Promise<string>
Parameters:
Returns:
Promise<string>
Returns the total amount of Fuse fees of the underlying held in this market.
Parameters:
Returns:
Promise<string>
Returns the total amount of reserves of the underlying held in this market.
Parameters:
Returns:
Promise<string>
Returns the total number of tokens in circulation.
Parameters:
Returns:
Promise<string>
EIP20 transfer function.
Parameters:
dst: string
- Account to transfer to.amount: number | string | BN
- Amount to transfer.
EIP20 transferFrom function.
Parameters:
src: string
- Account to transfer from.dst: string
- Account to transfer to.amount: number | string | BN
- Amount to transfer.
Returns the underlying asset for this cToken.
Parameters:
Returns:
Promise<string>
Last modified 9mo ago