B Token
Last updated
Last updated
Compound
Compound's CToken Contract
Abstract base for CTokens
Accepts transfer of admin rights. msg.sender must be pendingAdmin
Admin function for pending admin to accept role and update admin
Name | Type | Description |
---|---|---|
Accrues interest and reduces reserves by transferring to admin
Name | Type | Description |
---|---|---|
Sets a new bondtroller for the market
Admin function to set a new bondtroller
accrues interest and updates the interest rate model using _setInterestRateModelFresh
Admin function to accrue interest and update the interest rate model
Begins transfer of admin rights. The newPendingAdmin must call _acceptAdmin
to finalize the transfer.
Admin function to begin change of admin. The newPendingAdmin must call _acceptAdmin
to finalize the transfer.
accrues interest and sets a new reserve factor for the protocol using _setReserveFactorFresh
Admin function to accrue interest and set a new reserve factor
Official record of token balances for each account
Block number that interest was last accrued at
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.
Administrator for this contract
Get the current allowance from owner
for spender
Approve spender
to transfer up to amount
from src
This will overwrite the approval amount for spender
and is subject to issues noted here
Get the token balance of the owner
Get the underlying balance of the owner
This also accrues interest in a transaction
Contract which oversees inter-cToken operations
Accrue interest to updated borrowIndex and then calculate account's borrow balance using the updated borrowIndex
Return the borrow balance of account based on stored data
Accumulator of the total earned interest rate since the opening of the market
Returns the current per-block borrow interest rate for this cToken
EIP-20 token decimals for this token
Accrue interest then return the up-to-date exchange rate
Calculates the exchange rate from the underlying to the CToken
This function does not accrue interest before calculating the exchange rate
Get a snapshot of the account's balances, and the cached exchange rate
This is used by bondtroller to more efficiently perform liquidity checks.
Get cash balance of this cToken in the underlying asset
Initialize the money market
Model which tells what the current interest rate should be
Indicator that this is a CToken contract (for inspection)
EIP-20 token name for this token
Pending administrator for this contract
Share of seized collateral that is added to reserves
Fraction of interest currently set aside for reserves
Returns the current per-block supply interest rate for this cToken
EIP-20 token symbol for this token
Total amount of outstanding borrows of the underlying in this market
Returns the current total borrows plus accrued interest
Total amount of reserves of the underlying held in this market
Total number of tokens in circulation
Transfer amount
tokens from msg.sender
to dst
Transfer amount
tokens from src
to dst
Event emitted when interest is accrued
EIP20 Approval event
Event emitted when underlying is borrowed
Event emitted when a borrow is liquidated
Event emitted when tokens are minted
Event emitted when pendingAdmin is accepted, which means admin is updated
Event emitted when bondtroller is changed
Event emitted when interestRateModel is changed
Event emitted when pendingAdmin is changed
Event emitted when the reserve factor is changed
Event emitted when tokens are redeemed
Event emitted when a borrow is repaid
Event emitted when the reserves are added
Event emitted when the reserves are reduced
EIP20 Transfer event
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
_0
uint256
uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
reduceAmount
uint256
Amount of reduction to reserves
_0
uint256
uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
newBondtroller
contract Bondtroller
undefined
_0
uint256
uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
newInterestRateModel
contract InterestRateModel
the new interest rate model to use
_0
uint256
uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
newPendingAdmin
address payable
New pending admin.
_0
uint256
uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
newReserveFactorMantissa
uint256
undefined
_0
uint256
uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
_0
address
undefined
_0
uint256
undefined
_0
uint256
undefined
_0
uint256
undefined
_0
address payable
undefined
owner
address
The address of the account which owns the tokens to be spent
spender
address
The address of the account which may transfer tokens
_0
uint256
The number of tokens allowed to be spent (-1 means infinite)
spender
address
The address of the account which may transfer tokens
amount
uint256
The number of tokens that are approved (-1 means infinite)
_0
bool
Whether or not the approval succeeded
owner
address
The address of the account to query
_0
uint256
The number of tokens owned by owner
owner
address
The address of the account to query
_0
uint256
The amount of underlying owned by owner
owner
address
undefined
_0
uint256
undefined
_0
contract Bondtroller
undefined
account
address
The address whose balance should be calculated after updating borrowIndex
_0
uint256
The calculated balance
account
address
The address whose balance should be calculated
_0
uint256
The calculated balance
_0
uint256
undefined
_0
uint256
The borrow interest rate per block, scaled by 1e18
_0
uint8
undefined
_0
uint256
Calculated exchange rate scaled by 1e18
_0
uint256
Calculated exchange rate scaled by 1e18
account
address
Address of the account to snapshot
_0
uint256
(possible error, token balance, borrow balance, exchange rate mantissa)
_1
uint256
undefined
_2
uint256
undefined
_3
uint256
undefined
_0
uint256
The quantity of underlying asset owned by this contract
bondtroller_
contract Bondtroller
The address of the Bondtroller
interestRateModel_
contract InterestRateModel
The address of the interest rate model
initialExchangeRateMantissa_
uint256
The initial exchange rate, scaled by 1e18
name_
string
EIP-20 name of this token
symbol_
string
EIP-20 symbol of this token
decimals_
uint8
EIP-20 decimal precision of this token
_0
contract InterestRateModel
undefined
_0
bool
undefined
_0
string
undefined
_0
address payable
undefined
_0
uint256
undefined
_0
uint256
undefined
_0
uint256
The supply interest rate per block, scaled by 1e18
_0
string
undefined
_0
uint256
undefined
_0
uint256
The total borrows with interest
_0
uint256
undefined
_0
uint256
undefined
dst
address
The address of the destination account
amount
uint256
The number of tokens to transfer
_0
bool
Whether or not the transfer succeeded
src
address
The address of the source account
dst
address
The address of the destination account
amount
uint256
The number of tokens to transfer
_0
bool
Whether or not the transfer succeeded
cashPrior
uint256
undefined
interestAccumulated
uint256
undefined
borrowIndex
uint256
undefined
totalBorrows
uint256
undefined
owner indexed
address
undefined
spender indexed
address
undefined
amount
uint256
undefined
borrower
address
undefined
borrowAmount
uint256
undefined
accountBorrows
uint256
undefined
totalBorrows
uint256
undefined
error
uint256
undefined
info
uint256
undefined
detail
uint256
undefined
liquidator
address
undefined
borrower
address
undefined
repayAmount
uint256
undefined
cTokenCollateral
address
undefined
seizeTokens
uint256
undefined
minter
address
undefined
mintAmount
uint256
undefined
mintTokens
uint256
undefined
oldAdmin
address
undefined
newAdmin
address
undefined
oldBondtroller
contract Bondtroller
undefined
newBondtroller
contract Bondtroller
undefined
oldInterestRateModel
contract InterestRateModel
undefined
newInterestRateModel
contract InterestRateModel
undefined
oldPendingAdmin
address
undefined
newPendingAdmin
address
undefined
oldReserveFactorMantissa
uint256
undefined
newReserveFactorMantissa
uint256
undefined
redeemer
address
undefined
redeemAmount
uint256
undefined
redeemTokens
uint256
undefined
payer
address
undefined
borrower
address
undefined
repayAmount
uint256
undefined
accountBorrows
uint256
undefined
totalBorrows
uint256
undefined
benefactor
address
undefined
addAmount
uint256
undefined
newTotalReserves
uint256
undefined
admin
address
undefined
reduceAmount
uint256
undefined
newTotalReserves
uint256
undefined
from indexed
address
undefined
to indexed
address
undefined
amount
uint256
undefined