Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional oracle tidy-up #726

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions contracts/src/PriceFeeds/RETHPriceFeed.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ contract RETHPriceFeed is CompositePriceFeed, IRETHPriceFeed {
assert(priceSource == PriceSource.primary);
(uint256 ethUsdPrice, bool ethUsdOracleDown) = _getOracleAnswer(ethUsdOracle);
(uint256 rEthEthPrice, bool rEthEthOracleDown) = _getOracleAnswer(rEthEthOracle);
(uint256 rEthPerEth, bool exchangeRateIsDown) = _getCanonicalRate();
(uint256 ethPerReth, bool exchangeRateIsDown) = _getCanonicalRate();

// If either the ETH-USD feed or exchange rate is down, shut down and switch to the last good price
// seen by the system since we need both for primary and fallback price calcs
Expand All @@ -57,7 +57,7 @@ contract RETHPriceFeed is CompositePriceFeed, IRETHPriceFeed {
uint256 rEthUsdMarketPrice = ethUsdPrice * rEthEthPrice / 1e18;

// Calculate the canonical LST-USD price: USD_per_RETH = USD_per_ETH * ETH_per_RETH
uint256 rEthUsdCanonicalPrice = ethUsdPrice * rEthPerEth / 1e18;
uint256 rEthUsdCanonicalPrice = ethUsdPrice * ethPerReth / 1e18;

uint256 rEthUsdPrice;

Expand Down
4 changes: 0 additions & 4 deletions contracts/src/PriceFeeds/WETHPriceFeed.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ contract WETHPriceFeed is MainnetPriceFeedBase {
// _fetchPricePrimary returns:
// - The price
// - A bool indicating whether a new oracle failure was detected in the call
function _fetchPricePrimary(bool /* _isRedemption */ ) internal virtual returns (uint256, bool) {
return _fetchPricePrimary();
}

function _fetchPricePrimary() internal returns (uint256, bool) {
assert(priceSource == PriceSource.primary);
(uint256 ethUsdPrice, bool ethUsdOracleDown) = _getOracleAnswer(ethUsdOracle);
Expand Down
Loading