IVariableDebtToken
Inherits: IScaledBalanceToken
Author: Aave
Defines the basic interface for a variable debt token.
Functions
approveDelegation
delegates borrowing power to a user on the specific debt token
function approveDelegation(address delegatee, uint256 amount) external;
Parameters
Name | Type | Description |
---|---|---|
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) |
borrowAllowance
returns the borrow allowance of the user
function borrowAllowance(address fromUser, address toUser) external view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
fromUser | address | The user to giving allowance |
toUser | address | The user to give allowance to |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | the current allowance of toUser |
mint
Mints debt token to the onBehalfOf
address
function mint(address user, address onBehalfOf, uint256 amount, uint256 index) external returns (bool);
Parameters
Name | Type | Description |
---|---|---|
user | address | The address receiving the borrowed underlying, being the delegatee in case of credit delegate, or same as onBehalfOf otherwise |
onBehalfOf | address | The address receiving the debt tokens |
amount | uint256 | The amount of debt being minted |
index | uint256 | The variable debt index of the reserve |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | true if the the previous balance of the user is 0 |
burn
Burns user variable debt
function burn(address user, uint256 amount, uint256 index) external;
Parameters
Name | Type | Description |
---|---|---|
user | address | The user which debt is burnt |
amount | uint256 | |
index | uint256 | The variable debt index of the reserve |
balanceOf
Returns the debt balance of the user
function balanceOf(address user) external view returns (uint256);
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The debt balance of the user. |
Events
Mint
Emitted after the mint action
event Mint(address indexed from, address indexed onBehalfOf, uint256 value, uint256 index);
Burn
Emitted when variable debt is burnt
event Burn(address indexed user, uint256 amount, uint256 index);