UNPKG

@gnosis.pm/pm-contracts

Version:

Collection of smart contracts for the Gnosis prediction market platform

1,098 lines (1,097 loc) 134 kB
{ "contractName": "CentralizedOracle", "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": "masterCopy", "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" }, { "constant": false, "inputs": [ { "name": "newOwner", "type": "address" } ], "name": "replaceOwner", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "_outcome", "type": "int256" } ], "name": "setOutcome", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "isOutcomeSet", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "getOutcome", "outputs": [ { "name": "", "type": "int256" } ], "payable": false, "stateMutability": "view", "type": "function" } ], "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\":false,\"inputs\":[{\"name\":\"_outcome\",\"type\":\"int256\"}],\"name\":\"setOutcome\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getOutcome\",\"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\":false,\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"replaceOwner\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"masterCopy\",\"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\"},{\"constant\":true,\"inputs\":[],\"name\":\"isOutcomeSet\",\"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\":{\"author\":\"Stefan George - <stefan@gnosis.pm>\",\"methods\":{\"getOutcome()\":{\"details\":\"Returns outcome\",\"return\":\"Outcome\"},\"isOutcomeSet()\":{\"details\":\"Returns if winning outcome is set\",\"return\":\"Is outcome set?\"},\"replaceOwner(address)\":{\"details\":\"Replaces owner\",\"params\":{\"newOwner\":\"New owner\"}},\"setOutcome(int256)\":{\"details\":\"Sets event outcome\",\"params\":{\"_outcome\":\"Event outcome\"}}},\"title\":\"Centralized oracle contract - Allows the contract owner to set an outcome\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/home/alan/src/github.com/gnosis/pm-contracts/contracts/Oracles/CentralizedOracle.sol\":\"CentralizedOracle\"},\"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": "0x608060405234801561001057600080fd5b506105bb806100206000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c8063a39a45b711610066578063a39a45b71461014c578063a619486e14610190578063c623674f146101da578063c65fb3801461025d578063ccdf68f31461027f57610093565b806327793f8714610098578063717a195a146100b65780637e7e4b47146100e45780638da5cb5b14610102575b600080fd5b6100a06102a1565b6040518082815260200191505060405180910390f35b6100e2600480360360208110156100cc57600080fd5b81019080803590602001909291905050506102a7565b005b6100ec610377565b6040518082815260200191505060405180910390f35b61010a610381565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61018e6004803603602081101561016257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506103a7565b005b6101986104a2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101e26104c7565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610222578082015181840152602081019050610207565b50505050905090810190601f16801561024f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610265610565565b604051808215151515815260200191505060405180910390f35b610287610578565b604051808215151515815260200191505060405180910390f35b60045481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461030157600080fd5b600360009054906101000a900460ff161561031b57600080fd5b6001600360006101000a81548160ff021916908315150217905550806004819055507fb1aaa9f4484acc283375c8e495a44766e4026170797dc9280b4ae2ab5632fb71816040518082815260200191505060405180910390a150565b6000600454905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461040157600080fd5b600360009054906101000a900460ff161561041b57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f191a2405c52452c381a62f3b7480f9d3e77a76d7737659fc1030aff54b395dd560405160405180910390a250565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561055d5780601f106105325761010080835404028352916020019161055d565b820191906000526020600020905b81548152906001019060200180831161054057829003601f168201915b505050505081565b600360009054906101000a900460ff1681565b6000600360009054906101000a900460ff1690509056fea165627a7a72305820868adc38275f346a001e47a0e276de7290b5e19e187afe829dcd446f2c6082dc0029", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063a39a45b711610066578063a39a45b71461014c578063a619486e14610190578063c623674f146101da578063c65fb3801461025d578063ccdf68f31461027f57610093565b806327793f8714610098578063717a195a146100b65780637e7e4b47146100e45780638da5cb5b14610102575b600080fd5b6100a06102a1565b6040518082815260200191505060405180910390f35b6100e2600480360360208110156100cc57600080fd5b81019080803590602001909291905050506102a7565b005b6100ec610377565b6040518082815260200191505060405180910390f35b61010a610381565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61018e6004803603602081101561016257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506103a7565b005b6101986104a2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101e26104c7565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610222578082015181840152602081019050610207565b50505050905090810190601f16801561024f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610265610565565b604051808215151515815260200191505060405180910390f35b610287610578565b604051808215151515815260200191505060405180910390f35b60045481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461030157600080fd5b600360009054906101000a900460ff161561031b57600080fd5b6001600360006101000a81548160ff021916908315150217905550806004819055507fb1aaa9f4484acc283375c8e495a44766e4026170797dc9280b4ae2ab5632fb71816040518082815260200191505060405180910390a150565b6000600454905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461040157600080fd5b600360009054906101000a900460ff161561041b57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f191a2405c52452c381a62f3b7480f9d3e77a76d7737659fc1030aff54b395dd560405160405180910390a250565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561055d5780601f106105325761010080835404028352916020019161055d565b820191906000526020600020905b81548152906001019060200180831161054057829003601f168201915b505050505081565b600360009054906101000a900460ff1681565b6000600360009054906101000a900460ff1690509056fea165627a7a72305820868adc38275f346a001e47a0e276de7290b5e19e187afe829dcd446f2c6082dc0029", "sourceMap": "1159:1048:14:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1159:1048:14;;;;;;;", "deployedSourceMap": "1159:1048:14:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1159:1048:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;386:18;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1620:226;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1620:226:14;;;;;;;;;;;;;;;;;:::i;:::-;;2098:107;;;:::i;:::-;;;;;;;;;;;;;;;;;;;310:20;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;1337:207;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1337:207:14;;;;;;;;;;;;;;;;;;;:::i;:::-;;205:25:29;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;336:21:14;;;:::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;:::-;;;;;;;;;;;;;;;;;;;;;;;1931:108;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;386:18;;;;:::o;1620:226::-;540:5;;;;;;;;;;;526:19;;:10;:19;;;518:28;;;;;;1741:5;;;;;;;;;;;1740:6;1732:15;;;;;;1765:4;1757:5;;:12;;;;;;;;;;;;;;;;;;1789:8;1779:7;:18;;;;1812:27;1830:8;1812:27;;;;;;;;;;;;;;;;;;1620:226;:::o;2098:107::-;2165:3;2191:7;;2184:14;;2098:107;:::o;310:20::-;;;;;;;;;;;;;:::o;1337:207::-;540:5;;;;;;;;;;;526:19;;:10;:19;;;518:28;;;;;;1464:5;;;;;;;;;;;1463:6;1455:15;;;;;;1488:8;1480:5;;:16;;;;;;;;;;;;;;;;;;1528:8;1511:26;;;;;;;;;;;;1337:207;:::o;205:25:29:-;;;;;;;;;;;;;:::o;336:21:14:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;363:17::-;;;;;;;;;;;;;:::o;1931:108::-;2000:4;2027:5;;;;;;;;;;;2020:12;;1931:108;:::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,