From 567fb05475ef2573e8ea6fe165583fca8e46e8d4 Mon Sep 17 00:00:00 2001 From: kasperpawlowski Date: Thu, 24 Nov 2022 16:31:48 -0500 Subject: [PATCH] return configured chainlink price feed address in view --- contracts/views/EulerGeneralView.sol | 2 ++ contracts/views/EulerSimpleLens.sol | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/contracts/views/EulerGeneralView.sol b/contracts/views/EulerGeneralView.sol index 1cf4d1fd..9ba3fc78 100644 --- a/contracts/views/EulerGeneralView.sol +++ b/contracts/views/EulerGeneralView.sol @@ -65,6 +65,7 @@ contract EulerGeneralView is Constants { uint16 pricingType; uint32 pricingParameters; address pricingForwarded; + address chainlinkPriceFeed; // Account specific @@ -167,6 +168,7 @@ contract EulerGeneralView is Constants { (m.twap, m.twapPeriod, m.currPrice) = execProxy.getPriceFull(m.underlying); (m.pricingType, m.pricingParameters, m.pricingForwarded) = marketsProxy.getPricingConfig(m.underlying); + m.chainlinkPriceFeed = marketsProxy.getChainlinkPriceFeedConfig(m.underlying); if (q.account == address(0)) return; diff --git a/contracts/views/EulerSimpleLens.sol b/contracts/views/EulerSimpleLens.sol index b749ca4b..aa0c59c5 100644 --- a/contracts/views/EulerSimpleLens.sol +++ b/contracts/views/EulerSimpleLens.sol @@ -96,6 +96,11 @@ contract EulerSimpleLens is Constants { (pricingType, pricingParameters, pricingForwarded) = markets.getPricingConfig(underlying); } + // underlying -> chainlink price feed + function getChainlinkPriceFeedConfig(address underlying) external view returns (address chainlinkPriceFeed) { + chainlinkPriceFeed = markets.getChainlinkPriceFeedConfig(underlying); + } + // entered markets function getEnteredMarkets(address account) external view returns (address[] memory) { return markets.getEnteredMarkets(account);