witnet-solidity-bridge
Version:
Witnet Solidity Bridge contracts for EVM-compatible chains
959 lines (958 loc) • 62.7 kB
JSON
{
"contractName": "IWitPythReporter",
"abi": [
{
"inputs": [
{
"internalType": "bytes[]",
"name": "updates",
"type": "bytes[]"
},
{
"internalType": "IWitPyth.ID[]",
"name": "ids",
"type": "bytes32[]"
},
{
"internalType": "Witnet.Timestamp",
"name": "minTimestamp",
"type": "uint64"
},
{
"internalType": "Witnet.Timestamp",
"name": "maxTimestamp",
"type": "uint64"
}
],
"name": "parsePriceFeedUpdates",
"outputs": [
{
"components": [
{
"internalType": "IWitPyth.ID",
"name": "id",
"type": "bytes32"
},
{
"components": [
{
"internalType": "int64",
"name": "price",
"type": "int64"
},
{
"internalType": "uint64",
"name": "conf",
"type": "uint64"
},
{
"internalType": "int32",
"name": "expo",
"type": "int32"
},
{
"internalType": "uint256",
"name": "publishTime",
"type": "uint256"
}
],
"internalType": "struct IWitPyth.PythPrice",
"name": "price",
"type": "tuple"
},
{
"components": [
{
"internalType": "int64",
"name": "price",
"type": "int64"
},
{
"internalType": "uint64",
"name": "conf",
"type": "uint64"
},
{
"internalType": "int32",
"name": "expo",
"type": "int32"
},
{
"internalType": "uint256",
"name": "publishTime",
"type": "uint256"
}
],
"internalType": "struct IWitPyth.PythPrice",
"name": "emaPrice",
"type": "tuple"
}
],
"internalType": "struct IWitPythReporter.PriceFeed[]",
"name": "",
"type": "tuple[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes[]",
"name": "updates",
"type": "bytes[]"
},
{
"internalType": "IWitPyth.ID[]",
"name": "ids",
"type": "bytes32[]"
},
{
"internalType": "Witnet.Timestamp",
"name": "minTimestamp",
"type": "uint64"
},
{
"internalType": "Witnet.Timestamp",
"name": "maxTimestamp",
"type": "uint64"
}
],
"name": "parsePriceFeedUpdatesUnique",
"outputs": [
{
"components": [
{
"internalType": "IWitPyth.ID",
"name": "id",
"type": "bytes32"
},
{
"components": [
{
"internalType": "int64",
"name": "price",
"type": "int64"
},
{
"internalType": "uint64",
"name": "conf",
"type": "uint64"
},
{
"internalType": "int32",
"name": "expo",
"type": "int32"
},
{
"internalType": "uint256",
"name": "publishTime",
"type": "uint256"
}
],
"internalType": "struct IWitPyth.PythPrice",
"name": "price",
"type": "tuple"
},
{
"components": [
{
"internalType": "int64",
"name": "price",
"type": "int64"
},
{
"internalType": "uint64",
"name": "conf",
"type": "uint64"
},
{
"internalType": "int32",
"name": "expo",
"type": "int32"
},
{
"internalType": "uint256",
"name": "publishTime",
"type": "uint256"
}
],
"internalType": "struct IWitPyth.PythPrice",
"name": "emaPrice",
"type": "tuple"
}
],
"internalType": "struct IWitPythReporter.PriceFeed[]",
"name": "",
"type": "tuple[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes[]",
"name": "updates",
"type": "bytes[]"
}
],
"name": "updatePriceFeeds",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes[]",
"name": "updates",
"type": "bytes[]"
},
{
"internalType": "IWitPyth.ID[]",
"name": "ids",
"type": "bytes32[]"
},
{
"internalType": "Witnet.Timestamp[]",
"name": "timestamps",
"type": "uint64[]"
}
],
"name": "updatePriceFeedsIfNecessary",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.8.30+commit.73712a01\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"updates\",\"type\":\"bytes[]\"},{\"internalType\":\"IWitPyth.ID[]\",\"name\":\"ids\",\"type\":\"bytes32[]\"},{\"internalType\":\"Witnet.Timestamp\",\"name\":\"minTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"Witnet.Timestamp\",\"name\":\"maxTimestamp\",\"type\":\"uint64\"}],\"name\":\"parsePriceFeedUpdates\",\"outputs\":[{\"components\":[{\"internalType\":\"IWitPyth.ID\",\"name\":\"id\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"price\",\"type\":\"int64\"},{\"internalType\":\"uint64\",\"name\":\"conf\",\"type\":\"uint64\"},{\"internalType\":\"int32\",\"name\":\"expo\",\"type\":\"int32\"},{\"internalType\":\"uint256\",\"name\":\"publishTime\",\"type\":\"uint256\"}],\"internalType\":\"struct IWitPyth.PythPrice\",\"name\":\"price\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"price\",\"type\":\"int64\"},{\"internalType\":\"uint64\",\"name\":\"conf\",\"type\":\"uint64\"},{\"internalType\":\"int32\",\"name\":\"expo\",\"type\":\"int32\"},{\"internalType\":\"uint256\",\"name\":\"publishTime\",\"type\":\"uint256\"}],\"internalType\":\"struct IWitPyth.PythPrice\",\"name\":\"emaPrice\",\"type\":\"tuple\"}],\"internalType\":\"struct IWitPythReporter.PriceFeed[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"updates\",\"type\":\"bytes[]\"},{\"internalType\":\"IWitPyth.ID[]\",\"name\":\"ids\",\"type\":\"bytes32[]\"},{\"internalType\":\"Witnet.Timestamp\",\"name\":\"minTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"Witnet.Timestamp\",\"name\":\"maxTimestamp\",\"type\":\"uint64\"}],\"name\":\"parsePriceFeedUpdatesUnique\",\"outputs\":[{\"components\":[{\"internalType\":\"IWitPyth.ID\",\"name\":\"id\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"price\",\"type\":\"int64\"},{\"internalType\":\"uint64\",\"name\":\"conf\",\"type\":\"uint64\"},{\"internalType\":\"int32\",\"name\":\"expo\",\"type\":\"int32\"},{\"internalType\":\"uint256\",\"name\":\"publishTime\",\"type\":\"uint256\"}],\"internalType\":\"struct IWitPyth.PythPrice\",\"name\":\"price\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"price\",\"type\":\"int64\"},{\"internalType\":\"uint64\",\"name\":\"conf\",\"type\":\"uint64\"},{\"internalType\":\"int32\",\"name\":\"expo\",\"type\":\"int32\"},{\"internalType\":\"uint256\",\"name\":\"publishTime\",\"type\":\"uint256\"}],\"internalType\":\"struct IWitPyth.PythPrice\",\"name\":\"emaPrice\",\"type\":\"tuple\"}],\"internalType\":\"struct IWitPythReporter.PriceFeed[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"updates\",\"type\":\"bytes[]\"}],\"name\":\"updatePriceFeeds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"updates\",\"type\":\"bytes[]\"},{\"internalType\":\"IWitPyth.ID[]\",\"name\":\"ids\",\"type\":\"bytes32[]\"},{\"internalType\":\"Witnet.Timestamp[]\",\"name\":\"timestamps\",\"type\":\"uint64[]\"}],\"name\":\"updatePriceFeedsIfNecessary\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"parsePriceFeedUpdates(bytes[],bytes32[],uint64,uint64)\":{\"details\":\"Reverts if there is no update for any of the given `ids` within the given time range.\",\"params\":{\"ids\":\"Array of price ids.\",\"maxTimestamp\":\"maximum acceptable publishTime for the given `ids`.\",\"minTimestamp\":\"minimum acceptable publishTime for the given `ids`.\",\"updates\":\"Array of price update reports.\"},\"returns\":{\"_0\":\"priceFeeds Array of parsed Prices corresponding to the given `ids` (with the same order).\"}},\"parsePriceFeedUpdatesUnique(bytes[],bytes32[],uint64,uint64)\":{\"details\":\"Reverts if there is no update for any of the given `ids` within the given time range and uniqueness condition.\",\"params\":{\"ids\":\"Array of price ids.\",\"maxTimestamp\":\"maximum acceptable publishTime for the given `ids`.\",\"minTimestamp\":\"minimum acceptable publishTime for the given `ids`.\",\"updates\":\"Array of price update reports.\"},\"returns\":{\"_0\":\"priceFeeds Array of the Prices corresponding to the given `ids` (with the same order).\"}},\"updatePriceFeeds(bytes[])\":{\"details\":\"Reverts if any of the update reports is invalid.\",\"params\":{\"updates\":\"Array of price update reports.\"}},\"updatePriceFeedsIfNecessary(bytes[],bytes32[],uint64[])\":{\"details\":\"Reverts also if any of the price update data is valid.\",\"params\":{\"ids\":\"Array of price ids.\",\"timestamps\":\"Array of timestamps: `timestamps[i]` corresponds to known `timestamp` of `ids[i]`\",\"updates\":\"Array of price update data.\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"parsePriceFeedUpdates(bytes[],bytes32[],uint64,uint64)\":{\"notice\":\"If you need to make sure to get the earliest update after `minTimestamp` (ie. the one on-chain or the one being parsed), consider using `parsePriceFeedUpdatesUnique` instead. \"},\"parsePriceFeedUpdatesUnique(bytes[],bytes32[],uint64,uint64)\":{\"notice\":\"Use this function is you just want to use reported updates for a fixed time window and not necessarily the most recent update on-chain. Otherwise, consider using `updatePriceFeeds` followed by any of the `get*PriceNoOlderThan` variants. \"},\"updatePriceFeeds(bytes[])\":{\"notice\":\"Update price feeds with given update reports. Prices will be updated if they are more recent than the current stored prices. The call will succeed even if the update is not the most recent. \"},\"updatePriceFeedsIfNecessary(bytes[],bytes32[],uint64[])\":{\"notice\":\"Wrapper around updatePriceFeeds that rejects fast if a price update is not necessary. A price update is necessary if the current on-chain publishTime is older than the given timestamp. It relies solely on the given `timestamps` for the price feeds and does not read the actual price update publish time within `updates`. `ids` and `timestamps` are two arrays with the same size that correspond to sender's known timestamps of each Price Feed id when calling this method. If all of price feeds within `ids` have updated and have a newer or equal timestamp than the given timestamp, it will reject the transaction to save gas. Otherwise, it calls updatePriceFeeds method to update the prices.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"project:/contracts/interfaces/legacy/IWitPythReporter.sol\":\"IWitPythReporter\"},\"evmVersion\":\"prague\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"project:/contracts/interfaces/legacy/IWitPyth.sol\":{\"keccak256\":\"0xa06a34a5e553beae7dbe09a5d1049557190511e696a1b855ab5e1196a06048a2\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://d2c814b7be5539147c0ba1b55f6cddcad382d5e5e9f9de545d2d428c1989c7de\",\"dweb:/ipfs/QmY8KSV3PW2FBQVzXidLQ21KvDJ1v6y8WHaV8uxsqThJCC\"]},\"project:/contracts/interfaces/legacy/IWitPythErrors.sol\":{\"keccak256\":\"0x7d10dfd625a4914e4017cde140397f9f236f726ea82b4feed1d889f852866c1d\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5bbf8dc2bbac36cf0a141f7062b6ed8143cffaee7969a1afc3cf0d1971e8cf18\",\"dweb:/ipfs/QmbLiZwggZwhiTLJurBkAu492xAZZ9MXWiknsuGnLYNXhP\"]},\"project:/contracts/interfaces/legacy/IWitPythEvents.sol\":{\"keccak256\":\"0xacca21f4bb4d740de63f4f2e469e8313b1d8f9a7d2340efcc17981c3510c2800\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://da8b0493082593838fbc4df2431c1983a82165ae1f17215e988951c0c1ef3882\",\"dweb:/ipfs/QmNUX9K3UqxiR9igT87iLja8h3u7htp83ZhAGZ6UgD3BZP\"]},\"project:/contracts/interfaces/legacy/IWitPythReporter.sol\":{\"keccak256\":\"0x24efd6c34e19021cb989ce680dc9c89412e114cfd1109e73eabbb17c4ff101af\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8986f76052d66011f4be10a24f7049e50ecaa0491ec74e4c62f216e526dba8ae\",\"dweb:/ipfs/QmcyZ8joeP32RS3ncEbzw7rYwENVuPbMd3Mzur4aKRQM86\"]},\"project:/contracts/libs/Bech32.sol\":{\"keccak256\":\"0x14618323a0efe7586c20906a2e9cee7ad63baa976ff231c57f7f2d7d3707fb8b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a19f05fe84047a7a6d3d6fc39972b432e6e536aa70472386a9d7a6d9aab64a64\",\"dweb:/ipfs/QmcHwUY66yjiotRH4Q3kbRvSzcHyLQ1yHL3KbtQKiMhtZE\"]},\"project:/contracts/libs/Secp256k1.sol\":{\"keccak256\":\"0xbe686002da5004ff39dd70709f3820eba2afe9323ae9cb894009c161e4b1a666\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://18fab91775216de0707cea9ad285b10be09127461a13432fea358bf9cb2a0c2e\",\"dweb:/ipfs/QmeRUGsgstnM4hxM9hpkBf3L6cE5btirEaowcMxmuw3utj\"]},\"project:/contracts/libs/Witnet.sol\":{\"keccak256\":\"0x1d446c3e534e40e676d1763bfb2897fadfac8afed904ab757843d7d6770b0a6c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://338fb1073f17d64e8d31bfe492d9475ce906788ee08e6489ce30413f91dc1328\",\"dweb:/ipfs/QmPe5QX2AGTnQFjse1Xttq4ZYWwYAiXoySb5VUui3PqPhk\"]},\"project:/contracts/libs/WitnetBuffer.sol\":{\"keccak256\":\"0x8e07aebe2954ab3e6f2d8eceedb12db7cf915c1f3e8630f4fa9999cecb1c78ec\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ed6c54cc901183d61546e8fd15bd5ea8ef238ebc915642946071d435dd7481ea\",\"dweb:/ipfs/Qmcaqta7YjUSBbBUGqoh44bsCS6UqqoyHjBuz4qnKBShXM\"]},\"project:/contracts/libs/WitnetCBOR.sol\":{\"keccak256\":\"0xd99308373575cc10fb7f2ceb0f6a8625f3911275c1fa27811fae498d98d03d97\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b4909a999d7b660a2dc54ca957b6eccfa523e2765fc4d6a2574dee7d5cd67b43\",\"dweb:/ipfs/QmWGQT4KDcfSFe1hcHVoWx6E4PhYMaod5iLpJCWBEeShzh\"]}},\"version\":1}",
"bytecode": "0x",
"deployedBytecode": "0x",
"immutableReferences": {},
"generatedSources": [],
"deployedGeneratedSources": [],
"sourceMap": "",
"deployedSourceMap": "",
"source": "// SPDX-License-Identifier: MIT\r\n\r\npragma solidity >=0.8.0 <0.9.0;\r\n\r\nimport \"./IWitPyth.sol\";\r\n\r\ninterface IWitPythReporter {\r\n \r\n struct PriceFeed {\r\n IWitPyth.ID id;\r\n IWitPyth.PythPrice price;\r\n IWitPyth.PythPrice emaPrice;\r\n }\r\n\r\n /// @notice Parse `updates` and return price feeds of the given `ids` if they reported\r\n /// timestamps are within specified `minTimestamp` and `maxTimestamp`. Unlike `updatePriceFeeds`, \r\n /// calling this function will NOT update the on-chain price. \r\n ///\r\n /// Use this function if you just want to use reported updates as long as they refer\r\n /// a timestamp within the specified range, and not necessarily most recent updates in storage. \r\n /// Otherwise, consider using `updatePriceFeeds` followed by any of `get*Price*` methods.\r\n \r\n /// If you need to make sure to get the earliest update after `minTimestamp` (ie. the one on-chain \r\n /// or the one being parsed), consider using `parsePriceFeedUpdatesUnique` instead.\r\n /// \r\n /// @dev Reverts if there is no update for any of the given `ids` within the given time range.\r\n /// @param updates Array of price update reports.\r\n /// @param ids Array of price ids.\r\n /// @param minTimestamp minimum acceptable publishTime for the given `ids`.\r\n /// @param maxTimestamp maximum acceptable publishTime for the given `ids`.\r\n /// @return priceFeeds Array of parsed Prices corresponding to the given `ids` (with the same order).\r\n function parsePriceFeedUpdates(\r\n bytes[] calldata updates, \r\n IWitPyth.ID[] calldata ids, \r\n Witnet.Timestamp minTimestamp,\r\n Witnet.Timestamp maxTimestamp\r\n ) external view returns (PriceFeed[] memory);\r\n\r\n /// @notice Similar to `parsePriceFeedUpdates` but ensures the returned prices correspond to\r\n /// the earliest update after `minTimestamp`. That is to say, if `prevTs < minTs <= ts <= maxTs`, \r\n /// where `prevTs` is the timestamp of latest on-chain timestamp for each referred price-feed.\r\n /// This will guarantee no updates exist for the given `priceIds` earlier than the returned \r\n /// updates and still in the given time range. \r\n \r\n /// Use this function is you just want to use reported updates for a fixed time window and \r\n /// not necessarily the most recent update on-chain. Otherwise, consider using\r\n /// `updatePriceFeeds` followed by any of the `get*PriceNoOlderThan` variants.\r\n /// \r\n /// @dev Reverts if there is no update for any of the given `ids` within the given time range and \r\n /// uniqueness condition.\r\n /// @param updates Array of price update reports.\r\n /// @param ids Array of price ids.\r\n /// @param minTimestamp minimum acceptable publishTime for the given `ids`.\r\n /// @param maxTimestamp maximum acceptable publishTime for the given `ids`.\r\n /// @return priceFeeds Array of the Prices corresponding to the given `ids` (with the same order).\r\n function parsePriceFeedUpdatesUnique(\r\n bytes[] calldata updates, \r\n IWitPyth.ID[] calldata ids, \r\n Witnet.Timestamp minTimestamp,\r\n Witnet.Timestamp maxTimestamp\r\n ) external view returns (PriceFeed[] memory);\r\n\r\n /// @notice Update price feeds with given update reports. Prices will be updated if \r\n /// they are more recent than the current stored prices. \r\n /// The call will succeed even if the update is not the most recent.\r\n /// \r\n /// @dev Reverts if any of the update reports is invalid.\r\n /// @param updates Array of price update reports.\r\n function updatePriceFeeds(bytes[] calldata updates) external;\r\n\r\n /// @notice Wrapper around updatePriceFeeds that rejects fast if a price update is not necessary. \r\n /// A price update is necessary if the current on-chain publishTime is older than the given timestamp. \r\n /// It relies solely on the given `timestamps` for the price feeds and does not read the actual price update \r\n /// publish time within `updates`.\r\n ///\r\n /// `ids` and `timestamps` are two arrays with the same size that correspond to sender's known timestamps\r\n /// of each Price Feed id when calling this method. If all of price feeds within `ids` have updated and have\r\n /// a newer or equal timestamp than the given timestamp, it will reject the transaction to save gas.\r\n /// Otherwise, it calls updatePriceFeeds method to update the prices.\r\n ///\r\n /// @dev Reverts also if any of the price update data is valid.\r\n /// @param updates Array of price update data.\r\n /// @param ids Array of price ids.\r\n /// @param timestamps Array of timestamps: `timestamps[i]` corresponds to known `timestamp` of `ids[i]`\r\n function updatePriceFeedsIfNecessary(\r\n bytes[] calldata updates, \r\n IWitPyth.ID[] calldata ids, \r\n Witnet.Timestamp[] calldata timestamps\r\n ) external;\r\n}\r\n",
"sourcePath": "C:\\Users\\guill\\github\\guidiaz\\witnet-solidity-bridge\\contracts\\interfaces\\legacy\\IWitPythReporter.sol",
"ast": {
"absolutePath": "project:/contracts/interfaces/legacy/IWitPythReporter.sol",
"exportedSymbols": {
"Bech32": [
31372
],
"IWitPyth": [
29643
],
"IWitPythErrors": [
29697
],
"IWitPythEvents": [
29711
],
"IWitPythReporter": [
29789
],
"Secp256k1": [
32535
],
"Witnet": [
40741
],
"WitnetBuffer": [
42631
],
"WitnetCBOR": [
44174
]
},
"id": 29790,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 29713,
"literals": [
"solidity",
">=",
"0.8",
".0",
"<",
"0.9",
".0"
],
"nodeType": "PragmaDirective",
"src": "35:31:107"
},
{
"absolutePath": "project:/contracts/interfaces/legacy/IWitPyth.sol",
"file": "./IWitPyth.sol",
"id": 29714,
"nameLocation": "-1:-1:-1",
"nodeType": "ImportDirective",
"scope": 29790,
"sourceUnit": 29644,
"src": "70:24:107",
"symbolAliases": [],
"unitAlias": ""
},
{
"abstract": false,
"baseContracts": [],
"canonicalName": "IWitPythReporter",
"contractDependencies": [],
"contractKind": "interface",
"fullyImplemented": false,
"id": 29789,
"linearizedBaseContracts": [
29789
],
"name": "IWitPythReporter",
"nameLocation": "108:16:107",
"nodeType": "ContractDefinition",
"nodes": [
{
"canonicalName": "IWitPythReporter.PriceFeed",
"id": 29724,
"members": [
{
"constant": false,
"id": 29717,
"mutability": "mutable",
"name": "id",
"nameLocation": "178:2:107",
"nodeType": "VariableDeclaration",
"scope": 29724,
"src": "166:14:107",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_ID_$29561",
"typeString": "IWitPyth.ID"
},
"typeName": {
"id": 29716,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 29715,
"name": "IWitPyth.ID",
"nameLocations": [
"166:8:107",
"175:2:107"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 29561,
"src": "166:11:107"
},
"referencedDeclaration": 29561,
"src": "166:11:107",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_ID_$29561",
"typeString": "IWitPyth.ID"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 29720,
"mutability": "mutable",
"name": "price",
"nameLocation": "210:5:107",
"nodeType": "VariableDeclaration",
"scope": 29724,
"src": "191:24:107",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_struct$_PythPrice_$29570_storage_ptr",
"typeString": "struct IWitPyth.PythPrice"
},
"typeName": {
"id": 29719,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 29718,
"name": "IWitPyth.PythPrice",
"nameLocations": [
"191:8:107",
"200:9:107"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 29570,
"src": "191:18:107"
},
"referencedDeclaration": 29570,
"src": "191:18:107",
"typeDescriptions": {
"typeIdentifier": "t_struct$_PythPrice_$29570_storage_ptr",
"typeString": "struct IWitPyth.PythPrice"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 29723,
"mutability": "mutable",
"name": "emaPrice",
"nameLocation": "245:8:107",
"nodeType": "VariableDeclaration",
"scope": 29724,
"src": "226:27:107",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_struct$_PythPrice_$29570_storage_ptr",
"typeString": "struct IWitPyth.PythPrice"
},
"typeName": {
"id": 29722,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 29721,
"name": "IWitPyth.PythPrice",
"nameLocations": [
"226:8:107",
"235:9:107"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 29570,
"src": "226:18:107"
},
"referencedDeclaration": 29570,
"src": "226:18:107",
"typeDescriptions": {
"typeIdentifier": "t_struct$_PythPrice_$29570_storage_ptr",
"typeString": "struct IWitPyth.PythPrice"
}
},
"visibility": "internal"
}
],
"name": "PriceFeed",
"nameLocation": "145:9:107",
"nodeType": "StructDefinition",
"scope": 29789,
"src": "138:123:107",
"visibility": "public"
},
{
"documentation": {
"id": 29725,
"nodeType": "StructuredDocumentation",
"src": "835:662:107",
"text": "If you need to make sure to get the earliest update after `minTimestamp` (ie. the one on-chain \n or the one being parsed), consider using `parsePriceFeedUpdatesUnique` instead.\n \n @dev Reverts if there is no update for any of the given `ids` within the given time range.\n @param updates Array of price update reports.\n @param ids Array of price ids.\n @param minTimestamp minimum acceptable publishTime for the given `ids`.\n @param maxTimestamp maximum acceptable publishTime for the given `ids`.\n @return priceFeeds Array of parsed Prices corresponding to the given `ids` (with the same order)."
},
"functionSelector": "4716e9c5",
"id": 29745,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "parsePriceFeedUpdates",
"nameLocation": "1512:21:107",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 29739,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 29728,
"mutability": "mutable",
"name": "updates",
"nameLocation": "1565:7:107",
"nodeType": "VariableDeclaration",
"scope": 29745,
"src": "1548:24:107",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bytes_calldata_ptr_$dyn_calldata_ptr",
"typeString": "bytes[]"
},
"typeName": {
"baseType": {
"id": 29726,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "1548:5:107",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"id": 29727,
"nodeType": "ArrayTypeName",
"src": "1548:7:107",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bytes_storage_$dyn_storage_ptr",
"typeString": "bytes[]"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 29732,
"mutability": "mutable",
"name": "ids",
"nameLocation": "1611:3:107",
"nodeType": "VariableDeclaration",
"scope": 29745,
"src": "1588:26:107",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_userDefinedValueType$_ID_$29561_$dyn_calldata_ptr",
"typeString": "IWitPyth.ID[]"
},
"typeName": {
"baseType": {
"id": 29730,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 29729,
"name": "IWitPyth.ID",
"nameLocations": [
"1588:8:107",
"1597:2:107"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 29561,
"src": "1588:11:107"
},
"referencedDeclaration": 29561,
"src": "1588:11:107",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_ID_$29561",
"typeString": "IWitPyth.ID"
}
},
"id": 29731,
"nodeType": "ArrayTypeName",
"src": "1588:13:107",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_userDefinedValueType$_ID_$29561_$dyn_storage_ptr",
"typeString": "IWitPyth.ID[]"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 29735,
"mutability": "mutable",
"name": "minTimestamp",
"nameLocation": "1647:12:107",
"nodeType": "VariableDeclaration",
"scope": 29745,
"src": "1630:29:107",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_Timestamp_$37157",
"typeString": "Witnet.Timestamp"
},
"typeName": {
"id": 29734,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 29733,
"name": "Witnet.Timestamp",
"nameLocations": [
"1630:6:107",
"1637:9:107"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 37157,
"src": "1630:16:107"
},
"referencedDeclaration": 37157,
"src": "1630:16:107",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_Timestamp_$37157",
"typeString": "Witnet.Timestamp"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 29738,
"mutability": "mutable",
"name": "maxTimestamp",
"nameLocation": "1691:12:107",
"nodeType": "VariableDeclaration",
"scope": 29745,
"src": "1674:29:107",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_Timestamp_$37157",
"typeString": "Witnet.Timestamp"
},
"typeName": {
"id": 29737,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 29736,
"name": "Witnet.Timestamp",
"nameLocations": [
"1674:6:107",
"1681:9:107"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 37157,
"src": "1674:16:107"
},
"referencedDeclaration": 37157,
"src": "1674:16:107",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_Timestamp_$37157",
"typeString": "Witnet.Timestamp"
}
},
"visibility": "internal"
}
],
"src": "1533:181:107"
},
"returnParameters": {
"id": 29744,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 29743,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 29745,
"src": "1738:18:107",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_PriceFeed_$29724_memory_ptr_$dyn_memory_ptr",
"typeString": "struct IWitPythReporter.PriceFeed[]"
},
"typeName": {
"baseType": {
"id": 29741,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 29740,
"name": "PriceFeed",
"nameLocations": [
"1738:9:107"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 29724,
"src": "1738:9:107"
},
"referencedDeclaration": 29724,
"src": "1738:9:107",
"typeDescriptions": {
"typeIdentifier": "t_struct$_PriceFeed_$29724_storage_ptr",
"typeString": "struct IWitPythReporter.PriceFeed"
}
},
"id": 29742,
"nodeType": "ArrayTypeName",
"src": "1738:11:107",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_PriceFeed_$29724_storage_$dyn_storage_ptr",
"typeString": "struct IWitPythReporter.PriceFeed[]"
}
},
"visibility": "internal"
}
],
"src": "1737:20:107"
},
"scope": 29789,
"src": "1503:255:107",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"documentation": {
"id": 29746,
"nodeType": "StructuredDocumentation",
"src": "2225:766:107",
"text": "Use this function is you just want to use reported updates for a fixed time window and \n not necessarily the most recent update on-chain. Otherwise, consider using\n `updatePriceFeeds` followed by any of the `get*PriceNoOlderThan` variants.\n \n @dev Reverts if there is no update for any of the given `ids` within the given time range and \n uniqueness condition.\n @param updates Array of price update reports.\n @param ids Array of price ids.\n @param minTimestamp minimum acceptable publishTime for the given `ids`.\n @param maxTimestamp maximum acceptable publishTime for the given `ids`.\n @return priceFeeds Array of the Prices corresponding to the given `ids` (with the same order)."
},
"functionSelector": "accca7f9",
"id": 29766,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "parsePriceFeedUpdatesUnique",
"nameLocation": "3006:27:107",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 29760,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 29749,
"mutability": "mutable",
"name": "updates",
"nameLocation": "3065:7:107",
"nodeType": "VariableDeclaration",
"scope": 29766,
"src": "3048:24:107",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bytes_calldata_ptr_$dyn_calldata_ptr",
"typeString": "bytes[]"
},
"typeName": {
"baseType": {
"id": 29747,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "3048:5:107",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"id": 29748,
"nodeType": "ArrayTypeName",
"src": "3048:7:107",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bytes_storage_$dyn_storage_ptr",
"typeString": "bytes[]"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 29753,
"mutability": "mutable",
"name": "ids",
"nameLocation": "3111:3:107",
"nodeType": "VariableDeclaration",
"scope": 29766,
"src": "3088:26:107",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_userDefinedValueType$_ID_$29561_$dyn_calldata_ptr",
"typeString": "IWitPyth.ID[]"
},
"typeName": {
"baseType": {
"id": 29751,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 29750,
"name": "IWitPyth.ID",
"nameLocations": [
"3088:8:107",
"3097:2:107"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 29561,
"src": "3088:11:107"
},
"referencedDeclaration": 29561,
"src": "3088:11:107",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_ID_$29561",
"typeString": "IWitPyth.ID"
}
},
"id": 29752,
"nodeType": "ArrayTypeName",
"src": "3088:13:107",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_userDefinedValueType$_ID_$29561_$dyn_storage_ptr",
"typeString": "IWitPyth.ID[]"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 29756,
"mutability": "mutable",
"name": "minTimestamp",
"nameLocation": "3147:12:107",
"nodeType": "VariableDeclaration",
"scope": 29766,
"src": "3130:29:107",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_Timestamp_$37157",
"typeString": "Witnet.Timestamp"
},
"typeName": {
"id": 29755,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 29754,
"name": "Witnet.Timestamp",
"nameLocations": [
"3130:6:107",
"3137:9:107"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 37157,
"src": "3130:16:107"
},
"referencedDeclaration": 37157,
"src": "3130:16:107",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_Timestamp_$37157",
"typeString": "Witnet.Timestamp"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 29759,
"mutability": "mutable",
"name": "maxTimestamp",
"nameLocation": "3191:12:107",
"nodeType": "VariableDeclaration",
"scope": 29766,
"src": "3174:29:107",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_Timestamp_$37157",
"typeString": "Witnet.Timestamp"
},
"typeName": {
"id": 29758,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 29757,
"name": "Witnet.Timestamp",
"nameLocations": [
"3174:6:107",
"3181:9:107"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 37157,
"src": "3174:16:107"
},
"referencedDeclaration": 37157,
"src": "3174:16:107",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_Timestamp_$37157",
"typeString": "Witnet.Timestamp"
}
},
"visibility": "internal"
}
],
"src": "3033:181:107"
},
"returnParameters": {
"id": 29765,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 29764,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 29766,
"src": "3238:18:107",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_PriceFeed_$29724_memory_ptr_$dyn_memory_ptr",
"typeString": "struct IWitPythReporter.PriceFeed[]"
},
"typeName": {
"baseType": {
"id": 29762,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 29761,
"name": "PriceFeed",
"nameLocations": [
"3238:9:107"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 29724,
"src": "3238:9:107"
},
"referencedDeclaration": 29724,
"src": "3238:9:107",
"typeDescriptions": {
"typeIdentifier": "t_struct$_PriceFeed_$29724_storage_ptr",
"typeString": "struct IWitPythReporter.PriceFeed"
}
},
"id": 29763,
"nodeType": "ArrayTypeName",
"src": "3238:11:107",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_PriceFeed_$29724_storage_$dyn_storage_ptr",
"typeString": "struct IWitPythReporter.PriceFeed[]"
}
},
"visibility": "internal"
}
],
"src": "3237:20:107"
},
"scope": 29789,
"src": "2997:261:107",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"documentation": {
"id": 29767,
"nodeType": "StructuredDocumentation",
"src": "3266:349:107",
"text": "@notice Update price feeds with given update reports. Prices will be updated if \n they are more recent than the current stored prices. \n The call will succeed even if the update is not the most recent.\n \n @dev Reverts if any of the update reports is invalid.\n @param updates Array of price update reports."
},
"functionSelector": "ef9e5e28",
"id": 29773,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "updatePriceFeeds",
"nameLocation": "3630:16:107",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 29771,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 29770,
"mutability": "mutable",
"name": "updates",
"nameLocation": "3664:7:107",
"nodeType": "VariableDeclaration",
"scope": 29773,
"src": "3647:24:107",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bytes_calldata_ptr_$dyn_calldata_ptr",
"typeString": "bytes[]"
},
"typeName": {
"baseType": {