witnet-solidity-bridge
Version:
Witnet Solidity Bridge contracts for EVM-compatible chains
1,089 lines • 66.6 kB
JSON
{
"contractName": "WitnetRequestConsumer",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "id",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "evmReward",
"type": "uint256"
},
{
"components": [
{
"internalType": "uint8",
"name": "committeeSize",
"type": "uint8"
},
{
"internalType": "uint64",
"name": "witnessingFeeNanoWit",
"type": "uint64"
}
],
"indexed": false,
"internalType": "struct WitnetV2.RadonSLA",
"name": "witnetSLA",
"type": "tuple"
}
],
"name": "WitnetQuery",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "id",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "evmGasPrice",
"type": "uint256"
}
],
"name": "WitnetQueryResponse",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "id",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "evmGasPrice",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "evmCallbackGas",
"type": "uint256"
}
],
"name": "WitnetQueryResponseDelivered",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "id",
"type": "uint256"
},
{
"indexed": false,
"internalType": "bytes",
"name": "resultCborBytes",
"type": "bytes"
},
{
"indexed": false,
"internalType": "uint256",
"name": "evmGasPrice",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "evmCallbackActualGas",
"type": "uint256"
},
{
"indexed": false,
"internalType": "string",
"name": "evmCallbackRevertReason",
"type": "string"
}
],
"name": "WitnetQueryResponseDeliveryFailed",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "id",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "evmReward",
"type": "uint256"
}
],
"name": "WitnetQueryRewardUpgraded",
"type": "event"
},
{
"inputs": [],
"name": "dataRequest",
"outputs": [
{
"internalType": "contract WitnetRequest",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"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": "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": "_from",
"type": "address"
}
],
"name": "reportableFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "witnet",
"outputs": [
{
"internalType": "contract WitnetOracle",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"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\":\"committeeSize\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"witnessingFeeNanoWit\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"struct WitnetV2.RadonSLA\",\"name\":\"witnetSLA\",\"type\":\"tuple\"}],\"name\":\"WitnetQuery\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"evmGasPrice\",\"type\":\"uint256\"}],\"name\":\"WitnetQueryResponse\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"evmGasPrice\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"evmCallbackGas\",\"type\":\"uint256\"}],\"name\":\"WitnetQueryResponseDelivered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"resultCborBytes\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"evmGasPrice\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"evmCallbackActualGas\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"evmCallbackRevertReason\",\"type\":\"string\"}],\"name\":\"WitnetQueryResponseDeliveryFailed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"evmReward\",\"type\":\"uint256\"}],\"name\":\"WitnetQueryRewardUpgraded\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"dataRequest\",\"outputs\":[{\"internalType\":\"contract WitnetRequest\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"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\":\"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\":\"_from\",\"type\":\"address\"}],\"name\":\"reportableFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"witnet\",\"outputs\":[{\"internalType\":\"contract WitnetOracle\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"_baseFeeOverheadPercentage\":\"Percentage over base fee to pay as on every data request.\",\"_callbackGasLimit\":\"Maximum gas to be spent by the IWitnetConsumer's callback methods.\",\"_witnetRequest\":\"Address of the WitnetRequest contract containing the actual data request.\"}},\"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. \"}}},\"version\":1},\"userdoc\":{\"events\":{\"WitnetQuery(uint256,uint256,(uint8,uint64))\":{\"notice\":\"Emitted every time a new query containing some verified data request is posted to the WRB.\"},\"WitnetQueryResponse(uint256,uint256)\":{\"notice\":\"Emitted when a query with no callback gets reported into the WRB.\"},\"WitnetQueryResponseDelivered(uint256,uint256,uint256)\":{\"notice\":\"Emitted when a query with a callback gets successfully reported into the WRB.\"},\"WitnetQueryResponseDeliveryFailed(uint256,bytes,uint256,uint256,string)\":{\"notice\":\"Emitted when a query with a callback cannot get reported into the WRB.\"},\"WitnetQueryRewardUpgraded(uint256,uint256)\":{\"notice\":\"Emitted when the reward of some not-yet reported query is upgraded.\"}},\"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\":\"=============================================================================================================== --- Base implementation of IWitnetConsumer --------------------------------------------------------------------\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"project:/contracts/apps/WitnetRequestConsumer.sol\":\"WitnetRequestConsumer\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"project:/contracts/WitnetOracle.sol\":{\"keccak256\":\"0x84ef8d2ebcba273e4bc23a5ee414a1213df55d1b4e496197a146031fea3a4874\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c4a6e31964ed08c4c9dfe5279b4ffe9eeba6e759f15901e080e174e98e96a7f5\",\"dweb:/ipfs/QmTghzVFf2EHnfnHejgFGRBjanXYcstK9ftVaYmHWJfk8w\"]},\"project:/contracts/WitnetRequest.sol\":{\"keccak256\":\"0x5b5e8e9744de10fe86adf97826e3db5c5bcbf357d179a532ef4d7073c7c3af88\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://25bed2c86e46beb6f59024b731b9f3d1ab176312a28b090ad149ddea48841c32\",\"dweb:/ipfs/QmT3aAXfKQ2MTHo4dK1pCyhdvaLYf5TJtgcim5DfbWHjp4\"]},\"project:/contracts/WitnetRequestBytecodes.sol\":{\"keccak256\":\"0x2a79d919dd79c0e3f857e6bee08368ad0b463188aced4a52de29270ed0f5f3d2\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://290d6013ee9f75fedbbb7726527a637ea2ae7a5da0ad118ecc43b298846f0bb0\",\"dweb:/ipfs/QmU8AZtPyctrrvxdmH297p595ZMS6DgcD6djSFKNxAqYMs\"]},\"project:/contracts/WitnetRequestFactory.sol\":{\"keccak256\":\"0x3c66f27d7c1db0e662c37d98005c4cbd871ceb75e97079d7bf673fb75d59c858\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://52adb318b870d0825718125e94fdbdd0e968ced09926420e2543b0ca4c6eb579\",\"dweb:/ipfs/QmYack87Q2UTfQb8KLLEPFBrMJgN2o6PaPqPNSc95McPVH\"]},\"project:/contracts/WitnetRequestTemplate.sol\":{\"keccak256\":\"0x10084f4f493f87d0acd9937fa786bf9e92512bf3670ee0427445d43c2cae973e\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2491b8a6ec8f01a53f35f6aa602df8630955000f3dc67e7dc8b61b0b25a71657\",\"dweb:/ipfs/QmXEuPy6pVnSQpbg8G1DuVMKQyVfbTdtsDUrPYCbZNHARD\"]},\"project:/contracts/apps/UsingWitnet.sol\":{\"keccak256\":\"0x3fe6f2f1162bd1c128fb6aad2db81eaa1fdf04b5d15a5eeadf3e44bc81e2d4ef\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://927de4c99298ede8a240305bfd8e9daa5c79a32ed68cef19ece9b7f5bb37860b\",\"dweb:/ipfs/QmeZEbXpCTHegD6H7cVDipyXLYHUE4e3C66XojzYk8CpE4\"]},\"project:/contracts/apps/UsingWitnetRequest.sol\":{\"keccak256\":\"0xf6190594314d048d811a7668e298f0707adf4cf8aa05b8db17561714b5fe26fb\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://f2f1a7203febd7de5af91eb7357d2f42568930847c12a7ea2d93e521e37ea30e\",\"dweb:/ipfs/QmTpY6WxPcD9oQo24pyKywG5zqvr8B7xh3pJ2iKotPMLWD\"]},\"project:/contracts/apps/WitnetConsumer.sol\":{\"keccak256\":\"0xf1bb9a975c8bae03b99feb014e0dfb95640a20cc4a5e5a3037374db687a1e339\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6d6f1708356b2093c6b649f80e47c7a8ddaa07e66c31d32b4f439a8a6d07b209\",\"dweb:/ipfs/Qmd7fFXCaheGUqPfdZ6xv8dAVwUH7DzweE8squCRJ2NrAh\"]},\"project:/contracts/apps/WitnetRequestConsumer.sol\":{\"keccak256\":\"0x95e92bd21012f882984ce860177f14ff464f0ff328b476d069a0ca43cb0815c6\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://7931bd03ab1e4f35ff3add6ff00d0c268263dcd6c31faee715fe024fc45ef69e\",\"dweb:/ipfs/QmNMZwivsfnYjgBHeJknMCe68VrUwzHprSbrAMn7Hfhgwd\"]},\"project:/contracts/interfaces/IWitnetConsumer.sol\":{\"keccak256\":\"0xf90fbcf0a59428c0ac13a3903214656060a95175adfdef8c11a7e16675b849e0\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c2606640d3f343051ea18dfb8e136dfdb73ceecd8016c82ddb73d67ad39a30e0\",\"dweb:/ipfs/QmTADVW4M8pge6pGfenFAauEDk4yZEy78o5ksZiKGwP3DT\"]},\"project:/contracts/interfaces/IWitnetOracle.sol\":{\"keccak256\":\"0x5dbb04fce5e05675325232a735c46617378982b48dac2138aca0c6cc95e6e4d5\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://7447a70455478239500e16aebe5dce6676dc86307d22f662761d8e9f7c5d1276\",\"dweb:/ipfs/QmVkvA4Mt6G1JXxE8ebxKGAjT1WvNbp5QMKg9sUKdrJjhv\"]},\"project:/contracts/interfaces/IWitnetOracleEvents.sol\":{\"keccak256\":\"0x0442f474f253dc1f6bd6a4f153c3adb2abe5f6f0f24c76d1baf666185e61e659\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://535e8efcfc5693669d9bd2b6f62e6fc65aca19b7de355a27152e4362b410540d\",\"dweb:/ipfs/QmVZRXgku1cZewhoucebaiBKAyUjF2dmEzYrzGvjPzbwN9\"]},\"project:/contracts/interfaces/IWitnetRequestBytecodes.sol\":{\"keccak256\":\"0x8da168bee9a78442216965976b1f29087f760f37dcb09337283242599ed1cbca\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://e120623262ee0559913bdae56c0a7921147dfe08ada7ea81061b14e2fc38c5e1\",\"dweb:/ipfs/Qmbxe8XRrH6ZjJHiR6YYzcZV1jnSWwo9iBYz5r6GJ6To5G\"]},\"project:/contracts/interfaces/IWitnetRequestFactory.sol\":{\"keccak256\":\"0x3b19ec4a976745ba2646e7e1886d647ef30ad678460a712c93bbfb4405b57f1f\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://fa759ae15b7d4da622a81d50933474910959ac490d8b63ea2e7ed8608859a9c9\",\"dweb:/ipfs/QmRckCu7eBBP5fn9ff6djs7VbdhFc7sxYb2yqDr4go66jV\"]},\"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\"]},\"project:/contracts/libs/WitnetV2.sol\":{\"keccak256\":\"0xb276a6da373bfbe9cd942dd7e59979cda898215d1e36ab3df95a6d6cc6ff770f\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://bc4890876b9bc64f501ccdd48408bb63724865cb2ce8d2057f6b318540adce7c\",\"dweb:/ipfs/QmPMHPdbCsKBavhiLcaDgQ9EjNSvwwzv8TKffotcCv1ctP\"]}},\"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 \"./UsingWitnetRequest.sol\";\r\nimport \"./WitnetConsumer.sol\";\r\n\r\nabstract contract WitnetRequestConsumer\r\n is\r\n UsingWitnetRequest,\r\n WitnetConsumer\r\n{\r\n using WitnetCBOR for WitnetCBOR.CBOR;\r\n using WitnetCBOR for WitnetCBOR.CBOR[];\r\n\r\n /// @param _witnetRequest Address of the WitnetRequest contract containing the actual data request.\r\n /// @param _baseFeeOverheadPercentage Percentage over base fee to pay as on every data request.\r\n /// @param _callbackGasLimit Maximum gas to be spent by the IWitnetConsumer's callback methods.\r\n constructor(\r\n WitnetRequest _witnetRequest, \r\n uint16 _baseFeeOverheadPercentage,\r\n uint24 _callbackGasLimit\r\n )\r\n UsingWitnetRequest(_witnetRequest, _baseFeeOverheadPercentage)\r\n WitnetConsumer(_callbackGasLimit)\r\n {}\r\n\r\n function _witnetEstimateEvmReward() \r\n virtual override(UsingWitnetRequest, WitnetConsumer)\r\n internal view\r\n returns (uint256)\r\n {\r\n return WitnetConsumer._witnetEstimateEvmReward();\r\n } \r\n\r\n function _witnetEstimateEvmReward(uint16)\r\n virtual override(UsingWitnet, WitnetConsumer)\r\n internal view\r\n returns (uint256)\r\n {\r\n return WitnetConsumer._witnetEstimateEvmReward();\r\n }\r\n\r\n function __witnetRequestData(\r\n uint256 _witnetEvmReward, \r\n WitnetV2.RadonSLA memory _witnetQuerySLA\r\n )\r\n virtual override\r\n internal returns (uint256)\r\n {\r\n return __witnet.postRequestWithCallback{\r\n value: _witnetEvmReward\r\n }(\r\n __witnetRequestRadHash,\r\n _witnetQuerySLA,\r\n __witnetCallbackGasLimit\r\n );\r\n }\r\n}\r\n",
"sourcePath": "C:\\Users\\guill\\github\\witnet\\witnet-solidity-bridge\\contracts\\apps\\WitnetRequestConsumer.sol",
"ast": {
"absolutePath": "project:/contracts/apps/WitnetRequestConsumer.sol",
"exportedSymbols": {
"IWitnetConsumer": [
12829
],
"IWitnetOracle": [
13265
],
"IWitnetOracleEvents": [
13315
],
"IWitnetRequestBytecodes": [
13979
],
"IWitnetRequestFactory": [
14002
],
"UsingWitnet": [
1157
],
"UsingWitnetRequest": [
1314
],
"Witnet": [
17557
],
"WitnetBuffer": [
19191
],
"WitnetCBOR": [
20734
],
"WitnetConsumer": [
1566
],
"WitnetOracle": [
749
],
"WitnetRequest": [
826
],
"WitnetRequestBytecodes": [
849
],
"WitnetRequestConsumer": [
3223
],
"WitnetRequestFactory": [
880
],
"WitnetRequestTemplate": [
1005
],
"WitnetV2": [
23640
]
},
"id": 3224,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 3139,
"literals": [
"solidity",
"^",
"0.8",
".0"
],
"nodeType": "PragmaDirective",
"src": "33:23:24"
},
{
"absolutePath": "project:/contracts/apps/UsingWitnetRequest.sol",
"file": "./UsingWitnetRequest.sol",
"id": 3140,
"nameLocation": "-1:-1:-1",
"nodeType": "ImportDirective",
"scope": 3224,
"sourceUnit": 1315,
"src": "60:34:24",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "project:/contracts/apps/WitnetConsumer.sol",
"file": "./WitnetConsumer.sol",
"id": 3141,
"nameLocation": "-1:-1:-1",
"nodeType": "ImportDirective",
"scope": 3224,
"sourceUnit": 1567,
"src": "96:30:24",
"symbolAliases": [],
"unitAlias": ""
},
{
"abstract": true,
"baseContracts": [
{
"baseName": {
"id": 3142,
"name": "UsingWitnetRequest",
"nameLocations": [
"187:18:24"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 1314,
"src": "187:18:24"
},
"id": 3143,
"nodeType": "InheritanceSpecifier",
"src": "187:18:24"
},
{
"baseName": {
"id": 3144,
"name": "WitnetConsumer",
"nameLocations": [
"216:14:24"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 1566,
"src": "216:14:24"
},
"id": 3145,
"nodeType": "InheritanceSpecifier",
"src": "216:14:24"
}
],
"canonicalName": "WitnetRequestConsumer",
"contractDependencies": [],
"contractKind": "contract",
"fullyImplemented": false,
"id": 3223,
"linearizedBaseContracts": [
3223,
1566,
1314,
1157,
13315,
12829
],
"name": "WitnetRequestConsumer",
"nameLocation": "148:21:24",
"nodeType": "ContractDefinition",
"nodes": [
{
"global": false,
"id": 3149,
"libraryName": {
"id": 3146,
"name": "WitnetCBOR",
"nameLocations": [
"245:10:24"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 20734,
"src": "245:10:24"
},
"nodeType": "UsingForDirective",
"src": "239:37:24",
"typeName": {
"id": 3148,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 3147,
"name": "WitnetCBOR.CBOR",
"nameLocations": [
"260:10:24",
"271:4:24"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 19218,
"src": "260:15:24"
},
"referencedDeclaration": 19218,
"src": "260:15:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_CBOR_$19218_storage_ptr",
"typeString": "struct WitnetCBOR.CBOR"
}
}
},
{
"global": false,
"id": 3154,
"libraryName": {
"id": 3150,
"name": "WitnetCBOR",
"nameLocations": [
"288:10:24"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 20734,
"src": "288:10:24"
},
"nodeType": "UsingForDirective",
"src": "282:39:24",
"typeName": {
"baseType": {
"id": 3152,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 3151,
"name": "WitnetCBOR.CBOR",
"nameLocations": [
"303:10:24",
"314:4:24"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 19218,
"src": "303:15:24"
},
"referencedDeclaration": 19218,
"src": "303:15:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_CBOR_$19218_storage_ptr",
"typeString": "struct WitnetCBOR.CBOR"
}
},
"id": 3153,
"nodeType": "ArrayTypeName",
"src": "303:17:24",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_CBOR_$19218_storage_$dyn_storage_ptr",
"typeString": "struct WitnetCBOR.CBOR[]"
}
}
},
{
"body": {
"id": 3172,
"nodeType": "Block",
"src": "910:2:24",
"statements": []
},
"documentation": {
"id": 3155,
"nodeType": "StructuredDocumentation",
"src": "329:301:24",
"text": "@param _witnetRequest Address of the WitnetRequest contract containing the actual data request.\n @param _baseFeeOverheadPercentage Percentage over base fee to pay as on every data request.\n @param _callbackGasLimit Maximum gas to be spent by the IWitnetConsumer's callback methods."
},
"id": 3173,
"implemented": true,
"kind": "constructor",
"modifiers": [
{
"arguments": [
{
"id": 3165,
"name": "_witnetRequest",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3158,
"src": "818:14:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_WitnetRequest_$826",
"typeString": "contract WitnetRequest"
}
},
{
"id": 3166,
"name": "_baseFeeOverheadPercentage",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3160,
"src": "834:26:24",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
}
],
"id": 3167,
"kind": "baseConstructorSpecifier",
"modifierName": {
"id": 3164,
"name": "UsingWitnetRequest",
"nameLocations": [
"799:18:24"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 1314,
"src": "799:18:24"
},
"nodeType": "ModifierInvocation",
"src": "799:62:24"
},
{
"arguments": [
{
"id": 3169,
"name": "_callbackGasLimit",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3162,
"src": "886:17:24",
"typeDescriptions": {
"typeIdentifier": "t_uint24",
"typeString": "uint24"
}
}
],
"id": 3170,
"kind": "baseConstructorSpecifier",
"modifierName": {
"id": 3168,
"name": "WitnetConsumer",
"nameLocations": [
"871:14:24"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 1566,
"src": "871:14:24"
},
"nodeType": "ModifierInvocation",
"src": "871:33:24"
}
],
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 3163,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 3158,
"mutability": "mutable",
"name": "_witnetRequest",
"nameLocation": "676:14:24",
"nodeType": "VariableDeclaration",
"scope": 3173,
"src": "662:28:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_WitnetRequest_$826",
"typeString": "contract WitnetRequest"
},
"typeName": {
"id": 3157,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 3156,
"name": "WitnetRequest",
"nameLocations": [
"662:13:24"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 826,
"src": "662:13:24"
},
"referencedDeclaration": 826,
"src": "662:13:24",
"typeDescriptions": {
"typeIdentifier": "t_contract$_WitnetRequest_$826",
"typeString": "contract WitnetRequest"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 3160,
"mutability": "mutable",
"name": "_baseFeeOverheadPercentage",
"nameLocation": "713:26:24",
"nodeType": "VariableDeclaration",
"scope": 3173,
"src": "706:33:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 3159,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "706:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 3162,
"mutability": "mutable",
"name": "_callbackGasLimit",
"nameLocation": "761:17:24",
"nodeType": "VariableDeclaration",
"scope": 3173,
"src": "754:24:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint24",
"typeString": "uint24"
},
"typeName": {
"id": 3161,
"name": "uint24",
"nodeType": "ElementaryTypeName",
"src": "754:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint24",
"typeString": "uint24"
}
},
"visibility": "internal"
}
],
"src": "647:142:24"
},
"returnParameters": {
"id": 3171,
"nodeType": "ParameterList",
"parameters": [],
"src": "910:0:24"
},
"scope": 3223,
"src": "636:276:24",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
},
{
"baseFunctions": [
1281,
1529
],
"body": {
"id": 3185,
"nodeType": "Block",
"src": "1074:67:24",
"statements": [
{
"expression": {
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"id": 3181,
"name": "WitnetConsumer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1566,
"src": "1092:14:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_WitnetConsumer_$1566_$",
"typeString": "type(contract WitnetConsumer)"
}
},
"id": 3182,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberLocation": "1107:24:24",
"memberName": "_witnetEstimateEvmReward",
"nodeType": "MemberAccess",
"referencedDeclaration": 1529,
"src": "1092:39:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 3183,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "1092:41:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 3180,
"id": 3184,
"nodeType": "Return",
"src": "1085:48:24"
}
]
},
"id": 3186,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_witnetEstimateEvmReward",
"nameLocation": "929:24:24",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 3177,
"nodeType": "OverrideSpecifier",
"overrides": [
{
"id": 3175,
"name": "UsingWitnetRequest",
"nameLocations": [
"983:18:24"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 1314,
"src": "983:18:24"
},
{
"id": 3176,
"name": "WitnetConsumer",
"nameLocations": [
"1003:14:24"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 1566,
"src": "1003:14:24"
}
],
"src": "974:44:24"
},
"parameters": {
"id": 3174,
"nodeType": "ParameterList",
"parameters": [],
"src": "953:2:24"
},
"returnParameters": {
"id": 3180,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 3179,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 3186,
"src": "1060:7:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 3178,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1060:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "1059:9:24"
},
"scope": 3223,
"src": "920:221:24",
"stateMutability": "view",
"virtual": true,
"visibility": "internal"
},
{
"baseFunctions": [
1128,
1541
],
"body": {
"id": 3200,
"nodeType": "Block",
"src": "1302:67:24",
"statements": [
{
"expression": {
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"id": 3196,
"name": "WitnetConsumer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1566,
"src": "1320:14:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_WitnetConsumer_$1566_$",
"typeString": "type(contract WitnetConsumer)"
}
},
"id": 3197,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberLocation": "1335:24:24",
"memberName": "_witnetEstimateEvmReward",
"nodeType": "MemberAccess",
"referencedDeclaration": 1529,
"src": "1320:39:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 3198,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "1320:41:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 3195,
"id": 3199,
"nodeType": "Return",
"src": "1313:48:24"
}
]
},
"id": 3201,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_witnetEstimateEvmReward",
"nameLocation": "1159:24:24",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 3192,
"nodeType": "OverrideSpecifier",
"overrides": [
{
"id": 3190,
"name": "UsingWitnet",
"nameLocations": [
"1218:11:24"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 1157,
"src": "1218:11:24"
},
{
"id": 3191,
"name": "WitnetConsumer",
"nameLocations": [
"1231:14:24"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 1566,
"src": "1231:14:24"
}
],
"src": "1209:37:24"
},
"parameters": {
"id": 3189,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 3188,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 3201,
"src": "1184:6:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 3187,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "1184:6:24",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
}
],
"src": "1183:8:24"
},
"returnParameters": {
"id": 3195,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 3194,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 3201,
"src": "1288:7:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 3193,
"name": "uint256