UNPKG

witnet-solidity-bridge

Version:

Witnet Solidity Bridge contracts for EVM-compatible chains

556 lines 25.3 kB
{ "contractName": "IWitPriceFeedsConsumer", "abi": [ { "inputs": [ { "internalType": "IWitPriceFeedsTypes.ID4", "name": "id4", "type": "bytes4" }, { "internalType": "Witnet.Timestamp", "name": "timestamp", "type": "uint64" }, { "internalType": "Witnet.TransactionHash", "name": "trail", "type": "bytes32" }, { "internalType": "uint64", "name": "price", "type": "uint64" }, { "internalType": "int56", "name": "deltaPrice", "type": "int56" }, { "internalType": "uint64", "name": "deltaSecs", "type": "uint64" }, { "internalType": "int8", "name": "exponent", "type": "int8" } ], "name": "reportUpdate", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "witPriceFeeds", "outputs": [ { "internalType": "contract IWitPriceFeeds", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.8.30+commit.73712a01\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"IWitPriceFeedsTypes.ID4\",\"name\":\"id4\",\"type\":\"bytes4\"},{\"internalType\":\"Witnet.Timestamp\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"Witnet.TransactionHash\",\"name\":\"trail\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"price\",\"type\":\"uint64\"},{\"internalType\":\"int56\",\"name\":\"deltaPrice\",\"type\":\"int56\"},{\"internalType\":\"uint64\",\"name\":\"deltaSecs\",\"type\":\"uint64\"},{\"internalType\":\"int8\",\"name\":\"exponent\",\"type\":\"int8\"}],\"name\":\"reportUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"witPriceFeeds\",\"outputs\":[{\"internalType\":\"contract IWitPriceFeeds\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"reportUpdate(bytes4,uint64,bytes32,uint64,int56,uint64,int8)\":{\"details\":\"It should revert if called from an address other than `witPriceFeeds()`.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"reportUpdate(bytes4,uint64,bytes32,uint64,int56,uint64,int8)\":{\"notice\":\"Reports a Witnet-verified price feed update.\"},\"witPriceFeeds()\":{\"notice\":\"Returns the address of the one and only `IWitPriceFeeds` instance that can provide price feed updates.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"project:/contracts/interfaces/IWitPriceFeedsConsumer.sol\":\"IWitPriceFeedsConsumer\"},\"evmVersion\":\"prague\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"project:/contracts/interfaces/IWitPriceFeeds.sol\":{\"keccak256\":\"0xb29abe8819699e37e91b41c4cb63273fbb0ab8c482a09c31da6c91d7338cc405\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a9325f3cbd3b396216268ec83d583abd86f44a5d656c375485296e256b3c2f2a\",\"dweb:/ipfs/Qme8pjdacDLa8HLKF7Sm3XZa9uUQn1EL7gANLnAbak8y4f\"]},\"project:/contracts/interfaces/IWitPriceFeedsAdmin.sol\":{\"keccak256\":\"0xd05b103840eeb8a4770e140dbe91bd40dd33d92959d226c57a2ae45a5e615355\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://29e6104b0b62c676bb797ce8d01512550058f5b6de210b2467ba9bb0dfe8c00f\",\"dweb:/ipfs/QmUAgsVJYHqiRFrrnWCYo5vGJRaN4VsZvcBXJWYJUF5QyV\"]},\"project:/contracts/interfaces/IWitPriceFeedsConsumer.sol\":{\"keccak256\":\"0x2c12c7f4502a2953f352b67688cd8841a1198c9b8e8f9f87ab3fc0163b7533e9\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://d82ec627ac4c38a7336b03541c118d606e107128ba109097857a26d376e92f33\",\"dweb:/ipfs/QmQBmvL5ziD7fY2vDBNpbDbbhnwi8Cwh4XVthUjTd9ZyCF\"]},\"project:/contracts/interfaces/IWitPriceFeedsEvents.sol\":{\"keccak256\":\"0xf8b1a2ca8dd8dc8a5b8debf18f4c32df404709a4b03353c939e57a92a4e41b4e\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://f755b639781013ae0bae92f063b1f5b440c187bbc9a7f938b6982e579114acfe\",\"dweb:/ipfs/QmZafsjeELGnVdbXvsiXeQ82vR7DBFCrwDLGqeopgxBgyC\"]},\"project:/contracts/interfaces/IWitPriceFeedsTypes.sol\":{\"keccak256\":\"0x68e2189e863f50e8d0aad8394a526df00c1e626886c23aa24c915427e5285e46\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://f5ff40355d4144e7c08f033b55e9ef1b5994bbd83bbfbd7a41129b141f164194\",\"dweb:/ipfs/QmXMhM7GXaVXnCQ1VFB4kPhbhbfktuNFKqMGXMtWLgUk3d\"]},\"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;\r\n\r\nimport {IWitPriceFeeds} from \"./IWitPriceFeeds.sol\";\r\nimport {IWitPriceFeedsTypes} from \"./IWitPriceFeedsTypes.sol\";\r\nimport {Witnet} from \"../libs/Witnet.sol\";\r\n\r\ninterface IWitPriceFeedsConsumer {\r\n /// Reports a Witnet-verified price feed update.\r\n /// @dev It should revert if called from an address other than `witPriceFeeds()`.\r\n function reportUpdate(\r\n IWitPriceFeedsTypes.ID4 id4, \r\n Witnet.Timestamp timestamp,\r\n Witnet.TransactionHash trail,\r\n uint64 price, \r\n int56 deltaPrice,\r\n uint64 deltaSecs,\r\n int8 exponent\r\n ) external;\r\n\r\n /// Returns the address of the one and only `IWitPriceFeeds` \r\n /// instance that can provide price feed updates.\r\n function witPriceFeeds() external view returns (IWitPriceFeeds);\r\n}\r\n", "sourcePath": "C:\\Users\\guill\\github\\guidiaz\\witnet-solidity-bridge\\contracts\\interfaces\\IWitPriceFeedsConsumer.sol", "ast": { "absolutePath": "project:/contracts/interfaces/IWitPriceFeedsConsumer.sol", "exportedSymbols": { "IWitPriceFeeds": [ 27848 ], "IWitPriceFeedsConsumer": [ 27992 ], "IWitPriceFeedsTypes": [ 28156 ], "Witnet": [ 40741 ] }, "id": 27993, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 27957, "literals": [ "solidity", "^", "0.8", ".0" ], "nodeType": "PragmaDirective", "src": "35:23:82" }, { "absolutePath": "project:/contracts/interfaces/IWitPriceFeeds.sol", "file": "./IWitPriceFeeds.sol", "id": 27959, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 27993, "sourceUnit": 27849, "src": "62:52:82", "symbolAliases": [ { "foreign": { "id": 27958, "name": "IWitPriceFeeds", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 27848, "src": "70:14:82", "typeDescriptions": {} }, "nameLocation": "-1:-1:-1" } ], "unitAlias": "" }, { "absolutePath": "project:/contracts/interfaces/IWitPriceFeedsTypes.sol", "file": "./IWitPriceFeedsTypes.sol", "id": 27961, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 27993, "sourceUnit": 28157, "src": "116:62:82", "symbolAliases": [ { "foreign": { "id": 27960, "name": "IWitPriceFeedsTypes", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 28156, "src": "124:19:82", "typeDescriptions": {} }, "nameLocation": "-1:-1:-1" } ], "unitAlias": "" }, { "absolutePath": "project:/contracts/libs/Witnet.sol", "file": "../libs/Witnet.sol", "id": 27963, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 27993, "sourceUnit": 40742, "src": "180:42:82", "symbolAliases": [ { "foreign": { "id": 27962, "name": "Witnet", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 40741, "src": "188:6:82", "typeDescriptions": {} }, "nameLocation": "-1:-1:-1" } ], "unitAlias": "" }, { "abstract": false, "baseContracts": [], "canonicalName": "IWitPriceFeedsConsumer", "contractDependencies": [], "contractKind": "interface", "fullyImplemented": false, "id": 27992, "linearizedBaseContracts": [ 27992 ], "name": "IWitPriceFeedsConsumer", "nameLocation": "236:22:82", "nodeType": "ContractDefinition", "nodes": [ { "documentation": { "id": 27964, "nodeType": "StructuredDocumentation", "src": "266:135:82", "text": "Reports a Witnet-verified price feed update.\n @dev It should revert if called from an address other than `witPriceFeeds()`." }, "functionSelector": "525ca072", "id": 27984, "implemented": false, "kind": "function", "modifiers": [], "name": "reportUpdate", "nameLocation": "416:12:82", "nodeType": "FunctionDefinition", "parameters": { "id": 27982, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 27967, "mutability": "mutable", "name": "id4", "nameLocation": "467:3:82", "nodeType": "VariableDeclaration", "scope": 27984, "src": "443:27:82", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_userDefinedValueType$_ID4_$28155", "typeString": "IWitPriceFeedsTypes.ID4" }, "typeName": { "id": 27966, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 27965, "name": "IWitPriceFeedsTypes.ID4", "nameLocations": [ "443:19:82", "463:3:82" ], "nodeType": "IdentifierPath", "referencedDeclaration": 28155, "src": "443:23:82" }, "referencedDeclaration": 28155, "src": "443:23:82", "typeDescriptions": { "typeIdentifier": "t_userDefinedValueType$_ID4_$28155", "typeString": "IWitPriceFeedsTypes.ID4" } }, "visibility": "internal" }, { "constant": false, "id": 27970, "mutability": "mutable", "name": "timestamp", "nameLocation": "503:9:82", "nodeType": "VariableDeclaration", "scope": 27984, "src": "486:26:82", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_userDefinedValueType$_Timestamp_$37157", "typeString": "Witnet.Timestamp" }, "typeName": { "id": 27969, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 27968, "name": "Witnet.Timestamp", "nameLocations": [ "486:6:82", "493:9:82" ], "nodeType": "IdentifierPath", "referencedDeclaration": 37157, "src": "486:16:82" }, "referencedDeclaration": 37157, "src": "486:16:82", "typeDescriptions": { "typeIdentifier": "t_userDefinedValueType$_Timestamp_$37157", "typeString": "Witnet.Timestamp" } }, "visibility": "internal" }, { "constant": false, "id": 27973, "mutability": "mutable", "name": "trail", "nameLocation": "550:5:82", "nodeType": "VariableDeclaration", "scope": 27984, "src": "527:28:82", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_userDefinedValueType$_TransactionHash_$37159", "typeString": "Witnet.TransactionHash" }, "typeName": { "id": 27972, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 27971, "name": "Witnet.TransactionHash", "nameLocations": [ "527:6:82", "534:15:82" ], "nodeType": "IdentifierPath", "referencedDeclaration": 37159, "src": "527:22:82" }, "referencedDeclaration": 37159, "src": "527:22:82", "typeDescriptions": { "typeIdentifier": "t_userDefinedValueType$_TransactionHash_$37159", "typeString": "Witnet.TransactionHash" } }, "visibility": "internal" }, { "constant": false, "id": 27975, "mutability": "mutable", "name": "price", "nameLocation": "577:5:82", "nodeType": "VariableDeclaration", "scope": 27984, "src": "570:12:82", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" }, "typeName": { "id": 27974, "name": "uint64", "nodeType": "ElementaryTypeName", "src": "570:6:82", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" } }, "visibility": "internal" }, { "constant": false, "id": 27977, "mutability": "mutable", "name": "deltaPrice", "nameLocation": "604:10:82", "nodeType": "VariableDeclaration", "scope": 27984, "src": "598:16:82", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int56", "typeString": "int56" }, "typeName": { "id": 27976, "name": "int56", "nodeType": "ElementaryTypeName", "src": "598:5:82", "typeDescriptions": { "typeIdentifier": "t_int56", "typeString": "int56" } }, "visibility": "internal" }, { "constant": false, "id": 27979, "mutability": "mutable", "name": "deltaSecs", "nameLocation": "636:9:82", "nodeType": "VariableDeclaration", "scope": 27984, "src": "629:16:82", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" }, "typeName": { "id": 27978, "name": "uint64", "nodeType": "ElementaryTypeName", "src": "629:6:82", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" } }, "visibility": "internal" }, { "constant": false, "id": 27981, "mutability": "mutable", "name": "exponent", "nameLocation": "665:8:82", "nodeType": "VariableDeclaration", "scope": 27984, "src": "660:13:82", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int8", "typeString": "int8" }, "typeName": { "id": 27980, "name": "int8", "nodeType": "ElementaryTypeName", "src": "660:4:82", "typeDescriptions": { "typeIdentifier": "t_int8", "typeString": "int8" } }, "visibility": "internal" } ], "src": "428:256:82" }, "returnParameters": { "id": 27983, "nodeType": "ParameterList", "parameters": [], "src": "693:0:82" }, "scope": 27992, "src": "407:287:82", "stateMutability": "nonpayable", "virtual": false, "visibility": "external" }, { "documentation": { "id": 27985, "nodeType": "StructuredDocumentation", "src": "702:116:82", "text": "Returns the address of the one and only `IWitPriceFeeds` \n instance that can provide price feed updates." }, "functionSelector": "5f1cf137", "id": 27991, "implemented": false, "kind": "function", "modifiers": [], "name": "witPriceFeeds", "nameLocation": "833:13:82", "nodeType": "FunctionDefinition", "parameters": { "id": 27986, "nodeType": "ParameterList", "parameters": [], "src": "846:2:82" }, "returnParameters": { "id": 27990, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 27989, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 27991, "src": "872:14:82", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_IWitPriceFeeds_$27848", "typeString": "contract IWitPriceFeeds" }, "typeName": { "id": 27988, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 27987, "name": "IWitPriceFeeds", "nameLocations": [ "872:14:82" ], "nodeType": "IdentifierPath", "referencedDeclaration": 27848, "src": "872:14:82" }, "referencedDeclaration": 27848, "src": "872:14:82", "typeDescriptions": { "typeIdentifier": "t_contract$_IWitPriceFeeds_$27848", "typeString": "contract IWitPriceFeeds" } }, "visibility": "internal" } ], "src": "871:16:82" }, "scope": 27992, "src": "824:64:82", "stateMutability": "view", "virtual": false, "visibility": "external" } ], "scope": 27993, "src": "226:665:82", "usedErrors": [], "usedEvents": [] } ], "src": "35:858:82" }, "compiler": { "name": "solc", "version": "0.8.30+commit.73712a01.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.4.16", "updatedAt": "2025-10-15T14:34:45.912Z", "devdoc": { "kind": "dev", "methods": { "reportUpdate(bytes4,uint64,bytes32,uint64,int56,uint64,int8)": { "details": "It should revert if called from an address other than `witPriceFeeds()`." } }, "version": 1 }, "userdoc": { "kind": "user", "methods": { "reportUpdate(bytes4,uint64,bytes32,uint64,int56,uint64,int8)": { "notice": "Reports a Witnet-verified price feed update." }, "witPriceFeeds()": { "notice": "Returns the address of the one and only `IWitPriceFeeds` instance that can provide price feed updates." } }, "version": 1 } }