You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 26, 2023. It is now read-only.
getOraclePrice() will get signedPrice and timeStamp from Chainlink oracle. But it doesn't check round id ,leading to it may get a stale price from Chainlink oracle.
Vulnerability Detail
getOraclePrice() will get signedPrice and timeStamp from Chainlink oracle. But it doesn't check round id ,leading to it may get a stale price from Chainlink oracle.
function getOraclePrice(IAggregatorV3 _priceFeed, int192_maxPrice, int192_minPrice) publicviewreturns (uint256 ) {
(
/*uint80 roundID*/,
intsignedPrice,
/*uint startedAt*/,
uinttimeStamp,
/*uint80 answeredInRound*/
) = _priceFeed.latestRoundData();
//check for Chainlink oracle deviancies, force a revert if any are present. Helps prevent a LUNA like issuerequire(signedPrice >0, "Negative Oracle Price");
require(timeStamp >=block.timestamp- HEARTBEAT_TIME , "Stale pricefeed");
require(signedPrice < _maxPrice, "Upper price bound breached");
require(signedPrice > _minPrice, "Lower price bound breached");
uint256 price =uint256(signedPrice);
return price;
}
8olidity
medium
Price oracle could get a stale price
Summary
getOraclePrice()
will getsignedPrice
andtimeStamp
from Chainlink oracle. But it doesn't check round id ,leading to it may get a stale price from Chainlink oracle.Vulnerability Detail
getOraclePrice()
will getsignedPrice
andtimeStamp
from Chainlink oracle. But it doesn't check round id ,leading to it may get a stale price from Chainlink oracle.ref:https://github.com/sherlock-audit/2022-09-notional-judging/tree/7a9f89b45f7a49c21941b3eebe13251a326d75bf#issue-m-2-price-oracle-could-get-a-stale-price
Impact
Price oracle could get a stale price without checking roundId.
Code Snippet
https://github.com/sherlock-audit/2022-11-isomorph/blob/main/contracts/Velo-Deposit-Tokens/contracts/DepositReceipt_Base.sol#L164-L178
Tool used
Manual Review
Recommendation
Check
roundId
when getting priceDuplicate of #200
The text was updated successfully, but these errors were encountered: