aave-protocol-v2/contracts/tokenization/interfaces/IStableDebtToken.sol

55 lines
1.4 KiB
Solidity
Raw Normal View History

2020-06-30 12:09:28 +00:00
pragma solidity ^0.6.0;
/**
* @title interface IStableDebtToken
*
* @notice defines the interface for the stable debt token
*
* @dev it does not inherit from IERC20 to save in code size
*
* @author Aave
*
**/
2020-06-30 12:09:28 +00:00
interface IStableDebtToken {
/**
* @dev mints debt token to the target user. The resulting rate is the weighted average
* between the rate of the new debt and the rate of the previous debt
* @param _user the address of the user
* @param _amount the amount of debt tokens to mint
* @param _rate the rate of the debt being minted.
**/
2020-06-30 12:09:28 +00:00
function mint(
address _user,
uint256 _amount,
uint256 _rate
2020-06-30 12:09:28 +00:00
) external virtual;
/**
* @dev burns debt of the target user.
* @param _user the address of the user
* @param _amount the amount of debt tokens to mint
**/
function burn(address _user, uint256 _amount) external virtual;
2020-06-30 12:09:28 +00:00
/**
* @dev returns the average rate of all the stable rate loans.
* @return the average stable rate
**/
2020-06-30 12:09:28 +00:00
function getAverageStableRate() external virtual view returns(uint256);
/**
* @dev returns the stable rate of the user debt
* @return the stable rate of the user
**/
2020-06-30 12:09:28 +00:00
function getUserStableRate(address _user) external virtual view returns(uint256);
2020-07-03 21:20:02 +00:00
/**
* @dev returns the timestamp of the last update of the user
* @return the timestamp
**/
2020-07-03 21:20:02 +00:00
function getUserLastUpdated(address _user) external virtual view returns (uint40);
2020-06-30 12:09:28 +00:00
}