B Lending Token
Methods
DEFAULT_ADMIN_ROLE
Returns
_0
bytes32
undefined
MODERATOR_ROLE
Returns
_0
bytes32
undefined
_acceptAdmin
Accepts transfer of admin rights. msg.sender must be pendingAdmin
Admin function for pending admin to accept role and update admin
Returns
_0
uint256
uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
_addReserves
The sender adds to reserves.
Parameters
addAmount
uint256
The amount fo underlying token to add as reserves
Returns
_0
uint256
uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
_reduceReserves
Accrues interest and reduces reserves by transferring to admin
Parameters
reduceAmount
uint256
Amount of reduction to reserves
Returns
_0
uint256
uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
_setBondtroller
Sets a new bondtroller for the market
Admin function to set a new bondtroller
Parameters
newBondtroller
contract Bondtroller
undefined
Returns
_0
uint256
uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
_setInterestRateModel
accrues interest and updates the interest rate model using _setInterestRateModelFresh
Admin function to accrue interest and update the interest rate model
Parameters
newInterestRateModel
contract InterestRateModel
the new interest rate model to use
Returns
_0
uint256
uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
_setPendingAdmin
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.
Parameters
newPendingAdmin
address payable
New pending admin.
Returns
_0
uint256
uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
_setReserveFactor
accrues interest and sets a new reserve factor for the protocol using _setReserveFactorFresh
Admin function to accrue interest and set a new reserve factor
Parameters
newReserveFactorMantissa
uint256
undefined
Returns
_0
uint256
uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
accountTokens
Official record of token balances for each account
Parameters
_0
address
undefined
Returns
_0
uint256
undefined
accrualBlockNumber
Block number that interest was last accrued at
Returns
_0
uint256
undefined
accrueInterest
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.
Returns
_0
uint256
undefined
admin
Administrator for this contract
Returns
_0
address payable
undefined
allowance
Get the current allowance from owner
for spender
Parameters
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
Returns
_0
uint256
The number of tokens allowed to be spent (-1 means infinite)
approve
Approve spender
to transfer up to amount
from src
This will overwrite the approval amount for spender
and is subject to issues noted here
Parameters
spender
address
The address of the account which may transfer tokens
amount
uint256
The number of tokens that are approved (-1 means infinite)
Returns
_0
bool
Whether or not the approval succeeded
balanceOf
Get the token balance of the owner
Parameters
owner
address
The address of the account to query
Returns
_0
uint256
The number of tokens owned by owner
balanceOfUnderlying
Get the underlying balance of the owner
This also accrues interest in a transaction
Parameters
owner
address
The address of the account to query
Returns
_0
uint256
The amount of underlying owned by owner
balanceOfUnderlyingView
Parameters
owner
address
undefined
Returns
_0
uint256
undefined
bondtroller
Contract which oversees inter-cToken operations
Returns
_0
contract Bondtroller
undefined
borrowBalanceCurrent
Accrue interest to updated borrowIndex and then calculate account's borrow balance using the updated borrowIndex
Parameters
account
address
The address whose balance should be calculated after updating borrowIndex
Returns
_0
uint256
The calculated balance
borrowBalanceStored
Return the borrow balance of account based on stored data
Parameters
account
address
The address whose balance should be calculated
Returns
_0
uint256
The calculated balance
borrowIndex
Accumulator of the total earned interest rate since the opening of the market
Returns
_0
uint256
undefined
borrowRatePerBlock
Returns the current per-block borrow interest rate for this cToken
Returns
_0
uint256
The borrow interest rate per block, scaled by 1e18
borrowTo
Parameters
borrower
address
undefined
borrowAmount
uint256
undefined
Returns
borrowError
uint256
undefined
decimals
EIP-20 token decimals for this token
Returns
_0
uint8
undefined
exchangeRateCurrent
Accrue interest then return the up-to-date exchange rate
Returns
_0
uint256
Calculated exchange rate scaled by 1e18
exchangeRateStored
Calculates the exchange rate from the underlying to the CToken
This function does not accrue interest before calculating the exchange rate
Returns
_0
uint256
Calculated exchange rate scaled by 1e18
getAccountSnapshot
Get a snapshot of the account's balances, and the cached exchange rate
This is used by bondtroller to more efficiently perform liquidity checks.
Parameters
account
address
Address of the account to snapshot
Returns
_0
uint256
(possible error, token balance, borrow balance, exchange rate mantissa)
_1
uint256
undefined
_2
uint256
undefined
_3
uint256
undefined
getCash
Get cash balance of this cToken in the underlying asset
Returns
_0
uint256
The quantity of underlying asset owned by this contract
getEstimatedBorrowBalanceStored
Parameters
account
address
undefined
Returns
accrual
uint256
undefined
getEstimatedBorrowIndex
Returns
_0
uint256
undefined
getRoleAdmin
Returns the admin role that controls role
. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.
Parameters
role
bytes32
undefined
Returns
_0
bytes32
undefined
grandModerator
Parameters
newModerator
address
undefined
grantRole
Grants role
to account
. If account
had not been already granted role
, emits a {RoleGranted} event. Requirements: - the caller must have role
's admin role.
Parameters
role
bytes32
undefined
account
address
undefined
hasRole
Returns true
if account
has been granted role
.
Parameters
role
bytes32
undefined
account
address
undefined
Returns
_0
bool
undefined
init
Parameters
underlying_
address
undefined
bondtroller_
contract Bondtroller
undefined
interestRateModel_
contract InterestRateModel
undefined
initialExchangeRateMantissa_
uint256
undefined
name_
string
undefined
symbol_
string
undefined
decimals_
uint8
undefined
admin_
address
undefined
initialize
Initialize the new money market
Parameters
underlying_
address
The address of the underlying asset
comptroller_
contract Bondtroller
The address of the Comptroller
interestRateModel_
contract InterestRateModel
The address of the interest rate model
initialExchangeRateMantissa_
uint256
The initial exchange rate, scaled by 1e18
name_
string
ERC-20 name of this token
symbol_
string
ERC-20 symbol of this token
decimals_
uint8
ERC-20 decimal precision of this token
initialize
Initialize the money market
Parameters
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
interestRateModel
Model which tells what the current interest rate should be
Returns
_0
contract InterestRateModel
undefined
isCToken
Indicator that this is a CToken contract (for inspection)
Returns
_0
bool
undefined
mintTo
Parameters
minter
address
undefined
mintAmount
uint256
undefined
Returns
err
uint256
undefined
mintedAmount
uint256
undefined
name
EIP-20 token name for this token
Returns
_0
string
undefined
pendingAdmin
Pending administrator for this contract
Returns
_0
address payable
undefined
primaryIndexToken
Returns
_0
address
undefined
protocolSeizeShareMantissa
Share of seized collateral that is added to reserves
Returns
_0
uint256
undefined
redeemTo
Parameters
redeemer
address
undefined
redeemTokens
uint256
undefined
Returns
redeemErr
uint256
undefined
redeemUnderlyingTo
Parameters
redeemer
address
undefined
redeemAmount
uint256
undefined
Returns
redeemUnderlyingError
uint256
undefined
renounceRole
Revokes role
from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been granted role
, emits a {RoleRevoked} event. Requirements: - the caller must be account
.
Parameters
role
bytes32
undefined
account
address
undefined
repayTo
Parameters
payer
address
undefined
borrower
address
undefined
repayAmount
uint256
undefined
Returns
repayBorrowError
uint256
undefined
amountRepayed
uint256
undefined
reserveFactorMantissa
Fraction of interest currently set aside for reserves
Returns
_0
uint256
undefined
revokeModerator
Parameters
moderator
address
undefined
revokeRole
Revokes role
from account
. If account
had been granted role
, emits a {RoleRevoked} event. Requirements: - the caller must have role
's admin role.
Parameters
role
bytes32
undefined
account
address
undefined
setPrimaryIndexToken
Parameters
_primaryIndexToken
address
undefined
setReserveFactor
Parameters
reserveFactorMantissa
uint256
undefined
supplyRatePerBlock
Returns the current per-block supply interest rate for this cToken
Returns
_0
uint256
The supply interest rate per block, scaled by 1e18
supportsInterface
See {IERC165-supportsInterface}.
Parameters
interfaceId
bytes4
undefined
Returns
_0
bool
undefined
sweepToken
A public function to sweep accidental ERC-20 transfers to this contract. Tokens are sent to admin (timelock)
Parameters
token
contract EIP20NonStandardInterface
The address of the ERC-20 token to sweep
symbol
EIP-20 token symbol for this token
Returns
_0
string
undefined
totalBorrows
Total amount of outstanding borrows of the underlying in this market
Returns
_0
uint256
undefined
totalBorrowsCurrent
Returns the current total borrows plus accrued interest
Returns
_0
uint256
The total borrows with interest
totalReserves
Total amount of reserves of the underlying held in this market
Returns
_0
uint256
undefined
totalSupply
Total number of tokens in circulation
Returns
_0
uint256
undefined
transfer
Transfer amount
tokens from msg.sender
to dst
Parameters
dst
address
The address of the destination account
amount
uint256
The number of tokens to transfer
Returns
_0
bool
Whether or not the transfer succeeded
transferFrom
Transfer amount
tokens from src
to dst
Parameters
src
address
The address of the source account
dst
address
The address of the destination account
amount
uint256
The number of tokens to transfer
Returns
_0
bool
Whether or not the transfer succeeded
underlying
Underlying asset for this CToken
Returns
_0
address
undefined
Events
AccrueInterest
Event emitted when interest is accrued
Parameters
cashPrior
uint256
undefined
interestAccumulated
uint256
undefined
borrowIndex
uint256
undefined
totalBorrows
uint256
undefined
Approval
EIP20 Approval event
Parameters
owner indexed
address
undefined
spender indexed
address
undefined
amount
uint256
undefined
Borrow
Event emitted when underlying is borrowed
Parameters
borrower
address
undefined
borrowAmount
uint256
undefined
accountBorrows
uint256
undefined
totalBorrows
uint256
undefined
Failure
Parameters
error
uint256
undefined
info
uint256
undefined
detail
uint256
undefined
LiquidateBorrow
Event emitted when a borrow is liquidated
Parameters
liquidator
address
undefined
borrower
address
undefined
repayAmount
uint256
undefined
cTokenCollateral
address
undefined
seizeTokens
uint256
undefined
Mint
Event emitted when tokens are minted
Parameters
minter
address
undefined
mintAmount
uint256
undefined
mintTokens
uint256
undefined
NewAdmin
Event emitted when pendingAdmin is accepted, which means admin is updated
Parameters
oldAdmin
address
undefined
newAdmin
address
undefined
NewBondtroller
Event emitted when bondtroller is changed
Parameters
oldBondtroller
contract Bondtroller
undefined
newBondtroller
contract Bondtroller
undefined
NewMarketInterestRateModel
Event emitted when interestRateModel is changed
Parameters
oldInterestRateModel
contract InterestRateModel
undefined
newInterestRateModel
contract InterestRateModel
undefined
NewPendingAdmin
Event emitted when pendingAdmin is changed
Parameters
oldPendingAdmin
address
undefined
newPendingAdmin
address
undefined
NewReserveFactor
Event emitted when the reserve factor is changed
Parameters
oldReserveFactorMantissa
uint256
undefined
newReserveFactorMantissa
uint256
undefined
Redeem
Event emitted when tokens are redeemed
Parameters
redeemer
address
undefined
redeemAmount
uint256
undefined
redeemTokens
uint256
undefined
RepayBorrow
Event emitted when a borrow is repaid
Parameters
payer
address
undefined
borrower
address
undefined
repayAmount
uint256
undefined
accountBorrows
uint256
undefined
totalBorrows
uint256
undefined
ReservesAdded
Event emitted when the reserves are added
Parameters
benefactor
address
undefined
addAmount
uint256
undefined
newTotalReserves
uint256
undefined
ReservesReduced
Event emitted when the reserves are reduced
Parameters
admin
address
undefined
reduceAmount
uint256
undefined
newTotalReserves
uint256
undefined
RoleAdminChanged
Parameters
role indexed
bytes32
undefined
previousAdminRole indexed
bytes32
undefined
newAdminRole indexed
bytes32
undefined
RoleGranted
Parameters
role indexed
bytes32
undefined
account indexed
address
undefined
sender indexed
address
undefined
RoleRevoked
Parameters
role indexed
bytes32
undefined
account indexed
address
undefined
sender indexed
address
undefined
SetPrimaryIndexToken
Parameters
oldPrimaryIndexToken indexed
address
undefined
newPrimaryIndexToken indexed
address
undefined
Transfer
EIP20 Transfer event
Parameters
from indexed
address
undefined
to indexed
address
undefined
amount
uint256
undefined
Last updated