alchemix-finance / alchemix-v2-dao

5 stars 4 forks source link

5.37 Sanity Checks on Oracle (medium) #125

Closed toyv0 closed 1 year ago

toyv0 commented 1 year ago

Image

toyv0 commented 1 year ago

sanity checks are the following

`(uint80 roundId, int256 price, , uint256 timestamp, uint80 answeredInRound) = tokenPrice.latestRoundData();

    require(answeredInRound >= roundId, "Stale price");
    require(timestamp != 0, "Round not complete");
    require(price > 0, "Chainlink answer reporting 0");`