creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "src/oracle/ChainlinkOracle.sol": {
        "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.13;\n\nimport { IOracle } from \"../interfaces/IOracle.sol\";\n\nimport { AggregatorV3Interface } from \"../interfaces/chainlink/AggregatorV3Interface.sol\";\n\ncontract ChainlinkOracle is IOracle {\n    AggregatorV3Interface public immutable feed;\n\n    constructor(address feed_) {\n        require(feed_ != address(0));\n\n        feed = AggregatorV3Interface(feed_);\n    }\n\n    // Returns price with 8 decimals\n    function price(uint80 roundId_) external view returns (uint256) {\n        if (roundId_ == 0) {\n            ( , int256 result, , uint256 updatedAt, ) = feed.latestRoundData();\n            require(block.timestamp - 24 hours <= updatedAt, \"stale latest price\");\n            if (result < 0) return 0;\n            return uint256(result);\n        } else {\n            ( , int256 result, , , ) = feed.getRoundData(roundId_);\n            if (result < 0) return 0;\n            return uint256(result);\n        }\n    }\n\n    function timestamp(uint80 roundId_) external view returns (uint256) {\n        if (roundId_ == 0) {\n            ( , , , uint256 updatedAt, ) = feed.latestRoundData();\n            require(block.timestamp - 24 hours <= updatedAt, \"stale latest timestamp\");\n            return updatedAt;\n        } else {\n            ( , , , uint256 updatedAt, ) = feed.getRoundData(roundId_);\n            return updatedAt;\n        }\n    }\n\n    function roundId() external view returns (uint80) {\n        (uint80 r, , , , ) = feed.latestRoundData();\n        return r;\n    }\n}\n"
      },
      "src/interfaces/IOracle.sol": {
        "content": "// SPDX-License-Identifier: AGPL-3.0-only\npragma solidity ^0.8.13;\n\ninterface IOracle {\n    function price(uint80 roundId) external view returns (uint256);\n    function timestamp(uint80 roundId) external view returns (uint256);\n    function roundId() external view returns (uint80);\n}\n"
      },
      "src/interfaces/chainlink/AggregatorV3Interface.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface AggregatorV3Interface {\n  function decimals() external view returns (uint8);\n\n  function description() external view returns (string memory);\n\n  function version() external view returns (uint256);\n\n  function getRoundData(uint80 _roundId)\n      external\n      view\n      returns (uint80 roundId,\n               int256 answer,\n               uint256 startedAt,\n               uint256 updatedAt,\n               uint80 answeredInRound);\n\n  function latestRoundData()\n    external\n    view\n    returns (uint80 roundId,\n             int256 answer,\n             uint256 startedAt,\n             uint256 updatedAt,\n             uint80 answeredInRound);\n}\n"
      }
    },
    "settings": {
      "remappings": [
        "@openzeppelin/=lib/openzeppelin-contracts/",
        "ds-test/=lib/forge-std/lib/ds-test/src/",
        "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
        "forge-std/=lib/forge-std/src/",
        "openzeppelin-contracts/=lib/openzeppelin-contracts/",
        "lib/forge-std:ds-test/=lib/forge-std/lib/ds-test/src/",
        "lib/openzeppelin-contracts:@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
        "lib/openzeppelin-contracts:ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
        "lib/openzeppelin-contracts:erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
        "lib/openzeppelin-contracts:forge-std/=lib/openzeppelin-contracts/lib/forge-std/src/"
      ],
      "optimizer": {
        "enabled": true,
        "runs": 200
      },
      "metadata": {
        "useLiteralContent": false,
        "bytecodeHash": "ipfs",
        "appendCBOR": true
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "evmVersion": "paris",
      "libraries": {}
    }
  }}