UNPKG

@gnosis.pm/pm-contracts

Version:

Collection of smart contracts for the Gnosis prediction market platform

924 lines (923 loc) 78.4 kB
{ "contractName": "MajorityOracleFactory", "abi": [ { "constant": true, "inputs": [], "name": "majorityOracleMasterCopy", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "inputs": [ { "name": "_majorityOracleMasterCopy", "type": "address" } ], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "creator", "type": "address" }, { "indexed": false, "name": "majorityOracle", "type": "address" }, { "indexed": false, "name": "oracles", "type": "address[]" } ], "name": "MajorityOracleCreation", "type": "event" }, { "constant": false, "inputs": [ { "name": "oracles", "type": "address[]" } ], "name": "createMajorityOracle", "outputs": [ { "name": "majorityOracle", "type": "address" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.5.6+commit.b259423e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[],\"name\":\"majorityOracleMasterCopy\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"oracles\",\"type\":\"address[]\"}],\"name\":\"createMajorityOracle\",\"outputs\":[{\"name\":\"majorityOracle\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_majorityOracleMasterCopy\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"creator\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"majorityOracle\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"oracles\",\"type\":\"address[]\"}],\"name\":\"MajorityOracleCreation\",\"type\":\"event\"}],\"devdoc\":{\"author\":\"Stefan George - <stefan@gnosis.pm>\",\"methods\":{\"createMajorityOracle(address[])\":{\"details\":\"Creates a new majority oracle contract\",\"params\":{\"oracles\":\"List of oracles taking part in the majority vote\"},\"return\":\"Oracle contract\"}},\"title\":\"Majority oracle factory contract - Allows to create majority oracle contracts\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/home/alan/src/github.com/gnosis/pm-contracts/contracts/Oracles/MajorityOracleFactory.sol\":\"MajorityOracleFactory\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/home/alan/src/github.com/gnosis/pm-contracts/contracts/Oracles/MajorityOracle.sol\":{\"keccak256\":\"0x2662717bba85076a2beb5166630f415997b78174a11713845af147d2acfed289\",\"urls\":[\"bzzr://8172948c09ee1cc3a5bafe2fd38e97215b408cace6b61fbae6444cfb8bab5fa4\"]},\"/home/alan/src/github.com/gnosis/pm-contracts/contracts/Oracles/MajorityOracleFactory.sol\":{\"keccak256\":\"0xeb31d0f3d34ff7ac90c34e20e0c038437e5ad097b5559ef0eb4f6a88b7430bf7\",\"urls\":[\"bzzr://24ef196df6d5a8511e8c36bcf0de5e4e4ef91d570d4c1fbcaacaa0a2d05b2a7a\"]},\"/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": "0x608060405234801561001057600080fd5b506040516020806108568339810180604052602081101561003057600080fd5b8101908080519060200190929190505050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506107c5806100916000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063a41d7eec1461003b578063e04c0c5214610085575b600080fd5b61004361017d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61013b6004803603602081101561009b57600080fd5b81019080803590602001906401000000008111156100b857600080fd5b8201836020820111156100ca57600080fd5b803590602001918460208302840111640100000000831117156100ec57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506101a2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16826040516101d390610338565b808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019060200280838360005b8381101561024557808201518184015260208101905061022a565b505050509050019350505050604051809103906000f08015801561026d573d6000803e3d6000fd5b5090503373ffffffffffffffffffffffffffffffffffffffff167fdf1eeefc4815bdd1bdf45905c4ce59f6ca50efb4148303c9bbda2bff40301d3d8284604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019060200280838360005b8381101561031f578082015181840152602081019050610304565b50505050905001935050505060405180910390a2919050565b610454806103468339019056fe608060405234801561001057600080fd5b506040516104543803806104548339810180604052604081101561003357600080fd5b8101908080519060200190929190805164010000000081111561005557600080fd5b8281019050602081018481111561006b57600080fd5b815185602082028301116401000000008211171561008857600080fd5b505092919050505081600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156100cb57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050600281511161011a57600080fd5b60008090505b815181101561018357600073ffffffffffffffffffffffffffffffffffffffff1682828151811061014d57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141561017657600080fd5b8080600101915050610120565b50806001908051906020019061019a9291906101a2565b50505061026f565b82805482825590600052602060002090810192821561021b579160200282015b8281111561021a5782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550916020019190600101906101c2565b5b509050610228919061022c565b5090565b61026c91905b8082111561026857600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905550600101610232565b5090565b90565b6101d68061027e6000396000f3fe6080604052600436106100295760003560e01c80635b69a7d814610077578063a619486e146100f2575b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050366000803760008036600084600019f43d6000803e8060008114610072573d6000f35b3d6000fd5b34801561008357600080fd5b506100b06004803603602081101561009a57600080fd5b8101908080359060200190929190505050610149565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156100fe57600080fd5b50610107610185565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6001818154811061015657fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff168156fea165627a7a72305820c0cb7ad0d06d4526336a538b71b687b92ccbb9dcf9be005fc71d36dd275b53c80029a165627a7a723058207ac858d56aaa39565e1c677966dc6817b25991e36fa0f9d3e33859675eb75f230029", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063a41d7eec1461003b578063e04c0c5214610085575b600080fd5b61004361017d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61013b6004803603602081101561009b57600080fd5b81019080803590602001906401000000008111156100b857600080fd5b8201836020820111156100ca57600080fd5b803590602001918460208302840111640100000000831117156100ec57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506101a2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16826040516101d390610338565b808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019060200280838360005b8381101561024557808201518184015260208101905061022a565b505050509050019350505050604051809103906000f08015801561026d573d6000803e3d6000fd5b5090503373ffffffffffffffffffffffffffffffffffffffff167fdf1eeefc4815bdd1bdf45905c4ce59f6ca50efb4148303c9bbda2bff40301d3d8284604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019060200280838360005b8381101561031f578082015181840152602081019050610304565b50505050905001935050505060405180910390a2919050565b610454806103468339019056fe608060405234801561001057600080fd5b506040516104543803806104548339810180604052604081101561003357600080fd5b8101908080519060200190929190805164010000000081111561005557600080fd5b8281019050602081018481111561006b57600080fd5b815185602082028301116401000000008211171561008857600080fd5b505092919050505081600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156100cb57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050600281511161011a57600080fd5b60008090505b815181101561018357600073ffffffffffffffffffffffffffffffffffffffff1682828151811061014d57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141561017657600080fd5b8080600101915050610120565b50806001908051906020019061019a9291906101a2565b50505061026f565b82805482825590600052602060002090810192821561021b579160200282015b8281111561021a5782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550916020019190600101906101c2565b5b509050610228919061022c565b5090565b61026c91905b8082111561026857600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905550600101610232565b5090565b90565b6101d68061027e6000396000f3fe6080604052600436106100295760003560e01c80635b69a7d814610077578063a619486e146100f2575b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050366000803760008036600084600019f43d6000803e8060008114610072573d6000f35b3d6000fd5b34801561008357600080fd5b506100b06004803603602081101561009a57600080fd5b8101908080359060200190929190505050610149565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156100fe57600080fd5b50610107610185565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6001818154811061015657fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff168156fea165627a7a72305820c0cb7ad0d06d4526336a538b71b687b92ccbb9dcf9be005fc71d36dd275b53c80029a165627a7a723058207ac858d56aaa39565e1c677966dc6817b25991e36fa0f9d3e33859675eb75f230029", "sourceMap": "202:929:21:-;;;503:142;8:9:-1;5:2;;;30:1;27;20:12;5:2;503:142:21;;;;;;;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;503:142:21;;;;;;;;;;;;;;;;613:25;586:24;;:52;;;;;;;;;;;;;;;;;;503:142;202:929;;;;;;", "deployedSourceMap": "202:929:21:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;202:929:21;;;;;;;;;;;;;;;;;;;;;;;;410:46;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;807:322;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;807:322:21;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;807:322:21;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;807:322:21;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;39:11;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;807:322:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;807:322:21;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;410:46;;;;;;;;;;;;;:::o;807:322::-;894:29;1011:24;;;;;;;;;;;1038:7;979:67;;;;;:::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;979:67:21;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;979:67:21;939:109;;1086:10;1063:59;;;1098:14;1114:7;1063:59;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;1063:59:21;;;;;;;;;;;;;;;;;;807:322;;;:::o;202:929::-;;;;;;;;:::o", "source": "pragma solidity ^0.5.0;\nimport \"../Oracles/MajorityOracle.sol\";\n\n\n/// @title Majority oracle factory contract - Allows to create majority oracle contracts\n/// @author Stefan George - <stefan@gnosis.pm>\ncontract MajorityOracleFactory {\n\n /*\n * Events\n */\n event MajorityOracleCreation(address indexed creator, MajorityOracle majorityOracle, Oracle[] oracles);\n\n /*\n * Storage\n */\n MajorityOracle public majorityOracleMasterCopy;\n\n /*\n * Public functions\n */\n constructor(MajorityOracle _majorityOracleMasterCopy)\n public\n {\n majorityOracleMasterCopy = _majorityOracleMasterCopy;\n }\n\n /// @dev Creates a new majority oracle contract\n /// @param oracles List of oracles taking part in the majority vote\n /// @return Oracle contract\n function createMajorityOracle(Oracle[] memory oracles)\n public\n returns (MajorityOracle majorityOracle)\n {\n majorityOracle = MajorityOracle(address(new MajorityOracleProxy(address(majorityOracleMasterCopy), oracles)));\n emit MajorityOracleCreation(msg.sender, majorityOracle, oracles);\n }\n}\n", "sourcePath": "/home/alan/src/github.com/gnosis/pm-contracts/contracts/Oracles/MajorityOracleFactory.sol", "ast": { "absolutePath": "/home/alan/src/github.com/gnosis/pm-contracts/contracts/Oracles/MajorityOracleFactory.sol", "exportedSymbols": { "MajorityOracleFactory": [ 4827 ] }, "id": 4828, "nodeType": "SourceUnit", "nodes": [ { "id": 4774, "literals": [ "solidity", "^", "0.5", ".0" ], "nodeType": "PragmaDirective", "src": "0:23:21" }, { "absolutePath": "/home/alan/src/github.com/gnosis/pm-contracts/contracts/Oracles/MajorityOracle.sol", "file": "../Oracles/MajorityOracle.sol", "id": 4775, "nodeType": "ImportDirective", "scope": 4828, "sourceUnit": 4773, "src": "24:39:21", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [], "contractDependencies": [ 4579 ], "contractKind": "contract", "documentation": "@title Majority oracle factory contract - Allows to create majority oracle contracts\n @author Stefan George - <stefan@gnosis.pm>", "fullyImplemented": true, "id": 4827, "linearizedBaseContracts": [ 4827 ], "name": "MajorityOracleFactory", "nodeType": "ContractDefinition", "nodes": [ { "anonymous": false, "documentation": null, "id": 4784, "name": "MajorityOracleCreation", "nodeType": "EventDefinition", "parameters": { "id": 4783, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 4777, "indexed": true, "name": "creator", "nodeType": "VariableDeclaration", "scope": 4784, "src": "299:23:21", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 4776, "name": "address", "nodeType": "ElementaryTypeName", "src": "299:7:21", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 4779, "indexed": false, "name": "majorityOracle", "nodeType": "VariableDeclaration", "scope": 4784, "src": "324:29:21", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_MajorityOracle_$4772", "typeString": "contract MajorityOracle" }, "typeName": { "contractScope": null, "id": 4778, "name": "MajorityOracle", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4772, "src": "324:14:21", "typeDescriptions": { "typeIdentifier": "t_contract$_MajorityOracle_$4772", "typeString": "contract MajorityOracle" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 4782, "indexed": false, "name": "oracles", "nodeType": "VariableDeclaration", "scope": 4784, "src": "355:16:21", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_array$_t_contract$_Oracle_$4841_$dyn_memory_ptr", "typeString": "contract Oracle[]" }, "typeName": { "baseType": { "contractScope": null, "id": 4780, "name": "Oracle", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4841, "src": "355:6:21", "typeDescriptions": { "typeIdentifier": "t_contract$_Oracle_$4841", "typeString": "contract Oracle" } }, "id": 4781, "length": null, "nodeType": "ArrayTypeName", "src": "355:8:21", "typeDescriptions": { "typeIdentifier": "t_array$_t_contract$_Oracle_$4841_$dyn_storage_ptr", "typeString": "contract Oracle[]" } }, "value": null, "visibility": "internal" } ], "src": "298:74:21" }, "src": "270:103:21" }, { "constant": false, "id": 4786, "name": "majorityOracleMasterCopy", "nodeType": "VariableDeclaration", "scope": 4827, "src": "410:46:21", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_MajorityOracle_$4772", "typeString": "contract MajorityOracle" }, "typeName": { "contractScope": null, "id": 4785, "name": "MajorityOracle", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4772, "src": "410:14:21", "typeDescriptions": { "typeIdentifier": "t_contract$_MajorityOracle_$4772", "typeString": "contract MajorityOracle" } }, "value": null, "visibility": "public" }, { "body": { "id": 4795, "nodeType": "Block", "src": "576:69:21", "statements": [ { "expression": { "argumentTypes": null, "id": 4793, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 4791, "name": "majorityOracleMasterCopy", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4786, "src": "586:24:21", "typeDescriptions": { "typeIdentifier": "t_contract$_MajorityOracle_$4772", "typeString": "contract MajorityOracle" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 4792, "name": "_majorityOracleMasterCopy", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4788, "src": "613:25:21", "typeDescriptions": { "typeIdentifier": "t_contract$_MajorityOracle_$4772", "typeString": "contract MajorityOracle" } }, "src": "586:52:21", "typeDescriptions": { "typeIdentifier": "t_contract$_MajorityOracle_$4772", "typeString": "contract MajorityOracle" } }, "id": 4794, "nodeType": "ExpressionStatement", "src": "586:52:21" } ] }, "documentation": null, "id": 4796, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 4789, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 4788, "name": "_majorityOracleMasterCopy", "nodeType": "VariableDeclaration", "scope": 4796, "src": "515:40:21", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_MajorityOracle_$4772", "typeString": "contract MajorityOracle" }, "typeName": { "contractScope": null, "id": 4787, "name": "MajorityOracle", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4772, "src": "515:14:21", "typeDescriptions": { "typeIdentifier": "t_contract$_MajorityOracle_$4772", "typeString": "contract MajorityOracle" } }, "value": null, "visibility": "internal" } ], "src": "514:42:21" }, "returnParameters": { "id": 4790, "nodeType": "ParameterList", "parameters": [], "src": "576:0:21" }, "scope": 4827, "src": "503:142:21", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 4825, "nodeType": "Block", "src": "929:200:21", "statements": [ { "expression": { "argumentTypes": null, "id": 4816, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 4804, "name": "majorityOracle", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4802, "src": "939:14:21", "typeDescriptions": { "typeIdentifier": "t_contract$_MajorityOracle_$4772", "typeString": "contract MajorityOracle" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 4810, "name": "majorityOracleMasterCopy", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4786, "src": "1011:24:21", "typeDescriptions": { "typeIdentifier": "t_contract$_MajorityOracle_$4772", "typeString": "contract MajorityOracle" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_contract$_MajorityOracle_$4772", "typeString": "contract MajorityOracle" } ], "id": 4809, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "1003:7:21", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 4811, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1003:33:21", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, { "argumentTypes": null, "id": 4812, "name": "oracles", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4799, "src": "1038:7:21", "typeDescriptions": { "typeIdentifier": "t_array$_t_contract$_Oracle_$4841_$dyn_memory_ptr", "typeString": "contract Oracle[] memory" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" }, { "typeIdentifier": "t_array$_t_contract$_Oracle_$4841_$dyn_memory_ptr", "typeString": "contract Oracle[] memory" } ], "id": 4808, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "979:23:21", "typeDescriptions": { "typeIdentifier": "t_function_creation_nonpayable$_t_address_$_t_array$_t_contract$_Oracle_$4841_$dyn_memory_ptr_$returns$_t_contract$_MajorityOracleProxy_$4579_$", "typeString": "function (address,contract Oracle[] memory) returns (contract MajorityOracleProxy)" }, "typeName": { "contractScope": null, "id": 4807, "name": "MajorityOracleProxy", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4579, "src": "983:19:21", "typeDescriptions": { "typeIdentifier": "t_contract$_MajorityOracleProxy_$4579", "typeString": "contract MajorityOracleProxy" } } }, "id": 4813, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "979:67:21", "typeDescriptions": { "typeIdentifier": "t_contract$_MajorityOracleProxy_$4579", "typeString": "contract MajorityOracleProxy" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_contract$_MajorityOracleProxy_$4579", "typeString": "contract MajorityOracleProxy" } ], "id": 4806, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "971:7:21", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 4814, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "971:76:21", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address_payable", "typeString": "address payable" } ], "id": 4805, "name": "MajorityOracle", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4772, "src": "956:14:21", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_MajorityOracle_$4772_$", "typeString": "type(contract MajorityOracle)" } }, "id": 4815, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "956:92:21", "typeDescriptions": { "typeIdentifier": "t_contract$_MajorityOracle_$4772", "typeString": "contract MajorityOracle" } }, "src": "939:109:21", "typeDescriptions": { "typeIdentifier": "t_contract$_MajorityOracle_$4772", "typeString": "contract MajorityOracle" } }, "id": 4817, "nodeType": "ExpressionStatement", "src": "939:109:21" }, { "eventCall": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 4819, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7920, "src": "1086:3:21", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 4820, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "1086:10:21", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, { "argumentTypes": null, "id": 4821, "name": "majorityOracle", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4802, "src": "1098:14:21", "typeDescriptions": { "typeIdentifier": "t_contract$_MajorityOracle_$4772", "typeString": "contract MajorityOracle" } }, { "argumentTypes": null, "id": 4822, "name": "oracles", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4799, "src": "1114:7:21", "typeDescriptions": { "typeIdentifier": "t_array$_t_contract$_Oracle_$4841_$dyn_memory_ptr", "typeString": "contract Oracle[] memory" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address_payable", "typeString": "address payable" }, { "typeIdentifier": "t_contract$_MajorityOracle_$4772", "typeString": "contract MajorityOracle" }, { "typeIdentifier": "t_array$_t_contract$_Oracle_$4841_$dyn_memory_ptr", "typeString": "contract Oracle[] memory" } ], "id": 4818, "name": "MajorityOracleCreation", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4784, "src": "1063:22:21", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_contract$_MajorityOracle_$4772_$_t_array$_t_contract$_Oracle_$4841_$dyn_memory_ptr_$returns$__$", "typeString": "function (address,contract MajorityOracle,contract Oracle[] memory)" } }, "id": 4823, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1063:59:21", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 4824, "nodeType": "EmitStatement", "src": "1058:64:21" } ] }, "documentation": "@dev Creates a new majority oracle contract\n @param oracles List of oracles taking part in the majority vote\n @return Oracle contract", "id": 4826, "implemented": true, "kind": "function", "modifiers": [], "name": "createMajorityOracle", "nodeType": "FunctionDefinition", "parameters": { "id": 4800, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 4799, "name": "oracles", "nodeType": "VariableDeclaration", "scope": 4826, "src": "837:23:21", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_array$_t_contract$_Oracle_$4841_$dyn_memory_ptr", "typeString": "contract Oracle[]" }, "typeName": { "baseType": { "contractScope": null, "id": 4797, "name": "Oracle", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4841, "src": "837:6:21", "typeDescriptions": { "typeIdentifier": "t_contract$_Oracle_$4841", "typeString": "contract Oracle" } }, "id": 4798, "length": null, "nodeType": "ArrayTypeName", "src": "837:8:21", "typeDescriptions": { "typeIdentifier": "t_array$_t_contract$_Oracle_$4841_$dyn_storage_ptr", "typeString": "contract Oracle[]" } }, "value": null, "visibility": "internal" } ], "src": "836:25:21" }, "returnParameters": { "id": 4803, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 4802, "name": "majorityOracle", "nodeType": "VariableDeclaration", "scope": 4826, "src": "894:29:21", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_MajorityOracle_$4772", "typeString": "contract MajorityOracle" }, "typeName": { "contractScope": null, "id": 4801, "name": "MajorityOracle", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4772, "src": "894:14:21", "typeDescriptions": { "typeIdentifier": "t_contract$_MajorityOracle_$4772", "typeString": "contract MajorityOracle" } }, "value": null, "visibility": "internal" } ], "src": "893:31:21" }, "scope": 4827, "src": "807:322:21", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" } ], "scope": 4828, "src": "202:929:21" } ], "src": "0:1132:21" }, "legacyAST": { "absolutePath": "/home/alan/src/github.com/gnosis/pm-contracts/contracts/Oracles/MajorityOracleFactory.sol", "exportedSymbols": { "MajorityOracleFactory": [ 4827 ] }, "id": 4828, "nodeType": "SourceUnit", "nodes": [ { "id": 4774, "literals": [ "solidity", "^", "0.5", ".0" ], "nodeType": "PragmaDirective", "src": "0:23:21" }, { "absolutePath": "/home/alan/src/github.com/gnosis/pm-contracts/contracts/Oracles/MajorityOracle.sol", "file": "../Oracles/MajorityOracle.sol", "id": 4775, "nodeType": "ImportDirective", "scope": 4828, "sourceUnit": 4773, "src": "24:39:21", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [], "contractDependencies": [ 4579 ], "contractKind": "contract", "documentation": "@title Majority oracle factory contract - Allows to create majority oracle contracts\n @author Stefan George - <stefan@gnosis.pm>", "fullyImplemented": true, "id": 4827, "linearizedBaseContracts": [ 4827 ], "name": "MajorityOracleFactory", "nodeType": "ContractDefinition", "nodes": [ { "anonymous": false, "documentation": null, "id": 4784, "name": "MajorityOracleCreation", "nodeType": "EventDefinition", "parameters": { "id": 4783, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 4777, "indexed": true, "name": "creator", "nodeType": "VariableDeclaration", "scope": 4784, "src": "299:23:21", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 4776, "name": "address", "nodeType": "ElementaryTypeName", "src": "299:7:21", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 4779, "indexed": false, "name": "majorityOracle", "nodeType": "VariableDeclaration", "scope": 4784, "src": "324:29:21", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_MajorityOracle_$4772", "typeString": "contract MajorityOracle" }, "typeName": { "contractScope": null, "id": 4778, "name": "MajorityOracle", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4772, "src": "324:14:21", "typeDescriptions": { "typeIdentifier": "t_contract$_MajorityOracle_$4772", "typeString": "contract MajorityOracle" } }, "value": null, "visibility": "internal" }, { "constant": false,