Skip to content

Commit

Permalink
fix: More granular events for RETH oracle failure
Browse files Browse the repository at this point in the history
  • Loading branch information
bingen committed Dec 16, 2024
1 parent f8e21ae commit 9afed12
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion contracts/src/PriceFeeds/RETHPriceFeed.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@ contract RETHPriceFeed is CompositePriceFeed, IRETHPriceFeed {

// If the ETH-USD feed is down, shut down and switch to the last good price seen by the system
// since we need both ETH-USD and canonical for primary and fallback price calcs
if (ethUsdOracleDown || exchangeRateIsDown) {
if (ethUsdOracleDown) {
return (_shutDownAndSwitchToLastGoodPrice(address(ethUsdOracle.aggregator)), true);
}
if (exchangeRateIsDown) {
return (_shutDownAndSwitchToLastGoodPrice(rateProviderAddress), true);
}
// If the ETH-USD feed is live but the RETH-ETH oracle is down, shutdown and substitute RETH-ETH with the canonical rate
if (rEthEthOracleDown) {
return (_shutDownAndSwitchToETHUSDxCanonical(address(rEthEthOracle.aggregator), ethUsdPrice), true);
Expand Down

0 comments on commit 9afed12

Please sign in to comment.