2020-08-20 12:32:20 +00:00
|
|
|
// SPDX-License-Identifier: agpl-3.0
|
|
|
|
pragma solidity ^0.6.8;
|
2020-06-30 12:09:28 +00:00
|
|
|
|
2020-07-09 09:59:49 +00:00
|
|
|
/**
|
2020-07-13 08:54:08 +00:00
|
|
|
* @title interface IVariableDebtToken
|
|
|
|
* @author Aave
|
|
|
|
* @notice defines the basic interface for a variable debt token.
|
|
|
|
* @dev does not inherit from IERC20 to save in contract size
|
|
|
|
**/
|
2020-06-30 12:09:28 +00:00
|
|
|
interface IVariableDebtToken {
|
2020-08-21 14:03:01 +00:00
|
|
|
/**
|
|
|
|
* @dev emitted when new variable debt is minted
|
|
|
|
* @param user the user receiving the debt
|
|
|
|
* @param amount the amount of debt being minted
|
|
|
|
* @param previousBalance the previous balance of the user
|
|
|
|
* @param currentBalance the current balance of the user
|
|
|
|
* @param balanceIncrease the debt accumulated since the last action
|
|
|
|
* @param index the index of the user
|
|
|
|
**/
|
|
|
|
event MintDebt(
|
|
|
|
address user,
|
|
|
|
uint256 amount,
|
|
|
|
uint256 previousBalance,
|
|
|
|
uint256 currentBalance,
|
|
|
|
uint256 balanceIncrease,
|
|
|
|
uint256 index
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @dev emitted when variable debt is burnt
|
|
|
|
* @param user the user which debt has been burned
|
|
|
|
* @param amount the amount of debt being burned
|
|
|
|
* @param previousBalance the previous balance of the user
|
|
|
|
* @param currentBalance the current balance of the user
|
|
|
|
* @param balanceIncrease the debt accumulated since the last action
|
|
|
|
* @param index the index of the user
|
|
|
|
**/
|
|
|
|
event BurnDebt(
|
|
|
|
address user,
|
|
|
|
uint256 amount,
|
|
|
|
uint256 previousBalance,
|
|
|
|
uint256 currentBalance,
|
|
|
|
uint256 balanceIncrease,
|
|
|
|
uint256 index
|
|
|
|
);
|
|
|
|
|
2020-07-09 09:59:49 +00:00
|
|
|
/**
|
2020-07-13 08:54:08 +00:00
|
|
|
* @dev mints new variable debt
|
2020-08-21 10:38:08 +00:00
|
|
|
* @param user the user receiving the debt
|
|
|
|
* @param amount the amount of debt being minted
|
2020-07-13 08:54:08 +00:00
|
|
|
**/
|
2020-08-21 10:38:08 +00:00
|
|
|
function mint(address user, uint256 amount) external;
|
2020-06-30 12:09:28 +00:00
|
|
|
|
2020-07-09 09:59:49 +00:00
|
|
|
/**
|
2020-07-13 08:54:08 +00:00
|
|
|
* @dev burns user variable debt
|
2020-08-21 10:38:08 +00:00
|
|
|
* @param user the user which debt is burnt
|
|
|
|
* @param amount the amount of debt being burned
|
2020-07-13 08:54:08 +00:00
|
|
|
**/
|
2020-08-21 10:38:08 +00:00
|
|
|
function burn(address user, uint256 amount) external;
|
2020-07-09 09:59:49 +00:00
|
|
|
|
|
|
|
/**
|
2020-07-13 08:54:08 +00:00
|
|
|
* @dev returns the last index of the user
|
|
|
|
* @return the index of the user
|
|
|
|
**/
|
2020-08-21 10:38:08 +00:00
|
|
|
function getUserIndex(address user) external view returns (uint256);
|
2020-06-30 12:09:28 +00:00
|
|
|
}
|