contract BLendingToken is Initializable, BErc20, AccessControlUpgradeable
The BLendingToken contract
event SetPrimaryLendingPlatform(address indexed oldPrimaryLendingPlatform, address indexed newPrimaryLendingPlatform)
Emitted when the primary lending platform is set.
Parameters:
oldPrimaryLendingPlatform
The address of the old primary lending platform.
newPrimaryLendingPlatform
The address of the new primary lending platform.
MODERATOR_ROLE (0x797669c9)
State variables info
Modifier to check if the caller has the DEFAULT_ADMIN_ROLE.
Modifier to restrict access to functions that can only be called by the primary lending platform.
init (0x4703d19c)
Initializes the bToken contract with the given parameters.
Parameters:
The address of the underlying asset contract.
The address of the Bondtroller contract.
contract InterestRateModel
The address of the interest rate model contract.
initialExchangeRateMantissa_
The initial exchange rate mantissa for the bToken contract.
The name of the bToken contract.
The symbol of the bToken contract.
The number of decimals for the bToken contract.
The address of the admin for the bToken contract.
Sets the primary lending platform for the BLendingToken contract.
Parameters:
The address of the primary lending platform to be set.
grantModerator (0x6981c7ae)
Grants the MODERATOR_ROLE to a new address.
Parameters:
The address to grant the MODERATOR_ROLE to.
revokeModerator (0x36445636)
Revokes the moderator role from the specified address.
Parameters:
The address of the moderator to revoke the role from.
transferAdminship (0x5be7cc16)
Transfers the adminship to a new address.
Parameters:
The address of the new admin.
hasRoleModerator (0xd6526889)
Returns true if the specified account has the moderator role.
Parameters:
The address to check for the moderator role.
Return values:
A boolean indicating whether the account has the moderator role or not.
mintTo (0x449a52f8)
Mints new tokens to the specified minter address.
Parameters:
The address of the minter.
The amount of tokens to mint.
Return values:
An error code (0 if successful).
The amount of tokens that were minted.
redeemTo (0x2f7605fb)
Redeems redeemTokens amount of bTokens for underlying assets to the redeemer address. Only the primary lending platform can call this function.
Parameters:
The address of the account that will receive the underlying assets.
The amount of bTokens to be redeemed.
Return values:
An error code corresponding to the success or failure of the redemption operation.
redeemUnderlyingTo (0x6664aa78)
Redeems redeemAmount of bTokens for underlying asset and transfers them to redeemer. Only the primary lending platform can call this function.
Parameters:
The address of the account that will receive the underlying asset.
The amount of bTokens to redeem for underlying asset.
Return values:
An error code corresponding to the success or failure of the redeem operation.
borrowTo (0xfda0241d)
Allows the primary lending platform to borrow tokens on behalf of a borrower.
Parameters:
The address of the borrower.
The amount of tokens to be borrowed.
Return values:
The error code (if any) returned by the borrowFresh function.
repayTo (0x99c93213)
Repays a specified amount of the calling user's borrow balance to a borrower. Only callable by the primary lending platform.
Parameters:
The address of the account that will be paying the borrow balance.
The address of the account with the borrow balance being repaid.
The amount of the borrow balance to repay.
Return values:
The error code corresponding to the success or failure of the repay borrow operation.
The actual amount repaid, which may be less than the specified repayAmount if there is not enough balance available to repay.
getEstimatedBorrowIndex (0xcbebe597)
Calculates the estimated borrow index based on the current borrow interest rate and the number of blocks elapsed since the last accrual.
Return values:
The estimated borrow index as a uint256 value.
getEstimatedBorrowBalanceStored (0xb9ade142)
Returns the estimated borrow balance of an account based on the current borrow index.
Parameters:
The address of the account to get the borrow balance for.
Return values:
The estimated borrow balance of the account.