UNPKG

@realitio/realitio-contracts

Version:

Collection of smart contracts for the Realitio fact verification platform

973 lines 37 kB
{ "contractName": "CallbackClient", "abi": [ { "constant": true, "inputs": [ { "name": "", "type": "bytes32" } ], "name": "answers", "outputs": [ { "name": "", "type": "bytes32" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "anonymous": false, "inputs": [ { "indexed": false, "name": "question_id", "type": "bytes32" }, { "indexed": false, "name": "question_answer", "type": "bytes32" }, { "indexed": false, "name": "sender", "type": "address" } ], "name": "LogCallback", "type": "event" }, { "constant": false, "inputs": [ { "name": "question_id", "type": "bytes32" }, { "name": "question_answer", "type": "bytes32" } ], "name": "__realitycheck_callback", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" } ], "bytecode": "0x608060405234801561001057600080fd5b506101cb806100206000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631d7dbb4314610051578063aac753b614610090575b600080fd5b34801561005d57600080fd5b5061008e600480360381019080803560001916906020019092919080356000191690602001909291905050506100dd565b005b34801561009c57600080fd5b506100bf6004803603810190808035600019169060200190929190505050610187565b60405180826000191660001916815260200191505060405180910390f35b80600080846000191660001916815260200190815260200160002081600019169055507f0c3ddecd829066bed247527f262273acaf114be545e42b5b1683335dbeb25a9182823360405180846000191660001916815260200183600019166000191681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001935050505060405180910390a15050565b600060205280600052604060002060009150905054815600a165627a7a7230582056a5d9dea121dedbe88bfea810a621f23a349d666fee0b146e5056723d2f17a90029", "deployedBytecode": "0x60806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631d7dbb4314610051578063aac753b614610090575b600080fd5b34801561005d57600080fd5b5061008e600480360381019080803560001916906020019092919080356000191690602001909291905050506100dd565b005b34801561009c57600080fd5b506100bf6004803603810190808035600019169060200190929190505050610187565b60405180826000191660001916815260200191505060405180910390f35b80600080846000191660001916815260200190815260200160002081600019169055507f0c3ddecd829066bed247527f262273acaf114be545e42b5b1683335dbeb25a9182823360405180846000191660001916815260200183600019166000191681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001935050505060405180910390a15050565b600060205280600052604060002060009150905054815600a165627a7a7230582056a5d9dea121dedbe88bfea810a621f23a349d666fee0b146e5056723d2f17a90029", "sourceMap": "26:411:3:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;26:411:3;;;;;;;", "deployedSourceMap": "26:411:3:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;220:214;;8:9:-1;5:2;;;30:1;27;20:12;5:2;220:214:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;57:40;;8:9:-1;5:2;;;30:1;27;20:12;5:2;57:40:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;220:214;344:15;321:7;:20;329:11;321:20;;;;;;;;;;;;;;;;;:38;;;;;;;374:53;386:11;399:15;416:10;374:53;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;220:214;;:::o;57:40::-;;;;;;;;;;;;;;;;;:::o", "source": "pragma solidity ^0.4.25;\n\ncontract CallbackClient {\n\n mapping(bytes32=>bytes32) public answers;\n\n event LogCallback(\n bytes32 question_id,\n bytes32 question_answer,\n address sender\n );\n\n function __realitycheck_callback(bytes32 question_id, bytes32 question_answer) \n public {\n answers[question_id] = question_answer;\n emit LogCallback(question_id, question_answer, msg.sender);\n }\n\n}\n", "sourcePath": "/home/ed/working/realitio-contracts/truffle/contracts/CallbackClient.sol", "ast": { "absolutePath": "/home/ed/working/realitio-contracts/truffle/contracts/CallbackClient.sol", "exportedSymbols": { "CallbackClient": [ 520 ] }, "id": 521, "nodeType": "SourceUnit", "nodes": [ { "id": 486, "literals": [ "solidity", "^", "0.4", ".25" ], "nodeType": "PragmaDirective", "src": "0:24:3" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 520, "linearizedBaseContracts": [ 520 ], "name": "CallbackClient", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "id": 490, "name": "answers", "nodeType": "VariableDeclaration", "scope": 520, "src": "57:40:3", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes32_$", "typeString": "mapping(bytes32 => bytes32)" }, "typeName": { "id": 489, "keyType": { "id": 487, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "65:7:3", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "Mapping", "src": "57:25:3", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes32_$", "typeString": "mapping(bytes32 => bytes32)" }, "valueType": { "id": 488, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "74:7:3", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } }, "value": null, "visibility": "public" }, { "anonymous": false, "documentation": null, "id": 498, "name": "LogCallback", "nodeType": "EventDefinition", "parameters": { "id": 497, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 492, "indexed": false, "name": "question_id", "nodeType": "VariableDeclaration", "scope": 498, "src": "131:19:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 491, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "131:7:3", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 494, "indexed": false, "name": "question_answer", "nodeType": "VariableDeclaration", "scope": 498, "src": "160:23:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 493, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "160:7:3", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 496, "indexed": false, "name": "sender", "nodeType": "VariableDeclaration", "scope": 498, "src": "193:14:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 495, "name": "address", "nodeType": "ElementaryTypeName", "src": "193:7:3", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "121:92:3" }, "src": "104:110:3" }, { "body": { "id": 518, "nodeType": "Block", "src": "311:123:3", "statements": [ { "expression": { "argumentTypes": null, "id": 509, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, "id": 505, "name": "answers", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 490, "src": "321:7:3", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes32_$", "typeString": "mapping(bytes32 => bytes32)" } }, "id": 507, "indexExpression": { "argumentTypes": null, "id": 506, "name": "question_id", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 500, "src": "329:11:3", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", "src": "321:20:3", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 508, "name": "question_answer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 502, "src": "344:15:3", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "src": "321:38:3", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "id": 510, "nodeType": "ExpressionStatement", "src": "321:38:3" }, { "eventCall": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 512, "name": "question_id", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 500, "src": "386:11:3", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "id": 513, "name": "question_answer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 502, "src": "399:15:3", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 514, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9703, "src": "416:3:3", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 515, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "416:10:3", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 511, "name": "LogCallback", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 498, "src": "374:11:3", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_bytes32_$_t_address_$returns$__$", "typeString": "function (bytes32,bytes32,address)" } }, "id": 516, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "374:53:3", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 517, "nodeType": "EmitStatement", "src": "369:58:3" } ] }, "documentation": null, "id": 519, "implemented": true, "isConstructor": false, "isDeclaredConst": false, "modifiers": [], "name": "__realitycheck_callback", "nodeType": "FunctionDefinition", "parameters": { "id": 503, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 500, "name": "question_id", "nodeType": "VariableDeclaration", "scope": 519, "src": "253:19:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 499, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "253:7:3", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 502, "name": "question_answer", "nodeType": "VariableDeclaration", "scope": 519, "src": "274:23:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 501, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "274:7:3", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "src": "252:46:3" }, "payable": false, "returnParameters": { "id": 504, "nodeType": "ParameterList", "parameters": [], "src": "311:0:3" }, "scope": 520, "src": "220:214:3", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" } ], "scope": 521, "src": "26:411:3" } ], "src": "0:438:3" }, "legacyAST": { "absolutePath": "/home/ed/working/realitio-contracts/truffle/contracts/CallbackClient.sol", "exportedSymbols": { "CallbackClient": [ 520 ] }, "id": 521, "nodeType": "SourceUnit", "nodes": [ { "id": 486, "literals": [ "solidity", "^", "0.4", ".25" ], "nodeType": "PragmaDirective", "src": "0:24:3" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 520, "linearizedBaseContracts": [ 520 ], "name": "CallbackClient", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "id": 490, "name": "answers", "nodeType": "VariableDeclaration", "scope": 520, "src": "57:40:3", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes32_$", "typeString": "mapping(bytes32 => bytes32)" }, "typeName": { "id": 489, "keyType": { "id": 487, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "65:7:3", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "Mapping", "src": "57:25:3", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes32_$", "typeString": "mapping(bytes32 => bytes32)" }, "valueType": { "id": 488, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "74:7:3", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } }, "value": null, "visibility": "public" }, { "anonymous": false, "documentation": null, "id": 498, "name": "LogCallback", "nodeType": "EventDefinition", "parameters": { "id": 497, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 492, "indexed": false, "name": "question_id", "nodeType": "VariableDeclaration", "scope": 498, "src": "131:19:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 491, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "131:7:3", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 494, "indexed": false, "name": "question_answer", "nodeType": "VariableDeclaration", "scope": 498, "src": "160:23:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 493, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "160:7:3", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 496, "indexed": false, "name": "sender", "nodeType": "VariableDeclaration", "scope": 498, "src": "193:14:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 495, "name": "address", "nodeType": "ElementaryTypeName", "src": "193:7:3", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "121:92:3" }, "src": "104:110:3" }, { "body": { "id": 518, "nodeType": "Block", "src": "311:123:3", "statements": [ { "expression": { "argumentTypes": null, "id": 509, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, "id": 505, "name": "answers", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 490, "src": "321:7:3", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes32_$", "typeString": "mapping(bytes32 => bytes32)" } }, "id": 507, "indexExpression": { "argumentTypes": null, "id": 506, "name": "question_id", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 500, "src": "329:11:3", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", "src": "321:20:3", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 508, "name": "question_answer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 502, "src": "344:15:3", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "src": "321:38:3", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "id": 510, "nodeType": "ExpressionStatement", "src": "321:38:3" }, { "eventCall": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 512, "name": "question_id", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 500, "src": "386:11:3", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "id": 513, "name": "question_answer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 502, "src": "399:15:3", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 514, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9703, "src": "416:3:3", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 515, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "416:10:3", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 511, "name": "LogCallback", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 498, "src": "374:11:3", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_bytes32_$_t_address_$returns$__$", "typeString": "function (bytes32,bytes32,address)" } }, "id": 516, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "374:53:3", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 517, "nodeType": "EmitStatement", "src": "369:58:3" } ] }, "documentation": null, "id": 519, "implemented": true, "isConstructor": false, "isDeclaredConst": false, "modifiers": [], "name": "__realitycheck_callback", "nodeType": "FunctionDefinition", "parameters": { "id": 503, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 500, "name": "question_id", "nodeType": "VariableDeclaration", "scope": 519, "src": "253:19:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 499, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "253:7:3", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 502, "name": "question_answer", "nodeType": "VariableDeclaration", "scope": 519, "src": "274:23:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 501, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "274:7:3", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "src": "252:46:3" }, "payable": false, "returnParameters": { "id": 504, "nodeType": "ParameterList", "parameters": [], "src": "311:0:3" }, "scope": 520, "src": "220:214:3", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" } ], "scope": 521, "src": "26:411:3" } ], "src": "0:438:3" }, "compiler": { "name": "solc", "version": "0.4.25+commit.59dbf8f1.Emscripten.clang", "optimizer": false, "runs": 200 }, "networks": {}, "schemaVersion": "2.3.3", "updatedAt": "2021-01-13T02:23:04.461Z" }