UNPKG

witnet-solidity-bridge

Version:

Witnet Solidity Bridge contracts for EVM-compatible chains

1,088 lines (1,087 loc) 69.3 kB
{ "contractName": "UsingWitnetRequest", "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": [], "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\":[],\"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.\",\"_witnetRequest\":\"Address of the WitnetRequest contract containing the actual data request.\"}}},\"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\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"project:/contracts/apps/UsingWitnetRequest.sol\":\"UsingWitnetRequest\"},\"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/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 \"./UsingWitnet.sol\";\r\nimport \"../WitnetRequest.sol\";\r\n\r\nabstract contract UsingWitnetRequest\r\n is UsingWitnet\r\n{\r\n WitnetRequest immutable public dataRequest;\r\n \r\n bytes32 immutable internal __witnetRequestRadHash;\r\n uint16 immutable internal __witnetQueryResultMaxSize;\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 constructor (\r\n WitnetRequest _witnetRequest,\r\n uint16 _baseFeeOverheadPercentage\r\n )\r\n UsingWitnet(_witnetRequest.witnet())\r\n {\r\n require(\r\n _witnetRequest.specs() == type(WitnetRequest).interfaceId,\r\n \"UsingWitnetRequest: uncompliant WitnetRequest\"\r\n );\r\n dataRequest = _witnetRequest;\r\n __witnetQueryResultMaxSize = _witnetRequest.resultDataMaxSize();\r\n __witnetRequestRadHash = _witnetRequest.radHash();\r\n __witnetBaseFeeOverheadPercentage = _baseFeeOverheadPercentage;\r\n }\r\n\r\n function _witnetEstimateEvmReward()\r\n virtual internal view\r\n returns (uint256)\r\n {\r\n return _witnetEstimateEvmReward(__witnetQueryResultMaxSize);\r\n }\r\n\r\n function __witnetRequestData(uint256 _witnetEvmReward)\r\n virtual internal returns (uint256)\r\n {\r\n return __witnetRequestData(_witnetEvmReward, __witnetDefaultSLA);\r\n }\r\n\r\n function __witnetRequestData(\r\n uint256 _witnetEvmReward,\r\n WitnetV2.RadonSLA memory _witnetQuerySLA\r\n )\r\n virtual internal returns (uint256)\r\n {\r\n return __witnet.postRequest{value: _witnetEvmReward}(\r\n __witnetRequestRadHash,\r\n _witnetQuerySLA\r\n );\r\n }\r\n}\r\n", "sourcePath": "C:\\Users\\guill\\github\\witnet\\witnet-solidity-bridge\\contracts\\apps\\UsingWitnetRequest.sol", "ast": { "absolutePath": "project:/contracts/apps/UsingWitnetRequest.sol", "exportedSymbols": { "IWitnetOracle": [ 13265 ], "IWitnetOracleEvents": [ 13315 ], "IWitnetRequestBytecodes": [ 13979 ], "IWitnetRequestFactory": [ 14002 ], "UsingWitnet": [ 1157 ], "UsingWitnetRequest": [ 1314 ], "Witnet": [ 17557 ], "WitnetBuffer": [ 19191 ], "WitnetCBOR": [ 20734 ], "WitnetOracle": [ 749 ], "WitnetRequest": [ 826 ], "WitnetRequestBytecodes": [ 849 ], "WitnetRequestFactory": [ 880 ], "WitnetRequestTemplate": [ 1005 ], "WitnetV2": [ 23640 ] }, "id": 1315, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 1213, "literals": [ "solidity", "^", "0.8", ".0" ], "nodeType": "PragmaDirective", "src": "33:23:18" }, { "absolutePath": "project:/contracts/apps/UsingWitnet.sol", "file": "./UsingWitnet.sol", "id": 1214, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 1315, "sourceUnit": 1158, "src": "60:27:18", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "project:/contracts/WitnetRequest.sol", "file": "../WitnetRequest.sol", "id": 1215, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 1315, "sourceUnit": 827, "src": "89:30:18", "symbolAliases": [], "unitAlias": "" }, { "abstract": true, "baseContracts": [ { "baseName": { "id": 1216, "name": "UsingWitnet", "nameLocations": [ "168:11:18" ], "nodeType": "IdentifierPath", "referencedDeclaration": 1157, "src": "168:11:18" }, "id": 1217, "nodeType": "InheritanceSpecifier", "src": "168:11:18" } ], "canonicalName": "UsingWitnetRequest", "contractDependencies": [], "contractKind": "contract", "fullyImplemented": true, "id": 1314, "linearizedBaseContracts": [ 1314, 1157, 13315 ], "name": "UsingWitnetRequest", "nameLocation": "141:18:18", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "functionSelector": "ec935940", "id": 1220, "mutability": "immutable", "name": "dataRequest", "nameLocation": "219:11:18", "nodeType": "VariableDeclaration", "scope": 1314, "src": "188:42:18", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_WitnetRequest_$826", "typeString": "contract WitnetRequest" }, "typeName": { "id": 1219, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 1218, "name": "WitnetRequest", "nameLocations": [ "188:13:18" ], "nodeType": "IdentifierPath", "referencedDeclaration": 826, "src": "188:13:18" }, "referencedDeclaration": 826, "src": "188:13:18", "typeDescriptions": { "typeIdentifier": "t_contract$_WitnetRequest_$826", "typeString": "contract WitnetRequest" } }, "visibility": "public" }, { "constant": false, "id": 1222, "mutability": "immutable", "name": "__witnetRequestRadHash", "nameLocation": "270:22:18", "nodeType": "VariableDeclaration", "scope": 1314, "src": "243:49:18", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 1221, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "243:7:18", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "visibility": "internal" }, { "constant": false, "id": 1224, "mutability": "immutable", "name": "__witnetQueryResultMaxSize", "nameLocation": "326:26:18", "nodeType": "VariableDeclaration", "scope": 1314, "src": "299:53:18", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint16", "typeString": "uint16" }, "typeName": { "id": 1223, "name": "uint16", "nodeType": "ElementaryTypeName", "src": "299:6:18", "typeDescriptions": { "typeIdentifier": "t_uint16", "typeString": "uint16" } }, "visibility": "internal" }, { "body": { "id": 1270, "nodeType": "Block", "src": "734:417:18", "statements": [ { "expression": { "arguments": [ { "commonType": { "typeIdentifier": "t_bytes4", "typeString": "bytes4" }, "id": 1246, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "arguments": [], "expression": { "argumentTypes": [], "expression": { "id": 1239, "name": "_witnetRequest", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1228, "src": "767:14:18", "typeDescriptions": { "typeIdentifier": "t_contract$_WitnetRequest_$826", "typeString": "contract WitnetRequest" } }, "id": 1240, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberLocation": "782:5:18", "memberName": "specs", "nodeType": "MemberAccess", "referencedDeclaration": 918, "src": "767:20:18", "typeDescriptions": { "typeIdentifier": "t_function_external_view$__$returns$_t_bytes4_$", "typeString": "function () view external returns (bytes4)" } }, "id": 1241, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "767:22:18", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bytes4", "typeString": "bytes4" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "expression": { "arguments": [ { "id": 1243, "name": "WitnetRequest", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 826, "src": "798:13:18", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_WitnetRequest_$826_$", "typeString": "type(contract WitnetRequest)" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_type$_t_contract$_WitnetRequest_$826_$", "typeString": "type(contract WitnetRequest)" } ], "id": 1242, "name": "type", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4294967269, "src": "793:4:18", "typeDescriptions": { "typeIdentifier": "t_function_metatype_pure$__$returns$__$", "typeString": "function () pure" } }, "id": 1244, "isConstant": false, "isLValue": false, "isPure": true, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "793:19:18", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_magic_meta_type_t_contract$_WitnetRequest_$826", "typeString": "type(contract WitnetRequest)" } }, "id": 1245, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "memberLocation": "813:11:18", "memberName": "interfaceId", "nodeType": "MemberAccess", "src": "793:31:18", "typeDescriptions": { "typeIdentifier": "t_bytes4", "typeString": "bytes4" } }, "src": "767:57:18", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "hexValue": "5573696e675769746e6574526571756573743a20756e636f6d706c69616e74205769746e657452657175657374", "id": 1247, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "839:47:18", "typeDescriptions": { "typeIdentifier": "t_stringliteral_062714dd91ba195e1e9145e764cac47f5375434fdbca577542bc1979d41889d5", "typeString": "literal_string \"UsingWitnetRequest: uncompliant WitnetRequest\"" }, "value": "UsingWitnetRequest: uncompliant WitnetRequest" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_062714dd91ba195e1e9145e764cac47f5375434fdbca577542bc1979d41889d5", "typeString": "literal_string \"UsingWitnetRequest: uncompliant WitnetRequest\"" } ], "id": 1238, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 4294967278, 4294967278 ], "referencedDeclaration": 4294967278, "src": "745:7:18", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 1248, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "745:152:18", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1249, "nodeType": "ExpressionStatement", "src": "745:152:18" }, { "expression": { "id": 1252, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 1250, "name": "dataRequest", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1220, "src": "908:11:18", "typeDescriptions": { "typeIdentifier": "t_contract$_WitnetRequest_$826", "typeString": "contract WitnetRequest" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "id": 1251, "name": "_witnetRequest", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1228, "src": "922:14:18", "typeDescriptions": { "typeIdentifier": "t_contract$_WitnetRequest_$826", "typeString": "contract WitnetRequest" } }, "src": "908:28:18", "typeDescriptions": { "typeIdentifier": "t_contract$_WitnetRequest_$826", "typeString": "contract WitnetRequest" } }, "id": 1253, "nodeType": "ExpressionStatement", "src": "908:28:18" }, { "expression": { "id": 1258, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 1254, "name": "__witnetQueryResultMaxSize", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1224, "src": "947:26:18", "typeDescriptions": { "typeIdentifier": "t_uint16", "typeString": "uint16" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "arguments": [], "expression": { "argumentTypes": [], "expression": { "id": 1255, "name": "_witnetRequest", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1228, "src": "976:14:18", "typeDescriptions": { "typeIdentifier": "t_contract$_WitnetRequest_$826", "typeString": "contract WitnetRequest" } }, "id": 1256, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberLocation": "991:17:18", "memberName": "resultDataMaxSize", "nodeType": "MemberAccess", "referencedDeclaration": 944, "src": "976:32:18", "typeDescriptions": { "typeIdentifier": "t_function_external_view$__$returns$_t_uint16_$", "typeString": "function () view external returns (uint16)" } }, "id": 1257, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "976:34:18", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint16", "typeString": "uint16" } }, "src": "947:63:18", "typeDescriptions": { "typeIdentifier": "t_uint16", "typeString": "uint16" } }, "id": 1259, "nodeType": "ExpressionStatement", "src": "947:63:18" }, { "expression": { "id": 1264, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 1260, "name": "__witnetRequestRadHash", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1222, "src": "1021:22:18", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "arguments": [], "expression": { "argumentTypes": [], "expression": { "id": 1261, "name": "_witnetRequest", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1228, "src": "1046:14:18", "typeDescriptions": { "typeIdentifier": "t_contract$_WitnetRequest_$826", "typeString": "contract WitnetRequest" } }, "id": 1262, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberLocation": "1061:7:18", "memberName": "radHash", "nodeType": "MemberAccess", "referencedDeclaration": 825, "src": "1046:22:18", "typeDescriptions": { "typeIdentifier": "t_function_external_view$__$returns$_t_bytes32_$", "typeString": "function () view external returns (bytes32)" } }, "id": 1263, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "1046:24:18", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "src": "1021:49:18", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "id": 1265, "nodeType": "ExpressionStatement", "src": "1021:49:18" }, { "expression": { "id": 1268, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 1266, "name": "__witnetBaseFeeOverheadPercentage", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1023, "src": "1081:33:18", "typeDescriptions": { "typeIdentifier": "t_uint16", "typeString": "uint16" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "id": 1267, "name": "_baseFeeOverheadPercentage", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1230, "src": "1117:26:18", "typeDescriptions": { "typeIdentifier": "t_uint16", "typeString": "uint16" } }, "src": "1081:62:18", "typeDescriptions": { "typeIdentifier": "t_uint16", "typeString": "uint16" } }, "id": 1269, "nodeType": "ExpressionStatement", "src": "1081:62:18" } ] }, "documentation": { "id": 1225, "nodeType": "StructuredDocumentation", "src": "362:200:18", "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." }, "id": 1271, "implemented": true, "kind": "constructor", "modifiers": [ { "arguments": [ { "arguments": [], "expression": { "argumentTypes": [], "expression": { "id": 1233, "name": "_witnetRequest", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1228, "src": "704:14:18", "typeDescriptions": { "typeIdentifier": "t_contract$_WitnetRequest_$826", "typeString": "contract WitnetRequest" } }, "id": 1234, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberLocation": "719:6:18", "memberName": "witnet", "nodeType": "MemberAccess", "referencedDeclaration": 929, "src": "704:21:18", "typeDescriptions": { "typeIdentifier": "t_function_external_view$__$returns$_t_contract$_WitnetOracle_$749_$", "typeString": "function () view external returns (contract WitnetOracle)" } }, "id": 1235, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "704:23:18", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_contract$_WitnetOracle_$749", "typeString": "contract WitnetOracle" } } ], "id": 1236, "kind": "baseConstructorSpecifier", "modifierName": { "id": 1232, "name": "UsingWitnet", "nameLocations": [ "692:11:18" ], "nodeType": "IdentifierPath", "referencedDeclaration": 1157, "src": "692:11:18" }, "nodeType": "ModifierInvocation", "src": "692:36:18" } ], "name": "", "nameLocation": "-1:-1:-1", "nodeType": "FunctionDefinition", "parameters": { "id": 1231, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1228, "mutability": "mutable", "name": "_witnetRequest", "nameLocation": "609:14:18", "nodeType": "VariableDeclaration", "scope": 1271, "src": "595:28:18", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_WitnetRequest_$826", "typeString": "contract WitnetRequest" }, "typeName": { "id": 1227, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 1226, "name": "WitnetRequest", "nameLocations": [ "595:13:18" ], "nodeType": "IdentifierPath", "referencedDeclaration": 826, "src": "595:13:18" }, "referencedDeclaration": 826, "src": "595:13:18", "typeDescriptions": { "typeIdentifier": "t_contract$_WitnetRequest_$826", "typeString": "contract WitnetRequest" } }, "visibility": "internal" }, { "constant": false, "id": 1230, "mutability": "mutable", "name": "_baseFeeOverheadPercentage", "nameLocation": "645:26:18", "nodeType": "VariableDeclaration", "scope": 1271, "src": "638:33:18", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint16", "typeString": "uint16" }, "typeName": { "id": 1229, "name": "uint16", "nodeType": "ElementaryTypeName", "src": "638:6:18", "typeDescriptions": { "typeIdentifier": "t_uint16", "typeString": "uint16" } }, "visibility": "internal" } ], "src": "580:102:18" }, "returnParameters": { "id": 1237, "nodeType": "ParameterList", "parameters": [], "src": "734:0:18" }, "scope": 1314, "src": "568:583:18", "stateMutability": "nonpayable", "virtual": false, "visibility": "internal" }, { "body": { "id": 1280, "nodeType": "Block", "src": "1258:78:18", "statements": [ { "expression": { "arguments": [ { "id": 1277, "name": "__witnetQueryResultMaxSize", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1224, "src": "1301:26:18", "typeDescriptions": { "typeIdentifier": "t_uint16", "typeString": "uint16" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint16", "typeString": "uint16" } ], "id": 1276, "name": "_witnetEstimateEvmReward", "nodeType": "Identifier", "overloadedDeclarations": [ 1281, 1128 ], "referencedDeclaration": 1128, "src": "1276:24:18", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_uint16_$returns$_t_uint256_$", "typeString": "function (uint16) view returns (uint256)" } }, "id": 1278, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "1276:52:18", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 1275, "id": 1279, "nodeType": "Return", "src": "1269:59:18" } ] }, "id": 1281, "implemented": true, "kind": "function", "modifiers": [], "name": "_witnetEstimateEvmReward", "nameLocation": "1168:24:18", "nodeType": "FunctionDefinition", "parameters": { "id": 1272, "nodeType": "ParameterList", "parameters": [], "src": "1192:2:18" }, "returnParameters": { "id": 1275, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1274, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 1281,