IVariableDebtToken

Git Source

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

NameTypeDescription
delegateeaddressthe address receiving the delegated borrowing power
amountuint256the 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

NameTypeDescription
fromUseraddressThe user to giving allowance
toUseraddressThe user to give allowance to

Returns

NameTypeDescription
<none>uint256the 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

NameTypeDescription
useraddressThe address receiving the borrowed underlying, being the delegatee in case of credit delegate, or same as onBehalfOf otherwise
onBehalfOfaddressThe address receiving the debt tokens
amountuint256The amount of debt being minted
indexuint256The variable debt index of the reserve

Returns

NameTypeDescription
<none>booltrue 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

NameTypeDescription
useraddressThe user which debt is burnt
amountuint256
indexuint256The variable debt index of the reserve

balanceOf

Returns the debt balance of the user

function balanceOf(address user) external view returns (uint256);

Returns

NameTypeDescription
<none>uint256The 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);