UNPKG

witnet-solidity-bridge

Version:

Witnet Solidity Bridge contracts for EVM-compatible chains

990 lines (989 loc) 127 kB
{ "contractName": "IWitOracleQueriable", "abi": [ { "inputs": [ { "internalType": "uint256", "name": "queryId", "type": "uint256" } ], "name": "deleteQuery", "outputs": [ { "internalType": "Witnet.QueryEvmReward", "name": "", "type": "uint72" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "evmGasPrice", "type": "uint256" } ], "name": "estimateBaseFee", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "evmGasPrice", "type": "uint256" }, { "internalType": "uint24", "name": "callbackGas", "type": "uint24" } ], "name": "estimateBaseFeeWithCallback", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "evmGasPrice", "type": "uint256" }, { "internalType": "uint256", "name": "evmWitPrice", "type": "uint256" }, { "components": [ { "internalType": "uint16", "name": "witResultMaxSize", "type": "uint16" }, { "internalType": "uint16", "name": "witCommitteeSize", "type": "uint16" }, { "internalType": "uint64", "name": "witUnitaryReward", "type": "uint64" } ], "internalType": "struct Witnet.QuerySLA", "name": "querySLA", "type": "tuple" } ], "name": "estimateExtraFee", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getNextQueryId", "outputs": [ { "internalType": "Witnet.QueryId", "name": "", "type": "uint64" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "Witnet.QueryId", "name": "queryId", "type": "uint64" } ], "name": "getQuery", "outputs": [ { "components": [ { "components": [ { "internalType": "address", "name": "requester", "type": "address" }, { "internalType": "uint24", "name": "callbackGas", "type": "uint24" }, { "internalType": "bytes", "name": "radonBytecode", "type": "bytes" }, { "internalType": "Witnet.RadonHash", "name": "radonHash", "type": "bytes32" } ], "internalType": "struct Witnet.QueryRequest", "name": "request", "type": "tuple" }, { "components": [ { "internalType": "address", "name": "reporter", "type": "address" }, { "internalType": "Witnet.Timestamp", "name": "resultTimestamp", "type": "uint64" }, { "internalType": "Witnet.TransactionHash", "name": "resultDrTxHash", "type": "bytes32" }, { "internalType": "bytes", "name": "resultCborBytes", "type": "bytes" }, { "internalType": "address", "name": "disputer", "type": "address" } ], "internalType": "struct Witnet.QueryResponse", "name": "response", "type": "tuple" }, { "components": [ { "internalType": "uint16", "name": "witResultMaxSize", "type": "uint16" }, { "internalType": "uint16", "name": "witCommitteeSize", "type": "uint16" }, { "internalType": "uint64", "name": "witUnitaryReward", "type": "uint64" } ], "internalType": "struct Witnet.QuerySLA", "name": "slaParams", "type": "tuple" }, { "internalType": "Witnet.QueryUUID", "name": "uuid", "type": "bytes15" }, { "internalType": "Witnet.QueryEvmReward", "name": "reward", "type": "uint72" }, { "internalType": "Witnet.BlockNumber", "name": "checkpoint", "type": "uint64" } ], "internalType": "struct Witnet.Query", "name": "", "type": "tuple" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "name": "getQueryEvmReward", "outputs": [ { "internalType": "Witnet.QueryEvmReward", "name": "", "type": "uint72" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "Witnet.QueryId", "name": "", "type": "uint64" } ], "name": "getQueryRequest", "outputs": [ { "components": [ { "internalType": "address", "name": "requester", "type": "address" }, { "internalType": "uint24", "name": "callbackGas", "type": "uint24" }, { "internalType": "bytes", "name": "radonBytecode", "type": "bytes" }, { "internalType": "Witnet.RadonHash", "name": "radonHash", "type": "bytes32" } ], "internalType": "struct Witnet.QueryRequest", "name": "", "type": "tuple" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "Witnet.QueryId", "name": "", "type": "uint64" } ], "name": "getQueryResponse", "outputs": [ { "components": [ { "internalType": "address", "name": "reporter", "type": "address" }, { "internalType": "Witnet.Timestamp", "name": "resultTimestamp", "type": "uint64" }, { "internalType": "Witnet.TransactionHash", "name": "resultDrTxHash", "type": "bytes32" }, { "internalType": "bytes", "name": "resultCborBytes", "type": "bytes" }, { "internalType": "address", "name": "disputer", "type": "address" } ], "internalType": "struct Witnet.QueryResponse", "name": "", "type": "tuple" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "name": "getQueryResult", "outputs": [ { "components": [ { "internalType": "enum Witnet.ResultStatus", "name": "status", "type": "uint8" }, { "internalType": "enum Witnet.RadonDataTypes", "name": "dataType", "type": "uint8" }, { "internalType": "Witnet.TransactionHash", "name": "drTxHash", "type": "bytes32" }, { "internalType": "uint256", "name": "finality", "type": "uint256" }, { "internalType": "Witnet.Timestamp", "name": "timestamp", "type": "uint64" }, { "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": "value", "type": "tuple" } ], "internalType": "struct Witnet.DataResult", "name": "", "type": "tuple" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "name": "getQueryResultStatus", "outputs": [ { "internalType": "enum Witnet.ResultStatus", "name": "", "type": "uint8" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "name": "getQueryResultStatusDescription", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "name": "getQueryResultTrails", "outputs": [ { "internalType": "bytes32", "name": "queryUUID", "type": "bytes32" }, { "internalType": "Witnet.TransactionHash", "name": "resultDrTxHash", "type": "bytes32" }, { "internalType": "Witnet.Timestamp", "name": "resultTimestamp", "type": "uint64" }, { "internalType": "uint256", "name": "resultFinalityBlock", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "name": "getQueryStatus", "outputs": [ { "internalType": "enum Witnet.QueryStatus", "name": "", "type": "uint8" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "name": "getQueryStatusString", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256[]", "name": "", "type": "uint256[]" } ], "name": "getQueryStatusBatch", "outputs": [ { "internalType": "enum Witnet.QueryStatus[]", "name": "", "type": "uint8[]" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "Witnet.RadonHash", "name": "radonHash", "type": "bytes32" }, { "components": [ { "internalType": "uint16", "name": "witResultMaxSize", "type": "uint16" }, { "internalType": "uint16", "name": "witCommitteeSize", "type": "uint16" }, { "internalType": "uint64", "name": "witUnitaryReward", "type": "uint64" } ], "internalType": "struct Witnet.QuerySLA", "name": "", "type": "tuple" } ], "name": "queryData", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "Witnet.RadonHash", "name": "radonHash", "type": "bytes32" }, { "components": [ { "internalType": "uint16", "name": "witResultMaxSize", "type": "uint16" }, { "internalType": "uint16", "name": "witCommitteeSize", "type": "uint16" }, { "internalType": "uint64", "name": "witUnitaryReward", "type": "uint64" } ], "internalType": "struct Witnet.QuerySLA", "name": "", "type": "tuple" }, { "components": [ { "internalType": "address", "name": "consumer", "type": "address" }, { "internalType": "uint24", "name": "gasLimit", "type": "uint24" } ], "internalType": "struct Witnet.QueryCallback", "name": "", "type": "tuple" } ], "name": "queryDataWithCallback", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "name": "upgradeQueryEvmReward", "outputs": [], "stateMutability": "payable", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.8.30+commit.73712a01\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"queryId\",\"type\":\"uint256\"}],\"name\":\"deleteQuery\",\"outputs\":[{\"internalType\":\"Witnet.QueryEvmReward\",\"name\":\"\",\"type\":\"uint72\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"evmGasPrice\",\"type\":\"uint256\"}],\"name\":\"estimateBaseFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"evmGasPrice\",\"type\":\"uint256\"},{\"internalType\":\"uint24\",\"name\":\"callbackGas\",\"type\":\"uint24\"}],\"name\":\"estimateBaseFeeWithCallback\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"evmGasPrice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"evmWitPrice\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint16\",\"name\":\"witResultMaxSize\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"witCommitteeSize\",\"type\":\"uint16\"},{\"internalType\":\"uint64\",\"name\":\"witUnitaryReward\",\"type\":\"uint64\"}],\"internalType\":\"struct Witnet.QuerySLA\",\"name\":\"querySLA\",\"type\":\"tuple\"}],\"name\":\"estimateExtraFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNextQueryId\",\"outputs\":[{\"internalType\":\"Witnet.QueryId\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"Witnet.QueryId\",\"name\":\"queryId\",\"type\":\"uint64\"}],\"name\":\"getQuery\",\"outputs\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"callbackGas\",\"type\":\"uint24\"},{\"internalType\":\"bytes\",\"name\":\"radonBytecode\",\"type\":\"bytes\"},{\"internalType\":\"Witnet.RadonHash\",\"name\":\"radonHash\",\"type\":\"bytes32\"}],\"internalType\":\"struct Witnet.QueryRequest\",\"name\":\"request\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"reporter\",\"type\":\"address\"},{\"internalType\":\"Witnet.Timestamp\",\"name\":\"resultTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"Witnet.TransactionHash\",\"name\":\"resultDrTxHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"resultCborBytes\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"disputer\",\"type\":\"address\"}],\"internalType\":\"struct Witnet.QueryResponse\",\"name\":\"response\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint16\",\"name\":\"witResultMaxSize\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"witCommitteeSize\",\"type\":\"uint16\"},{\"internalType\":\"uint64\",\"name\":\"witUnitaryReward\",\"type\":\"uint64\"}],\"internalType\":\"struct Witnet.QuerySLA\",\"name\":\"slaParams\",\"type\":\"tuple\"},{\"internalType\":\"Witnet.QueryUUID\",\"name\":\"uuid\",\"type\":\"bytes15\"},{\"internalType\":\"Witnet.QueryEvmReward\",\"name\":\"reward\",\"type\":\"uint72\"},{\"internalType\":\"Witnet.BlockNumber\",\"name\":\"checkpoint\",\"type\":\"uint64\"}],\"internalType\":\"struct Witnet.Query\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"getQueryEvmReward\",\"outputs\":[{\"internalType\":\"Witnet.QueryEvmReward\",\"name\":\"\",\"type\":\"uint72\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"Witnet.QueryId\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"getQueryRequest\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"callbackGas\",\"type\":\"uint24\"},{\"internalType\":\"bytes\",\"name\":\"radonBytecode\",\"type\":\"bytes\"},{\"internalType\":\"Witnet.RadonHash\",\"name\":\"radonHash\",\"type\":\"bytes32\"}],\"internalType\":\"struct Witnet.QueryRequest\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"Witnet.QueryId\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"getQueryResponse\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"reporter\",\"type\":\"address\"},{\"internalType\":\"Witnet.Timestamp\",\"name\":\"resultTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"Witnet.TransactionHash\",\"name\":\"resultDrTxHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"resultCborBytes\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"disputer\",\"type\":\"address\"}],\"internalType\":\"struct Witnet.QueryResponse\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"getQueryResult\",\"outputs\":[{\"components\":[{\"internalType\":\"enum Witnet.ResultStatus\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"enum Witnet.RadonDataTypes\",\"name\":\"dataType\",\"type\":\"uint8\"},{\"internalType\":\"Witnet.TransactionHash\",\"name\":\"drTxHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"finality\",\"type\":\"uint256\"},{\"internalType\":\"Witnet.Timestamp\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"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\":\"value\",\"type\":\"tuple\"}],\"internalType\":\"struct Witnet.DataResult\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"getQueryResultStatus\",\"outputs\":[{\"internalType\":\"enum Witnet.ResultStatus\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"getQueryResultStatusDescription\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"getQueryResultTrails\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"queryUUID\",\"type\":\"bytes32\"},{\"internalType\":\"Witnet.TransactionHash\",\"name\":\"resultDrTxHash\",\"type\":\"bytes32\"},{\"internalType\":\"Witnet.Timestamp\",\"name\":\"resultTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"resultFinalityBlock\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"getQueryStatus\",\"outputs\":[{\"internalType\":\"enum Witnet.QueryStatus\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"name\":\"getQueryStatusBatch\",\"outputs\":[{\"internalType\":\"enum Witnet.QueryStatus[]\",\"name\":\"\",\"type\":\"uint8[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"getQueryStatusString\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"Witnet.RadonHash\",\"name\":\"radonHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint16\",\"name\":\"witResultMaxSize\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"witCommitteeSize\",\"type\":\"uint16\"},{\"internalType\":\"uint64\",\"name\":\"witUnitaryReward\",\"type\":\"uint64\"}],\"internalType\":\"struct Witnet.QuerySLA\",\"name\":\"\",\"type\":\"tuple\"}],\"name\":\"queryData\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"Witnet.RadonHash\",\"name\":\"radonHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint16\",\"name\":\"witResultMaxSize\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"witCommitteeSize\",\"type\":\"uint16\"},{\"internalType\":\"uint64\",\"name\":\"witUnitaryReward\",\"type\":\"uint64\"}],\"internalType\":\"struct Witnet.QuerySLA\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"consumer\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"gasLimit\",\"type\":\"uint24\"}],\"internalType\":\"struct Witnet.QueryCallback\",\"name\":\"\",\"type\":\"tuple\"}],\"name\":\"queryDataWithCallback\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"upgradeQueryEvmReward\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"deleteQuery(uint256)\":{\"details\":\"Fails if the query is not in a final status, or not called from the actual requester.\",\"params\":{\"queryId\":\"The unique query identifier.\"}},\"estimateBaseFee(uint256)\":{\"params\":{\"evmGasPrice\":\"Expected gas price to pay upon posting the data request.\"}},\"estimateBaseFeeWithCallback(uint256,uint24)\":{\"params\":{\"callbackGas\":\"Maximum gas to be spent when reporting the data request result.\",\"evmGasPrice\":\"Expected gas price to pay upon posting the data request.\"}},\"estimateExtraFee(uint256,uint256,(uint16,uint16,uint64))\":{\"details\":\"The extra fee gets calculated in proportion to:\",\"params\":{\"evmGasPrice\":\"Tentative EVM gas price at the moment the query result is ready.\",\"evmWitPrice\":\"Tentative nanoWit price in Wei at the moment the query is solved on the Wit/Oracle blockchain.\",\"querySLA\":\"The query SLA data security parameters as required for the Wit/Oracle blockchain. \"}},\"queryData(bytes32,(uint16,uint16,uint64))\":{\"details\":\"Reasons to revert:- the data request's RAD hash was not previously verified into the WitOracleRadonRegistry contract;- invalid query SLA parameters were provided;- insufficient value is paid as reward.\",\"params\":{\"radonHash\":\"The unique hash of the Radon Request to be solved by Wit/Oracle sidechain. \"}},\"queryDataWithCallback(bytes32,(uint16,uint16,uint64),(address,uint24))\":{\"details\":\"Reasons to revert:- the data request's RAD hash was not previously verified into the Radon Registry;- invalid query SLA parameters were provided;- insufficient value is paid as reward.- passed `consumer` is not a contract implementing the IWitOracleQueriableConsumer interface;\",\"params\":{\"radonHash\":\"The unique hash of the Radon Request to be solved by Wit/Oracle sidechain. \"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"deleteQuery(uint256)\":{\"notice\":\"Removes all query data from storage. Pays back reward on expired queries.\"},\"estimateBaseFee(uint256)\":{\"notice\":\"Estimate the minimum reward required for posting a data request.\"},\"estimateBaseFeeWithCallback(uint256,uint24)\":{\"notice\":\"Estimate the minimum reward required for posting a data request with a callback.\"},\"estimateExtraFee(uint256,uint256,(uint16,uint16,uint64))\":{\"notice\":\"Estimate the extra reward (i.e. over the base fee) to be paid when posting a newdata query in order to avoid getting provable \\\"too low incentives\\\" results fromthe Wit/Oracle blockchain. \"},\"getNextQueryId()\":{\"notice\":\"Returns next query id to be generated by the Witnet Request Board.\"},\"getQuery(uint64)\":{\"notice\":\"Gets the whole Query data contents, if any, no matter its current status.\"},\"getQueryEvmReward(uint256)\":{\"notice\":\"Gets the current EVM reward the reporter can claim, if not done yet.\"},\"getQueryRequest(uint64)\":{\"notice\":\"Retrieves the RAD hash and SLA parameters of the given query.\"},\"getQueryResponse(uint64)\":{\"notice\":\"Retrieves the whole `Witnet.QueryResponse` record referred to a previously posted Witnet Data Request.\"},\"getQueryResultTrails(uint256)\":{\"notice\":\"Gets query's result back tracing trails\"},\"getQueryStatus(uint256)\":{\"notice\":\"Gets current status of given query.\"},\"getQueryStatusBatch(uint256[])\":{\"notice\":\"Get current status of all given query ids.\"},\"queryData(bytes32,(uint16,uint16,uint64))\":{\"notice\":\"Request real world data from the Wit/Oracle sidechain. The paid fee is escrowed as a reward for the reporter that eventually relays back a valid query result from the Wit/Oracle sidechain.Query results are CBOR-encoded, and can contain either some data, or an error.\"},\"queryDataWithCallback(bytes32,(uint16,uint16,uint64),(address,uint24))\":{\"notice\":\"Request real world data from the Wit/Oracle sidechain. The paid fee is escrowed as a reward for the reporter that eventually relays back a valid query result from the Wit/Oracle sidechain.The Witnet-provable result will be reported directly to the requesting contract. Query results are CBOR-encoded, and can contain either some data, or an error.\"},\"upgradeQueryEvmReward(uint256)\":{\"notice\":\"Increments the reward of a previously posted request by adding the transaction value to it.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"project:/contracts/interfaces/IWitOracleQueriable.sol\":\"IWitOracleQueriable\"},\"evmVersion\":\"prague\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"project:/contracts/interfaces/IWitOracleQueriable.sol\":{\"keccak256\":\"0xdb0da1e377a35a7d620f43cb583a876750a52d91da2b888f48042483ad9c4910\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://edfcdf3e96ec3c5de7438f82e3d5a1dc9af9eb29080044213dccb26ff978354c\",\"dweb:/ipfs/Qmap2FzSysh2fug88eortbsTM7itFygRzKc9HfV43ePMik\"]},\"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 IWitOracleQueriable {\r\n \r\n /// @notice Removes all query data from storage. Pays back reward on expired queries.\r\n /// @dev Fails if the query is not in a final status, or not called from the actual requester.\r\n /// @param queryId The unique query identifier.\r\n function deleteQuery(uint256 queryId) external returns (Witnet.QueryEvmReward);\r\n\r\n /// @notice Estimate the minimum reward required for posting a data request.\r\n /// @param evmGasPrice Expected gas price to pay upon posting the data request.\r\n function estimateBaseFee(uint256 evmGasPrice) external view returns (uint256);\r\n \r\n /// @notice Estimate the minimum reward required for posting a data request with a callback.\r\n /// @param evmGasPrice Expected gas price to pay upon posting the data request.\r\n /// @param callbackGas Maximum gas to be spent when reporting the data request result.\r\n function estimateBaseFeeWithCallback(uint256 evmGasPrice, uint24 callbackGas) external view returns (uint256);\r\n\r\n /// @notice Estimate the extra reward (i.e. over the base fee) to be paid when posting a new\r\n /// @notice data query in order to avoid getting provable \"too low incentives\" results from\r\n /// @notice the Wit/Oracle blockchain. \r\n /// @dev The extra fee gets calculated in proportion to:\r\n /// @param evmGasPrice Tentative EVM gas price at the moment the query result is ready.\r\n /// @param evmWitPrice Tentative nanoWit price in Wei at the moment the query is solved on the Wit/Oracle blockchain.\r\n /// @param querySLA The query SLA data security parameters as required for the Wit/Oracle blockchain. \r\n function estimateExtraFee(uint256 evmGasPrice, uint256 evmWitPrice, Witnet.QuerySLA calldata querySLA) external view returns (uint256);\r\n\r\n /// @notice Returns next query id to be generated by the Witnet Request Board.\r\n function getNextQueryId() external view returns (Witnet.QueryId);\r\n\r\n /// @notice Gets the whole Query data contents, if any, no matter its current status.\r\n function getQuery(Witnet.QueryId queryId) external view returns (Witnet.Query memory);\r\n\r\n /// @notice Gets the current EVM reward the reporter can claim, if not done yet.\r\n function getQueryEvmReward(uint256) external view returns (Witnet.QueryEvmReward);\r\n\r\n /// @notice Retrieves the RAD hash and SLA parameters of the given query.\r\n function getQueryRequest(Witnet.QueryId) external view returns (Witnet.QueryRequest memory);\r\n\r\n /// @notice Retrieves the whole `Witnet.QueryResponse` record referred to a previously posted Witnet Data Request.\r\n function getQueryResponse(Witnet.QueryId) external view returns (Witnet.QueryResponse memory);\r\n\r\n function getQueryResult(uint256) external view returns (Witnet.DataResult memory);\r\n function getQueryResultStatus(uint256) external view returns (Witnet.ResultStatus);\r\n function getQueryResultStatusDescription(uint256) external view returns (string memory);\r\n \r\n /// @notice Gets query's result back tracing trails\r\n function getQueryResultTrails(uint256) \r\n external view returns (\r\n bytes32 queryUUID,\r\n Witnet.TransactionHash resultDrTxHash,\r\n Witnet.Timestamp resultTimestamp,\r\n uint256 resultFinalityBlock\r\n );\r\n\r\n /// @notice Gets current status of given query.\r\n function getQueryStatus(uint256) external view returns (Witnet.QueryStatus);\r\n function getQueryStatusString(uint256) external view returns (string memory);\r\n \r\n /// @notice Get current status of all given query ids.\r\n function getQueryStatusBatch(uint256[] calldata) external view returns (Witnet.QueryStatus[] memory);\r\n\r\n /// @notice Request real world data from the Wit/Oracle sidechain. \r\n /// @notice The paid fee is escrowed as a reward for the reporter that eventually relays back \r\n /// @notice a valid query result from the Wit/Oracle sidechain.\r\n /// @notice Query results are CBOR-encoded, and can contain either some data, or an error.\r\n /// @dev Reasons to revert:\r\n /// @dev - the data request's RAD hash was not previously verified into the WitOracleRadonRegistry contract;\r\n /// @dev - invalid query SLA parameters were provided;\r\n /// @dev - insufficient value is paid as reward.\r\n /// @param radonHash The unique hash of the Radon Request to be solved by Wit/Oracle sidechain. \r\n function queryData(\r\n Witnet.RadonHash radonHash,\r\n Witnet.QuerySLA calldata\r\n )\r\n external payable returns (uint256);\r\n\r\n /// @notice Request real world data from the Wit/Oracle sidechain. \r\n /// @notice The paid fee is escrowed as a reward for the reporter that eventually relays back \r\n /// @notice a valid query result from the Wit/Oracle sidechain.\r\n /// @notice The Witnet-provable result will be reported directly to the requesting contract. \r\n /// @notice Query results are CBOR-encoded, and can contain either some data, or an error.\r\n /// @dev Reasons to revert:\r\n /// @dev - the data request's RAD hash was not previously verified into the Radon Registry;\r\n /// @dev - invalid query SLA parameters were provided;\r\n /// @dev - insufficient value is paid as reward.\r\n /// @dev - passed `consumer` is not a contract implementing the IWitOracleQueriableConsumer interface;\r\n /// @param radonHash The unique hash of the Radon Request to be solved by Wit/Oracle sidechain. \r\n function queryDataWithCallback(\r\n Witnet.RadonHash radonHash, \r\n Witnet.QuerySLA calldata, \r\n Witnet.QueryCallback calldata\r\n )\r\n external payable returns (uint256);\r\n\r\n /// @notice Increments the reward of a previously posted request by adding the transaction value to it.\r\n function upgradeQueryEvmReward(uint256) external payable;\r\n}", "sourcePath": "C:\\Users\\guill\\github\\guidiaz\\witnet-solidity-bridge\\contracts\\interfaces\\IWitOracleQueriable.sol", "ast": { "absolutePath": "project:/contracts/interfaces/IWitOracleQueriable.sol", "exportedSymbols": { "Bech32": [ 31372 ], "IWitOracleQueriable": [ 26795 ], "Secp256k1": [ 32535 ], "Witnet": [ 40741 ], "WitnetBuffer": [ 42631 ], "WitnetCBOR": [ 44174 ] }, "id": 26796, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 26608, "literals": [ "solidity", ">=", "0.8", ".0", "<", "0.9", ".0" ], "nodeType": "PragmaDirective", "src": "35:31:67" }, { "absolutePath": "project:/contracts/libs/Witnet.sol", "file": "../libs/Witnet.sol", "id": 26609, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 26796, "sourceUnit": 40742, "src": "70:28:67", "symbolAliases": [], "unitAlias": "" }, { "abstract": false, "baseContracts": [], "canonicalName": "IWitOracleQueriable", "contractDependencies": [], "contractKind": "interface", "fullyImplemented": false, "id": 26795, "linearizedBaseContracts": [ 26795 ], "name": "IWitOracleQueriable", "nameLocation": "112:19:67", "nodeType": "ContractDefinition", "nodes": [ { "documentation": { "id": 26610, "nodeType": "StructuredDocumentation", "src": "145:238:67", "text": "@notice Removes all query data from storage. Pays back reward on expired queries.\n @dev Fails if the query is not in a final status, or not called from the actual requester.\n @param queryId The unique query identifier." }, "functionSelector": "7c1fbda3", "id": 26618, "implemented": false, "kind": "function", "modifiers": [], "name": "deleteQuery", "nameLocation": "398:11:67", "nodeType": "FunctionDefinition", "parameters": { "id": 26613, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 26612, "mutability": "mutable", "name": "queryId", "nameLocation": "418:7:67", "nodeType": "VariableDeclaration", "scope": 26618, "src": "410:15:67", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 26611, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "410:7:67", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "409:17:67" }, "returnParameters": { "id": 26617, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 26616, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 26618, "src": "445:21:67", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_userDefinedValueType$_QueryEvmReward_$37147", "typeString": "Witnet.QueryEvmReward" }, "typeName": { "id": 26615, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 26614, "name": "Witnet.QueryEvmReward", "nameLocations": [ "445:6:67", "452:14:67" ], "nodeType": "IdentifierPath", "referencedDeclaration": 37147, "src": "445:21:67" }, "referencedDeclaration": 37147, "src": "445:21:67", "typeDescriptions": { "typeIdentifier": "t_userDefinedValueType$_QueryEvmReward_$37147", "typeString": "Witnet.QueryEvmReward" } }, "visibility": "internal" } ], "src": "444:23:67" }, "scope": 26795, "src": "389:79:67", "stateMutability": "nonpayable", "virtual": false, "visibility": "external" }, { "documentation": { "id": 26619, "nodeType": "StructuredDocumentation", "src": "476:161:67", "text": "@notice Estimate the minimum reward required for posting a data request.\n @param evmGasPrice Expected gas price to pay upon posting the data request." }, "functionSelector": "39a8653e", "id": 26626, "implemented": false, "kind": "function", "modifiers": [], "name": "estimateBaseFee", "nameLocation": "652:15:67", "nodeType": "FunctionDefinition", "parameters": { "id": 26622, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 26621, "mutability": "mutable", "name": "evmGasPrice", "nameLocation": "676:11:67", "nodeType": "VariableDeclaration", "scope": 26626, "src": "668:19:67", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 26620, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "668:7:67", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "667:21:67" }, "returnParameters": { "id": 26625, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 26624, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 26626, "src": "712:7:67", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 26623, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "712:7:67", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "711:9:67" }, "scope": 26795, "src": "643:78:67", "stateMutability": "view", "virtual": false, "visibility": "external" }, { "documentation": { "id": 26627, "nodeType": "StructuredDocumentation", "src": "733:269:67", "text": "@notice Estimate the minimum reward required for posting a data request with a callback.\n @param evmGasPrice Expected gas price to pay upon posting the data request.\n @param callbackGas Maximum gas to be spent when reporting the data request result." }, "functionSelector": "05e742ef", "id": 26636, "implemented": false, "kind": "function", "modifiers": [], "name": "estimateBaseFeeWithCallback", "nameLocation": "1017:27:67", "nodeType": "FunctionDefinition", "parameters": { "id": 26632, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 26629, "mutability": "mutable", "name": "evmGasPrice", "nameLocation": "1053:11:67", "nodeType": "VariableDeclaration", "scope": 26636, "src": "1045:19:67", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 26628, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1045:7:67",