shaka
medium
Error in Chainlink oracle call not handled.
In the case of Chainlink oracle being taken offline or erroring for any other reason priceFeed.latestRoundData()
will revert.
Rebalancing and minting functionalities would be broken and USSD would lose its peg.
Manual Review
Handle possible error with a try-catch
block.
try priceFeed.latestRoundData() returns (
uint80,
int256 price,
uint256,
uint256,
uint80
) {
return
(wethPriceUSD * 1e18) /
((DAIWethPrice + uint256(price) * 1e10) / 2);
} catch Error(string memory) {
// Call an alternative price source or pause the protocol
}