BToken
Overview
License: MIT
Author: Compound Abstract base for CTokens
Structs info
MintLocalVars
RedeemLocalVars
BorrowLocalVars
RepayBorrowLocalVars
Modifiers info
nonReentrant
Prevents a contract from calling itself, directly or indirectly.
Functions info
initialize (0x99d8c1b4)
Initializes the money market.
Parameters:
transfer (0xa9059cbb)
Transfers amount
tokens from msg.sender
to dst
.
Parameters:
Return values:
transferFrom (0x23b872dd)
Transfers amount
tokens from src
to dst
.
Parameters:
Return values:
approve (0x095ea7b3)
Approves spender
to transfer up to amount
from src
. This will overwrite the approval amount for spender
and is subject to issues noted here.
Parameters:
Return values:
allowance (0xdd62ed3e)
Gets the current allowance from owner
for spender
.
Parameters:
Return values:
balanceOf (0x70a08231)
Gets the token balance of the owner
.
Parameters:
Return values:
balanceOfUnderlying (0x3af9e669)
Gets the underlying balance of the owner
. This also accrues interest in a transaction.
Parameters:
Return values:
balanceOfUnderlyingView (0x439d3ee7)
Returns the balance of the underlying asset of this bToken for the given account. This is a view function, which means it will not modify the blockchain state.
Parameters:
Return values:
getAccountSnapshot (0xc37f68e2)
Gets a snapshot of the account's balances, and the cached exchange rate. This is used by bondtroller to more efficiently perform liquidity checks.
Parameters:
Return values:
borrowRatePerBlock (0xf8f9da28)
Returns the current per-block borrow interest rate for this cToken.
Return values:
supplyRatePerBlock (0xae9d70b0)
Returns the current per-block supply interest rate for this cToken.
Return values:
totalBorrowsCurrent (0x73acee98)
Returns the current total borrows plus accrued interest.
Return values:
borrowBalanceCurrent (0x17bfdfbc)
Accrues interest to updated borrowIndex and then calculate account's borrow balance using the updated borrowIndex.
Parameters:
Return values:
borrowBalanceStored (0x95dd9193)
Returns the borrow balance of account based on stored data.
Parameters:
Return values:
exchangeRateCurrent (0xbd6d894d)
Accrues interest then return the up-to-date exchange rate.
Return values:
exchangeRateStored (0x182df0f5)
Calculates the exchange rate from the underlying to the CToken.
Return values:
getCash (0x3b1d21a2)
Gets cash balance of this cToken in the underlying asset.
Return values:
accrueInterest (0xa6afed95)
Applies accrued interest to total borrows and reserves. This calculates interest accrued from the last checkpointed block up to the current block and writes new checkpoint to storage.
_setBondtroller (0xb4ac7688)
Sets a new bondtroller for the market. Admin function to set a new bondtroller.
Return values:
_setReserveFactor (0xfca7820b)
Accrues interest and sets a new reserve factor for the protocol using _setReserveFactorFresh. Admin function to accrue interest and set a new reserve factor.
Return values:
_reduceReserves (0x601a0bf1)
Accrues interest and reduces reserves by transferring to moderator.
Parameters:
Return values:
_setInterestRateModel (0xf2b3abbd)
accrues interest and updates the interest rate model using _setInterestRateModelFresh. Admin function to accrue interest and update the interest rate model.
Parameters:
Return values:
hasRoleModerator (0xd6526889)
Returns whether the specified account has the moderator role.
Parameters:
Return values:
Last updated