witnet-solidity-bridge
Version:
Witnet Solidity Bridge contracts for EVM-compatible chains
1,033 lines • 72.7 kB
JSON
{
"contractName": "IWitPyth",
"abi": [
{
"inputs": [],
"name": "DeviantPrice",
"type": "error"
},
{
"inputs": [],
"name": "HotPrice",
"type": "error"
},
{
"inputs": [],
"name": "InvalidArgument",
"type": "error"
},
{
"inputs": [],
"name": "InvalidGovernanceTarget",
"type": "error"
},
{
"inputs": [],
"name": "InvalidUpdateData",
"type": "error"
},
{
"inputs": [],
"name": "InvalidUpdateDataSource",
"type": "error"
},
{
"inputs": [],
"name": "NoFreshUpdate",
"type": "error"
},
{
"inputs": [],
"name": "PriceFeedNotFound",
"type": "error"
},
{
"inputs": [],
"name": "PriceFeedNotFoundWithinRange",
"type": "error"
},
{
"inputs": [],
"name": "StalePrice",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "id",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "uint64",
"name": "publishTime",
"type": "uint64"
},
{
"indexed": false,
"internalType": "int64",
"name": "price",
"type": "int64"
},
{
"indexed": false,
"internalType": "uint64",
"name": "",
"type": "uint64"
}
],
"name": "PriceFeedUpdate",
"type": "event"
},
{
"inputs": [
{
"internalType": "IWitPyth.ID",
"name": "id",
"type": "bytes32"
}
],
"name": "getEmaPrice",
"outputs": [
{
"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": "",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "IWitPyth.ID",
"name": "id",
"type": "bytes32"
},
{
"internalType": "uint64",
"name": "age",
"type": "uint64"
}
],
"name": "getEmaPriceNotOlderThan",
"outputs": [
{
"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": "",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "IWitPyth.ID",
"name": "id",
"type": "bytes32"
}
],
"name": "getEmaPriceUnsafe",
"outputs": [
{
"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": "",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "IWitPyth.ID",
"name": "id",
"type": "bytes32"
}
],
"name": "getPrice",
"outputs": [
{
"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": "",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "IWitPyth.ID",
"name": "id",
"type": "bytes32"
},
{
"internalType": "uint64",
"name": "age",
"type": "uint64"
}
],
"name": "getPriceNotOlderThan",
"outputs": [
{
"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": "",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "IWitPyth.ID",
"name": "id",
"type": "bytes32"
}
],
"name": "getPriceUnsafe",
"outputs": [
{
"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": "",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"name": "getUpdateFee",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.8.30+commit.73712a01\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"DeviantPrice\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"HotPrice\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidArgument\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidGovernanceTarget\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidUpdateData\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidUpdateDataSource\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoFreshUpdate\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PriceFeedNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PriceFeedNotFoundWithinRange\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StalePrice\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"id\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"publishTime\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"int64\",\"name\":\"price\",\"type\":\"int64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"PriceFeedUpdate\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"IWitPyth.ID\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"getEmaPrice\",\"outputs\":[{\"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\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"IWitPyth.ID\",\"name\":\"id\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"age\",\"type\":\"uint64\"}],\"name\":\"getEmaPriceNotOlderThan\",\"outputs\":[{\"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\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"IWitPyth.ID\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"getEmaPriceUnsafe\",\"outputs\":[{\"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\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"IWitPyth.ID\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"getPrice\",\"outputs\":[{\"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\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"IWitPyth.ID\",\"name\":\"id\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"age\",\"type\":\"uint64\"}],\"name\":\"getPriceNotOlderThan\",\"outputs\":[{\"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\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"IWitPyth.ID\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"getPriceUnsafe\",\"outputs\":[{\"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\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"getUpdateFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"DeviantPrice()\":[{\"details\":\"Signature: 0x7b0d2bb5\"}],\"HotPrice()\":[{\"details\":\"Signature: 0x0fbbc581\"}],\"InvalidArgument()\":[{\"details\":\"Signature: 0xa9cb9e0d\"}],\"InvalidUpdateData()\":[{\"details\":\"Signature: 0xe69ffece\"}],\"InvalidUpdateDataSource()\":[{\"details\":\"Signature: 0xe60dce71\"}],\"NoFreshUpdate()\":[{\"details\":\"Signature: 0xde2c57fa\"}],\"PriceFeedNotFound()\":[{\"details\":\"Signature: 0x14aebe68\"}],\"PriceFeedNotFoundWithinRange()\":[{\"details\":\"Signature: 0x45805f5d\"}],\"StalePrice()\":[{\"details\":\"Signature: 0x19abf40e\"}]},\"events\":{\"PriceFeedUpdate(bytes32,uint64,int64,uint64)\":{\"details\":\"Emitted when the price feed with `id` has received a fresh update.\",\"params\":{\"id\":\"The Pyth Price Feed ID.\",\"price\":\"Price of the given price update.\",\"publishTime\":\"Publish time of the given price update.\"}}},\"kind\":\"dev\",\"methods\":{\"getEmaPrice(bytes32)\":{\"details\":\"Reverts if the EMA price is not available.\",\"params\":{\"id\":\"The Price Feed ID of which to fetch the EMA price.\"}},\"getEmaPriceNotOlderThan(bytes32,uint64)\":{\"details\":\"This function is a sanity-checked version of `getEmaPriceUnsafe` which is useful in applications that require a sufficiently-recent price. Reverts if the price wasn't updated sufficiently recently.\"},\"getEmaPriceUnsafe(bytes32)\":{\"details\":\"This function returns the same price as `getEmaPrice` in the case where the price is available. However, if the price is not recent this function returns the latest available price. The returned price can be from arbitrarily far in the past; this function makes no guarantees that the returned price is recent or useful for any particular application. Users of this function should check the `timestamp` in the price to ensure that the returned price is sufficiently recent for their application. If you are considering using this function, it may be safer / easier to use either `getEmaPrice` or `getEmaPriceNoOlderThan`.\"},\"getPrice(bytes32)\":{\"details\":\"Reverts if the price has not been updated within the last `heartbeatSecs`. \",\"params\":{\"id\":\"The Price Feed ID of which to fetch the price.\"}},\"getPriceNotOlderThan(bytes32,uint64)\":{\"details\":\"This function is a sanity-checked version of `getPriceUnsafe` which is useful in applications that require a sufficiently-recent price. Reverts if the price wasn't updated sufficiently recently.\"},\"getPriceUnsafe(bytes32)\":{\"details\":\"This function returns the most recent price update in this contract without any recency checks. This function is unsafe as the returned price update may be arbitrarily far in the past. Users of this function should check the `timestamp` in the price to ensure that the returned price is sufficiently recent for their application. If you are considering using this function, it may be safer / easier to use either `getPrice` or `getPriceNoOlderThan`.\"}},\"version\":1},\"userdoc\":{\"errors\":{\"DeviantPrice()\":[{\"notice\":\"Requested price deviated too much after previous update.\"}],\"HotPrice()\":[{\"notice\":\"Attempting to update a price before cooldown period expires.\"}],\"InvalidArgument()\":[{\"notice\":\"Function arguments are invalid (e.g., the arguments lengths mismatch)\"}],\"InvalidGovernanceTarget()\":[{\"notice\":\"Either the number of witnesses that solved a price update is not within the settled range in this contract, or an EMA is being asked for a price feed that's not settled for the EMA to be computed. \"}],\"InvalidUpdateData()\":[{\"notice\":\"Update data is invalid (e.g. badly serialized, or bad proof was provided).\"}],\"InvalidUpdateDataSource()\":[{\"notice\":\"Update data is coming from an invalid Wit/Oracle Radon Hash.\"}],\"NoFreshUpdate()\":[{\"notice\":\"There is no fresh update, whereas expected fresh updates.\"}],\"PriceFeedNotFound()\":[{\"notice\":\"Price feed not found or it is not pushed on-chain yet.\"}],\"PriceFeedNotFoundWithinRange()\":[{\"notice\":\"There is no price feed found within the given range or it does not exist.\"}],\"StalePrice()\":[{\"notice\":\"Requested price is stale.\"}]},\"kind\":\"user\",\"methods\":{\"getEmaPrice(bytes32)\":{\"notice\":\"Returns the exponentially-weighted moving average price.\"},\"getEmaPriceNotOlderThan(bytes32,uint64)\":{\"notice\":\"Returns the exponentially-weighted moving average price that is no older than `age` seconds of the current time.\"},\"getEmaPriceUnsafe(bytes32)\":{\"notice\":\"Returns the exponentially-weighted moving average price of a price feed without any sanity checks.\"},\"getPrice(bytes32)\":{\"notice\":\"Returns the price and confidence interval.\"},\"getPriceNotOlderThan(bytes32,uint64)\":{\"notice\":\"Returns the price that is no older than `age` seconds of the current time.\"},\"getPriceUnsafe(bytes32)\":{\"notice\":\"Returns the price of a price feed without any sanity checks.\"},\"getUpdateFee(bytes)\":{\"notice\":\"Legacy-compliant to get the required fee to update an array of price updates, which would be always 0 if relying on the Wit/Oracle bridging framework. \"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"project:/contracts/interfaces/legacy/IWitPyth.sol\":\"IWitPyth\"},\"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/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 \"./IWitPythErrors.sol\";\r\nimport \"./IWitPythEvents.sol\";\r\n\r\nimport \"../../libs/Witnet.sol\";\r\n\r\ninterface IWitPyth\r\n is\r\n IWitPythErrors,\r\n IWitPythEvents\r\n{\r\n type ID is bytes32;\r\n\r\n struct PythPrice {\r\n // Price\r\n int64 price;\r\n // Confidence interval around the price\r\n uint64 conf;\r\n // Price exponent\r\n int32 expo;\r\n // Unix timestamp describing when the price was published\r\n uint publishTime;\r\n }\r\n\r\n /// @notice Returns the exponentially-weighted moving average price.\r\n /// @dev Reverts if the EMA price is not available.\r\n /// @param id The Price Feed ID of which to fetch the EMA price.\r\n function getEmaPrice(ID id) external view returns (PythPrice memory);\r\n\r\n /// @notice Returns the exponentially-weighted moving average price that is no older than `age` seconds\r\n /// of the current time.\r\n /// @dev This function is a sanity-checked version of `getEmaPriceUnsafe` which is useful in\r\n /// applications that require a sufficiently-recent price. Reverts if the price wasn't updated sufficiently\r\n /// recently.\r\n function getEmaPriceNotOlderThan(ID id, uint64 age) external view returns (PythPrice memory);\r\n\r\n /// @notice Returns the exponentially-weighted moving average price of a price feed without any sanity checks.\r\n /// @dev This function returns the same price as `getEmaPrice` in the case where the price is available.\r\n /// However, if the price is not recent this function returns the latest available price.\r\n ///\r\n /// The returned price can be from arbitrarily far in the past; this function makes no guarantees that\r\n /// the returned price is recent or useful for any particular application.\r\n ///\r\n /// Users of this function should check the `timestamp` in the price to ensure that the returned price is\r\n /// sufficiently recent for their application. If you are considering using this function, it may be\r\n /// safer / easier to use either `getEmaPrice` or `getEmaPriceNoOlderThan`.\r\n function getEmaPriceUnsafe(ID id) external view returns (PythPrice memory);\r\n\r\n // /// @notice Returns the latest known exponentially-weight average price for all required price feeds \r\n // /// without any sanity checks. This function is unsafe as the returned price updates may be arbitrarily \r\n // /// far in the past.\r\n // /// \r\n // /// Users of this function should check the `timestamp` of each price feed to ensure that the returned values \r\n // /// are sufficiently recent for their application. If you need safe access to fresh data, please consider\r\n // /// using calling to either `getEmaPrice` or `getEmaPriceNoOlderThan` for every individual price feed.\r\n // function getEmaPricesUnsafe(ID[] calldata ids) external view returns (Price[] memory);\r\n\r\n /// @notice Returns the price and confidence interval.\r\n /// @dev Reverts if the price has not been updated within the last `heartbeatSecs`. \r\n /// @param id The Price Feed ID of which to fetch the price.\r\n function getPrice(ID id) external view returns (PythPrice memory);\r\n\r\n /// @notice Returns the price that is no older than `age` seconds of the current time.\r\n /// @dev This function is a sanity-checked version of `getPriceUnsafe` which is useful in\r\n /// applications that require a sufficiently-recent price. \r\n /// Reverts if the price wasn't updated sufficiently\r\n /// recently.\r\n function getPriceNotOlderThan(ID id, uint64 age) external view returns (PythPrice memory);\r\n\r\n /// @notice Returns the price of a price feed without any sanity checks.\r\n /// @dev This function returns the most recent price update in this contract without any recency checks.\r\n /// This function is unsafe as the returned price update may be arbitrarily far in the past.\r\n /// \r\n /// Users of this function should check the `timestamp` in the price to ensure that the returned price is\r\n /// sufficiently recent for their application. If you are considering using this function, it may be\r\n /// safer / easier to use either `getPrice` or `getPriceNoOlderThan`.\r\n function getPriceUnsafe(ID id) external view returns (PythPrice memory);\r\n \r\n /// @notice Legacy-compliant to get the required fee to update an array of price updates, which would be\r\n /// always 0 if relying on the Wit/Oracle bridging framework. \r\n function getUpdateFee(bytes calldata) external view returns (uint256);\r\n}\r\n",
"sourcePath": "C:\\Users\\guill\\github\\guidiaz\\witnet-solidity-bridge\\contracts\\interfaces\\legacy\\IWitPyth.sol",
"ast": {
"absolutePath": "project:/contracts/interfaces/legacy/IWitPyth.sol",
"exportedSymbols": {
"Bech32": [
31372
],
"IWitPyth": [
29643
],
"IWitPythErrors": [
29697
],
"IWitPythEvents": [
29711
],
"Secp256k1": [
32535
],
"Witnet": [
40741
],
"WitnetBuffer": [
42631
],
"WitnetCBOR": [
44174
]
},
"id": 29644,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 29552,
"literals": [
"solidity",
">=",
"0.8",
".0",
"<",
"0.9",
".0"
],
"nodeType": "PragmaDirective",
"src": "35:31:103"
},
{
"absolutePath": "project:/contracts/interfaces/legacy/IWitPythErrors.sol",
"file": "./IWitPythErrors.sol",
"id": 29553,
"nameLocation": "-1:-1:-1",
"nodeType": "ImportDirective",
"scope": 29644,
"sourceUnit": 29698,
"src": "70:30:103",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "project:/contracts/interfaces/legacy/IWitPythEvents.sol",
"file": "./IWitPythEvents.sol",
"id": 29554,
"nameLocation": "-1:-1:-1",
"nodeType": "ImportDirective",
"scope": 29644,
"sourceUnit": 29712,
"src": "102:30:103",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "project:/contracts/libs/Witnet.sol",
"file": "../../libs/Witnet.sol",
"id": 29555,
"nameLocation": "-1:-1:-1",
"nodeType": "ImportDirective",
"scope": 29644,
"sourceUnit": 40742,
"src": "136:31:103",
"symbolAliases": [],
"unitAlias": ""
},
{
"abstract": false,
"baseContracts": [
{
"baseName": {
"id": 29556,
"name": "IWitPythErrors",
"nameLocations": [
"207:14:103"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 29697,
"src": "207:14:103"
},
"id": 29557,
"nodeType": "InheritanceSpecifier",
"src": "207:14:103"
},
{
"baseName": {
"id": 29558,
"name": "IWitPythEvents",
"nameLocations": [
"232:14:103"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 29711,
"src": "232:14:103"
},
"id": 29559,
"nodeType": "InheritanceSpecifier",
"src": "232:14:103"
}
],
"canonicalName": "IWitPyth",
"contractDependencies": [],
"contractKind": "interface",
"fullyImplemented": false,
"id": 29643,
"linearizedBaseContracts": [
29643,
29711,
29697
],
"name": "IWitPyth",
"nameLocation": "181:8:103",
"nodeType": "ContractDefinition",
"nodes": [
{
"canonicalName": "IWitPyth.ID",
"id": 29561,
"name": "ID",
"nameLocation": "260:2:103",
"nodeType": "UserDefinedValueTypeDefinition",
"src": "255:19:103",
"underlyingType": {
"id": 29560,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "266:7:103",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
},
{
"canonicalName": "IWitPyth.PythPrice",
"id": 29570,
"members": [
{
"constant": false,
"id": 29563,
"mutability": "mutable",
"name": "price",
"nameLocation": "334:5:103",
"nodeType": "VariableDeclaration",
"scope": 29570,
"src": "328:11:103",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int64",
"typeString": "int64"
},
"typeName": {
"id": 29562,
"name": "int64",
"nodeType": "ElementaryTypeName",
"src": "328:5:103",
"typeDescriptions": {
"typeIdentifier": "t_int64",
"typeString": "int64"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 29565,
"mutability": "mutable",
"name": "conf",
"nameLocation": "406:4:103",
"nodeType": "VariableDeclaration",
"scope": 29570,
"src": "399:11:103",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint64",
"typeString": "uint64"
},
"typeName": {
"id": 29564,
"name": "uint64",
"nodeType": "ElementaryTypeName",
"src": "399:6:103",
"typeDescriptions": {
"typeIdentifier": "t_uint64",
"typeString": "uint64"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 29567,
"mutability": "mutable",
"name": "expo",
"nameLocation": "454:4:103",
"nodeType": "VariableDeclaration",
"scope": 29570,
"src": "448:10:103",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int32",
"typeString": "int32"
},
"typeName": {
"id": 29566,
"name": "int32",
"nodeType": "ElementaryTypeName",
"src": "448:5:103",
"typeDescriptions": {
"typeIdentifier": "t_int32",
"typeString": "int32"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 29569,
"mutability": "mutable",
"name": "publishTime",
"nameLocation": "541:11:103",
"nodeType": "VariableDeclaration",
"scope": 29570,
"src": "536:16:103",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 29568,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "536:4:103",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"name": "PythPrice",
"nameLocation": "289:9:103",
"nodeType": "StructDefinition",
"scope": 29643,
"src": "282:278:103",
"visibility": "public"
},
{
"documentation": {
"id": 29571,
"nodeType": "StructuredDocumentation",
"src": "568:195:103",
"text": "@notice Returns the exponentially-weighted moving average price.\n @dev Reverts if the EMA price is not available.\n @param id The Price Feed ID of which to fetch the EMA price."
},
"functionSelector": "b5dcc911",
"id": 29580,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "getEmaPrice",
"nameLocation": "778:11:103",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 29575,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 29574,
"mutability": "mutable",
"name": "id",
"nameLocation": "793:2:103",
"nodeType": "VariableDeclaration",
"scope": 29580,
"src": "790:5:103",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_ID_$29561",
"typeString": "IWitPyth.ID"
},
"typeName": {
"id": 29573,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 29572,
"name": "ID",
"nameLocations": [
"790:2:103"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 29561,
"src": "790:2:103"
},
"referencedDeclaration": 29561,
"src": "790:2:103",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_ID_$29561",
"typeString": "IWitPyth.ID"
}
},
"visibility": "internal"
}
],
"src": "789:7:103"
},
"returnParameters": {
"id": 29579,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 29578,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 29580,
"src": "820:16:103",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_PythPrice_$29570_memory_ptr",
"typeString": "struct IWitPyth.PythPrice"
},
"typeName": {
"id": 29577,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 29576,
"name": "PythPrice",
"nameLocations": [
"820:9:103"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 29570,
"src": "820:9:103"
},
"referencedDeclaration": 29570,
"src": "820:9:103",
"typeDescriptions": {
"typeIdentifier": "t_struct$_PythPrice_$29570_storage_ptr",
"typeString": "struct IWitPyth.PythPrice"
}
},
"visibility": "internal"
}
],
"src": "819:18:103"
},
"scope": 29643,
"src": "769:69:103",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"documentation": {
"id": 29581,
"nodeType": "StructuredDocumentation",
"src": "846:363:103",
"text": "@notice Returns the exponentially-weighted moving average price that is no older than `age` seconds\n of the current time.\n @dev This function is a sanity-checked version of `getEmaPriceUnsafe` which is useful in\n applications that require a sufficiently-recent price. Reverts if the price wasn't updated sufficiently\n recently."
},
"functionSelector": "288b5e67",
"id": 29592,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "getEmaPriceNotOlderThan",
"nameLocation": "1224:23:103",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 29587,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 29584,
"mutability": "mutable",
"name": "id",
"nameLocation": "1251:2:103",
"nodeType": "VariableDeclaration",
"scope": 29592,
"src": "1248:5:103",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_ID_$29561",
"typeString": "IWitPyth.ID"
},
"typeName": {
"id": 29583,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 29582,
"name": "ID",
"nameLocations": [
"1248:2:103"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 29561,
"src": "1248:2:103"
},
"referencedDeclaration": 29561,
"src": "1248:2:103",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_ID_$29561",
"typeString": "IWitPyth.ID"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 29586,
"mutability": "mutable",
"name": "age",
"nameLocation": "1262:3:103",
"nodeType": "VariableDeclaration",
"scope": 29592,
"src": "1255:10:103",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint64",
"typeString": "uint64"
},
"typeName": {
"id": 29585,
"name": "uint64",
"nodeType": "ElementaryTypeName",
"src": "1255:6:103",
"typeDescriptions": {
"typeIdentifier": "t_uint64",
"typeString": "uint64"
}
},
"visibility": "internal"
}
],
"src": "1247:19:103"
},
"returnParameters": {
"id": 29591,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 29590,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 29592,
"src": "1290:16:103",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_PythPrice_$29570_memory_ptr",
"typeString": "struct IWitPyth.PythPrice"
},
"typeName": {
"id": 29589,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 29588,
"name": "PythPrice",
"nameLocations": [
"1290:9:103"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 29570,
"src": "1290:9:103"
},
"referencedDeclaration": 29570,
"src": "1290:9:103",
"typeDescriptions": {
"typeIdentifier": "t_struct$_PythPrice_$29570_storage_ptr",
"typeString": "struct IWitPyth.PythPrice"
}
},
"visibility": "internal"
}
],
"src": "1289:18:103"
},
"scope": 29643,
"src": "1215:93:103",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"documentation": {
"id": 29593,
"nodeType": "StructuredDocumentation",
"src": "1316:819:103",
"text": "@notice Returns the exponentially-weighted moving average price of a price feed without any sanity checks.\n @dev This function returns the same price as `getEmaPrice` in the case where the price is available.\n However, if the price is not recent this function returns the latest available price.\n The returned price can be from arbitrarily far in the past; this function makes no guarantees that\n the returned price is recent or useful for any particular application.\n Users of this function should check the `timestamp` in the price to ensure that the returned price is\n sufficiently recent for their application. If you are considering using this function, it may be\n safer / easier to use either `getEmaPrice` or `getEmaPriceNoOlderThan`."
},
"functionSelector": "9474f45b",
"id": 29602,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "getEmaPriceUnsafe",
"nameLocation": "2150:17:103",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 29597,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 29596,
"mutability": "mutable",
"name": "id",
"nameLocation": "2171:2:103",
"nodeType": "VariableDeclaration",
"scope": 29602,
"src": "2168:5:103",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_ID_$29561",
"typeString": "IWitPyth.ID"
},
"typeName": {
"id": 29595,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 29594,
"name": "ID",
"nameLocations": [
"2168:2:103"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 29561,
"src": "2168:2:103"
},
"referencedDeclaration": 29561,
"src": "2168:2:103",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_ID_$29561",
"typeString": "IWitPyth.ID"
}
},
"visibility": "internal"
}
],
"src": "2167:7:103"
},
"returnParameters": {
"id": 29601,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 29600,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 29602,
"src": "2198:16:103",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_PythPrice_$29570_memory_ptr",
"typeString": "struct IWitPyth.PythPrice"
},
"typeName": {
"id": 29599,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 29598,
"name": "PythPrice",
"nameLocations": [
"2198:9:103"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 29570,
"src": "2198:9:103"
},
"referencedDeclaration": 29570,
"src": "2198:9:103",
"typeDescriptions": {
"typeIdentifier": "t_struct$_PythPrice_$29570_storage_ptr",
"typeString": "struct IWitPyth.PythPrice"
}
},
"visibility": "internal"
}
],
"src": "2197:18:103"
},
"scope": 29643,
"src": "2141:75:103",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"documentation": {
"id": 29603,
"nodeType": "StructuredDocumentation",
"src": "2930:210:103",
"text": "@notice Returns the price and confidence interval.\n @dev Reverts if the price has not been updated within the last `heartbeatSecs`. \n @param id The Price Feed ID of which to fetch the price."
},
"functionSelector": "31d98b3f",
"id": 29612,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "getPrice",
"nameLocation": "3155:8:103",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 29607,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 29606,
"mutability": "mutable",
"name": "id",
"nameLocation": "3167:2:103",
"nodeType": "VariableDeclaration",
"scope": 29612,
"src": "3164:5:103",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_ID_$29561",
"typeString": "IWitPyth.ID"
},
"typeName": {
"id": 29605,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 29604,
"name": "ID",
"name