Skip to content

Commit

Permalink
feat: Add getReserveEModeCategory at DataProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelmtzinf committed Sep 25, 2021
1 parent c0576f8 commit 268dac1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion contracts/misc/AaveProtocolDataProvider.sol
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,25 @@ contract AaveProtocolDataProvider {
DataTypes.ReserveConfigurationMap memory configuration = IPool(ADDRESSES_PROVIDER.getPool())
.getConfiguration(asset);

(ltv, liquidationThreshold, liquidationBonus, decimals, reserveFactor,) = configuration
(ltv, liquidationThreshold, liquidationBonus, decimals, reserveFactor, ) = configuration
.getParams();

(isActive, isFrozen, borrowingEnabled, stableBorrowRateEnabled, ) = configuration.getFlags();

usageAsCollateralEnabled = liquidationThreshold > 0;
}

/**
* Returns the efficiency mode category of the reserve
* @param asset The address of the underlying asset of the reserve
* @return eModeCategory The eMode id of the reserve
*/
function getReserveEModeCategory(address asset) external view returns (uint256) {
DataTypes.ReserveConfigurationMap memory configuration = IPool(ADDRESSES_PROVIDER.getPool())
.getConfiguration(asset);
return configuration.getEModeCategory();
}

/**
* @notice Returns the caps paramters of the reserve
* @param asset The address of the underlying asset of the reserve
Expand Down

0 comments on commit 268dac1

Please sign in to comment.