UNPKG

witnet-solidity-bridge

Version:

Witnet Solidity Bridge contracts for EVM-compatible chains

1,112 lines 130 kB
{ "contractName": "IWitOracleLegacy", "abi": [ { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "id", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "evmReward", "type": "uint256" }, { "components": [ { "internalType": "uint8", "name": "numWitnesses", "type": "uint8" }, { "internalType": "uint64", "name": "witnessReward", "type": "uint64" } ], "indexed": false, "internalType": "struct IWitOracleLegacy.RadonSLA", "name": "witnetSLA", "type": "tuple" } ], "name": "WitnetQuery", "type": "event" }, { "inputs": [ { "internalType": "uint256", "name": "gasPrice", "type": "uint256" }, { "internalType": "uint16", "name": "resultMaxSize", "type": "uint16" } ], "name": "estimateBaseFee", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "gasPrice", "type": "uint256" }, { "internalType": "bytes32", "name": "radHash", "type": "bytes32" } ], "name": "estimateBaseFee", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "name": "getQuery", "outputs": [ { "components": [ { "components": [ { "internalType": "address", "name": "requester", "type": "address" }, { "internalType": "uint24", "name": "callbackGas", "type": "uint24" }, { "internalType": "uint72", "name": "evmReward", "type": "uint72" }, { "internalType": "bytes", "name": "radonBytecode", "type": "bytes" }, { "internalType": "bytes32", "name": "radonHash", "type": "bytes32" }, { "components": [ { "internalType": "uint8", "name": "numWitnesses", "type": "uint8" }, { "internalType": "uint64", "name": "witnessReward", "type": "uint64" } ], "internalType": "struct IWitOracleLegacy.RadonSLA", "name": "radonParams", "type": "tuple" } ], "internalType": "struct IWitOracleLegacy.QueryRequest", "name": "request", "type": "tuple" }, { "components": [ { "internalType": "address", "name": "reporter", "type": "address" }, { "internalType": "uint64", "name": "finality", "type": "uint64" }, { "internalType": "uint32", "name": "timestamp", "type": "uint32" }, { "internalType": "bytes32", "name": "trail", "type": "bytes32" }, { "internalType": "bytes", "name": "cborBytes", "type": "bytes" } ], "internalType": "struct IWitOracleLegacy.QueryResponse", "name": "response", "type": "tuple" } ], "internalType": "struct IWitOracleLegacy.Query", "name": "", "type": "tuple" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "name": "getQueryRequest", "outputs": [ { "components": [ { "internalType": "address", "name": "requester", "type": "address" }, { "internalType": "uint24", "name": "callbackGas", "type": "uint24" }, { "internalType": "uint72", "name": "evmReward", "type": "uint72" }, { "internalType": "bytes", "name": "radonBytecode", "type": "bytes" }, { "internalType": "bytes32", "name": "radonHash", "type": "bytes32" }, { "components": [ { "internalType": "uint8", "name": "numWitnesses", "type": "uint8" }, { "internalType": "uint64", "name": "witnessReward", "type": "uint64" } ], "internalType": "struct IWitOracleLegacy.RadonSLA", "name": "radonParams", "type": "tuple" } ], "internalType": "struct IWitOracleLegacy.QueryRequest", "name": "", "type": "tuple" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "name": "getQueryResponse", "outputs": [ { "components": [ { "internalType": "address", "name": "reporter", "type": "address" }, { "internalType": "uint64", "name": "finality", "type": "uint64" }, { "internalType": "uint32", "name": "timestamp", "type": "uint32" }, { "internalType": "bytes32", "name": "trail", "type": "bytes32" }, { "internalType": "bytes", "name": "cborBytes", "type": "bytes" } ], "internalType": "struct IWitOracleLegacy.QueryResponse", "name": "", "type": "tuple" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "name": "getQueryResponseStatus", "outputs": [ { "internalType": "enum IWitOracleLegacy.QueryResponseStatus", "name": "", "type": "uint8" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "name": "getQueryResultCborBytes", "outputs": [ { "internalType": "bytes", "name": "", "type": "bytes" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "name": "getQueryResultError", "outputs": [ { "components": [ { "internalType": "uint8", "name": "code", "type": "uint8" }, { "internalType": "string", "name": "reason", "type": "string" } ], "internalType": "struct IWitOracleLegacy.ResultError", "name": "", "type": "tuple" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256[]", "name": "queryIds", "type": "uint256[]" } ], "name": "extractWitnetDataRequests", "outputs": [ { "internalType": "bytes[]", "name": "", "type": "bytes[]" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "queryId", "type": "uint256" } ], "name": "fetchQueryResponse", "outputs": [ { "internalType": "bytes", "name": "", "type": "bytes" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" }, { "components": [ { "internalType": "uint8", "name": "numWitnesses", "type": "uint8" }, { "internalType": "uint64", "name": "witnessReward", "type": "uint64" } ], "internalType": "struct IWitOracleLegacy.RadonSLA", "name": "", "type": "tuple" } ], "name": "postRequest", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" }, { "components": [ { "internalType": "uint8", "name": "numWitnesses", "type": "uint8" }, { "internalType": "uint64", "name": "witnessReward", "type": "uint64" } ], "internalType": "struct IWitOracleLegacy.RadonSLA", "name": "", "type": "tuple" }, { "internalType": "uint24", "name": "", "type": "uint24" } ], "name": "postRequestWithCallback", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "bytes32", "name": "", "type": "bytes32" }, { "internalType": "bytes", "name": "", "type": "bytes" } ], "name": "reportResult", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "uint32", "name": "", "type": "uint32" }, { "internalType": "bytes32", "name": "", "type": "bytes32" }, { "internalType": "bytes", "name": "", "type": "bytes" } ], "name": "reportResult", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "queryId", "type": "uint256" }, { "internalType": "uint32", "name": "resultTimestamp", "type": "uint32" }, { "internalType": "bytes32", "name": "drTxHash", "type": "bytes32" }, { "internalType": "bytes", "name": "resultCborBytes", "type": "bytes" } ], "internalType": "struct IWitOracleLegacy.BatchResultLegacy[]", "name": "", "type": "tuple[]" } ], "name": "reportResultBatch", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.8.30+commit.73712a01\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"evmReward\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"numWitnesses\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"witnessReward\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"struct IWitOracleLegacy.RadonSLA\",\"name\":\"witnetSLA\",\"type\":\"tuple\"}],\"name\":\"WitnetQuery\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"gasPrice\",\"type\":\"uint256\"},{\"internalType\":\"uint16\",\"name\":\"resultMaxSize\",\"type\":\"uint16\"}],\"name\":\"estimateBaseFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"gasPrice\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"radHash\",\"type\":\"bytes32\"}],\"name\":\"estimateBaseFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"queryIds\",\"type\":\"uint256[]\"}],\"name\":\"extractWitnetDataRequests\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"\",\"type\":\"bytes[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"queryId\",\"type\":\"uint256\"}],\"name\":\"fetchQueryResponse\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"getQuery\",\"outputs\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"callbackGas\",\"type\":\"uint24\"},{\"internalType\":\"uint72\",\"name\":\"evmReward\",\"type\":\"uint72\"},{\"internalType\":\"bytes\",\"name\":\"radonBytecode\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"radonHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"numWitnesses\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"witnessReward\",\"type\":\"uint64\"}],\"internalType\":\"struct IWitOracleLegacy.RadonSLA\",\"name\":\"radonParams\",\"type\":\"tuple\"}],\"internalType\":\"struct IWitOracleLegacy.QueryRequest\",\"name\":\"request\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"reporter\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"finality\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"trail\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"cborBytes\",\"type\":\"bytes\"}],\"internalType\":\"struct IWitOracleLegacy.QueryResponse\",\"name\":\"response\",\"type\":\"tuple\"}],\"internalType\":\"struct IWitOracleLegacy.Query\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"getQueryRequest\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"callbackGas\",\"type\":\"uint24\"},{\"internalType\":\"uint72\",\"name\":\"evmReward\",\"type\":\"uint72\"},{\"internalType\":\"bytes\",\"name\":\"radonBytecode\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"radonHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"numWitnesses\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"witnessReward\",\"type\":\"uint64\"}],\"internalType\":\"struct IWitOracleLegacy.RadonSLA\",\"name\":\"radonParams\",\"type\":\"tuple\"}],\"internalType\":\"struct IWitOracleLegacy.QueryRequest\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"getQueryResponse\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"reporter\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"finality\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"trail\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"cborBytes\",\"type\":\"bytes\"}],\"internalType\":\"struct IWitOracleLegacy.QueryResponse\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"getQueryResponseStatus\",\"outputs\":[{\"internalType\":\"enum IWitOracleLegacy.QueryResponseStatus\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"getQueryResultCborBytes\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"getQueryResultError\",\"outputs\":[{\"components\":[{\"internalType\":\"uint8\",\"name\":\"code\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"internalType\":\"struct IWitOracleLegacy.ResultError\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"numWitnesses\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"witnessReward\",\"type\":\"uint64\"}],\"internalType\":\"struct IWitOracleLegacy.RadonSLA\",\"name\":\"\",\"type\":\"tuple\"}],\"name\":\"postRequest\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"numWitnesses\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"witnessReward\",\"type\":\"uint64\"}],\"internalType\":\"struct IWitOracleLegacy.RadonSLA\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"uint24\",\"name\":\"\",\"type\":\"uint24\"}],\"name\":\"postRequestWithCallback\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"reportResult\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"reportResult\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"queryId\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"resultTimestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"drTxHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"resultCborBytes\",\"type\":\"bytes\"}],\"internalType\":\"struct IWitOracleLegacy.BatchResultLegacy[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"name\":\"reportResultBatch\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"estimateBaseFee(uint256,bytes32)\":{\"details\":\"Fails if the RAD hash was not previously verified on the WitOracleRadonRegistry registry.\",\"params\":{\"gasPrice\":\"Expected gas price to pay upon posting the data request.\",\"radHash\":\"The RAD hash of the data request to be solved by Witnet.\"}},\"estimateBaseFee(uint256,uint16)\":{\"details\":\"Underestimates if the size of returned data is greater than `resultMaxSize`. \",\"params\":{\"gasPrice\":\"Expected gas price to pay upon posting the data request.\",\"resultMaxSize\":\"Maximum expected size of returned data (in bytes). \"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"estimateBaseFee(uint256,bytes32)\":{\"notice\":\"Estimate the minimum reward required for posting a data request.\"},\"estimateBaseFee(uint256,uint16)\":{\"notice\":\"Estimate the minimum reward required for posting a data request.\"},\"getQueryResponseStatus(uint256)\":{\"notice\":\"Returns query's result current status from a requester's point of view:- 0 => Void: the query is either non-existent or deleted;- 1 => Awaiting: the query has not yet been reported;- 2 => Ready: the query response was finalized, and contains a result with no erros.- 3 => Error: the query response was finalized, and contains a result with errors.- 4 => Finalizing: some result to the query has been reported, but cannot yet be considered finalized.- 5 => Delivered: at least one response, either successful or with errors, was delivered to the requesting contract.\"},\"getQueryResultCborBytes(uint256)\":{\"notice\":\"Retrieves the CBOR-encoded buffer containing the Witnet-provided result to the given query.\"},\"getQueryResultError(uint256)\":{\"notice\":\"Gets error code identifying some possible failure on the resolution of the given query.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"project:/contracts/interfaces/legacy/IWitOracleLegacy.sol\":\"IWitOracleLegacy\"},\"evmVersion\":\"prague\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"project:/contracts/interfaces/IWitOracleRadonRegistry.sol\":{\"keccak256\":\"0x437bbb89129311bd1cc8f6becd333df46109ec53b24d3159be942b225614071f\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ef9bcdf4a73cb126885478c994821b7fe2b87d9221b767b4c9342b89b0d6550a\",\"dweb:/ipfs/QmXzZXPMxjSiFpcEnhg6CjLFNxGCpDZt22xpUh7VHxNTGd\"]},\"project:/contracts/interfaces/legacy/IWitOracleLegacy.sol\":{\"keccak256\":\"0xd2929c9aa5a02d261d6d1a068a6b7231ae58d8f81f081ba89f2d3267a31fbbb5\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://956b26323a02cf400c32012586954fc5dbc98b4d5b7a8b0533401cbda8619059\",\"dweb:/ipfs/QmSWdCRwL5t3atFM8osdaohLTqEEmY1FbnR6xrRCmw1GDM\"]},\"project:/contracts/interfaces/legacy/IWitOracleRequest.sol\":{\"keccak256\":\"0x0fb3f0ba03f4f7a0214ecb36df26525564cf51a8a2176cba92c185af8a1d419e\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://340b7bdb92c3259519fe120eb3061b393e7a5e9c1b576a2fe4eab020af466b64\",\"dweb:/ipfs/QmRt4wMX9WdxFwfdFMUZ3zKMAW1grS7qLk1x1PDMJdEAVU\"]},\"project:/contracts/interfaces/legacy/IWitOracleRequestTemplate.sol\":{\"keccak256\":\"0x9e065ef5880c64eefff5fcfb1347fde6684e0e311f8c2350a6aefdbd1f8b0f22\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://817de760c7cce9d00dcd4312aea6434d88abddf1c0e68ea7e8fb1e6c5165a445\",\"dweb:/ipfs/QmUNmtn85nFXbje2nRJQY2h65KJCVinDMMU6P2jQmo1Nij\"]},\"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 \"../IWitOracleRadonRegistry.sol\";\r\nimport \"./IWitOracleRequest.sol\";\r\nimport \"./IWitOracleRequestTemplate.sol\";\r\n\r\ninterface IWitOracleLegacy {\r\n\r\n struct Query {\r\n QueryRequest request;\r\n QueryResponse response;\r\n }\r\n\r\n struct QueryRequest {\r\n address requester;\r\n uint24 callbackGas;\r\n uint72 evmReward;\r\n bytes radonBytecode;\r\n bytes32 radonHash;\r\n RadonSLA radonParams;\r\n }\r\n\r\n struct QueryResponse {\r\n address reporter;\r\n uint64 finality;\r\n uint32 timestamp;\r\n bytes32 trail;\r\n bytes cborBytes;\r\n }\r\n\r\n struct RadonSLA {\r\n uint8 numWitnesses;\r\n uint64 witnessReward;\r\n }\r\n\r\n event WitnetQuery(uint256 id, uint256 evmReward, RadonSLA witnetSLA);\r\n\r\n /// @notice Estimate the minimum reward required for posting a data request.\r\n /// @dev Underestimates if the size of returned data is greater than `resultMaxSize`. \r\n /// @param gasPrice Expected gas price to pay upon posting the data request.\r\n /// @param resultMaxSize Maximum expected size of returned data (in bytes). \r\n function estimateBaseFee(uint256 gasPrice, uint16 resultMaxSize) external view returns (uint256);\r\n \r\n /// @notice Estimate the minimum reward required for posting a data request.\r\n /// @dev Fails if the RAD hash was not previously verified on the WitOracleRadonRegistry registry.\r\n /// @param gasPrice Expected gas price to pay upon posting the data request.\r\n /// @param radHash The RAD hash of the data request to be solved by Witnet.\r\n function estimateBaseFee(uint256 gasPrice, bytes32 radHash) external view returns (uint256);\r\n\r\n function getQuery(uint256) external view returns (Query memory);\r\n function getQueryRequest(uint256) external view returns (QueryRequest memory);\r\n function getQueryResponse(uint256) external view returns (QueryResponse memory);\r\n\r\n /// @notice Returns query's result current status from a requester's point of view:\r\n /// @notice - 0 => Void: the query is either non-existent or deleted;\r\n /// @notice - 1 => Awaiting: the query has not yet been reported;\r\n /// @notice - 2 => Ready: the query response was finalized, and contains a result with no erros.\r\n /// @notice - 3 => Error: the query response was finalized, and contains a result with errors.\r\n /// @notice - 4 => Finalizing: some result to the query has been reported, but cannot yet be considered finalized.\r\n /// @notice - 5 => Delivered: at least one response, either successful or with errors, was delivered to the requesting contract.\r\n function getQueryResponseStatus(uint256) external view returns (QueryResponseStatus);\r\n\r\n /// QueryResponse status from a requester's point of view.\r\n enum QueryResponseStatus {\r\n Void,\r\n Awaiting,\r\n Ready,\r\n Error,\r\n Finalizing,\r\n Delivered,\r\n Expired\r\n }\r\n\r\n /// @notice Retrieves the CBOR-encoded buffer containing the Witnet-provided result to the given query.\r\n function getQueryResultCborBytes(uint256) external view returns (bytes memory);\r\n\r\n /// @notice Gets error code identifying some possible failure on the resolution of the given query.\r\n function getQueryResultError(uint256) external view returns (ResultError memory);\r\n\r\n /// Data struct describing an error when trying to fetch a Witnet-provided result to a Data Request.\r\n struct ResultError {\r\n uint8 code;\r\n string reason;\r\n }\r\n\r\n function extractWitnetDataRequests(uint256[] calldata queryIds) external view returns (bytes[] memory);\r\n function fetchQueryResponse(uint256 queryId) external returns (bytes memory);\r\n function postRequest(bytes32, RadonSLA calldata) external payable returns (uint256);\r\n function postRequestWithCallback(bytes32, RadonSLA calldata, uint24) external payable returns (uint256);\r\n function reportResult(uint256, uint32, bytes32, bytes calldata) external returns (uint256);\r\n function reportResult(uint256, bytes32, bytes calldata) external returns (uint256);\r\n\r\n struct BatchResultLegacy {\r\n uint256 queryId;\r\n uint32 resultTimestamp;\r\n bytes32 drTxHash;\r\n bytes resultCborBytes;\r\n }\r\n function reportResultBatch(BatchResultLegacy[] calldata) external returns (uint256);\r\n}\r\n", "sourcePath": "C:\\Users\\guill\\github\\guidiaz\\witnet-solidity-bridge\\contracts\\interfaces\\legacy\\IWitOracleLegacy.sol", "ast": { "absolutePath": "project:/contracts/interfaces/legacy/IWitOracleLegacy.sol", "exportedSymbols": { "Bech32": [ 31372 ], "IWitOracleLegacy": [ 28786 ], "IWitOracleRadonRegistry": [ 27394 ], "IWitOracleRequest": [ 28922 ], "IWitOracleRequestTemplate": [ 29115 ], "Secp256k1": [ 32535 ], "Witnet": [ 40741 ], "WitnetBuffer": [ 42631 ], "WitnetCBOR": [ 44174 ] }, "id": 28787, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 28571, "literals": [ "solidity", ">=", "0.8", ".0", "<", "0.9", ".0" ], "nodeType": "PragmaDirective", "src": "35:31:93" }, { "absolutePath": "project:/contracts/interfaces/IWitOracleRadonRegistry.sol", "file": "../IWitOracleRadonRegistry.sol", "id": 28572, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 28787, "sourceUnit": 27395, "src": "70:40:93", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "project:/contracts/interfaces/legacy/IWitOracleRequest.sol", "file": "./IWitOracleRequest.sol", "id": 28573, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 28787, "sourceUnit": 28923, "src": "112:33:93", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "project:/contracts/interfaces/legacy/IWitOracleRequestTemplate.sol", "file": "./IWitOracleRequestTemplate.sol", "id": 28574, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 28787, "sourceUnit": 29116, "src": "147:41:93", "symbolAliases": [], "unitAlias": "" }, { "abstract": false, "baseContracts": [], "canonicalName": "IWitOracleLegacy", "contractDependencies": [], "contractKind": "interface", "fullyImplemented": false, "id": 28786, "linearizedBaseContracts": [ 28786 ], "name": "IWitOracleLegacy", "nameLocation": "202:16:93", "nodeType": "ContractDefinition", "nodes": [ { "canonicalName": "IWitOracleLegacy.Query", "id": 28581, "members": [ { "constant": false, "id": 28577, "mutability": "mutable", "name": "request", "nameLocation": "265:7:93", "nodeType": "VariableDeclaration", "scope": 28581, "src": "252:20:93", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_struct$_QueryRequest_$28595_storage_ptr", "typeString": "struct IWitOracleLegacy.QueryRequest" }, "typeName": { "id": 28576, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 28575, "name": "QueryRequest", "nameLocations": [ "252:12:93" ], "nodeType": "IdentifierPath", "referencedDeclaration": 28595, "src": "252:12:93" }, "referencedDeclaration": 28595, "src": "252:12:93", "typeDescriptions": { "typeIdentifier": "t_struct$_QueryRequest_$28595_storage_ptr", "typeString": "struct IWitOracleLegacy.QueryRequest" } }, "visibility": "internal" }, { "constant": false, "id": 28580, "mutability": "mutable", "name": "response", "nameLocation": "297:8:93", "nodeType": "VariableDeclaration", "scope": 28581, "src": "283:22:93", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_struct$_QueryResponse_$28606_storage_ptr", "typeString": "struct IWitOracleLegacy.QueryResponse" }, "typeName": { "id": 28579, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 28578, "name": "QueryResponse", "nameLocations": [ "283:13:93" ], "nodeType": "IdentifierPath", "referencedDeclaration": 28606, "src": "283:13:93" }, "referencedDeclaration": 28606, "src": "283:13:93", "typeDescriptions": { "typeIdentifier": "t_struct$_QueryResponse_$28606_storage_ptr", "typeString": "struct IWitOracleLegacy.QueryResponse" } }, "visibility": "internal" } ], "name": "Query", "nameLocation": "235:5:93", "nodeType": "StructDefinition", "scope": 28786, "src": "228:85:93", "visibility": "public" }, { "canonicalName": "IWitOracleLegacy.QueryRequest", "id": 28595, "members": [ { "constant": false, "id": 28583, "mutability": "mutable", "name": "requester", "nameLocation": "360:9:93", "nodeType": "VariableDeclaration", "scope": 28595, "src": "352:17:93", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 28582, "name": "address", "nodeType": "ElementaryTypeName", "src": "352:7:93", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" }, { "constant": false, "id": 28585, "mutability": "mutable", "name": "callbackGas", "nameLocation": "388:11:93", "nodeType": "VariableDeclaration", "scope": 28595, "src": "380:19:93", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint24", "typeString": "uint24" }, "typeName": { "id": 28584, "name": "uint24", "nodeType": "ElementaryTypeName", "src": "380:6:93", "typeDescriptions": { "typeIdentifier": "t_uint24", "typeString": "uint24" } }, "visibility": "internal" }, { "constant": false, "id": 28587, "mutability": "mutable", "name": "evmReward", "nameLocation": "418:9:93", "nodeType": "VariableDeclaration", "scope": 28595, "src": "410:17:93", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint72", "typeString": "uint72" }, "typeName": { "id": 28586, "name": "uint72", "nodeType": "ElementaryTypeName", "src": "410:6:93", "typeDescriptions": { "typeIdentifier": "t_uint72", "typeString": "uint72" } }, "visibility": "internal" }, { "constant": false, "id": 28589, "mutability": "mutable", "name": "radonBytecode", "nameLocation": "446:13:93", "nodeType": "VariableDeclaration", "scope": 28595, "src": "438:21:93", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" }, "typeName": { "id": 28588, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "438:5:93", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "visibility": "internal" }, { "constant": false, "id": 28591, "mutability": "mutable", "name": "radonHash", "nameLocation": "478:9:93", "nodeType": "VariableDeclaration", "scope": 28595, "src": "470:17:93", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 28590, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "470:7:93", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "visibility": "internal" }, { "constant": false, "id": 28594, "mutability": "mutable", "name": "radonParams", "nameLocation": "507:11:93", "nodeType": "VariableDeclaration", "scope": 28595, "src": "498:20:93", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_struct$_RadonSLA_$28611_storage_ptr", "typeString": "struct IWitOracleLegacy.RadonSLA" }, "typeName": { "id": 28593, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 28592, "name": "RadonSLA", "nameLocations": [ "498:8:93" ], "nodeType": "IdentifierPath", "referencedDeclaration": 28611, "src": "498:8:93" }, "referencedDeclaration": 28611, "src": "498:8:93", "typeDescriptions": { "typeIdentifier": "t_struct$_RadonSLA_$28611_storage_ptr", "typeString": "struct IWitOracleLegacy.RadonSLA" } }, "visibility": "internal" } ], "name": "QueryRequest", "nameLocation": "328:12:93", "nodeType": "StructDefinition", "scope": 28786, "src": "321:205:93", "visibility": "public" }, { "canonicalName": "IWitOracleLegacy.QueryResponse", "id": 28606, "members": [ { "constant": false, "id": 28597, "mutability": "mutable", "name": "reporter", "nameLocation": "574:8:93", "nodeType": "VariableDeclaration", "scope": 28606, "src": "566:16:93", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 28596, "name": "address", "nodeType": "ElementaryTypeName", "src": "566:7:93", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" }, { "constant": false, "id": 28599, "mutability": "mutable", "name": "finality", "nameLocation": "600:8:93", "nodeType": "VariableDeclaration", "scope": 28606, "src": "593:15:93", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" }, "typeName": { "id": 28598, "name": "uint64", "nodeType": "ElementaryTypeName", "src": "593:6:93", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" } }, "visibility": "internal" }, { "constant": false, "id": 28601, "mutability": "mutable", "name": "timestamp", "nameLocation": "626:9:93", "nodeType": "VariableDeclaration", "scope": 28606, "src": "619:16:93", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "typeName": { "id": 28600, "name": "uint32", "nodeType": "ElementaryTypeName", "src": "619:6:93", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "visibility": "internal" }, { "constant": false, "id": 28603, "mutability": "mutable", "name": "trail", "nameLocation": "654:5:93", "nodeType": "VariableDeclaration", "scope": 28606, "src": "646:13:93", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 28602, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "646:7:93", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "visibility": "internal" }, { "constant": false, "id": 28605, "mutability": "mutable", "name": "cborBytes", "nameLocation": "676:9:93", "nodeType": "VariableDeclaration", "scope": 28606, "src": "670:15:93", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" }, "typeName": { "id": 28604, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "670:5:93", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "visibility": "internal" } ], "name": "QueryResponse", "nameLocation": "541:13:93",