Minor change to instapoolV2 resolver

This commit is contained in:
Thrilok Kumar 2020-12-13 16:47:39 +05:30
parent f23b112bb9
commit 639cfc2d87

View File

@ -57,6 +57,7 @@ interface AavePriceInterface {
interface AaveCoreInterface {
function getReserveCurrentLiquidityRate(address _reserve) external view returns (uint256);
function getReserveCurrentVariableBorrowRate(address _reserve) external view returns (uint256);
function getReserveATokenAddress(address _reserve) external view returns (address);
}
interface VatLike {
@ -250,6 +251,9 @@ contract AaveHelpers is CompoundResolver {
public view returns (uint) {
AaveProviderInterface AaveProvider = AaveProviderInterface(getAaveProviderAddress());
AaveInterface aave = AaveInterface(AaveProvider.getLendingPool());
AaveCoreInterface aaveCore = AaveCoreInterface(AaveProvider.getLendingPoolCore());
if (aaveCore.getReserveATokenAddress(token) == address(0)) return 0;
AaveTokenData memory aaveToken = collateralData(aave, token);
AaveTokenData memory aaveEthToken = collateralData(aave, getEthAddress());
if (!aaveToken.borrowEnabled) return 0;