witnet-solidity-bridge
Version:
Witnet Solidity Bridge contracts for EVM-compatible chains
800 lines • 39.5 kB
JSON
{
"contractName": "IWitnetConsumer",
"abi": [
{
"inputs": [
{
"internalType": "uint256",
"name": "witnetQueryId",
"type": "uint256"
},
{
"internalType": "uint64",
"name": "witnetResultTimestamp",
"type": "uint64"
},
{
"internalType": "bytes32",
"name": "witnetResultTallyHash",
"type": "bytes32"
},
{
"internalType": "uint256",
"name": "witnetEvmFinalityBlock",
"type": "uint256"
},
{
"components": [
{
"components": [
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
},
{
"internalType": "uint256",
"name": "cursor",
"type": "uint256"
}
],
"internalType": "struct WitnetBuffer.Buffer",
"name": "buffer",
"type": "tuple"
},
{
"internalType": "uint8",
"name": "initialByte",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "majorType",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "additionalInformation",
"type": "uint8"
},
{
"internalType": "uint64",
"name": "len",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "tag",
"type": "uint64"
}
],
"internalType": "struct WitnetCBOR.CBOR",
"name": "witnetResultCborValue",
"type": "tuple"
}
],
"name": "reportWitnetQueryResult",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "witnetQueryId",
"type": "uint256"
},
{
"internalType": "uint64",
"name": "witnetResultTimestamp",
"type": "uint64"
},
{
"internalType": "bytes32",
"name": "witnetResultTallyHash",
"type": "bytes32"
},
{
"internalType": "uint256",
"name": "witnetEvmFinalityBlock",
"type": "uint256"
},
{
"internalType": "enum Witnet.ResultErrorCodes",
"name": "errorCode",
"type": "uint8"
},
{
"components": [
{
"components": [
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
},
{
"internalType": "uint256",
"name": "cursor",
"type": "uint256"
}
],
"internalType": "struct WitnetBuffer.Buffer",
"name": "buffer",
"type": "tuple"
},
{
"internalType": "uint8",
"name": "initialByte",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "majorType",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "additionalInformation",
"type": "uint8"
},
{
"internalType": "uint64",
"name": "len",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "tag",
"type": "uint64"
}
],
"internalType": "struct WitnetCBOR.CBOR",
"name": "errorArgs",
"type": "tuple"
}
],
"name": "reportWitnetQueryError",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "reportableFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"witnetQueryId\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"witnetResultTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"witnetResultTallyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"witnetEvmFinalityBlock\",\"type\":\"uint256\"},{\"internalType\":\"enum Witnet.ResultErrorCodes\",\"name\":\"errorCode\",\"type\":\"uint8\"},{\"components\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"cursor\",\"type\":\"uint256\"}],\"internalType\":\"struct WitnetBuffer.Buffer\",\"name\":\"buffer\",\"type\":\"tuple\"},{\"internalType\":\"uint8\",\"name\":\"initialByte\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"majorType\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"additionalInformation\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"len\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"tag\",\"type\":\"uint64\"}],\"internalType\":\"struct WitnetCBOR.CBOR\",\"name\":\"errorArgs\",\"type\":\"tuple\"}],\"name\":\"reportWitnetQueryError\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"witnetQueryId\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"witnetResultTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"witnetResultTallyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"witnetEvmFinalityBlock\",\"type\":\"uint256\"},{\"components\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"cursor\",\"type\":\"uint256\"}],\"internalType\":\"struct WitnetBuffer.Buffer\",\"name\":\"buffer\",\"type\":\"tuple\"},{\"internalType\":\"uint8\",\"name\":\"initialByte\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"majorType\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"additionalInformation\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"len\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"tag\",\"type\":\"uint64\"}],\"internalType\":\"struct WitnetCBOR.CBOR\",\"name\":\"witnetResultCborValue\",\"type\":\"tuple\"}],\"name\":\"reportWitnetQueryResult\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"reportableFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"reportWitnetQueryError(uint256,uint64,bytes32,uint256,uint8,((bytes,uint256),uint8,uint8,uint8,uint64,uint64))\":{\"details\":\"It should revert if called from any other address different to the WitnetOracle being usedby the WitnetConsumer contract. \",\"params\":{\"errorArgs\":\"Error arguments, if any. An empty buffer is to be passed if no error arguments apply.\",\"errorCode\":\"The error code enum identifying the error produced during resolution on the Witnet blockchain.\",\"witnetEvmFinalityBlock\":\"EVM block at which the provided data can be considered to be final.\",\"witnetQueryId\":\"The unique identifier of the Witnet query being reported.\",\"witnetResultTallyHash\":\"Hash of the commit/reveal witnessing act that took place in the Witnet blockahin.\",\"witnetResultTimestamp\":\"Timestamp at which the reported value was captured by the Witnet blockchain. \"}},\"reportWitnetQueryResult(uint256,uint64,bytes32,uint256,((bytes,uint256),uint8,uint8,uint8,uint64,uint64))\":{\"details\":\"It should revert if called from any other address different to the WitnetOracle being usedby the WitnetConsumer contract. \",\"params\":{\"witnetEvmFinalityBlock\":\"EVM block at which the provided data can be considered to be final.\",\"witnetQueryId\":\"The unique identifier of the Witnet query being reported.\",\"witnetResultCborValue\":\"The CBOR-encoded resulting value of the Witnet query being reported.\",\"witnetResultTallyHash\":\"Hash of the commit/reveal witnessing act that took place in the Witnet blockahin.\",\"witnetResultTimestamp\":\"Timestamp at which the reported value was captured by the Witnet blockchain. \"}},\"reportableFrom(address)\":{\"details\":\"In practice, must only be true on the WitnetOracle address that's being used bythe WitnetConsumer to post queries. \"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"reportWitnetQueryError(uint256,uint64,bytes32,uint256,uint8,((bytes,uint256),uint8,uint8,uint8,uint64,uint64))\":{\"notice\":\"Method to be called from the WitnetOracle contract as soon as the given Witnet `queryId`gets reported, if reported WITH errors.\"},\"reportWitnetQueryResult(uint256,uint64,bytes32,uint256,((bytes,uint256),uint8,uint8,uint8,uint64,uint64))\":{\"notice\":\"Method to be called from the WitnetOracle contract as soon as the given Witnet `queryId`gets reported, if reported with no errors.\"},\"reportableFrom(address)\":{\"notice\":\"Determines if Witnet queries can be reported from given address.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"project:/contracts/interfaces/IWitnetConsumer.sol\":\"IWitnetConsumer\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"project:/contracts/interfaces/IWitnetConsumer.sol\":{\"keccak256\":\"0xf90fbcf0a59428c0ac13a3903214656060a95175adfdef8c11a7e16675b849e0\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c2606640d3f343051ea18dfb8e136dfdb73ceecd8016c82ddb73d67ad39a30e0\",\"dweb:/ipfs/QmTADVW4M8pge6pGfenFAauEDk4yZEy78o5ksZiKGwP3DT\"]},\"project:/contracts/libs/Witnet.sol\":{\"keccak256\":\"0x65a87375dd79d63a83fb454b7199b6c999bd59c50b3b59d521c5c4d45a7d3cc3\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ca865b681d810c2fc5c3672ea6343c3bdf6fd71764ab824d25994744dc85866b\",\"dweb:/ipfs/QmPGcP3xGTNZfsQ9GSKdujNLRVs8dWDdubyUko1rbQqJNv\"]},\"project:/contracts/libs/WitnetBuffer.sol\":{\"keccak256\":\"0xa14570492eb5a313ddbacae0185c850ec99c67211eb33989a5e21d31bf06a150\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://e83c11edb49cab6a767c0b685825bc22ece0d3d2897e0d54fe1923df5cc76ba5\",\"dweb:/ipfs/QmdLDgCc3tnKbgRrXwfNzsg6uUDirNmjvBB8V3iMmnD69a\"]},\"project:/contracts/libs/WitnetCBOR.sol\":{\"keccak256\":\"0xb346547ff731163beea2c657c52675cdf7936691d566a76a045577cf9c34ade0\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6d4b5b6424a033584b41f1204d635db98fda9ca9bd2a614c9d82539a3e4e6529\",\"dweb:/ipfs/QmW6Qy3wWpzHSECYaCPaf9LWGfPqWDKVoP2kPSNNQu7LMQ\"]}},\"version\":1}",
"bytecode": "0x",
"deployedBytecode": "0x",
"immutableReferences": {},
"generatedSources": [],
"deployedGeneratedSources": [],
"sourceMap": "",
"deployedSourceMap": "",
"source": "// SPDX-License-Identifier: MIT\r\npragma solidity ^0.8.0;\r\n\r\nimport \"../libs/Witnet.sol\";\r\n\r\ninterface IWitnetConsumer {\r\n\r\n /// @notice Method to be called from the WitnetOracle contract as soon as the given Witnet `queryId`\r\n /// @notice gets reported, if reported with no errors.\r\n /// @dev It should revert if called from any other address different to the WitnetOracle being used\r\n /// @dev by the WitnetConsumer contract. \r\n /// @param witnetQueryId The unique identifier of the Witnet query being reported.\r\n /// @param witnetResultTallyHash Hash of the commit/reveal witnessing act that took place in the Witnet blockahin.\r\n /// @param witnetResultTimestamp Timestamp at which the reported value was captured by the Witnet blockchain. \r\n /// @param witnetEvmFinalityBlock EVM block at which the provided data can be considered to be final.\r\n /// @param witnetResultCborValue The CBOR-encoded resulting value of the Witnet query being reported.\r\n function reportWitnetQueryResult(\r\n uint256 witnetQueryId, \r\n uint64 witnetResultTimestamp,\r\n bytes32 witnetResultTallyHash,\r\n uint256 witnetEvmFinalityBlock,\r\n WitnetCBOR.CBOR calldata witnetResultCborValue\r\n ) external;\r\n\r\n /// @notice Method to be called from the WitnetOracle contract as soon as the given Witnet `queryId`\r\n /// @notice gets reported, if reported WITH errors.\r\n /// @dev It should revert if called from any other address different to the WitnetOracle being used\r\n /// @dev by the WitnetConsumer contract. \r\n /// @param witnetQueryId The unique identifier of the Witnet query being reported.\r\n /// @param witnetResultTallyHash Hash of the commit/reveal witnessing act that took place in the Witnet blockahin.\r\n /// @param witnetResultTimestamp Timestamp at which the reported value was captured by the Witnet blockchain. \r\n /// @param witnetEvmFinalityBlock EVM block at which the provided data can be considered to be final.\r\n /// @param errorCode The error code enum identifying the error produced during resolution on the Witnet blockchain.\r\n /// @param errorArgs Error arguments, if any. An empty buffer is to be passed if no error arguments apply.\r\n function reportWitnetQueryError(\r\n uint256 witnetQueryId, \r\n uint64 witnetResultTimestamp,\r\n bytes32 witnetResultTallyHash,\r\n uint256 witnetEvmFinalityBlock,\r\n Witnet.ResultErrorCodes errorCode, \r\n WitnetCBOR.CBOR calldata errorArgs\r\n ) external;\r\n\r\n /// @notice Determines if Witnet queries can be reported from given address.\r\n /// @dev In practice, must only be true on the WitnetOracle address that's being used by\r\n /// @dev the WitnetConsumer to post queries. \r\n function reportableFrom(address) external view returns (bool);\r\n}",
"sourcePath": "C:\\Users\\guill\\github\\witnet\\witnet-solidity-bridge\\contracts\\interfaces\\IWitnetConsumer.sol",
"ast": {
"absolutePath": "project:/contracts/interfaces/IWitnetConsumer.sol",
"exportedSymbols": {
"IWitnetConsumer": [
12829
],
"Witnet": [
17557
],
"WitnetBuffer": [
19191
],
"WitnetCBOR": [
20734
]
},
"id": 12830,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 12786,
"literals": [
"solidity",
"^",
"0.8",
".0"
],
"nodeType": "PragmaDirective",
"src": "33:23:46"
},
{
"absolutePath": "project:/contracts/libs/Witnet.sol",
"file": "../libs/Witnet.sol",
"id": 12787,
"nameLocation": "-1:-1:-1",
"nodeType": "ImportDirective",
"scope": 12830,
"sourceUnit": 17558,
"src": "60:28:46",
"symbolAliases": [],
"unitAlias": ""
},
{
"abstract": false,
"baseContracts": [],
"canonicalName": "IWitnetConsumer",
"contractDependencies": [],
"contractKind": "interface",
"fullyImplemented": false,
"id": 12829,
"linearizedBaseContracts": [
12829
],
"name": "IWitnetConsumer",
"nameLocation": "102:15:46",
"nodeType": "ContractDefinition",
"nodes": [
{
"documentation": {
"id": 12788,
"nodeType": "StructuredDocumentation",
"src": "127:850:46",
"text": "@notice Method to be called from the WitnetOracle contract as soon as the given Witnet `queryId`\n @notice gets reported, if reported with no errors.\n @dev It should revert if called from any other address different to the WitnetOracle being used\n @dev by the WitnetConsumer contract. \n @param witnetQueryId The unique identifier of the Witnet query being reported.\n @param witnetResultTallyHash Hash of the commit/reveal witnessing act that took place in the Witnet blockahin.\n @param witnetResultTimestamp Timestamp at which the reported value was captured by the Witnet blockchain. \n @param witnetEvmFinalityBlock EVM block at which the provided data can be considered to be final.\n @param witnetResultCborValue The CBOR-encoded resulting value of the Witnet query being reported."
},
"functionSelector": "bcc6307b",
"id": 12802,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "reportWitnetQueryResult",
"nameLocation": "992:23:46",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 12800,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 12790,
"mutability": "mutable",
"name": "witnetQueryId",
"nameLocation": "1038:13:46",
"nodeType": "VariableDeclaration",
"scope": 12802,
"src": "1030:21:46",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 12789,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1030:7:46",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 12792,
"mutability": "mutable",
"name": "witnetResultTimestamp",
"nameLocation": "1075:21:46",
"nodeType": "VariableDeclaration",
"scope": 12802,
"src": "1067:29:46",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint64",
"typeString": "uint64"
},
"typeName": {
"id": 12791,
"name": "uint64",
"nodeType": "ElementaryTypeName",
"src": "1067:6:46",
"typeDescriptions": {
"typeIdentifier": "t_uint64",
"typeString": "uint64"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 12794,
"mutability": "mutable",
"name": "witnetResultTallyHash",
"nameLocation": "1119:21:46",
"nodeType": "VariableDeclaration",
"scope": 12802,
"src": "1111:29:46",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 12793,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "1111:7:46",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 12796,
"mutability": "mutable",
"name": "witnetEvmFinalityBlock",
"nameLocation": "1163:22:46",
"nodeType": "VariableDeclaration",
"scope": 12802,
"src": "1155:30:46",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 12795,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1155:7:46",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 12799,
"mutability": "mutable",
"name": "witnetResultCborValue",
"nameLocation": "1225:21:46",
"nodeType": "VariableDeclaration",
"scope": 12802,
"src": "1200:46:46",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_struct$_CBOR_$19218_calldata_ptr",
"typeString": "struct WitnetCBOR.CBOR"
},
"typeName": {
"id": 12798,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 12797,
"name": "WitnetCBOR.CBOR",
"nameLocations": [
"1200:10:46",
"1211:4:46"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 19218,
"src": "1200:15:46"
},
"referencedDeclaration": 19218,
"src": "1200:15:46",
"typeDescriptions": {
"typeIdentifier": "t_struct$_CBOR_$19218_storage_ptr",
"typeString": "struct WitnetCBOR.CBOR"
}
},
"visibility": "internal"
}
],
"src": "1015:242:46"
},
"returnParameters": {
"id": 12801,
"nodeType": "ParameterList",
"parameters": [],
"src": "1266:0:46"
},
"scope": 12829,
"src": "983:284:46",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "external"
},
{
"documentation": {
"id": 12803,
"nodeType": "StructuredDocumentation",
"src": "1275:973:46",
"text": "@notice Method to be called from the WitnetOracle contract as soon as the given Witnet `queryId`\n @notice gets reported, if reported WITH errors.\n @dev It should revert if called from any other address different to the WitnetOracle being used\n @dev by the WitnetConsumer contract. \n @param witnetQueryId The unique identifier of the Witnet query being reported.\n @param witnetResultTallyHash Hash of the commit/reveal witnessing act that took place in the Witnet blockahin.\n @param witnetResultTimestamp Timestamp at which the reported value was captured by the Witnet blockchain. \n @param witnetEvmFinalityBlock EVM block at which the provided data can be considered to be final.\n @param errorCode The error code enum identifying the error produced during resolution on the Witnet blockchain.\n @param errorArgs Error arguments, if any. An empty buffer is to be passed if no error arguments apply."
},
"functionSelector": "63febc9c",
"id": 12820,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "reportWitnetQueryError",
"nameLocation": "2263:22:46",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 12818,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 12805,
"mutability": "mutable",
"name": "witnetQueryId",
"nameLocation": "2308:13:46",
"nodeType": "VariableDeclaration",
"scope": 12820,
"src": "2300:21:46",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 12804,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2300:7:46",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 12807,
"mutability": "mutable",
"name": "witnetResultTimestamp",
"nameLocation": "2345:21:46",
"nodeType": "VariableDeclaration",
"scope": 12820,
"src": "2337:29:46",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint64",
"typeString": "uint64"
},
"typeName": {
"id": 12806,
"name": "uint64",
"nodeType": "ElementaryTypeName",
"src": "2337:6:46",
"typeDescriptions": {
"typeIdentifier": "t_uint64",
"typeString": "uint64"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 12809,
"mutability": "mutable",
"name": "witnetResultTallyHash",
"nameLocation": "2389:21:46",
"nodeType": "VariableDeclaration",
"scope": 12820,
"src": "2381:29:46",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 12808,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "2381:7:46",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 12811,
"mutability": "mutable",
"name": "witnetEvmFinalityBlock",
"nameLocation": "2433:22:46",
"nodeType": "VariableDeclaration",
"scope": 12820,
"src": "2425:30:46",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 12810,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2425:7:46",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 12814,
"mutability": "mutable",
"name": "errorCode",
"nameLocation": "2494:9:46",
"nodeType": "VariableDeclaration",
"scope": 12820,
"src": "2470:33:46",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_enum$_ResultErrorCodes_$16311",
"typeString": "enum Witnet.ResultErrorCodes"
},
"typeName": {
"id": 12813,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 12812,
"name": "Witnet.ResultErrorCodes",
"nameLocations": [
"2470:6:46",
"2477:16:46"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 16311,
"src": "2470:23:46"
},
"referencedDeclaration": 16311,
"src": "2470:23:46",
"typeDescriptions": {
"typeIdentifier": "t_enum$_ResultErrorCodes_$16311",
"typeString": "enum Witnet.ResultErrorCodes"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 12817,
"mutability": "mutable",
"name": "errorArgs",
"nameLocation": "2544:9:46",
"nodeType": "VariableDeclaration",
"scope": 12820,
"src": "2519:34:46",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_struct$_CBOR_$19218_calldata_ptr",
"typeString": "struct WitnetCBOR.CBOR"
},
"typeName": {
"id": 12816,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 12815,
"name": "WitnetCBOR.CBOR",
"nameLocations": [
"2519:10:46",
"2530:4:46"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 19218,
"src": "2519:15:46"
},
"referencedDeclaration": 19218,
"src": "2519:15:46",
"typeDescriptions": {
"typeIdentifier": "t_struct$_CBOR_$19218_storage_ptr",
"typeString": "struct WitnetCBOR.CBOR"
}
},
"visibility": "internal"
}
],
"src": "2285:279:46"
},
"returnParameters": {
"id": 12819,
"nodeType": "ParameterList",
"parameters": [],
"src": "2573:0:46"
},
"scope": 12829,
"src": "2254:320:46",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "external"
},
{
"documentation": {
"id": 12821,
"nodeType": "StructuredDocumentation",
"src": "2582:221:46",
"text": "@notice Determines if Witnet queries can be reported from given address.\n @dev In practice, must only be true on the WitnetOracle address that's being used by\n @dev the WitnetConsumer to post queries. "
},
"functionSelector": "47a10e56",
"id": 12828,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "reportableFrom",
"nameLocation": "2818:14:46",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 12824,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 12823,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 12828,
"src": "2833:7:46",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 12822,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2833:7:46",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
}
],
"src": "2832:9:46"
},
"returnParameters": {
"id": 12827,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 12826,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 12828,
"src": "2865:4:46",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 12825,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "2865:4:46",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"visibility": "internal"
}
],
"src": "2864:6:46"
},
"scope": 12829,
"src": "2809:62:46",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
}
],
"scope": 12830,
"src": "92:2782:46",
"usedErrors": [],
"usedEvents": []
}
],
"src": "33:2841:46"
},
"compiler": {
"name": "solc",
"version": "0.8.25+commit.b61c2a91.Emscripten.clang"
},
"networks": {},
"schemaVersion": "3.4.16",
"updatedAt": "2024-12-05T09:36:04.495Z",
"devdoc": {
"kind": "dev",
"methods": {
"reportWitnetQueryError(uint256,uint64,bytes32,uint256,uint8,((bytes,uint256),uint8,uint8,uint8,uint64,uint64))": {
"details": "It should revert if called from any other address different to the WitnetOracle being usedby the WitnetConsumer contract. ",
"params": {
"errorArgs": "Error arguments, if any. An empty buffer is to be passed if no error arguments apply.",
"errorCode": "The error code enum identifying the error produced during resolution on the Witnet blockchain.",
"witnetEvmFinalityBlock": "EVM block at which the provided data can be considered to be final.",
"witnetQueryId": "The unique identifier of the Witnet query being reported.",
"witnetResultTallyHash": "Hash of the commit/reveal witnessing act that took place in the Witnet blockahin.",
"witnetResultTimestamp": "Timestamp at which the reported value was captured by the Witnet blockchain. "
}
},
"reportWitnetQueryResult(uint256,uint64,bytes32,uint256,((bytes,uint256),uint8,uint8,uint8,uint64,uint64))": {
"details": "It should revert if called from any other address different to the WitnetOracle being usedby the WitnetConsumer contract. ",
"params": {
"witnetEvmFinalityBlock": "EVM block at which the provided data can be considered to be final.",
"witnetQueryId": "The unique identifier of the Witnet query being reported.",
"witnetResultCborValue": "The CBOR-encoded resulting value of the Witnet query being reported.",
"witnetResultTallyHash": "Hash of the commit/reveal witnessing act that took place in the Witnet blockahin.",
"witnetResultTimestamp": "Timestamp at which the reported value was captured by the Witnet blockchain. "
}
},
"reportableFrom(address)": {
"details": "In practice, must only be true on the WitnetOracle address that's being used bythe WitnetConsumer to post queries. "
}
},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {
"reportWitnetQueryError(uint256,uint64,bytes32,uint256,uint8,((bytes,uint256),uint8,uint8,uint8,uint64,uint64))": {
"notice": "Method to be called from the WitnetOracle contract as soon as the given Witnet `queryId`gets reported, if reported WITH errors."
},
"reportWitnetQueryResult(uint256,uint64,bytes32,uint256,((bytes,uint256),uint8,uint8,uint8,uint64,uint64))": {
"notice": "Method to be called from the WitnetOracle contract as soon as the given Witnet `queryId`gets reported, if reported with no errors."
},
"reportableFrom(address)": {
"notice": "Determines if Witnet queries can be reported from given address."
}
},
"version": 1
}
}