UNPKG

@gnosis.pm/pm-contracts

Version:

Collection of smart contracts for the Gnosis prediction market platform

1,214 lines 125 kB
{ "contractName": "CentralizedOracleData", "abi": [ { "constant": true, "inputs": [], "name": "outcome", "outputs": [ { "name": "", "type": "int256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "owner", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "ipfsHash", "outputs": [ { "name": "", "type": "bytes" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "isSet", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "newOwner", "type": "address" } ], "name": "OwnerReplacement", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "name": "outcome", "type": "int256" } ], "name": "OutcomeAssignment", "type": "event" } ], "metadata": "{\"compiler\":{\"version\":\"0.5.6+commit.b259423e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[],\"name\":\"outcome\",\"outputs\":[{\"name\":\"\",\"type\":\"int256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"ipfsHash\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"isSet\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnerReplacement\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"outcome\",\"type\":\"int256\"}],\"name\":\"OutcomeAssignment\",\"type\":\"event\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/home/alan/src/github.com/gnosis/pm-contracts/contracts/Oracles/CentralizedOracle.sol\":\"CentralizedOracleData\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/home/alan/src/github.com/gnosis/pm-contracts/contracts/Oracles/CentralizedOracle.sol\":{\"keccak256\":\"0x60e5fbab4649a29eb315696966f60b20c85f4fe05f57b2f9ba82dea23b86f9fa\",\"urls\":[\"bzzr://398156d9ccb87bd9bb386084d19f0b868314361c091c1f9db664862a0408595f\"]},\"/home/alan/src/github.com/gnosis/pm-contracts/contracts/Oracles/Oracle.sol\":{\"keccak256\":\"0xf4d12f4a59c17e66dfa6791188f621a8914e2038a4e3f72d6fc9fb903ca8e18e\",\"urls\":[\"bzzr://a477ccd203e677cc904b1a4f8fcc85251c5b5e09c5c10eed27e01318584b16d1\"]},\"@gnosis.pm/util-contracts/contracts/Proxy.sol\":{\"keccak256\":\"0xeab0e83a9ec9e7f052c0455a11577061ec6d1994db08dae429abd6faaabf6555\",\"urls\":[\"bzzr://b2c1273d4ec30e2f9e768eea8c510f8493a7359b03e01923d93eea86b57ec145\"]}},\"version\":1}", "bytecode": "0x608060405234801561001057600080fd5b50610266806100206000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806327793f87146100515780638da5cb5b1461006f578063c623674f146100b9578063c65fb3801461013c575b600080fd5b61005961015e565b6040518082815260200191505060405180910390f35b610077610164565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100c1610189565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101015780820151818401526020810190506100e6565b50505050905090810190601f16801561012e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610144610227565b604051808215151515815260200191505060405180910390f35b60035481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561021f5780601f106101f45761010080835404028352916020019161021f565b820191906000526020600020905b81548152906001019060200180831161020257829003601f168201915b505050505081565b600260009054906101000a900460ff168156fea165627a7a72305820ebfa083670876ed29cb8378f5761f35a5cb8c68556689a321ce755aa9188a0960029", "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806327793f87146100515780638da5cb5b1461006f578063c623674f146100b9578063c65fb3801461013c575b600080fd5b61005961015e565b6040518082815260200191505060405180910390f35b610077610164565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100c1610189565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101015780820151818401526020810190506100e6565b50505050905090810190601f16801561012e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610144610227565b604051808215151515815260200191505060405180910390f35b60035481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561021f5780601f106101f45761010080835404028352916020019161021f565b820191906000526020600020905b81548152906001019060200180831161020257829003601f168201915b505050505081565b600260009054906101000a900460ff168156fea165627a7a72305820ebfa083670876ed29cb8378f5761f35a5cb8c68556689a321ce755aa9188a0960029", "sourceMap": "114:452:14:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;114:452:14;;;;;;;", "deployedSourceMap": "114:452:14:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;114:452:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;386:18;;;:::i;:::-;;;;;;;;;;;;;;;;;;;310:20;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;336:21;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;336:21:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;363:17;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;386:18;;;;:::o;310:20::-;;;;;;;;;;;;;:::o;336:21::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;363:17::-;;;;;;;;;;;;;:::o", "source": "pragma solidity ^0.5.0;\nimport \"../Oracles/Oracle.sol\";\nimport \"@gnosis.pm/util-contracts/contracts/Proxy.sol\";\n\n\ncontract CentralizedOracleData {\n\n /*\n * Events\n */\n event OwnerReplacement(address indexed newOwner);\n event OutcomeAssignment(int outcome);\n\n /*\n * Storage\n */\n address public owner;\n bytes public ipfsHash;\n bool public isSet;\n int public outcome;\n\n /*\n * Modifiers\n */\n modifier isOwner () {\n // Only owner is allowed to proceed\n require(msg.sender == owner);\n _;\n }\n}\n\ncontract CentralizedOracleProxy is Proxy, CentralizedOracleData {\n\n /// @dev Constructor sets owner address and IPFS hash\n /// @param _ipfsHash Hash identifying off chain event description\n constructor(address proxied, address _owner, bytes memory _ipfsHash)\n public\n Proxy(proxied)\n {\n // Description hash cannot be null\n require(_ipfsHash.length == 46);\n owner = _owner;\n ipfsHash = _ipfsHash;\n }\n}\n\n/// @title Centralized oracle contract - Allows the contract owner to set an outcome\n/// @author Stefan George - <stefan@gnosis.pm>\ncontract CentralizedOracle is Proxied, Oracle, CentralizedOracleData {\n\n /*\n * Public functions\n */\n /// @dev Replaces owner\n /// @param newOwner New owner\n function replaceOwner(address newOwner)\n public\n isOwner\n {\n // Result is not set yet\n require(!isSet);\n owner = newOwner;\n emit OwnerReplacement(newOwner);\n }\n\n /// @dev Sets event outcome\n /// @param _outcome Event outcome\n function setOutcome(int _outcome)\n public\n isOwner\n {\n // Result is not set yet\n require(!isSet);\n isSet = true;\n outcome = _outcome;\n emit OutcomeAssignment(_outcome);\n }\n\n /// @dev Returns if winning outcome is set\n /// @return Is outcome set?\n function isOutcomeSet()\n public\n view\n returns (bool)\n {\n return isSet;\n }\n\n /// @dev Returns outcome\n /// @return Outcome\n function getOutcome()\n public\n view\n returns (int)\n {\n return outcome;\n }\n}\n", "sourcePath": "/home/alan/src/github.com/gnosis/pm-contracts/contracts/Oracles/CentralizedOracle.sol", "ast": { "absolutePath": "/home/alan/src/github.com/gnosis/pm-contracts/contracts/Oracles/CentralizedOracle.sol", "exportedSymbols": { "CentralizedOracle": [ 3815 ], "CentralizedOracleData": [ 3713 ], "CentralizedOracleProxy": [ 3746 ] }, "id": 3816, "nodeType": "SourceUnit", "nodes": [ { "id": 3683, "literals": [ "solidity", "^", "0.5", ".0" ], "nodeType": "PragmaDirective", "src": "0:23:14" }, { "absolutePath": "/home/alan/src/github.com/gnosis/pm-contracts/contracts/Oracles/Oracle.sol", "file": "../Oracles/Oracle.sol", "id": 3684, "nodeType": "ImportDirective", "scope": 3816, "sourceUnit": 4842, "src": "24:31:14", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "@gnosis.pm/util-contracts/contracts/Proxy.sol", "file": "@gnosis.pm/util-contracts/contracts/Proxy.sol", "id": 3685, "nodeType": "ImportDirective", "scope": 3816, "sourceUnit": 6829, "src": "56:55:14", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 3713, "linearizedBaseContracts": [ 3713 ], "name": "CentralizedOracleData", "nodeType": "ContractDefinition", "nodes": [ { "anonymous": false, "documentation": null, "id": 3689, "name": "OwnerReplacement", "nodeType": "EventDefinition", "parameters": { "id": 3688, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 3687, "indexed": true, "name": "newOwner", "nodeType": "VariableDeclaration", "scope": 3689, "src": "205:24:14", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 3686, "name": "address", "nodeType": "ElementaryTypeName", "src": "205:7:14", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "204:26:14" }, "src": "182:49:14" }, { "anonymous": false, "documentation": null, "id": 3693, "name": "OutcomeAssignment", "nodeType": "EventDefinition", "parameters": { "id": 3692, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 3691, "indexed": false, "name": "outcome", "nodeType": "VariableDeclaration", "scope": 3693, "src": "260:11:14", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" }, "typeName": { "id": 3690, "name": "int", "nodeType": "ElementaryTypeName", "src": "260:3:14", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "value": null, "visibility": "internal" } ], "src": "259:13:14" }, "src": "236:37:14" }, { "constant": false, "id": 3695, "name": "owner", "nodeType": "VariableDeclaration", "scope": 3713, "src": "310:20:14", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 3694, "name": "address", "nodeType": "ElementaryTypeName", "src": "310:7:14", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 3697, "name": "ipfsHash", "nodeType": "VariableDeclaration", "scope": 3713, "src": "336:21:14", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes_storage", "typeString": "bytes" }, "typeName": { "id": 3696, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "336:5:14", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 3699, "name": "isSet", "nodeType": "VariableDeclaration", "scope": 3713, "src": "363:17:14", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 3698, "name": "bool", "nodeType": "ElementaryTypeName", "src": "363:4:14", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 3701, "name": "outcome", "nodeType": "VariableDeclaration", "scope": 3713, "src": "386:18:14", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" }, "typeName": { "id": 3700, "name": "int", "nodeType": "ElementaryTypeName", "src": "386:3:14", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "value": null, "visibility": "public" }, { "body": { "id": 3711, "nodeType": "Block", "src": "464:100:14", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 3707, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 3704, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7920, "src": "526:3:14", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 3705, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "526:10:14", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "id": 3706, "name": "owner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3695, "src": "540:5:14", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "526:19:14", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 3703, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 7923, 7924 ], "referencedDeclaration": 7923, "src": "518:7:14", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 3708, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "518:28:14", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 3709, "nodeType": "ExpressionStatement", "src": "518:28:14" }, { "id": 3710, "nodeType": "PlaceholderStatement", "src": "556:1:14" } ] }, "documentation": null, "id": 3712, "name": "isOwner", "nodeType": "ModifierDefinition", "parameters": { "id": 3702, "nodeType": "ParameterList", "parameters": [], "src": "461:2:14" }, "src": "444:120:14", "visibility": "internal" } ], "scope": 3816, "src": "114:452:14" }, { "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 3714, "name": "Proxy", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 6828, "src": "603:5:14", "typeDescriptions": { "typeIdentifier": "t_contract$_Proxy_$6828", "typeString": "contract Proxy" } }, "id": 3715, "nodeType": "InheritanceSpecifier", "src": "603:5:14" }, { "arguments": null, "baseName": { "contractScope": null, "id": 3716, "name": "CentralizedOracleData", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 3713, "src": "610:21:14", "typeDescriptions": { "typeIdentifier": "t_contract$_CentralizedOracleData_$3713", "typeString": "contract CentralizedOracleData" } }, "id": 3717, "nodeType": "InheritanceSpecifier", "src": "610:21:14" } ], "contractDependencies": [ 3713, 6798, 6828 ], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 3746, "linearizedBaseContracts": [ 3746, 3713, 6828, 6798 ], "name": "CentralizedOracleProxy", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 3744, "nodeType": "Block", "src": "878:145:14", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 3733, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 3730, "name": "_ipfsHash", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3723, "src": "939:9:14", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, "id": 3731, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "length", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "939:16:14", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "hexValue": "3436", "id": 3732, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "959:2:14", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_46_by_1", "typeString": "int_const 46" }, "value": "46" }, "src": "939:22:14", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 3729, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 7923, 7924 ], "referencedDeclaration": 7923, "src": "931:7:14", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 3734, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "931:31:14", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 3735, "nodeType": "ExpressionStatement", "src": "931:31:14" }, { "expression": { "argumentTypes": null, "id": 3738, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 3736, "name": "owner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3695, "src": "972:5:14", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 3737, "name": "_owner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3721, "src": "980:6:14", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "972:14:14", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 3739, "nodeType": "ExpressionStatement", "src": "972:14:14" }, { "expression": { "argumentTypes": null, "id": 3742, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 3740, "name": "ipfsHash", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3697, "src": "996:8:14", "typeDescriptions": { "typeIdentifier": "t_bytes_storage", "typeString": "bytes storage ref" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 3741, "name": "_ipfsHash", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3723, "src": "1007:9:14", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, "src": "996:20:14", "typeDescriptions": { "typeIdentifier": "t_bytes_storage", "typeString": "bytes storage ref" } }, "id": 3743, "nodeType": "ExpressionStatement", "src": "996:20:14" } ] }, "documentation": "@dev Constructor sets owner address and IPFS hash\n @param _ipfsHash Hash identifying off chain event description", "id": 3745, "implemented": true, "kind": "constructor", "modifiers": [ { "arguments": [ { "argumentTypes": null, "id": 3726, "name": "proxied", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3719, "src": "865:7:14", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "id": 3727, "modifierName": { "argumentTypes": null, "id": 3725, "name": "Proxy", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6828, "src": "859:5:14", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_Proxy_$6828_$", "typeString": "type(contract Proxy)" } }, "nodeType": "ModifierInvocation", "src": "859:14:14" } ], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 3724, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 3719, "name": "proxied", "nodeType": "VariableDeclaration", "scope": 3745, "src": "779:15:14", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 3718, "name": "address", "nodeType": "ElementaryTypeName", "src": "779:7:14", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 3721, "name": "_owner", "nodeType": "VariableDeclaration", "scope": 3745, "src": "796:14:14", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 3720, "name": "address", "nodeType": "ElementaryTypeName", "src": "796:7:14", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 3723, "name": "_ipfsHash", "nodeType": "VariableDeclaration", "scope": 3745, "src": "812:22:14", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 3722, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "812:5:14", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": null, "visibility": "internal" } ], "src": "778:57:14" }, "returnParameters": { "id": 3728, "nodeType": "ParameterList", "parameters": [], "src": "878:0:14" }, "scope": 3746, "src": "767:256:14", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" } ], "scope": 3816, "src": "568:457:14" }, { "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 3747, "name": "Proxied", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 6798, "src": "1189:7:14", "typeDescriptions": { "typeIdentifier": "t_contract$_Proxied_$6798", "typeString": "contract Proxied" } }, "id": 3748, "nodeType": "InheritanceSpecifier", "src": "1189:7:14" }, { "arguments": null, "baseName": { "contractScope": null, "id": 3749, "name": "Oracle", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4841, "src": "1198:6:14", "typeDescriptions": { "typeIdentifier": "t_contract$_Oracle_$4841", "typeString": "contract Oracle" } }, "id": 3750, "nodeType": "InheritanceSpecifier", "src": "1198:6:14" }, { "arguments": null, "baseName": { "contractScope": null, "id": 3751, "name": "CentralizedOracleData", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 3713, "src": "1206:21:14", "typeDescriptions": { "typeIdentifier": "t_contract$_CentralizedOracleData_$3713", "typeString": "contract CentralizedOracleData" } }, "id": 3752, "nodeType": "InheritanceSpecifier", "src": "1206:21:14" } ], "contractDependencies": [ 3713, 4841, 6798 ], "contractKind": "contract", "documentation": "@title Centralized oracle contract - Allows the contract owner to set an outcome\n @author Stefan George - <stefan@gnosis.pm>", "fullyImplemented": true, "id": 3815, "linearizedBaseContracts": [ 3815, 3713, 4841, 6798 ], "name": "CentralizedOracle", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 3772, "nodeType": "Block", "src": "1412:132:14", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 3761, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "!", "prefix": true, "src": "1463:6:14", "subExpression": { "argumentTypes": null, "id": 3760, "name": "isSet", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3699, "src": "1464:5:14", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 3759, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 7923, 7924 ], "referencedDeclaration": 7923, "src": "1455:7:14", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 3762, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1455:15:14", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 3763, "nodeType": "ExpressionStatement", "src": "1455:15:14" }, { "expression": { "argumentTypes": null, "id": 3766, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 3764, "name": "owner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3695, "src": "1480:5:14", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 3765, "name": "newOwner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3754, "src": "1488:8:14", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "1480:16:14", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 3767, "nodeType": "ExpressionStatement", "src": "1480:16:14" }, { "eventCall": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 3769, "name": "newOwner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3754, "src": "1528:8:14", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 3768, "name": "OwnerReplacement", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3689, "src": "1511:16:14", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, "id": 3770, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1511:26:14", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 3771, "nodeType": "EmitStatement", "src": "1506:31:14" } ] }, "documentation": "@dev Replaces owner\n @param newOwner New owner", "id": 3773, "implemented": true, "kind": "function", "modifiers": [ { "arguments": null, "id": 3757, "modifierName": { "argumentTypes": null, "id": 3756, "name": "isOwner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3712, "src": "1400:7:14", "typeDescriptions": { "typeIdentifier": "t_modifier$__$", "typeString": "modifier ()" } }, "nodeType": "ModifierInvocation", "src": "1400:7:14" } ], "name": "replaceOwner", "nodeType": "FunctionDefinition", "parameters": { "id": 3755, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 3754, "name": "newOwner", "nodeType": "VariableDeclaration", "scope": 3773, "src": "1359:16:14", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 3753, "name": "address", "nodeType": "ElementaryTypeName", "src": "1359:7:14", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "1358:18:14" }, "returnParameters": { "id": 3758, "nodeType": "ParameterList", "parameters": [], "src": "1412:0:14" }, "scope": 3815, "sr