UNPKG

@realitio/realitio-contracts

Version:

Collection of smart contracts for the Realitio fact verification platform

966 lines 33.4 kB
{ "contractName": "Owned", "abi": [ { "constant": true, "inputs": [], "name": "owner", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "inputs": [], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "constant": false, "inputs": [ { "name": "newOwner", "type": "address" } ], "name": "transferOwnership", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" } ], "bytecode": "0x", "deployedBytecode": "0x", "sourceMap": "", "deployedSourceMap": "", "source": "pragma solidity ^0.4.25;\n\nimport './IOwned.sol';\n\ncontract Owned is IOwned {\n address public owner;\n\n constructor() \n public {\n owner = msg.sender;\n }\n\n modifier onlyOwner {\n require(msg.sender == owner);\n _;\n }\n\n function transferOwnership(address newOwner) \n onlyOwner \n external {\n owner = newOwner;\n }\n}\n", "sourcePath": "/home/ed/working/realitio-contracts/truffle/contracts/Owned.sol", "ast": { "absolutePath": "/home/ed/working/realitio-contracts/truffle/contracts/Owned.sol", "exportedSymbols": { "Owned": [ 2748 ] }, "id": 2749, "nodeType": "SourceUnit", "nodes": [ { "id": 2710, "literals": [ "solidity", "^", "0.4", ".25" ], "nodeType": "PragmaDirective", "src": "0:24:12" }, { "absolutePath": "/home/ed/working/realitio-contracts/truffle/contracts/IOwned.sol", "file": "./IOwned.sol", "id": 2711, "nodeType": "ImportDirective", "scope": 2749, "sourceUnit": 1366, "src": "26:22:12", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 2712, "name": "IOwned", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 1365, "src": "68:6:12", "typeDescriptions": { "typeIdentifier": "t_contract$_IOwned_$1365", "typeString": "contract IOwned" } }, "id": 2713, "nodeType": "InheritanceSpecifier", "src": "68:6:12" } ], "contractDependencies": [ 1365 ], "contractKind": "contract", "documentation": null, "fullyImplemented": false, "id": 2748, "linearizedBaseContracts": [ 2748, 1365 ], "name": "Owned", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "id": 2715, "name": "owner", "nodeType": "VariableDeclaration", "scope": 2748, "src": "81:20:12", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2714, "name": "address", "nodeType": "ElementaryTypeName", "src": "81:7:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "public" }, { "body": { "id": 2723, "nodeType": "Block", "src": "134:35:12", "statements": [ { "expression": { "argumentTypes": null, "id": 2721, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 2718, "name": "owner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2715, "src": "144:5:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 2719, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9703, "src": "152:3:12", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 2720, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "152:10:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "144:18:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 2722, "nodeType": "ExpressionStatement", "src": "144:18:12" } ] }, "documentation": null, "id": 2724, "implemented": true, "isConstructor": true, "isDeclaredConst": false, "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 2716, "nodeType": "ParameterList", "parameters": [], "src": "119:2:12" }, "payable": false, "returnParameters": { "id": 2717, "nodeType": "ParameterList", "parameters": [], "src": "134:0:12" }, "scope": 2748, "src": "108:61:12", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 2734, "nodeType": "Block", "src": "194:56:12", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 2730, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 2727, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9703, "src": "212:3:12", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 2728, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "212:10:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "id": 2729, "name": "owner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2715, "src": "226:5:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "212:19:12", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 2726, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 9706, 9707 ], "referencedDeclaration": 9706, "src": "204:7:12", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 2731, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "204:28:12", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2732, "nodeType": "ExpressionStatement", "src": "204:28:12" }, { "id": 2733, "nodeType": "PlaceholderStatement", "src": "242:1:12" } ] }, "documentation": null, "id": 2735, "name": "onlyOwner", "nodeType": "ModifierDefinition", "parameters": { "id": 2725, "nodeType": "ParameterList", "parameters": [], "src": "194:0:12" }, "src": "175:75:12", "visibility": "internal" }, { "body": { "id": 2746, "nodeType": "Block", "src": "334:33:12", "statements": [ { "expression": { "argumentTypes": null, "id": 2744, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 2742, "name": "owner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2715, "src": "344:5:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 2743, "name": "newOwner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2737, "src": "352:8:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "344:16:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 2745, "nodeType": "ExpressionStatement", "src": "344:16:12" } ] }, "documentation": null, "id": 2747, "implemented": true, "isConstructor": false, "isDeclaredConst": false, "modifiers": [ { "arguments": null, "id": 2740, "modifierName": { "argumentTypes": null, "id": 2739, "name": "onlyOwner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2735, "src": "310:9:12", "typeDescriptions": { "typeIdentifier": "t_modifier$__$", "typeString": "modifier ()" } }, "nodeType": "ModifierInvocation", "src": "310:9:12" } ], "name": "transferOwnership", "nodeType": "FunctionDefinition", "parameters": { "id": 2738, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2737, "name": "newOwner", "nodeType": "VariableDeclaration", "scope": 2747, "src": "283:16:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2736, "name": "address", "nodeType": "ElementaryTypeName", "src": "283:7:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "282:18:12" }, "payable": false, "returnParameters": { "id": 2741, "nodeType": "ParameterList", "parameters": [], "src": "334:0:12" }, "scope": 2748, "src": "256:111:12", "stateMutability": "nonpayable", "superFunction": 1364, "visibility": "external" } ], "scope": 2749, "src": "50:319:12" } ], "src": "0:370:12" }, "legacyAST": { "absolutePath": "/home/ed/working/realitio-contracts/truffle/contracts/Owned.sol", "exportedSymbols": { "Owned": [ 2748 ] }, "id": 2749, "nodeType": "SourceUnit", "nodes": [ { "id": 2710, "literals": [ "solidity", "^", "0.4", ".25" ], "nodeType": "PragmaDirective", "src": "0:24:12" }, { "absolutePath": "/home/ed/working/realitio-contracts/truffle/contracts/IOwned.sol", "file": "./IOwned.sol", "id": 2711, "nodeType": "ImportDirective", "scope": 2749, "sourceUnit": 1366, "src": "26:22:12", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 2712, "name": "IOwned", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 1365, "src": "68:6:12", "typeDescriptions": { "typeIdentifier": "t_contract$_IOwned_$1365", "typeString": "contract IOwned" } }, "id": 2713, "nodeType": "InheritanceSpecifier", "src": "68:6:12" } ], "contractDependencies": [ 1365 ], "contractKind": "contract", "documentation": null, "fullyImplemented": false, "id": 2748, "linearizedBaseContracts": [ 2748, 1365 ], "name": "Owned", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "id": 2715, "name": "owner", "nodeType": "VariableDeclaration", "scope": 2748, "src": "81:20:12", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2714, "name": "address", "nodeType": "ElementaryTypeName", "src": "81:7:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "public" }, { "body": { "id": 2723, "nodeType": "Block", "src": "134:35:12", "statements": [ { "expression": { "argumentTypes": null, "id": 2721, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 2718, "name": "owner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2715, "src": "144:5:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 2719, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9703, "src": "152:3:12", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 2720, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "152:10:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "144:18:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 2722, "nodeType": "ExpressionStatement", "src": "144:18:12" } ] }, "documentation": null, "id": 2724, "implemented": true, "isConstructor": true, "isDeclaredConst": false, "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 2716, "nodeType": "ParameterList", "parameters": [], "src": "119:2:12" }, "payable": false, "returnParameters": { "id": 2717, "nodeType": "ParameterList", "parameters": [], "src": "134:0:12" }, "scope": 2748, "src": "108:61:12", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 2734, "nodeType": "Block", "src": "194:56:12", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 2730, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 2727, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9703, "src": "212:3:12", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 2728, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "212:10:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "id": 2729, "name": "owner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2715, "src": "226:5:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "212:19:12", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 2726, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 9706, 9707 ], "referencedDeclaration": 9706, "src": "204:7:12", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 2731, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "204:28:12", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2732, "nodeType": "ExpressionStatement", "src": "204:28:12" }, { "id": 2733, "nodeType": "PlaceholderStatement", "src": "242:1:12" } ] }, "documentation": null, "id": 2735, "name": "onlyOwner", "nodeType": "ModifierDefinition", "parameters": { "id": 2725, "nodeType": "ParameterList", "parameters": [], "src": "194:0:12" }, "src": "175:75:12", "visibility": "internal" }, { "body": { "id": 2746, "nodeType": "Block", "src": "334:33:12", "statements": [ { "expression": { "argumentTypes": null, "id": 2744, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 2742, "name": "owner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2715, "src": "344:5:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 2743, "name": "newOwner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2737, "src": "352:8:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "344:16:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 2745, "nodeType": "ExpressionStatement", "src": "344:16:12" } ] }, "documentation": null, "id": 2747, "implemented": true, "isConstructor": false, "isDeclaredConst": false, "modifiers": [ { "arguments": null, "id": 2740, "modifierName": { "argumentTypes": null, "id": 2739, "name": "onlyOwner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2735, "src": "310:9:12", "typeDescriptions": { "typeIdentifier": "t_modifier$__$", "typeString": "modifier ()" } }, "nodeType": "ModifierInvocation", "src": "310:9:12" } ], "name": "transferOwnership", "nodeType": "FunctionDefinition", "parameters": { "id": 2738, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2737, "name": "newOwner", "nodeType": "VariableDeclaration", "scope": 2747, "src": "283:16:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2736, "name": "address", "nodeType": "ElementaryTypeName", "src": "283:7:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "282:18:12" }, "payable": false, "returnParameters": { "id": 2741, "nodeType": "ParameterList", "parameters": [], "src": "334:0:12" }, "scope": 2748, "src": "256:111:12", "stateMutability": "nonpayable", "superFunction": 1364, "visibility": "external" } ], "scope": 2749, "src": "50:319:12" } ], "src": "0:370:12" }, "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.463Z" }