UNPKG

witnet-solidity-bridge

Version:

Witnet Solidity Bridge contracts for EVM-compatible chains

746 lines 28.7 kB
{ "contractName": "IWitPriceFeedsLegacySolver", "abi": [ { "inputs": [], "name": "class", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "pure", "type": "function" }, { "inputs": [], "name": "delegator", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes4", "name": "feedId", "type": "bytes4" } ], "name": "solve", "outputs": [ { "components": [ { "internalType": "uint64", "name": "value", "type": "uint64" }, { "internalType": "Witnet.Timestamp", "name": "timestamp", "type": "uint64" }, { "internalType": "Witnet.TransactionHash", "name": "drTxHash", "type": "bytes32" }, { "internalType": "enum IWitPriceFeedsLegacySolver.LatestUpdateStatus", "name": "latestStatus", "type": "uint8" } ], "internalType": "struct IWitPriceFeedsLegacySolver.Price", "name": "", "type": "tuple" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "specs", "outputs": [ { "internalType": "bytes4", "name": "", "type": "bytes4" } ], "stateMutability": "pure", "type": "function" }, { "inputs": [ { "internalType": "bytes4", "name": "feedId", "type": "bytes4" }, { "internalType": "string[]", "name": "initdata", "type": "string[]" } ], "name": "validate", "outputs": [], "stateMutability": "nonpayable", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.8.30+commit.73712a01\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"class\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"delegator\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"feedId\",\"type\":\"bytes4\"}],\"name\":\"solve\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"value\",\"type\":\"uint64\"},{\"internalType\":\"Witnet.Timestamp\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"Witnet.TransactionHash\",\"name\":\"drTxHash\",\"type\":\"bytes32\"},{\"internalType\":\"enum IWitPriceFeedsLegacySolver.LatestUpdateStatus\",\"name\":\"latestStatus\",\"type\":\"uint8\"}],\"internalType\":\"struct IWitPriceFeedsLegacySolver.Price\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"specs\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"feedId\",\"type\":\"bytes4\"},{\"internalType\":\"string[]\",\"name\":\"initdata\",\"type\":\"string[]\"}],\"name\":\"validate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"project:/contracts/interfaces/legacy/IWitPriceFeedsLegacySolver.sol\":\"IWitPriceFeedsLegacySolver\"},\"evmVersion\":\"prague\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"project:/contracts/interfaces/legacy/IWitPriceFeedsLegacySolver.sol\":{\"keccak256\":\"0x9543c5a64bbd38a3d1af6d00badda31c8c1fc90412efc7894023277e1e6b7490\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ab133acd1c20af1f676bf17017c77e4918338fdbad764660e42d892a5f412eaf\",\"dweb:/ipfs/QmeQFGuv3jm46R4bux8NaW56SbFWHvvBNCqFzfafgtWi1W\"]},\"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 \"../../libs/Witnet.sol\";\r\n\r\ninterface IWitPriceFeedsLegacySolver {\r\n enum LatestUpdateStatus {\r\n Void,\r\n Awaiting,\r\n Ready,\r\n Error\r\n }\r\n struct Price {\r\n uint64 value;\r\n Witnet.Timestamp timestamp;\r\n Witnet.TransactionHash drTxHash;\r\n LatestUpdateStatus latestStatus;\r\n }\r\n function class() external pure returns (string memory);\r\n function delegator() external view returns (address);\r\n function solve(bytes4 feedId) external view returns (Price memory);\r\n function specs() external pure returns (bytes4);\r\n function validate(bytes4 feedId, string[] calldata initdata) external;\r\n}", "sourcePath": "C:\\Users\\guill\\github\\guidiaz\\witnet-solidity-bridge\\contracts\\interfaces\\legacy\\IWitPriceFeedsLegacySolver.sol", "ast": { "absolutePath": "project:/contracts/interfaces/legacy/IWitPriceFeedsLegacySolver.sol", "exportedSymbols": { "Bech32": [ 31372 ], "IWitPriceFeedsLegacySolver": [ 29521 ], "Secp256k1": [ 32535 ], "Witnet": [ 40741 ], "WitnetBuffer": [ 42631 ], "WitnetCBOR": [ 44174 ] }, "id": 29522, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 29471, "literals": [ "solidity", ">=", "0.8", ".0", "<", "0.9", ".0" ], "nodeType": "PragmaDirective", "src": "35:31:101" }, { "absolutePath": "project:/contracts/libs/Witnet.sol", "file": "../../libs/Witnet.sol", "id": 29472, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 29522, "sourceUnit": 40742, "src": "70:31:101", "symbolAliases": [], "unitAlias": "" }, { "abstract": false, "baseContracts": [], "canonicalName": "IWitPriceFeedsLegacySolver", "contractDependencies": [], "contractKind": "interface", "fullyImplemented": false, "id": 29521, "linearizedBaseContracts": [ 29521 ], "name": "IWitPriceFeedsLegacySolver", "nameLocation": "115:26:101", "nodeType": "ContractDefinition", "nodes": [ { "canonicalName": "IWitPriceFeedsLegacySolver.LatestUpdateStatus", "id": 29477, "members": [ { "id": 29473, "name": "Void", "nameLocation": "184:4:101", "nodeType": "EnumValue", "src": "184:4:101" }, { "id": 29474, "name": "Awaiting", "nameLocation": "199:8:101", "nodeType": "EnumValue", "src": "199:8:101" }, { "id": 29475, "name": "Ready", "nameLocation": "218:5:101", "nodeType": "EnumValue", "src": "218:5:101" }, { "id": 29476, "name": "Error", "nameLocation": "234:5:101", "nodeType": "EnumValue", "src": "234:5:101" } ], "name": "LatestUpdateStatus", "nameLocation": "154:18:101", "nodeType": "EnumDefinition", "src": "149:97:101" }, { "canonicalName": "IWitPriceFeedsLegacySolver.Price", "id": 29489, "members": [ { "constant": false, "id": 29479, "mutability": "mutable", "name": "value", "nameLocation": "283:5:101", "nodeType": "VariableDeclaration", "scope": 29489, "src": "276:12:101", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" }, "typeName": { "id": 29478, "name": "uint64", "nodeType": "ElementaryTypeName", "src": "276:6:101", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" } }, "visibility": "internal" }, { "constant": false, "id": 29482, "mutability": "mutable", "name": "timestamp", "nameLocation": "316:9:101", "nodeType": "VariableDeclaration", "scope": 29489, "src": "299:26:101", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_userDefinedValueType$_Timestamp_$37157", "typeString": "Witnet.Timestamp" }, "typeName": { "id": 29481, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 29480, "name": "Witnet.Timestamp", "nameLocations": [ "299:6:101", "306:9:101" ], "nodeType": "IdentifierPath", "referencedDeclaration": 37157, "src": "299:16:101" }, "referencedDeclaration": 37157, "src": "299:16:101", "typeDescriptions": { "typeIdentifier": "t_userDefinedValueType$_Timestamp_$37157", "typeString": "Witnet.Timestamp" } }, "visibility": "internal" }, { "constant": false, "id": 29485, "mutability": "mutable", "name": "drTxHash", "nameLocation": "359:8:101", "nodeType": "VariableDeclaration", "scope": 29489, "src": "336:31:101", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_userDefinedValueType$_TransactionHash_$37159", "typeString": "Witnet.TransactionHash" }, "typeName": { "id": 29484, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 29483, "name": "Witnet.TransactionHash", "nameLocations": [ "336:6:101", "343:15:101" ], "nodeType": "IdentifierPath", "referencedDeclaration": 37159, "src": "336:22:101" }, "referencedDeclaration": 37159, "src": "336:22:101", "typeDescriptions": { "typeIdentifier": "t_userDefinedValueType$_TransactionHash_$37159", "typeString": "Witnet.TransactionHash" } }, "visibility": "internal" }, { "constant": false, "id": 29488, "mutability": "mutable", "name": "latestStatus", "nameLocation": "397:12:101", "nodeType": "VariableDeclaration", "scope": 29489, "src": "378:31:101", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_enum$_LatestUpdateStatus_$29477", "typeString": "enum IWitPriceFeedsLegacySolver.LatestUpdateStatus" }, "typeName": { "id": 29487, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 29486, "name": "LatestUpdateStatus", "nameLocations": [ "378:18:101" ], "nodeType": "IdentifierPath", "referencedDeclaration": 29477, "src": "378:18:101" }, "referencedDeclaration": 29477, "src": "378:18:101", "typeDescriptions": { "typeIdentifier": "t_enum$_LatestUpdateStatus_$29477", "typeString": "enum IWitPriceFeedsLegacySolver.LatestUpdateStatus" } }, "visibility": "internal" } ], "name": "Price", "nameLocation": "259:5:101", "nodeType": "StructDefinition", "scope": 29521, "src": "252:165:101", "visibility": "public" }, { "functionSelector": "bff852fa", "id": 29494, "implemented": false, "kind": "function", "modifiers": [], "name": "class", "nameLocation": "432:5:101", "nodeType": "FunctionDefinition", "parameters": { "id": 29490, "nodeType": "ParameterList", "parameters": [], "src": "437:2:101" }, "returnParameters": { "id": 29493, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 29492, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 29494, "src": "463:13:101", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 29491, "name": "string", "nodeType": "ElementaryTypeName", "src": "463:6:101", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "visibility": "internal" } ], "src": "462:15:101" }, "scope": 29521, "src": "423:55:101", "stateMutability": "pure", "virtual": false, "visibility": "external" }, { "functionSelector": "ce9b7930", "id": 29499, "implemented": false, "kind": "function", "modifiers": [], "name": "delegator", "nameLocation": "493:9:101", "nodeType": "FunctionDefinition", "parameters": { "id": 29495, "nodeType": "ParameterList", "parameters": [], "src": "502:2:101" }, "returnParameters": { "id": 29498, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 29497, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 29499, "src": "528:7:101", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 29496, "name": "address", "nodeType": "ElementaryTypeName", "src": "528:7:101", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" } ], "src": "527:9:101" }, "scope": 29521, "src": "484:53:101", "stateMutability": "view", "virtual": false, "visibility": "external" }, { "functionSelector": "e0d20f73", "id": 29507, "implemented": false, "kind": "function", "modifiers": [], "name": "solve", "nameLocation": "552:5:101", "nodeType": "FunctionDefinition", "parameters": { "id": 29502, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 29501, "mutability": "mutable", "name": "feedId", "nameLocation": "565:6:101", "nodeType": "VariableDeclaration", "scope": 29507, "src": "558:13:101", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes4", "typeString": "bytes4" }, "typeName": { "id": 29500, "name": "bytes4", "nodeType": "ElementaryTypeName", "src": "558:6:101", "typeDescriptions": { "typeIdentifier": "t_bytes4", "typeString": "bytes4" } }, "visibility": "internal" } ], "src": "557:15:101" }, "returnParameters": { "id": 29506, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 29505, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 29507, "src": "596:12:101", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_struct$_Price_$29489_memory_ptr", "typeString": "struct IWitPriceFeedsLegacySolver.Price" }, "typeName": { "id": 29504, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 29503, "name": "Price", "nameLocations": [ "596:5:101" ], "nodeType": "IdentifierPath", "referencedDeclaration": 29489, "src": "596:5:101" }, "referencedDeclaration": 29489, "src": "596:5:101", "typeDescriptions": { "typeIdentifier": "t_struct$_Price_$29489_storage_ptr", "typeString": "struct IWitPriceFeedsLegacySolver.Price" } }, "visibility": "internal" } ], "src": "595:14:101" }, "scope": 29521, "src": "543:67:101", "stateMutability": "view", "virtual": false, "visibility": "external" }, { "functionSelector": "adb7c3f7", "id": 29512, "implemented": false, "kind": "function", "modifiers": [], "name": "specs", "nameLocation": "625:5:101", "nodeType": "FunctionDefinition", "parameters": { "id": 29508, "nodeType": "ParameterList", "parameters": [], "src": "630:2:101" }, "returnParameters": { "id": 29511, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 29510, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 29512, "src": "656:6:101", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes4", "typeString": "bytes4" }, "typeName": { "id": 29509, "name": "bytes4", "nodeType": "ElementaryTypeName", "src": "656:6:101", "typeDescriptions": { "typeIdentifier": "t_bytes4", "typeString": "bytes4" } }, "visibility": "internal" } ], "src": "655:8:101" }, "scope": 29521, "src": "616:48:101", "stateMutability": "pure", "virtual": false, "visibility": "external" }, { "functionSelector": "e6f87158", "id": 29520, "implemented": false, "kind": "function", "modifiers": [], "name": "validate", "nameLocation": "679:8:101", "nodeType": "FunctionDefinition", "parameters": { "id": 29518, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 29514, "mutability": "mutable", "name": "feedId", "nameLocation": "695:6:101", "nodeType": "VariableDeclaration", "scope": 29520, "src": "688:13:101", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes4", "typeString": "bytes4" }, "typeName": { "id": 29513, "name": "bytes4", "nodeType": "ElementaryTypeName", "src": "688:6:101", "typeDescriptions": { "typeIdentifier": "t_bytes4", "typeString": "bytes4" } }, "visibility": "internal" }, { "constant": false, "id": 29517, "mutability": "mutable", "name": "initdata", "nameLocation": "721:8:101", "nodeType": "VariableDeclaration", "scope": 29520, "src": "703:26:101", "stateVariable": false, "storageLocation": "calldata", "typeDescriptions": { "typeIdentifier": "t_array$_t_string_calldata_ptr_$dyn_calldata_ptr", "typeString": "string[]" }, "typeName": { "baseType": { "id": 29515, "name": "string", "nodeType": "ElementaryTypeName", "src": "703:6:101", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "id": 29516, "nodeType": "ArrayTypeName", "src": "703:8:101", "typeDescriptions": { "typeIdentifier": "t_array$_t_string_storage_$dyn_storage_ptr", "typeString": "string[]" } }, "visibility": "internal" } ], "src": "687:43:101" }, "returnParameters": { "id": 29519, "nodeType": "ParameterList", "parameters": [], "src": "739:0:101" }, "scope": 29521, "src": "670:70:101", "stateMutability": "nonpayable", "virtual": false, "visibility": "external" } ], "scope": 29522, "src": "105:638:101", "usedErrors": [], "usedEvents": [] } ], "src": "35:708:101" }, "compiler": { "name": "solc", "version": "0.8.30+commit.73712a01.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.4.16", "updatedAt": "2025-10-15T14:34:45.933Z", "devdoc": { "kind": "dev", "methods": {}, "version": 1 }, "userdoc": { "kind": "user", "methods": {}, "version": 1 } }