{"file_path":"src/OjoPTFeed.sol","creation_status":"success","source_code":"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\npragma solidity ^0.8.22;\n\nimport {AggregatorV3Interface} from \"./interfaces/AggregatorV2V3Interface.sol\";\nimport {AggregatorV2V3Interface} from \"./interfaces/AggregatorV2V3Interface.sol\";\nimport {Initializable} from \"@openzeppelin/contracts/proxy/utils/Initializable.sol\";\n\ncontract OjoPTFeed is AggregatorV3Interface, Initializable {\n    uint256 constant DEFAULT_VERSION = 1;\n    uint256 public constant STALENESS_THRESHOLD = 24 hours;\n\n    AggregatorV2V3Interface public FEED_1;\n    AggregatorV2V3Interface public FEED_2;\n    string private feedDescription;\n\n    error GetRoundDataCanBeOnlyCalledWithLatestRound(uint80 requestedRoundId);\n    error StaleOracleData(uint256 timestamp, uint256 threshold);\n\n    function initialize(address _FEED_1, address _FEED_2) external initializer {\n        require(_FEED_1 != address(0), \"Zero address for FEED_1\");\n        require(_FEED_2 != address(0), \"Zero address for FEED_2\");\n\n        AggregatorV2V3Interface feed1 = AggregatorV2V3Interface(_FEED_1);\n        AggregatorV2V3Interface feed2 = AggregatorV2V3Interface(_FEED_2);\n\n        require(feed1.decimals() == feed2.decimals(), \"FEED_1 decimals not equal to FEED_2 decimals\");\n\n        FEED_1 = feed1;\n        FEED_2 = feed2;\n        feedDescription = string(abi.encodePacked(\"Ojo PT Feed \", feed1.description()));\n    }\n\n    function decimals() external view override returns (uint8) {\n        return FEED_1.decimals();\n    }\n\n    function description() external view override returns (string memory) {\n        return feedDescription;\n    }\n\n    function version() external view override returns (uint256) {\n        return DEFAULT_VERSION;\n    }\n\n    /**\n     * @notice Returns data for a specific round ID\n     * @dev Note: This function returns the roundId from whichever oracle provided the minimum price.\n     * This means roundIds may not be monotonically increasing when switching between oracles,\n     * which could break protocols that rely on roundId being non-decreasing.\n     */\n    function getRoundData(\n        uint80 _roundId\n    )\n        external\n        view\n        override\n        returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)\n    {\n        (roundId, answer, startedAt, updatedAt, answeredInRound) = latestRoundData();\n        if (_roundId != roundId) {\n            revert GetRoundDataCanBeOnlyCalledWithLatestRound(_roundId);\n        }\n        return (roundId, answer, startedAt, updatedAt, answeredInRound);\n    }\n\n    /**\n     * @notice Returns the latest round data\n     * @dev Note: This function returns the roundId from whichever oracle provided the minimum price.\n     * This means roundIds may not be monotonically increasing when switching between oracles,\n     * which could break protocols that rely on roundId being non-decreasing.\n     */\n    function latestRoundData()\n        public\n        view\n        override\n        returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)\n    {\n        (uint80 roundId1, int256 answer1, uint256 startedAt1, uint256 updatedAt1, uint80 answeredInRound1) =\n            FEED_1.latestRoundData();\n\n        (uint80 roundId2, int256 answer2, uint256 startedAt2, uint256 updatedAt2, uint80 answeredInRound2) =\n            FEED_2.latestRoundData();\n\n        if (updatedAt1 != 0 && block.timestamp - updatedAt1 > STALENESS_THRESHOLD) {\n            revert StaleOracleData(updatedAt1, STALENESS_THRESHOLD);\n        }\n\n        if (updatedAt2 != 0 && block.timestamp - updatedAt2 > STALENESS_THRESHOLD) {\n            revert StaleOracleData(updatedAt2, STALENESS_THRESHOLD);\n        }\n\n        if (answer1 <= answer2) {\n            return (roundId1, answer1, startedAt1, updatedAt1, answeredInRound1);\n        } else {\n            return (roundId2, answer2, startedAt2, updatedAt2, answeredInRound2);\n        }\n    }\n\n    function getActiveOracle() external view returns (address) {\n        (, int256 answer1,,,) = FEED_1.latestRoundData();\n        (, int256 answer2,,,) = FEED_2.latestRoundData();\n\n        if (answer1 <= answer2) {\n            return address(FEED_1);\n        } else {\n            return address(FEED_2);\n        }\n    }\n}\n","deployed_bytecode":"0x6080604090808252600480361015610015575f80fd5b5f3560e01c918263313ce567146108545750816341299f941461082c578163485cc9551461030457816354fd4d50146102e95781637215b0bf146102cc5781637284e416146101d157816372b14462146101a45781639a6fc8f51461011157508063d84bd024146100ea5763feaf968c1461008e575f80fd5b346100e6575f3660031901126100e6576100e2906100aa610aae565b945169ffffffffffffffffffff94851681526020810193909352604083019190915260608201529116608082015290819060a0820190565b0390f35b5f80fd5b50346100e6575f3660031901126100e6575f5490516001600160a01b039091168152602090f35b9050346100e65760203660031901126100e65780359069ffffffffffffffffffff908183168093036100e657610145610aae565b949192969093958616810361018e575050945169ffffffffffffffffffff938416815260208101949094526040840194909452606083019390935291909116608082015260a090f35b87516322bfd6df60e01b81529182015260249150fd5b82346100e6575f3660031901126100e6576020906101c06109c1565b90516001600160a01b039091168152f35b82346100e6575f3660031901126100e6578051905f916002546101f38161093d565b808352826020958692838301946001906001811690815f146102ad5750600114610250575b5050610226925003836108ee565b61024283519485938185525192838092860152858501906108cd565b601f01601f19168101030190f35b9093915060025f527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace935f915b81831061029557508894505082010161022688610218565b8554888401850152948501948794509183019161027d565b91505061022694925060ff19168552151560051b820101869288610218565b82346100e6575f3660031901126100e65760209051620151808152f35b82346100e6575f3660031901126100e6576020905160018152f35b82346100e657806003193601126100e6576001600160a01b038235818116939192908490036100e657602480359384168094036100e6577ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a009485549360ff85851c16159267ffffffffffffffff9283871696871580610825575b6001809914908161081b575b159081610812575b506108025767ffffffffffffffff19811688178a55856107e3575b5080156107a157871561075f57855163313ce56760e01b80825260209991908a828781875afa918215610736575f92610740575b5088519081528a818781865afa9081156107365760ff9182915f91610709575b50169116036106b25783915f916bffffffffffffffffffffffff60a01b82818554161784558a5416178955875194858092633942720b60e11b82525afa9283156106a8575f93610620575b5061048d602c875180956b027b53790282a102332b2b2160a51b8c83015261047d8c825192839186860191016108cd565b810103600c8101865201846108ee565b825193841161060f57505081906104a560025461093d565b601f81116105a0575b508690601f8311600114610521575f92610516575b50505f19600383901b1c191690841b176002555b6104dd57005b7fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29368ff000000000000000019815416905551908152a1005b0151905087806104c3565b90869350601f1983169160025f527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace925f5b8a82821061058a5750508411610572575b505050811b016002556104d7565b01515f1960f88460031b161c19169055878080610564565b8385015186558a97909501949384019301610553565b90915060025f527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace601f840160051c810191888510610605575b84939291601f89920160051c01915b8281106105f75750506104ae565b5f81558594508891016105e9565b90915081906105da565b604190634e487b7160e01b5f52525ffd5b9092503d805f833e61063281836108ee565b81019088818303126100e6578051908582116100e6570181601f820112156100e657805185811161069657875192610673601f8301601f19168c01856108ee565b8184528a82840101116100e65761068f918a80850191016108cd565b918961044c565b83604186634e487b7160e01b5f52525ffd5b86513d5f823e3d90fd5b865162461bcd60e51b81528085018a9052602c818501527f464545445f3120646563696d616c73206e6f7420657175616c20746f2046454560448201526b445f3220646563696d616c7360a01b6064820152608490fd5b61072991508d803d1061072f575b61072181836108ee565b810190610924565b8e610401565b503d610717565b89513d5f823e3d90fd5b6107589192508b3d8d1161072f5761072181836108ee565b908c6103e1565b855162461bcd60e51b81526020818501526017818401527f5a65726f206164647265737320666f7220464545445f320000000000000000006044820152606490fd5b855162461bcd60e51b81526020818501526017818401527f5a65726f206164647265737320666f7220464545445f310000000000000000006044820152606490fd5b68ffffffffffffffffff191668010000000000000001178955896103ad565b865163f92ee8a960e01b81528490fd5b9050158b610392565b303b15915061038a565b508561037e565b82346100e6575f3660031901126100e65760015490516001600160a01b039091168152602090f35b9150346100e6575f3660031901126100e6575f5463313ce56760e01b8352602091839182906001600160a01b03165afa9081156108c357916020925f926108a1575b5060ff905191168152f35b60ff9192506108bc90843d861161072f5761072181836108ee565b9190610896565b82513d5f823e3d90fd5b5f5b8381106108de5750505f910152565b81810151838201526020016108cf565b90601f8019910116810190811067ffffffffffffffff82111761091057604052565b634e487b7160e01b5f52604160045260245ffd5b908160209103126100e6575160ff811681036100e65790565b90600182811c9216801561096b575b602083101461095757565b634e487b7160e01b5f52602260045260245ffd5b91607f169161094c565b519069ffffffffffffffffffff821682036100e657565b908160a09103126100e6576109a081610975565b916020820151916040810151916109be608060608401519301610975565b90565b5f54604051633fabe5a360e21b8082526001600160a01b0392831692909160a0918282600481885afa918215610a5e575f92610a69575b5060015416926040519081528281600481875afa928315610a5e575f93610a2a575b505013610a25575090565b905090565b610a4a929350803d10610a57575b610a4281836108ee565b81019061098c565b5050509050905f80610a1a565b503d610a38565b6040513d5f823e3d90fd5b610a81919250833d8511610a5757610a4281836108ee565b5050509050905f6109f8565b91908203918211610a9a57565b634e487b7160e01b5f52601160045260245ffd5b60018060a01b03805f541660408051938492633fabe5a360e21b9081855284600460a09889935afa928315610c29575f915f975f975f975f97610bf2575b5081906001541692600485518095819382525afa8015610be8575f80945f945f945f94610bbd575b505089151580610ba8575b610b885783151580610b73575b610b535750848b13610b445750505050509493929190565b99509297509095509350919050565b51635f51811b60e11b815260048101849052620151806024820152604490fd5b5062015180610b828542610a8d565b11610b2c565b51635f51811b60e11b8152600481018a9052620151806024820152604490fd5b5062015180610bb78b42610a8d565b11610b1f565b93509350945050610bda9250803d10610a5757610a4281836108ee565b929491939092915f80610b14565b83513d5f823e3d90fd5b9299509550809750610c149296508093503d8411610a5757610a4281836108ee565b97939992949199989098949998979690610aec565b513d5f823e3d90fdfea26469706673582212207ef3530a3a8bbb281a55c2023c13d4b560902b508907f8832b0218445a9a45dd64736f6c63430008160033","optimization_enabled":true,"verified_twin_address_hash":null,"is_verified":true,"compiler_settings":{"evmVersion":"shanghai","libraries":{},"metadata":{"appendCBOR":true,"bytecodeHash":"ipfs","useLiteralContent":false},"optimizer":{"enabled":true,"runs":200},"outputSelection":{"*":{"":["*"],"*":["*"]}},"remappings":["forge-std/=lib/forge-std/src/","@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/","erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/","halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/","openzeppelin-contracts/=lib/openzeppelin-contracts/"],"viaIR":true},"optimization_runs":200,"sourcify_repo_url":null,"decoded_constructor_args":null,"compiler_version":"v0.8.22+commit.4fc1097e","is_verified_via_verifier_alliance":false,"verified_at":"2026-06-25T14:01:44.799900Z","implementations":[],"proxy_type":null,"external_libraries":[],"creation_bytecode":"0x6080806040523461001657610c68908161001b8239f35b5f80fdfe6080604090808252600480361015610015575f80fd5b5f3560e01c918263313ce567146108545750816341299f941461082c578163485cc9551461030457816354fd4d50146102e95781637215b0bf146102cc5781637284e416146101d157816372b14462146101a45781639a6fc8f51461011157508063d84bd024146100ea5763feaf968c1461008e575f80fd5b346100e6575f3660031901126100e6576100e2906100aa610aae565b945169ffffffffffffffffffff94851681526020810193909352604083019190915260608201529116608082015290819060a0820190565b0390f35b5f80fd5b50346100e6575f3660031901126100e6575f5490516001600160a01b039091168152602090f35b9050346100e65760203660031901126100e65780359069ffffffffffffffffffff908183168093036100e657610145610aae565b949192969093958616810361018e575050945169ffffffffffffffffffff938416815260208101949094526040840194909452606083019390935291909116608082015260a090f35b87516322bfd6df60e01b81529182015260249150fd5b82346100e6575f3660031901126100e6576020906101c06109c1565b90516001600160a01b039091168152f35b82346100e6575f3660031901126100e6578051905f916002546101f38161093d565b808352826020958692838301946001906001811690815f146102ad5750600114610250575b5050610226925003836108ee565b61024283519485938185525192838092860152858501906108cd565b601f01601f19168101030190f35b9093915060025f527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace935f915b81831061029557508894505082010161022688610218565b8554888401850152948501948794509183019161027d565b91505061022694925060ff19168552151560051b820101869288610218565b82346100e6575f3660031901126100e65760209051620151808152f35b82346100e6575f3660031901126100e6576020905160018152f35b82346100e657806003193601126100e6576001600160a01b038235818116939192908490036100e657602480359384168094036100e6577ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a009485549360ff85851c16159267ffffffffffffffff9283871696871580610825575b6001809914908161081b575b159081610812575b506108025767ffffffffffffffff19811688178a55856107e3575b5080156107a157871561075f57855163313ce56760e01b80825260209991908a828781875afa918215610736575f92610740575b5088519081528a818781865afa9081156107365760ff9182915f91610709575b50169116036106b25783915f916bffffffffffffffffffffffff60a01b82818554161784558a5416178955875194858092633942720b60e11b82525afa9283156106a8575f93610620575b5061048d602c875180956b027b53790282a102332b2b2160a51b8c83015261047d8c825192839186860191016108cd565b810103600c8101865201846108ee565b825193841161060f57505081906104a560025461093d565b601f81116105a0575b508690601f8311600114610521575f92610516575b50505f19600383901b1c191690841b176002555b6104dd57005b7fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29368ff000000000000000019815416905551908152a1005b0151905087806104c3565b90869350601f1983169160025f527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace925f5b8a82821061058a5750508411610572575b505050811b016002556104d7565b01515f1960f88460031b161c19169055878080610564565b8385015186558a97909501949384019301610553565b90915060025f527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace601f840160051c810191888510610605575b84939291601f89920160051c01915b8281106105f75750506104ae565b5f81558594508891016105e9565b90915081906105da565b604190634e487b7160e01b5f52525ffd5b9092503d805f833e61063281836108ee565b81019088818303126100e6578051908582116100e6570181601f820112156100e657805185811161069657875192610673601f8301601f19168c01856108ee565b8184528a82840101116100e65761068f918a80850191016108cd565b918961044c565b83604186634e487b7160e01b5f52525ffd5b86513d5f823e3d90fd5b865162461bcd60e51b81528085018a9052602c818501527f464545445f3120646563696d616c73206e6f7420657175616c20746f2046454560448201526b445f3220646563696d616c7360a01b6064820152608490fd5b61072991508d803d1061072f575b61072181836108ee565b810190610924565b8e610401565b503d610717565b89513d5f823e3d90fd5b6107589192508b3d8d1161072f5761072181836108ee565b908c6103e1565b855162461bcd60e51b81526020818501526017818401527f5a65726f206164647265737320666f7220464545445f320000000000000000006044820152606490fd5b855162461bcd60e51b81526020818501526017818401527f5a65726f206164647265737320666f7220464545445f310000000000000000006044820152606490fd5b68ffffffffffffffffff191668010000000000000001178955896103ad565b865163f92ee8a960e01b81528490fd5b9050158b610392565b303b15915061038a565b508561037e565b82346100e6575f3660031901126100e65760015490516001600160a01b039091168152602090f35b9150346100e6575f3660031901126100e6575f5463313ce56760e01b8352602091839182906001600160a01b03165afa9081156108c357916020925f926108a1575b5060ff905191168152f35b60ff9192506108bc90843d861161072f5761072181836108ee565b9190610896565b82513d5f823e3d90fd5b5f5b8381106108de5750505f910152565b81810151838201526020016108cf565b90601f8019910116810190811067ffffffffffffffff82111761091057604052565b634e487b7160e01b5f52604160045260245ffd5b908160209103126100e6575160ff811681036100e65790565b90600182811c9216801561096b575b602083101461095757565b634e487b7160e01b5f52602260045260245ffd5b91607f169161094c565b519069ffffffffffffffffffff821682036100e657565b908160a09103126100e6576109a081610975565b916020820151916040810151916109be608060608401519301610975565b90565b5f54604051633fabe5a360e21b8082526001600160a01b0392831692909160a0918282600481885afa918215610a5e575f92610a69575b5060015416926040519081528281600481875afa928315610a5e575f93610a2a575b505013610a25575090565b905090565b610a4a929350803d10610a57575b610a4281836108ee565b81019061098c565b5050509050905f80610a1a565b503d610a38565b6040513d5f823e3d90fd5b610a81919250833d8511610a5757610a4281836108ee565b5050509050905f6109f8565b91908203918211610a9a57565b634e487b7160e01b5f52601160045260245ffd5b60018060a01b03805f541660408051938492633fabe5a360e21b9081855284600460a09889935afa928315610c29575f915f975f975f975f97610bf2575b5081906001541692600485518095819382525afa8015610be8575f80945f945f945f94610bbd575b505089151580610ba8575b610b885783151580610b73575b610b535750848b13610b445750505050509493929190565b99509297509095509350919050565b51635f51811b60e11b815260048101849052620151806024820152604490fd5b5062015180610b828542610a8d565b11610b2c565b51635f51811b60e11b8152600481018a9052620151806024820152604490fd5b5062015180610bb78b42610a8d565b11610b1f565b93509350945050610bda9250803d10610a5757610a4281836108ee565b929491939092915f80610b14565b83513d5f823e3d90fd5b9299509550809750610c149296508093503d8411610a5757610a4281836108ee565b97939992949199989098949998979690610aec565b513d5f823e3d90fdfea26469706673582212207ef3530a3a8bbb281a55c2023c13d4b560902b508907f8832b0218445a9a45dd64736f6c63430008160033","name":"OjoPTFeed","is_blueprint":false,"license_type":"none","is_fully_verified":true,"is_verified_via_eth_bytecode_db":false,"language":"solidity","evm_version":"shanghai","can_be_visualized_via_sol2uml":true,"is_verified_via_sourcify":false,"additional_sources":[{"file_path":"lib/openzeppelin-contracts/contracts/proxy/utils/Initializable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n *     function initialize() initializer public {\n *         __ERC20_init(\"MyToken\", \"MTK\");\n *     }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n *     function initializeV2() reinitializer(2) public {\n *         __ERC20Permit_init(\"MyToken\");\n *     }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n *     _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Storage of the initializable contract.\n     *\n     * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\n     * when using with upgradeable contracts.\n     *\n     * @custom:storage-location erc7201:openzeppelin.storage.Initializable\n     */\n    struct InitializableStorage {\n        /**\n         * @dev Indicates that the contract has been initialized.\n         */\n        uint64 _initialized;\n        /**\n         * @dev Indicates that the contract is in the process of being initialized.\n         */\n        bool _initializing;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Initializable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;\n\n    /**\n     * @dev The contract is already initialized.\n     */\n    error InvalidInitialization();\n\n    /**\n     * @dev The contract is not initializing.\n     */\n    error NotInitializing();\n\n    /**\n     * @dev Triggered when the contract has been initialized or reinitialized.\n     */\n    event Initialized(uint64 version);\n\n    /**\n     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n     * `onlyInitializing` functions can be used to initialize parent contracts.\n     *\n     * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any\n     * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in\n     * production.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier initializer() {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        // Cache values to avoid duplicated sloads\n        bool isTopLevelCall = !$._initializing;\n        uint64 initialized = $._initialized;\n\n        // Allowed calls:\n        // - initialSetup: the contract is not in the initializing state and no previous version was\n        //                 initialized\n        // - construction: the contract is initialized at version 1 (no reininitialization) and the\n        //                 current contract is just being deployed\n        bool initialSetup = initialized == 0 && isTopLevelCall;\n        bool construction = initialized == 1 && address(this).code.length == 0;\n\n        if (!initialSetup && !construction) {\n            revert InvalidInitialization();\n        }\n        $._initialized = 1;\n        if (isTopLevelCall) {\n            $._initializing = true;\n        }\n        _;\n        if (isTopLevelCall) {\n            $._initializing = false;\n            emit Initialized(1);\n        }\n    }\n\n    /**\n     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n     * used to initialize parent contracts.\n     *\n     * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n     * are added through upgrades and that require initialization.\n     *\n     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n     * cannot be nested. If one is invoked in the context of another, execution will revert.\n     *\n     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n     * a contract, executing them in the right order is up to the developer or operator.\n     *\n     * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier reinitializer(uint64 version) {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing || $._initialized >= version) {\n            revert InvalidInitialization();\n        }\n        $._initialized = version;\n        $._initializing = true;\n        _;\n        $._initializing = false;\n        emit Initialized(version);\n    }\n\n    /**\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n     * {initializer} and {reinitializer} modifiers, directly or indirectly.\n     */\n    modifier onlyInitializing() {\n        _checkInitializing();\n        _;\n    }\n\n    /**\n     * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\n     */\n    function _checkInitializing() internal view virtual {\n        if (!_isInitializing()) {\n            revert NotInitializing();\n        }\n    }\n\n    /**\n     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n     * through proxies.\n     *\n     * Emits an {Initialized} event the first time it is successfully executed.\n     */\n    function _disableInitializers() internal virtual {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing) {\n            revert InvalidInitialization();\n        }\n        if ($._initialized != type(uint64).max) {\n            $._initialized = type(uint64).max;\n            emit Initialized(type(uint64).max);\n        }\n    }\n\n    /**\n     * @dev Returns the highest version that has been initialized. See {reinitializer}.\n     */\n    function _getInitializedVersion() internal view returns (uint64) {\n        return _getInitializableStorage()._initialized;\n    }\n\n    /**\n     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n     */\n    function _isInitializing() internal view returns (bool) {\n        return _getInitializableStorage()._initializing;\n    }\n\n    /**\n     * @dev Returns a pointer to the storage namespace.\n     */\n    // solhint-disable-next-line var-name-mixedcase\n    function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\n        assembly {\n            $.slot := INITIALIZABLE_STORAGE\n        }\n    }\n}\n"},{"file_path":"src/interfaces/AggregatorV2V3Interface.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity >=0.5.0;\n\ninterface AggregatorInterface {\n    function latestAnswer() external view returns (int256);\n    function latestTimestamp() external view returns (uint256);\n    function latestRound() external view returns (uint256);\n    function getAnswer(\n        uint256 roundId\n    ) external view returns (int256);\n    function getTimestamp(\n        uint256 roundId\n    ) external view returns (uint256);\n\n    event AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 updatedAt);\n    event NewRound(uint256 indexed roundId, address indexed startedBy, uint256 startedAt);\n}\n\ninterface AggregatorV3Interface {\n    function decimals() external view returns (uint8);\n    function description() external view returns (string memory);\n    function version() external view returns (uint256);\n\n    function getRoundData(\n        uint80 _roundId\n    )\n        external\n        view\n        returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);\n    function latestRoundData()\n        external\n        view\n        returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);\n}\n\ninterface AggregatorV2V3Interface is AggregatorInterface, AggregatorV3Interface {}\n"}],"certified":false,"conflicting_implementations":null,"abi":[{"inputs":[{"internalType":"uint80","name":"requestedRoundId","type":"uint80"}],"name":"GetRoundDataCanBeOnlyCalledWithLatestRound","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"threshold","type":"uint256"}],"name":"StaleOracleData","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"inputs":[],"name":"FEED_1","outputs":[{"internalType":"contract AggregatorV2V3Interface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEED_2","outputs":[{"internalType":"contract AggregatorV2V3Interface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STALENESS_THRESHOLD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"description","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getActiveOracle","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint80","name":"_roundId","type":"uint80"}],"name":"getRoundData","outputs":[{"internalType":"uint80","name":"roundId","type":"uint80"},{"internalType":"int256","name":"answer","type":"int256"},{"internalType":"uint256","name":"startedAt","type":"uint256"},{"internalType":"uint256","name":"updatedAt","type":"uint256"},{"internalType":"uint80","name":"answeredInRound","type":"uint80"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_FEED_1","type":"address"},{"internalType":"address","name":"_FEED_2","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"latestRoundData","outputs":[{"internalType":"uint80","name":"roundId","type":"uint80"},{"internalType":"int256","name":"answer","type":"int256"},{"internalType":"uint256","name":"startedAt","type":"uint256"},{"internalType":"uint256","name":"updatedAt","type":"uint256"},{"internalType":"uint80","name":"answeredInRound","type":"uint80"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}],"is_changed_bytecode":false,"is_partially_verified":false,"constructor_args":null}