shaka
high
Chainlink price feed data could be stale.
It is not checked that the updatedAt
value returned by priceFeed.latestRoundData()
is recent enough. This can lead to the use of outdated price data.
As per Chainlink docs:
Your application should track the latestTimestamp variable or use the updatedAt value from the latestRoundData() function to make sure that the latest answer is recent enough for your application to use it. If your application detects that the reported answer is not updated within the heartbeat or within time limits that you determine are acceptable for your application, pause operation or switch to an alternate operation mode while identifying the cause of the delay.
USSD.sol:mintForToken()
will mint an incorrect amount of USSD tokens.
The rebalance functionality will not work as expected, as the amounts to be swapped in USSDRebalancer.sol:SellUSSDBuyCollateral()
and USSDRebalancer.sol:BuyUSSDSellCollateral()
will be incorrect.
Manual Review
(, int256 price, , uint256 updatedAt, ) = priceFeed.latestRoundData();
if (block.timestamp - updatedAt > validPeriod) {
// Call an alternative price source or pause the protocol
}