mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
87 lines
3.0 KiB
Solidity
87 lines
3.0 KiB
Solidity
// SPDX-License-Identifier: agpl-3.0
|
|
pragma solidity 0.6.12;
|
|
|
|
/**
|
|
* @title ILendingPoolCollateralManager
|
|
* @author Aave
|
|
* @notice Defines the actions involving management of collateral in the protocol.
|
|
**/
|
|
interface ILendingPoolCollateralManager {
|
|
/**
|
|
* @dev Emitted when a borrower is liquidated
|
|
* @param collateral The address of the collateral being liquidated
|
|
* @param principal The address of the reserve
|
|
* @param user The address of the user being liquidated
|
|
* @param debtToCover The total amount liquidated
|
|
* @param liquidatedCollateralAmount The amount of collateral being liquidated
|
|
* @param liquidator The address of the liquidator
|
|
* @param receiveAToken true if the liquidator wants to receive aTokens, false otherwise
|
|
**/
|
|
event LiquidationCall(
|
|
address indexed collateral,
|
|
address indexed principal,
|
|
address indexed user,
|
|
uint256 debtToCover,
|
|
uint256 liquidatedCollateralAmount,
|
|
address liquidator,
|
|
bool receiveAToken
|
|
);
|
|
|
|
/**
|
|
* @dev Emitted when the collateral of a user has been seized
|
|
* @param user The user whose collateral has been seized
|
|
* @param asset The addresse of the underlying asset to seize
|
|
* @param to The address that will receive the funds
|
|
* @param amount The amount seized
|
|
**/
|
|
event Seized(
|
|
address indexed user,
|
|
address indexed to,
|
|
address indexed asset,
|
|
uint256 amount
|
|
);
|
|
|
|
/**
|
|
* @dev Emitted when a reserve is disabled as collateral for an user
|
|
* @param reserve The address of the reserve
|
|
* @param user The address of the user
|
|
**/
|
|
event ReserveUsedAsCollateralDisabled(address indexed reserve, address indexed user);
|
|
|
|
/**
|
|
* @dev Emitted when a reserve is enabled as collateral for an user
|
|
* @param reserve The address of the reserve
|
|
* @param user The address of the user
|
|
**/
|
|
event ReserveUsedAsCollateralEnabled(address indexed reserve, address indexed user);
|
|
|
|
/**
|
|
* @dev Users can invoke this function to liquidate an undercollateralized position.
|
|
* @param collateral The address of the collateral to liquidated
|
|
* @param principal The address of the principal reserve
|
|
* @param user The address of the borrower
|
|
* @param debtToCover The amount of principal that the liquidator wants to repay
|
|
* @param receiveAToken true if the liquidators wants to receive the aTokens, false if
|
|
* he wants to receive the underlying asset directly
|
|
**/
|
|
function liquidationCall(
|
|
address collateral,
|
|
address principal,
|
|
address user,
|
|
uint256 debtToCover,
|
|
bool receiveAToken
|
|
) external returns (uint256, string memory);
|
|
|
|
/**
|
|
* @dev Function to seize the collateral of a user. Only whitelisters of the user can call this function
|
|
* @param user The user whose collateral has been seized
|
|
* @param assets The addresses of the underlying assets to seize
|
|
* @param to The address that will receive the funds
|
|
**/
|
|
function seize(
|
|
address user,
|
|
address[] calldata assets,
|
|
address to
|
|
) external returns (uint256, string memory);
|
|
}
|