debtTokens
DebtToken.sol
Last updated
DebtToken.sol
Last updated
Implements a debt token to track the borrowing positions of users.
function balanceOf(address user) public view virtual returns (uint256)
Calculates the accumulated debt balance of the user.
Name | Type | Description |
---|---|---|
Type | Description |
---|---|
function scaledBalanceOf(address user) public view virtual returns (uint256)
Returns the principal debt balance of the user.
Name | Type | Description |
---|---|---|
function totalSupply() public view virtual returns (uint256)
Returns the total supply of the variable debt token. Represents the total debt accrued by the users
function scaledTotalSupply() public view virtual returns (uint256)
Returns the scaled total supply of the variable debt token. Represents sum(debt/index).
function getScaledUserBalanceAndSupply(address user) external view returns (uint256, uint256)
Returns the principal balance of the user and principal total supply.
function UNDERLYING_ASSET_ADDRESS() public view returns (address)
Returns the address of the underlying asset of this uToken.
Return Values
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.
function burn(address user, uint256 amount, uint256 index) external
It will burn the user's variable debt after redeeming, repaying or getting liquidated.
function transfer(address recipient, uint256 amount) public virtual returns (bool)
This method is not supported. It will revert the transaction.
function allowance(address owner, address spender) public view virtual returns (uint256)
This method is not supported. It will revert the transaction.
function approve(address spender, uint256 amount) public virtual returns (bool)
This method is not supported. It will revert the transaction.
function transferFrom(address sender, address recipient, uint256 amount) public virtual returns (bool)
This method is not supported. It will revert the transaction.
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool)
This method is not supported. It will revert the transaction.
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool)
This method is not supported. It will revert the transaction.
function approveDelegation(address delegatee, uint256 amount) external
Delegates borrowing power to a user on the specific debt token.
function borrowAllowance(address fromUser, address toUser) external view returns (uint256)
returns the borrow allowance of the user
Type | Description |
---|---|
Type | Description |
---|---|
Type | Description |
---|---|
Name | Type | Description |
---|---|---|
Type | Description |
---|---|
Type | Description |
---|---|
Name | Type | Description |
---|---|---|
Type | Description |
---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Type | Description |
---|---|
user
address
the users address we want to query the balance
uint256
The debt balance of the user
user
address
the scalled debt amount of the specified address
uint256
The debt balance of the user since the last burn/mint action
uint256
The total supply
uint256
the scaled total supply
user
address
The address of the user
uint256
The principal balance of the user
uint256
The principal total supply
address
the address of the the underlying asset.
initiator
address
The address calling borrow
onBehalfOf
address
The address of the user that will receive the debtTokens
amount
uint256
The amount of debt being minted
index
uint256
The variable debt index of the reserve
bool
true
if the the previous balance of the user is 0
user
address
The user whose debt is getting burned
amount
uint256
The amount getting burned
index
uint256
The variable debt index of the reserve
delegatee
address
the address receiving the delegated borrowing power
amount
uint256
the maximum amount being delegated. Delegation will still respect the liquidation constraints (even if delegated, a delegatee cannot force a delegator HF to go below 1)
fromUser
address
The user to giving allowance
toUser
address
The user to give allowance to
uint256
the current allowance of toUser