2022-03-22 16:17:41 +00:00
|
|
|
//SPDX-License-Identifier: MIT
|
2022-03-06 12:49:42 +00:00
|
|
|
pragma solidity ^0.7.0;
|
|
|
|
pragma experimental ABIEncoderV2;
|
|
|
|
|
|
|
|
// aave v2
|
|
|
|
interface AaveV2Interface {
|
|
|
|
function withdraw(
|
|
|
|
address _asset,
|
|
|
|
uint256 _amount,
|
|
|
|
address _to
|
|
|
|
) external;
|
|
|
|
|
|
|
|
function borrow(
|
|
|
|
address _asset,
|
|
|
|
uint256 _amount,
|
|
|
|
uint256 _interestRateMode,
|
|
|
|
uint16 _referralCode,
|
|
|
|
address _onBehalfOf
|
|
|
|
) external;
|
|
|
|
|
|
|
|
function repay(
|
|
|
|
address _asset,
|
|
|
|
uint256 _amount,
|
|
|
|
uint256 _rateMode,
|
|
|
|
address _onBehalfOf
|
|
|
|
) external;
|
|
|
|
|
|
|
|
function setUserUseReserveAsCollateral(
|
|
|
|
address _asset,
|
|
|
|
bool _useAsCollateral
|
|
|
|
) external;
|
|
|
|
|
|
|
|
function getUserAccountData(address user)
|
|
|
|
external
|
|
|
|
view
|
|
|
|
returns (
|
|
|
|
uint256 totalCollateralETH,
|
|
|
|
uint256 totalDebtETH,
|
|
|
|
uint256 availableBorrowsETH,
|
|
|
|
uint256 currentLiquidationThreshold,
|
|
|
|
uint256 ltv,
|
|
|
|
uint256 healthFactor
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
interface AaveV2LendingPoolProviderInterface {
|
|
|
|
function getLendingPool() external view returns (address);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Aave Protocol Data Provider
|
|
|
|
interface AaveV2DataProviderInterface {
|
|
|
|
function getUserReserveData(address _asset, address _user)
|
|
|
|
external
|
|
|
|
view
|
|
|
|
returns (
|
|
|
|
uint256 currentATokenBalance,
|
|
|
|
uint256 currentStableDebt,
|
|
|
|
uint256 currentVariableDebt,
|
|
|
|
uint256 principalStableDebt,
|
|
|
|
uint256 scaledVariableDebt,
|
|
|
|
uint256 stableBorrowRate,
|
|
|
|
uint256 liquidityRate,
|
|
|
|
uint40 stableRateLastUpdated,
|
|
|
|
bool usageAsCollateralEnabled
|
|
|
|
);
|
|
|
|
|
|
|
|
// function getReserveConfigurationData(address asset)
|
|
|
|
// external
|
|
|
|
// view
|
|
|
|
// returns (
|
|
|
|
// uint256 decimals,
|
|
|
|
// uint256 ltv,
|
|
|
|
// uint256 liquidationThreshold,
|
|
|
|
// uint256 liquidationBonus,
|
|
|
|
// uint256 reserveFactor,
|
|
|
|
// bool usageAsCollateralEnabled,
|
|
|
|
// bool borrowingEnabled,
|
|
|
|
// bool stableBorrowRateEnabled,
|
|
|
|
// bool isActive,
|
|
|
|
// bool isFrozen
|
|
|
|
// );
|
|
|
|
|
|
|
|
function getReserveTokensAddresses(address asset)
|
|
|
|
external
|
|
|
|
view
|
|
|
|
returns (
|
|
|
|
address aTokenAddress,
|
|
|
|
address stableDebtTokenAddress,
|
|
|
|
address variableDebtTokenAddress
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ATokenV2Interface {
|
|
|
|
function scaledBalanceOf(address _user) external view returns (uint256);
|
|
|
|
|
|
|
|
function isTransferAllowed(address _user, uint256 _amount)
|
|
|
|
external
|
|
|
|
view
|
|
|
|
returns (bool);
|
|
|
|
|
|
|
|
function balanceOf(address _user) external view returns (uint256);
|
|
|
|
|
|
|
|
function transferFrom(
|
|
|
|
address,
|
|
|
|
address,
|
|
|
|
uint256
|
|
|
|
) external returns (bool);
|
|
|
|
|
|
|
|
function allowance(address, address) external returns (uint256);
|
|
|
|
}
|
|
|
|
|
|
|
|
// aave v3
|
|
|
|
interface AaveV3Interface {
|
|
|
|
function supply(
|
|
|
|
address asset,
|
|
|
|
uint256 amount,
|
|
|
|
address onBehalfOf,
|
|
|
|
uint16 referralCode
|
|
|
|
) external;
|
|
|
|
|
|
|
|
function withdraw(
|
|
|
|
address asset,
|
|
|
|
uint256 amount,
|
|
|
|
address to
|
|
|
|
) external returns (uint256);
|
|
|
|
|
|
|
|
function borrow(
|
|
|
|
address asset,
|
|
|
|
uint256 amount,
|
|
|
|
uint256 interestRateMode,
|
|
|
|
uint16 referralCode,
|
|
|
|
address onBehalfOf
|
|
|
|
) external;
|
|
|
|
|
|
|
|
function repay(
|
|
|
|
address asset,
|
|
|
|
uint256 amount,
|
|
|
|
uint256 interestRateMode,
|
|
|
|
address onBehalfOf
|
|
|
|
) external returns (uint256);
|
|
|
|
|
|
|
|
function setUserUseReserveAsCollateral(address asset, bool useAsCollateral)
|
|
|
|
external;
|
|
|
|
|
|
|
|
function swapBorrowRateMode(address asset, uint256 interestRateMode)
|
|
|
|
external;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface AaveV3PoolProviderInterface {
|
|
|
|
function getPool() external view returns (address);
|
|
|
|
}
|