UNPKG

@etherisc/gif-interface

Version:

This repository holds the necessary interfaces and base contracts to interact with an existing GIF instance. The repository is not intended to be used on its own.

1,030 lines 35.1 kB
{ "abi": [ { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "requestId", "type": "uint256" } ], "name": "LogOracleCanceled", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "bytes32", "name": "processId", "type": "bytes32" }, { "indexed": false, "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "responsibleOracleId", "type": "uint256" } ], "name": "LogOracleRequested", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "bytes32", "name": "processId", "type": "bytes32" }, { "indexed": false, "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "responder", "type": "address" }, { "indexed": false, "internalType": "bool", "name": "success", "type": "bool" } ], "name": "LogOracleResponded", "type": "event" }, { "inputs": [ { "internalType": "uint256", "name": "requestId", "type": "uint256" } ], "name": "cancel", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "processId", "type": "bytes32" }, { "internalType": "bytes", "name": "input", "type": "bytes" }, { "internalType": "string", "name": "callbackMethodName", "type": "string" }, { "internalType": "address", "name": "callbackContractAddress", "type": "address" }, { "internalType": "uint256", "name": "responsibleOracleId", "type": "uint256" } ], "name": "request", "outputs": [ { "internalType": "uint256", "name": "requestId", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "internalType": "address", "name": "responder", "type": "address" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "respond", "outputs": [], "stateMutability": "nonpayable", "type": "function" } ], "allSourcePaths": { "20": "contracts/modules/IQuery.sol" }, "ast": { "absolutePath": "contracts/modules/IQuery.sol", "exportedSymbols": { "IQuery": [ 3440 ] }, "id": 3441, "license": "Apache-2.0", "nodeType": "SourceUnit", "nodes": [ { "id": 3375, "literals": [ "solidity", "0.8", ".2" ], "nodeType": "PragmaDirective", "src": "39:22:20" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "interface", "fullyImplemented": false, "id": 3440, "linearizedBaseContracts": [ 3440 ], "name": "IQuery", "nameLocation": "73:6:20", "nodeType": "ContractDefinition", "nodes": [ { "canonicalName": "IQuery.OracleRequest", "id": 3388, "members": [ { "constant": false, "id": 3377, "mutability": "mutable", "name": "processId", "nameLocation": "126:9:20", "nodeType": "VariableDeclaration", "scope": 3388, "src": "118:17:20", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 3376, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "118:7:20", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "visibility": "internal" }, { "constant": false, "id": 3379, "mutability": "mutable", "name": "responsibleOracleId", "nameLocation": "153:19:20", "nodeType": "VariableDeclaration", "scope": 3388, "src": "145:27:20", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 3378, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "145:7:20", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" }, { "constant": false, "id": 3381, "mutability": "mutable", "name": "callbackContractAddress", "nameLocation": "190:23:20", "nodeType": "VariableDeclaration", "scope": 3388, "src": "182:31:20", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 3380, "name": "address", "nodeType": "ElementaryTypeName", "src": "182:7:20", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" }, { "constant": false, "id": 3383, "mutability": "mutable", "name": "callbackMethodName", "nameLocation": "230:18:20", "nodeType": "VariableDeclaration", "scope": 3388, "src": "223:25:20", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" }, "typeName": { "id": 3382, "name": "string", "nodeType": "ElementaryTypeName", "src": "223:6:20", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "visibility": "internal" }, { "constant": false, "id": 3385, "mutability": "mutable", "name": "data", "nameLocation": "264:4:20", "nodeType": "VariableDeclaration", "scope": 3388, "src": "258:10:20", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" }, "typeName": { "id": 3384, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "258:5:20", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "visibility": "internal" }, { "constant": false, "id": 3387, "mutability": "mutable", "name": "createdAt", "nameLocation": "286:9:20", "nodeType": "VariableDeclaration", "scope": 3388, "src": "278:17:20", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 3386, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "278:7:20", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "name": "OracleRequest", "nameLocation": "94:13:20", "nodeType": "StructDefinition", "scope": 3440, "src": "87:215:20", "visibility": "public" }, { "anonymous": false, "id": 3396, "name": "LogOracleRequested", "nameLocation": "314:18:20", "nodeType": "EventDefinition", "parameters": { "id": 3395, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 3390, "indexed": false, "mutability": "mutable", "name": "processId", "nameLocation": "350:9:20", "nodeType": "VariableDeclaration", "scope": 3396, "src": "342:17:20", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 3389, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "342:7:20", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "visibility": "internal" }, { "constant": false, "id": 3392, "indexed": false, "mutability": "mutable", "name": "requestId", "nameLocation": "377:9:20", "nodeType": "VariableDeclaration", "scope": 3396, "src": "369:17:20", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 3391, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "369:7:20", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" }, { "constant": false, "id": 3394, "indexed": false, "mutability": "mutable", "name": "responsibleOracleId", "nameLocation": "404:19:20", "nodeType": "VariableDeclaration", "scope": 3396, "src": "396:27:20", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 3393, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "396:7:20", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "332:97:20" }, "src": "308:122:20" }, { "anonymous": false, "id": 3406, "name": "LogOracleResponded", "nameLocation": "442:18:20", "nodeType": "EventDefinition", "parameters": { "id": 3405, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 3398, "indexed": false, "mutability": "mutable", "name": "processId", "nameLocation": "478:9:20", "nodeType": "VariableDeclaration", "scope": 3406, "src": "470:17:20", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 3397, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "470:7:20", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "visibility": "internal" }, { "constant": false, "id": 3400, "indexed": false, "mutability": "mutable", "name": "requestId", "nameLocation": "505:9:20", "nodeType": "VariableDeclaration", "scope": 3406, "src": "497:17:20", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 3399, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "497:7:20", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" }, { "constant": false, "id": 3402, "indexed": false, "mutability": "mutable", "name": "responder", "nameLocation": "532:9:20", "nodeType": "VariableDeclaration", "scope": 3406, "src": "524:17:20", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 3401, "name": "address", "nodeType": "ElementaryTypeName", "src": "524:7:20", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" }, { "constant": false, "id": 3404, "indexed": false, "mutability": "mutable", "name": "success", "nameLocation": "556:7:20", "nodeType": "VariableDeclaration", "scope": 3406, "src": "551:12:20", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 3403, "name": "bool", "nodeType": "ElementaryTypeName", "src": "551:4:20", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "visibility": "internal" } ], "src": "460:109:20" }, "src": "436:134:20" }, { "anonymous": false, "id": 3410, "name": "LogOracleCanceled", "nameLocation": "582:17:20", "nodeType": "EventDefinition", "parameters": { "id": 3409, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 3408, "indexed": false, "mutability": "mutable", "name": "requestId", "nameLocation": "617:9:20", "nodeType": "VariableDeclaration", "scope": 3410, "src": "609:17:20", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 3407, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "609:7:20", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "599:33:20" }, "src": "576:57:20" }, { "functionSelector": "2c933f22", "id": 3425, "implemented": false, "kind": "function", "modifiers": [], "name": "request", "nameLocation": "648:7:20", "nodeType": "FunctionDefinition", "parameters": { "id": 3421, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 3412, "mutability": "mutable", "name": "processId", "nameLocation": "673:9:20", "nodeType": "VariableDeclaration", "scope": 3425, "src": "665:17:20", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 3411, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "665:7:20", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "visibility": "internal" }, { "constant": false, "id": 3414, "mutability": "mutable", "name": "input", "nameLocation": "707:5:20", "nodeType": "VariableDeclaration", "scope": 3425, "src": "692:20:20", "stateVariable": false, "storageLocation": "calldata", "typeDescriptions": { "typeIdentifier": "t_bytes_calldata_ptr", "typeString": "bytes" }, "typeName": { "id": 3413, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "692:5:20", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "visibility": "internal" }, { "constant": false, "id": 3416, "mutability": "mutable", "name": "callbackMethodName", "nameLocation": "738:18:20", "nodeType": "VariableDeclaration", "scope": 3425, "src": "722:34:20", "stateVariable": false, "storageLocation": "calldata", "typeDescriptions": { "typeIdentifier": "t_string_calldata_ptr", "typeString": "string" }, "typeName": { "id": 3415, "name": "string", "nodeType": "ElementaryTypeName", "src": "722:6:20", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "visibility": "internal" }, { "constant": false, "id": 3418, "mutability": "mutable", "name": "callbackContractAddress", "nameLocation": "774:23:20", "nodeType": "VariableDeclaration", "scope": 3425, "src": "766:31:20", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 3417, "name": "address", "nodeType": "ElementaryTypeName", "src": "766:7:20", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" }, { "constant": false, "id": 3420, "mutability": "mutable", "name": "responsibleOracleId", "nameLocation": "815:19:20", "nodeType": "VariableDeclaration", "scope": 3425, "src": "807:27:20", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 3419, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "807:7:20", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "655:185:20" }, "returnParameters": { "id": 3424, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 3423, "mutability": "mutable", "name": "requestId", "nameLocation": "867:9:20", "nodeType": "VariableDeclaration", "scope": 3425, "src": "859:17:20", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 3422, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "859:7:20", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "858:19:20" }, "scope": 3440, "src": "639:239:20", "stateMutability": "nonpayable", "virtual": false, "visibility": "external" }, { "functionSelector": "9af8c4ba", "id": 3434, "implemented": false, "kind": "function", "modifiers": [], "name": "respond", "nameLocation": "893:7:20", "nodeType": "FunctionDefinition", "parameters": { "id": 3432, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 3427, "mutability": "mutable", "name": "requestId", "nameLocation": "918:9:20", "nodeType": "VariableDeclaration", "scope": 3434, "src": "910:17:20", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 3426, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "910:7:20", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" }, { "constant": false, "id": 3429, "mutability": "mutable", "name": "responder", "nameLocation": "945:9:20", "nodeType": "VariableDeclaration", "scope": 3434, "src": "937:17:20", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 3428, "name": "address", "nodeType": "ElementaryTypeName", "src": "937:7:20", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" }, { "constant": false, "id": 3431, "mutability": "mutable", "name": "data", "nameLocation": "979:4:20", "nodeType": "VariableDeclaration", "scope": 3434, "src": "964:19:20", "stateVariable": false, "storageLocation": "calldata", "typeDescriptions": { "typeIdentifier": "t_bytes_calldata_ptr", "typeString": "bytes" }, "typeName": { "id": 3430, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "964:5:20", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "visibility": "internal" } ], "src": "900:89:20" }, "returnParameters": { "id": 3433, "nodeType": "ParameterList", "parameters": [], "src": "998:0:20" }, "scope": 3440, "src": "884:115:20", "stateMutability": "nonpayable", "virtual": false, "visibility": "external" }, { "functionSelector": "40e58ee5", "id": 3439, "implemented": false, "kind": "function", "modifiers": [], "name": "cancel", "nameLocation": "1014:6:20", "nodeType": "FunctionDefinition", "parameters": { "id": 3437, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 3436, "mutability": "mutable", "name": "requestId", "nameLocation": "1029:9:20", "nodeType": "VariableDeclaration", "scope": 3439, "src": "1021:17:20", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 3435, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1021:7:20", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "1020:19:20" }, "returnParameters": { "id": 3438, "nodeType": "ParameterList", "parameters": [], "src": "1048:0:20" }, "scope": 3440, "src": "1005:44:20", "stateMutability": "nonpayable", "virtual": false, "visibility": "external" } ], "scope": 3441, "src": "63:989:20" } ], "src": "39:1014:20" }, "bytecode": "", "bytecodeSha1": "da39a3ee5e6b4b0d3255bfef95601890afd80709", "compiler": { "evm_version": "istanbul", "optimizer": { "enabled": true, "runs": 200 }, "version": "0.8.2+commit.661d1103" }, "contractName": "IQuery", "coverageMap": { "branches": {}, "statements": {} }, "dependencies": [], "deployedBytecode": "", "deployedSourceMap": "", "language": "Solidity", "natspec": { "kind": "dev", "methods": {}, "version": 1 }, "offset": [ 63, 1052 ], "opcodes": "", "pcMap": {}, "sha1": "22c96a323054cc6ba890d8a7821886580a1cb5e5", "source": "// SPDX-License-Identifier: Apache-2.0\npragma solidity 0.8.2;\n\ninterface IQuery {\n\n struct OracleRequest {\n bytes32 processId;\n uint256 responsibleOracleId;\n address callbackContractAddress;\n string callbackMethodName;\n bytes data;\n uint256 createdAt;\n }\n\n event LogOracleRequested(\n bytes32 processId,\n uint256 requestId,\n uint256 responsibleOracleId\n );\n\n event LogOracleResponded(\n bytes32 processId,\n uint256 requestId,\n address responder,\n bool success\n );\n\n event LogOracleCanceled(\n uint256 requestId\n );\n\n function request(\n bytes32 processId,\n bytes calldata input,\n string calldata callbackMethodName,\n address callbackContractAddress,\n uint256 responsibleOracleId\n ) external returns (uint256 requestId);\n\n function respond(\n uint256 requestId,\n address responder,\n bytes calldata data\n ) external;\n\n function cancel(uint256 requestId) external;\n\n}\n", "sourceMap": "", "sourcePath": "contracts/modules/IQuery.sol", "type": "interface" }