UNPKG

witnet-solidity-bridge

Version:

Witnet Solidity Bridge contracts for EVM-compatible chains

1,023 lines 47.7 kB
{ "contractName": "UsingWitnetRandomness", "abi": [ { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "blockNumber", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "evmTxGasPrice", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "evmRandomizeFee", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "witnetQueryId", "type": "uint256" }, { "components": [ { "internalType": "uint8", "name": "committeeSize", "type": "uint8" }, { "internalType": "uint64", "name": "witnessingFeeNanoWit", "type": "uint64" } ], "indexed": false, "internalType": "struct WitnetV2.RadonSLA", "name": "witnetQuerySLA", "type": "tuple" } ], "name": "Randomizing", "type": "event" }, { "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": "__RNG", "outputs": [ { "internalType": "contract WitnetRandomness", "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\":\"blockNumber\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"evmTxGasPrice\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"evmRandomizeFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"witnetQueryId\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"committeeSize\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"witnessingFeeNanoWit\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"struct WitnetV2.RadonSLA\",\"name\":\"witnetQuerySLA\",\"type\":\"tuple\"}],\"name\":\"Randomizing\",\"type\":\"event\"},{\"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\":\"__RNG\",\"outputs\":[{\"internalType\":\"contract WitnetRandomness\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"witnet\",\"outputs\":[{\"internalType\":\"contract WitnetOracle\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"The Witnet Foundation.\",\"details\":\"Contracts willing to interact with WitnetRandomness appliance should just inherit from this contract.\",\"kind\":\"dev\",\"methods\":{},\"title\":\"The UsingWitnetRandomness contract\",\"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/UsingWitnetRandomness.sol\":\"UsingWitnetRandomness\"},\"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/WitnetRandomness.sol\":{\"keccak256\":\"0xa18727bf1e426ea2cd9c51e29f20090d2e305bd4548225b612deac8a175eb290\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://358755b23533fd4e59c26de21a5996a494867ff9324f5a8969674cc50f0de371\",\"dweb:/ipfs/QmSbLdscuJTortmR4LoCriKbGTSepUgMuxptN9xCsFuFJ1\"]},\"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/apps/UsingWitnetRandomness.sol\":{\"keccak256\":\"0x5000fca3d29528e5e5087fb0446072fe572db176eb24c022948958fb42a4909f\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://398fc23b88c58d068a6a193c9311394c432781d0eb8b704b404bc377f0f14b12\",\"dweb:/ipfs/QmemT4hGAL7w3n7xzvFLtMgFVsoek3YxsQNPJGayBDjJuz\"]},\"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/IWitnetRandomness.sol\":{\"keccak256\":\"0xe1dece4459bee43e03cbc83e3feb455de406e633c778ac70e3da5d0c65402d68\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8d79acbdbddc0882e6067d4722184423102b78fa1ca9fd94e4d0b9c6dd9f4485\",\"dweb:/ipfs/QmVs5it4bV2cqZPfdCejmHh3SybxciuQoKE8pswUWqPc1R\"]},\"project:/contracts/interfaces/IWitnetRandomnessEvents.sol\":{\"keccak256\":\"0x3d5510777da725c0772a04bc40a967c07713139bc50bb732462baccc1acfb0eb\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://481f334e116fa761e2d9fdc668cf9278c8d192f0b0511066637dab6011fac908\",\"dweb:/ipfs/QmS1Vh6Xab5oBmTxLempvGvpAsVfEQthbrg1aWXe2SqRRa\"]},\"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\n\r\npragma solidity >=0.7.0 <0.9.0;\r\npragma experimental ABIEncoderV2;\r\n\r\nimport \"../WitnetRandomness.sol\";\r\n\r\n/// @title The UsingWitnetRandomness contract\r\n/// @dev Contracts willing to interact with WitnetRandomness appliance should just inherit from this contract.\r\n/// @author The Witnet Foundation.\r\nabstract contract UsingWitnetRandomness\r\n is\r\n IWitnetOracleEvents,\r\n IWitnetRandomnessEvents\r\n{\r\n WitnetOracle immutable public witnet;\r\n WitnetRandomness immutable public __RNG;\r\n\r\n constructor(WitnetRandomness _witnetRandomness) {\r\n require(\r\n address(_witnetRandomness).code.length > 0\r\n && _witnetRandomness.specs() == type(WitnetRandomness).interfaceId,\r\n \"UsingWitnetRandomness: uncompliant WitnetRandomness appliance\"\r\n );\r\n __RNG = _witnetRandomness;\r\n witnet = __RNG.witnet();\r\n }\r\n\r\n}\r\n\r\n", "sourcePath": "C:\\Users\\guill\\github\\witnet\\witnet-solidity-bridge\\contracts\\apps\\UsingWitnetRandomness.sol", "ast": { "absolutePath": "project:/contracts/apps/UsingWitnetRandomness.sol", "exportedSymbols": { "IWitnetOracle": [ 13265 ], "IWitnetOracleEvents": [ 13315 ], "IWitnetRandomness": [ 13639 ], "IWitnetRandomnessEvents": [ 13696 ], "IWitnetRequestBytecodes": [ 13979 ], "IWitnetRequestFactory": [ 14002 ], "UsingWitnetRandomness": [ 1211 ], "Witnet": [ 17557 ], "WitnetBuffer": [ 19191 ], "WitnetCBOR": [ 20734 ], "WitnetOracle": [ 749 ], "WitnetRandomness": [ 794 ], "WitnetRequestBytecodes": [ 849 ], "WitnetRequestFactory": [ 880 ], "WitnetV2": [ 23640 ] }, "id": 1212, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 1159, "literals": [ "solidity", ">=", "0.7", ".0", "<", "0.9", ".0" ], "nodeType": "PragmaDirective", "src": "35:31:17" }, { "id": 1160, "literals": [ "experimental", "ABIEncoderV2" ], "nodeType": "PragmaDirective", "src": "68:33:17" }, { "absolutePath": "project:/contracts/WitnetRandomness.sol", "file": "../WitnetRandomness.sol", "id": 1161, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 1212, "sourceUnit": 795, "src": "105:33:17", "symbolAliases": [], "unitAlias": "" }, { "abstract": true, "baseContracts": [ { "baseName": { "id": 1163, "name": "IWitnetOracleEvents", "nameLocations": [ "394:19:17" ], "nodeType": "IdentifierPath", "referencedDeclaration": 13315, "src": "394:19:17" }, "id": 1164, "nodeType": "InheritanceSpecifier", "src": "394:19:17" }, { "baseName": { "id": 1165, "name": "IWitnetRandomnessEvents", "nameLocations": [ "424:23:17" ], "nodeType": "IdentifierPath", "referencedDeclaration": 13696, "src": "424:23:17" }, "id": 1166, "nodeType": "InheritanceSpecifier", "src": "424:23:17" } ], "canonicalName": "UsingWitnetRandomness", "contractDependencies": [], "contractKind": "contract", "documentation": { "id": 1162, "nodeType": "StructuredDocumentation", "src": "142:195:17", "text": "@title The UsingWitnetRandomness contract\n @dev Contracts willing to interact with WitnetRandomness appliance should just inherit from this contract.\n @author The Witnet Foundation." }, "fullyImplemented": true, "id": 1211, "linearizedBaseContracts": [ 1211, 13696, 13315 ], "name": "UsingWitnetRandomness", "nameLocation": "355:21:17", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "functionSelector": "46d1d21a", "id": 1169, "mutability": "immutable", "name": "witnet", "nameLocation": "486:6:17", "nodeType": "VariableDeclaration", "scope": 1211, "src": "456:36:17", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_WitnetOracle_$749", "typeString": "contract WitnetOracle" }, "typeName": { "id": 1168, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 1167, "name": "WitnetOracle", "nameLocations": [ "456:12:17" ], "nodeType": "IdentifierPath", "referencedDeclaration": 749, "src": "456:12:17" }, "referencedDeclaration": 749, "src": "456:12:17", "typeDescriptions": { "typeIdentifier": "t_contract$_WitnetOracle_$749", "typeString": "contract WitnetOracle" } }, "visibility": "public" }, { "constant": false, "functionSelector": "9d69f749", "id": 1172, "mutability": "immutable", "name": "__RNG", "nameLocation": "533:5:17", "nodeType": "VariableDeclaration", "scope": 1211, "src": "499:39:17", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_WitnetRandomness_$794", "typeString": "contract WitnetRandomness" }, "typeName": { "id": 1171, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 1170, "name": "WitnetRandomness", "nameLocations": [ "499:16:17" ], "nodeType": "IdentifierPath", "referencedDeclaration": 794, "src": "499:16:17" }, "referencedDeclaration": 794, "src": "499:16:17", "typeDescriptions": { "typeIdentifier": "t_contract$_WitnetRandomness_$794", "typeString": "contract WitnetRandomness" } }, "visibility": "public" }, { "body": { "id": 1209, "nodeType": "Block", "src": "595:326:17", "statements": [ { "expression": { "arguments": [ { "commonType": { "typeIdentifier": "t_bool", "typeString": "bool" }, "id": 1195, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1186, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "expression": { "expression": { "arguments": [ { "id": 1181, "name": "_witnetRandomness", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1175, "src": "636:17:17", "typeDescriptions": { "typeIdentifier": "t_contract$_WitnetRandomness_$794", "typeString": "contract WitnetRandomness" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_contract$_WitnetRandomness_$794", "typeString": "contract WitnetRandomness" } ], "id": 1180, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "628:7:17", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": { "id": 1179, "name": "address", "nodeType": "ElementaryTypeName", "src": "628:7:17", "typeDescriptions": {} } }, "id": 1182, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "628:26:17", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 1183, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberLocation": "655:4:17", "memberName": "code", "nodeType": "MemberAccess", "src": "628:31:17", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, "id": 1184, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberLocation": "660:6:17", "memberName": "length", "nodeType": "MemberAccess", "src": "628:38:17", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "hexValue": "30", "id": 1185, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "669:1:17", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "628:42:17", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "BinaryOperation", "operator": "&&", "rightExpression": { "commonType": { "typeIdentifier": "t_bytes4", "typeString": "bytes4" }, "id": 1194, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "arguments": [], "expression": { "argumentTypes": [], "expression": { "id": 1187, "name": "_witnetRandomness", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1175, "src": "691:17:17", "typeDescriptions": { "typeIdentifier": "t_contract$_WitnetRandomness_$794", "typeString": "contract WitnetRandomness" } }, "id": 1188, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberLocation": "709:5:17", "memberName": "specs", "nodeType": "MemberAccess", "referencedDeclaration": 793, "src": "691:23:17", "typeDescriptions": { "typeIdentifier": "t_function_external_view$__$returns$_t_bytes4_$", "typeString": "function () view external returns (bytes4)" } }, "id": 1189, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "691:25:17", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bytes4", "typeString": "bytes4" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "expression": { "arguments": [ { "id": 1191, "name": "WitnetRandomness", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 794, "src": "725:16:17", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_WitnetRandomness_$794_$", "typeString": "type(contract WitnetRandomness)" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_type$_t_contract$_WitnetRandomness_$794_$", "typeString": "type(contract WitnetRandomness)" } ], "id": 1190, "name": "type", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4294967269, "src": "720:4:17", "typeDescriptions": { "typeIdentifier": "t_function_metatype_pure$__$returns$__$", "typeString": "function () pure" } }, "id": 1192, "isConstant": false, "isLValue": false, "isPure": true, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "720:22:17", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_magic_meta_type_t_contract$_WitnetRandomness_$794", "typeString": "type(contract WitnetRandomness)" } }, "id": 1193, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "memberLocation": "743:11:17", "memberName": "interfaceId", "nodeType": "MemberAccess", "src": "720:34:17", "typeDescriptions": { "typeIdentifier": "t_bytes4", "typeString": "bytes4" } }, "src": "691:63:17", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "src": "628:126:17", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "hexValue": "5573696e675769746e657452616e646f6d6e6573733a20756e636f6d706c69616e74205769746e657452616e646f6d6e657373206170706c69616e6365", "id": 1196, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "769:63:17", "typeDescriptions": { "typeIdentifier": "t_stringliteral_1d6b6232522f9c219f5df278ac28d26ff127b319089fc7d3948c57eb01aedc2d", "typeString": "literal_string \"UsingWitnetRandomness: uncompliant WitnetRandomness appliance\"" }, "value": "UsingWitnetRandomness: uncompliant WitnetRandomness appliance" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_1d6b6232522f9c219f5df278ac28d26ff127b319089fc7d3948c57eb01aedc2d", "typeString": "literal_string \"UsingWitnetRandomness: uncompliant WitnetRandomness appliance\"" } ], "id": 1178, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 4294967278, 4294967278 ], "referencedDeclaration": 4294967278, "src": "606:7:17", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 1197, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "606:237:17", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1198, "nodeType": "ExpressionStatement", "src": "606:237:17" }, { "expression": { "id": 1201, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 1199, "name": "__RNG", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1172, "src": "854:5:17", "typeDescriptions": { "typeIdentifier": "t_contract$_WitnetRandomness_$794", "typeString": "contract WitnetRandomness" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "id": 1200, "name": "_witnetRandomness", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1175, "src": "862:17:17", "typeDescriptions": { "typeIdentifier": "t_contract$_WitnetRandomness_$794", "typeString": "contract WitnetRandomness" } }, "src": "854:25:17", "typeDescriptions": { "typeIdentifier": "t_contract$_WitnetRandomness_$794", "typeString": "contract WitnetRandomness" } }, "id": 1202, "nodeType": "ExpressionStatement", "src": "854:25:17" }, { "expression": { "id": 1207, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 1203, "name": "witnet", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1169, "src": "890:6:17", "typeDescriptions": { "typeIdentifier": "t_contract$_WitnetOracle_$749", "typeString": "contract WitnetOracle" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "arguments": [], "expression": { "argumentTypes": [], "expression": { "id": 1204, "name": "__RNG", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1172, "src": "899:5:17", "typeDescriptions": { "typeIdentifier": "t_contract$_WitnetRandomness_$794", "typeString": "contract WitnetRandomness" } }, "id": 1205, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberLocation": "905:6:17", "memberName": "witnet", "nodeType": "MemberAccess", "referencedDeclaration": 13625, "src": "899:12:17", "typeDescriptions": { "typeIdentifier": "t_function_external_view$__$returns$_t_contract$_WitnetOracle_$749_$", "typeString": "function () view external returns (contract WitnetOracle)" } }, "id": 1206, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "899:14:17", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_contract$_WitnetOracle_$749", "typeString": "contract WitnetOracle" } }, "src": "890:23:17", "typeDescriptions": { "typeIdentifier": "t_contract$_WitnetOracle_$749", "typeString": "contract WitnetOracle" } }, "id": 1208, "nodeType": "ExpressionStatement", "src": "890:23:17" } ] }, "id": 1210, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nameLocation": "-1:-1:-1", "nodeType": "FunctionDefinition", "parameters": { "id": 1176, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1175, "mutability": "mutable", "name": "_witnetRandomness", "nameLocation": "576:17:17", "nodeType": "VariableDeclaration", "scope": 1210, "src": "559:34:17", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_WitnetRandomness_$794", "typeString": "contract WitnetRandomness" }, "typeName": { "id": 1174, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 1173, "name": "WitnetRandomness", "nameLocations": [ "559:16:17" ], "nodeType": "IdentifierPath", "referencedDeclaration": 794, "src": "559:16:17" }, "referencedDeclaration": 794, "src": "559:16:17", "typeDescriptions": { "typeIdentifier": "t_contract$_WitnetRandomness_$794", "typeString": "contract WitnetRandomness" } }, "visibility": "internal" } ], "src": "558:36:17" }, "returnParameters": { "id": 1177, "nodeType": "ParameterList", "parameters": [], "src": "595:0:17" }, "scope": 1211, "src": "547:374:17", "stateMutability": "nonpayable", "virtual": false, "visibility": "internal" } ], "scope": 1212, "src": "337:589:17", "usedErrors": [], "usedEvents": [ 13278, 13285, 13294, 13307, 13314, 13695 ] } ], "src": "35:895:17" }, "compiler": { "name": "solc", "version": "0.8.25+commit.b61c2a91.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.4.16", "updatedAt": "2024-12-05T09:36:04.168Z", "devdoc": { "author": "The Witnet Foundation.", "details": "Contracts willing to interact with WitnetRandomness appliance should just inherit from this contract.", "kind": "dev", "methods": {}, "title": "The UsingWitnetRandomness contract", "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 } }