debtTokens

DebtToken.sol

Implements a debt token to track the borrowing positions of users.

View Methods

balanceOf

function balanceOf(address user) public view virtual returns (uint256)

Calculates the accumulated debt balance of the user.

Call Params

Return Values

scaledBalanceOf

function scaledBalanceOf(address user) public view virtual returns (uint256)

Returns the principal debt balance of the user.

Call Params

Return Values

totalSupply

function totalSupply() public view virtual returns (uint256)

Returns the total supply of the variable debt token. Represents the total debt accrued by the users

Return Values

scaledTotalSupply

function scaledTotalSupply() public view virtual returns (uint256)

Returns the scaled total supply of the variable debt token. Represents sum(debt/index).

Return Values

getScaledUserBalanceAndSupply

function getScaledUserBalanceAndSupply(address user) external view returns (uint256, uint256)

Returns the principal balance of the user and principal total supply.

Parameters

Return Values

UNDERLYING_ASSET_ADDRESS

function UNDERLYING_ASSET_ADDRESS() public view returns (address)

Returns the address of the underlying asset of this uToken.

Return Values

Write Methods

function mint(address initiator, address onBehalfOf, uint256 amount, uint256 index) external returns (bool)

Mints debt tokens when the user borrows, representing the user's debt.

Call Params

Return Values

burn

function burn(address user, uint256 amount, uint256 index) external

It will burn the user's variable debt after redeeming, repaying or getting liquidated.

Call Params

transfer

function transfer(address recipient, uint256 amount) public virtual returns (bool)

This method is not supported. It will revert the transaction.

allowance

function allowance(address owner, address spender) public view virtual returns (uint256)

This method is not supported. It will revert the transaction.

approve

function approve(address spender, uint256 amount) public virtual returns (bool)

This method is not supported. It will revert the transaction.

transferFrom

function transferFrom(address sender, address recipient, uint256 amount) public virtual returns (bool)

This method is not supported. It will revert the transaction.

increaseAllowance

function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool)

This method is not supported. It will revert the transaction.

decreaseAllowance

function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool)

This method is not supported. It will revert the transaction.

approveDelegation

function approveDelegation(address delegatee, uint256 amount) external

Delegates borrowing power to a user on the specific debt token.

Call Params

borrowAllowance

function borrowAllowance(address fromUser, address toUser) external view returns (uint256)

returns the borrow allowance of the user

Parameters

Return Values

Last updated