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

86 lines
2.7 KiB
Solidity
Raw Normal View History

// SPDX-License-Identifier: agpl-3.0
2020-11-20 10:45:20 +00:00
pragma solidity 0.6.12;
import {IERC20} from '../../../dependencies/openzeppelin/contracts/IERC20.sol';
2020-09-21 15:41:38 +00:00
import {IScaledBalanceToken} from './IScaledBalanceToken.sol';
2020-09-21 15:41:38 +00:00
interface IAToken is IERC20, IScaledBalanceToken {
2020-11-03 18:47:57 +00:00
/**
* @dev emitted after the mint action
* @param from the address performing the mint
* @param value the amount to be minted
* @param index the last index of the reserve
**/
event Mint(address indexed from, uint256 value, uint256 index);
/**
* @dev mints aTokens to user
* only lending pools can call this function
* @param user the address receiving the minted tokens
* @param amount the amount of tokens to mint
* @param index the liquidity index
*/
function mint(
address user,
uint256 amount,
uint256 index
) external returns (bool);
/**
* @dev emitted after aTokens are burned
* @param from the address performing the redeem
* @param value the amount to be redeemed
2020-09-07 15:55:47 +00:00
* @param index the last index of the reserve
**/
2020-09-14 13:53:34 +00:00
event Burn(address indexed from, address indexed target, uint256 value, uint256 index);
/**
* @dev emitted during the transfer action
* @param from the address from which the tokens are being transferred
* @param to the adress of the destination
* @param value the amount to be minted
2020-09-07 15:55:47 +00:00
* @param index the last index of the reserve
**/
2020-09-14 13:53:34 +00:00
event BalanceTransfer(address indexed from, address indexed to, uint256 value, uint256 index);
/**
* @dev burns the aTokens and sends the equivalent amount of underlying to the target.
* only lending pools can call this function
* @param amount the amount being burned
2020-09-12 11:18:17 +00:00
* @param index the liquidity index
**/
function burn(
address user,
address underlyingTarget,
2020-09-12 11:18:17 +00:00
uint256 amount,
uint256 index
) external;
/**
2020-09-14 13:09:16 +00:00
* @dev mints aTokens to the reserve treasury
* @param amount the amount to mint
* @param index the liquidity index of the reserve
**/
function mintToTreasury(uint256 amount, uint256 index) external;
/**
* @dev transfers tokens in the event of a borrow being liquidated, in case the liquidators reclaims the aToken
* only lending pools can call this function
* @param from the address from which transfer the aTokens
* @param to the destination address
* @param value the amount to transfer
**/
function transferOnLiquidation(
address from,
address to,
uint256 value
) external;
/**
* @dev transfer the amount of the underlying asset to the user
* @param user address of the user
* @param amount the amount to transfer
* @return the amount transferred
**/
function transferUnderlyingTo(address user, uint256 amount) external returns (uint256);
}