// SPDX-License-Identifier: BUSL-1.1 // Gearbox Protocol. Generalized leverage for DeFi protocols // (c) Gearbox Holdings, 2022 pragma solidity ^0.8.10; import { IPriceOracleV2Exceptions } from "../interfaces/IPriceOracle.sol"; /// @title Sanity checker for Chainlink price feed results contract PriceFeedChecker is IPriceOracleV2Exceptions { function _checkAnswer( uint80 roundID, int256 price, uint256 updatedAt, uint80 answeredInRound ) internal pure { if (price <= 0) revert ZeroPriceException(); // F:[PO-5] if (answeredInRound < roundID || updatedAt == 0) revert ChainPriceStaleException(); // F:[PO-5] } }