UNPKG

@gnosis.pm/pm-contracts

Version:

Collection of smart contracts for the Gnosis prediction market platform

766 lines (765 loc) 122 kB
{ "contractName": "UltimateOracleFactory", "abi": [ { "constant": true, "inputs": [], "name": "ultimateOracleMasterCopy", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "inputs": [ { "name": "_ultimateOracleMasterCopy", "type": "address" } ], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "creator", "type": "address" }, { "indexed": false, "name": "ultimateOracle", "type": "address" }, { "indexed": false, "name": "oracle", "type": "address" }, { "indexed": false, "name": "collateralToken", "type": "address" }, { "indexed": false, "name": "spreadMultiplier", "type": "uint8" }, { "indexed": false, "name": "challengePeriod", "type": "uint256" }, { "indexed": false, "name": "challengeAmount", "type": "uint256" }, { "indexed": false, "name": "frontRunnerPeriod", "type": "uint256" } ], "name": "UltimateOracleCreation", "type": "event" }, { "constant": false, "inputs": [ { "name": "oracle", "type": "address" }, { "name": "collateralToken", "type": "address" }, { "name": "spreadMultiplier", "type": "uint8" }, { "name": "challengePeriod", "type": "uint256" }, { "name": "challengeAmount", "type": "uint256" }, { "name": "frontRunnerPeriod", "type": "uint256" } ], "name": "createUltimateOracle", "outputs": [ { "name": "ultimateOracle", "type": "address" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.5.6+commit.b259423e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[],\"name\":\"ultimateOracleMasterCopy\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"oracle\",\"type\":\"address\"},{\"name\":\"collateralToken\",\"type\":\"address\"},{\"name\":\"spreadMultiplier\",\"type\":\"uint8\"},{\"name\":\"challengePeriod\",\"type\":\"uint256\"},{\"name\":\"challengeAmount\",\"type\":\"uint256\"},{\"name\":\"frontRunnerPeriod\",\"type\":\"uint256\"}],\"name\":\"createUltimateOracle\",\"outputs\":[{\"name\":\"ultimateOracle\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_ultimateOracleMasterCopy\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"creator\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"ultimateOracle\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"oracle\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"collateralToken\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"spreadMultiplier\",\"type\":\"uint8\"},{\"indexed\":false,\"name\":\"challengePeriod\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"challengeAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"frontRunnerPeriod\",\"type\":\"uint256\"}],\"name\":\"UltimateOracleCreation\",\"type\":\"event\"}],\"devdoc\":{\"author\":\"Stefan George - <stefan@gnosis.pm>\",\"methods\":{\"createUltimateOracle(address,address,uint8,uint256,uint256,uint256)\":{\"details\":\"Creates a new ultimate Oracle contract\",\"params\":{\"challengeAmount\":\"Amount to challenge the outcome\",\"challengePeriod\":\"Time to challenge oracle outcome\",\"collateralToken\":\"Collateral token address\",\"frontRunnerPeriod\":\"Time to overbid the front-runner\",\"oracle\":\"Oracle address\",\"spreadMultiplier\":\"Defines the spread as a multiple of the money bet on other outcomes\"},\"return\":\"Oracle contract\"}},\"title\":\"Ultimate oracle factory contract - Allows to create ultimate oracle contracts\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/home/alan/src/github.com/gnosis/pm-contracts/contracts/Oracles/UltimateOracleFactory.sol\":\"UltimateOracleFactory\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/home/alan/src/github.com/gnosis/pm-contracts/contracts/Oracles/Oracle.sol\":{\"keccak256\":\"0xf4d12f4a59c17e66dfa6791188f621a8914e2038a4e3f72d6fc9fb903ca8e18e\",\"urls\":[\"bzzr://a477ccd203e677cc904b1a4f8fcc85251c5b5e09c5c10eed27e01318584b16d1\"]},\"/home/alan/src/github.com/gnosis/pm-contracts/contracts/Oracles/UltimateOracle.sol\":{\"keccak256\":\"0x58cd0fc631023fdc5be8ca10d38d470c45b9bd6a07c55a32b1e37c5017c15c9d\",\"urls\":[\"bzzr://75b2c3baa37871dbb7604d38fc3c1a113dec600c55f7ad22a97f41675cf6c873\"]},\"/home/alan/src/github.com/gnosis/pm-contracts/contracts/Oracles/UltimateOracleFactory.sol\":{\"keccak256\":\"0x68ede9ac0c231e649e78f086051e80df778d20661624468c90e18ae2d660d34b\",\"urls\":[\"bzzr://0f583208b94aad6fcf917c51d7e9ecb1faf40d2bfbf105bf24aa7b26acf5e27b\"]},\"@gnosis.pm/util-contracts/contracts/Proxy.sol\":{\"keccak256\":\"0xeab0e83a9ec9e7f052c0455a11577061ec6d1994db08dae429abd6faaabf6555\",\"urls\":[\"bzzr://b2c1273d4ec30e2f9e768eea8c510f8493a7359b03e01923d93eea86b57ec145\"]},\"openzeppelin-solidity/contracts/drafts/SignedSafeMath.sol\":{\"keccak256\":\"0xb4b45cd5475c318722ac0f8d7e2b9e77fee6f4f36374c1110fe615d50fbc0650\",\"urls\":[\"bzzr://a90fb457269c8a03ec5b811c71acef08a2751a4d2019b0661328610f9357dae7\"]},\"openzeppelin-solidity/contracts/math/SafeMath.sol\":{\"keccak256\":\"0x4ccf2d7b51873db1ccfd54ca2adae5eac3b184f9699911ed4490438419f1c690\",\"urls\":[\"bzzr://1604f5b6d6e916c154efd8c6720cda069e5ba32dfa0a9dedf2b42e5b02d07f89\"]},\"openzeppelin-solidity/contracts/token/ERC20/ERC20.sol\":{\"keccak256\":\"0x852793a3c2f86d336a683b30d688ec3dcfc57451af5a2bf5975cda3b7191a901\",\"urls\":[\"bzzr://07fb42206812a17c1f71e548cfa5cec6f9aa1ae0ca5df870718ca4aa9759d1a5\"]},\"openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x90e8c2521653bbb1768b05889c5760031e688d9cd361f167489b89215e201b95\",\"urls\":[\"bzzr://aa8b45b57edafc3d67bc5d916327ea16807fae33f753ca163ae0c4061b789766\"]}},\"version\":1}", "bytecode": "0x608060405234801561001057600080fd5b50604051602080610c648339810180604052602081101561003057600080fd5b8101908080519060200190929190505050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610bd3806100916000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80632d1dc8491461003b578063ce70faec14610085575b600080fd5b610043610154565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610112600480360360c081101561009b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190803590602001909291908035906020019092919080359060200190929190505050610179565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168787878787876040516101af9061039e565b808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018560ff1660ff168152602001848152602001838152602001828152602001975050505050505050604051809103906000f080158015610289573d6000803e3d6000fd5b5090503373ffffffffffffffffffffffffffffffffffffffff167fe6ae2b8211e9721c5dae1d93f70be0ba07bd111608ba4db4317742e1a87fff4082898989898989604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018560ff1660ff16815260200184815260200183815260200182815260200197505050505050505060405180910390a29695505050505050565b6107fc806103ac8339019056fe608060405234801561001057600080fd5b5060405160e0806107fc833981018060405260e081101561003057600080fd5b810190808051906020019092919080519060200190929190805190602001909291908051906020019092919080519060200190929190805190602001909291908051906020019092919050505086600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156100b857600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141580156101635750600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015610173575060028460ff1610155b801561017f5750600083115b801561018b5750600082115b80156101975750600081115b6101a057600080fd5b85600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555084600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600260146101000a81548160ff021916908360ff16021790555082600381905550816004819055508060058190555050505050505050610594806102686000396000f3fe6080604052600436106100dd5760003560e01c8063984a470a1161007f578063b2016bd411610059578063b2016bd414610355578063c427af9b146103ac578063d84d2a471461041b578063f3f480d91461044c576100dd565b8063984a470a146102a85780639d89e7d4146102d3578063a619486e146102fe576100dd565b80631a39d8ef116100bb5780631a39d8ef146101d85780631ff1431114610203578063466ae314146102525780638ef8125e1461027d576100dd565b8063061a85c71461012b5780630853f7eb146101825780630f3e9438146101ad575b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050366000803760008036600084600019f43d6000803e8060008114610126573d6000f35b3d6000fd5b34801561013757600080fd5b50610140610477565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561018e57600080fd5b5061019761049d565b6040518082815260200191505060405180910390f35b3480156101b957600080fd5b506101c26104a3565b6040518082815260200191505060405180910390f35b3480156101e457600080fd5b506101ed6104a9565b6040518082815260200191505060405180910390f35b34801561020f57600080fd5b5061023c6004803603602081101561022657600080fd5b81019080803590602001909291905050506104af565b6040518082815260200191505060405180910390f35b34801561025e57600080fd5b506102676104c7565b6040518082815260200191505060405180910390f35b34801561028957600080fd5b506102926104cd565b6040518082815260200191505060405180910390f35b3480156102b457600080fd5b506102bd6104d3565b6040518082815260200191505060405180910390f35b3480156102df57600080fd5b506102e86104d9565b6040518082815260200191505060405180910390f35b34801561030a57600080fd5b506103136104df565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561036157600080fd5b5061036a610504565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103b857600080fd5b50610405600480360360408110156103cf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061052a565b6040518082815260200191505060405180910390f35b34801561042757600080fd5b5061043061054f565b604051808260ff1660ff16815260200191505060405180910390f35b34801561045857600080fd5b50610461610562565b6040518082815260200191505060405180910390f35b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b60085481565b600a5481565b600b6020528060005260406000206000915090505481565b60075481565b60095481565b60065481565b60045481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600c602052816000526040600020602052806000526040600020600091509150505481565b600260149054906101000a900460ff1681565b6003548156fea165627a7a7230582052d82f92036ae3d480ca814bd18c547f9ea020394feec8bbcbe34212d46f0ae40029a165627a7a72305820e55ce12d30304ff6b12d7b8357560f2022cfa839a23fd73ba84873da1f468db60029", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c80632d1dc8491461003b578063ce70faec14610085575b600080fd5b610043610154565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610112600480360360c081101561009b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190803590602001909291908035906020019092919080359060200190929190505050610179565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168787878787876040516101af9061039e565b808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018560ff1660ff168152602001848152602001838152602001828152602001975050505050505050604051809103906000f080158015610289573d6000803e3d6000fd5b5090503373ffffffffffffffffffffffffffffffffffffffff167fe6ae2b8211e9721c5dae1d93f70be0ba07bd111608ba4db4317742e1a87fff4082898989898989604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018560ff1660ff16815260200184815260200183815260200182815260200197505050505050505060405180910390a29695505050505050565b6107fc806103ac8339019056fe608060405234801561001057600080fd5b5060405160e0806107fc833981018060405260e081101561003057600080fd5b810190808051906020019092919080519060200190929190805190602001909291908051906020019092919080519060200190929190805190602001909291908051906020019092919050505086600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156100b857600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141580156101635750600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015610173575060028460ff1610155b801561017f5750600083115b801561018b5750600082115b80156101975750600081115b6101a057600080fd5b85600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555084600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600260146101000a81548160ff021916908360ff16021790555082600381905550816004819055508060058190555050505050505050610594806102686000396000f3fe6080604052600436106100dd5760003560e01c8063984a470a1161007f578063b2016bd411610059578063b2016bd414610355578063c427af9b146103ac578063d84d2a471461041b578063f3f480d91461044c576100dd565b8063984a470a146102a85780639d89e7d4146102d3578063a619486e146102fe576100dd565b80631a39d8ef116100bb5780631a39d8ef146101d85780631ff1431114610203578063466ae314146102525780638ef8125e1461027d576100dd565b8063061a85c71461012b5780630853f7eb146101825780630f3e9438146101ad575b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050366000803760008036600084600019f43d6000803e8060008114610126573d6000f35b3d6000fd5b34801561013757600080fd5b50610140610477565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561018e57600080fd5b5061019761049d565b6040518082815260200191505060405180910390f35b3480156101b957600080fd5b506101c26104a3565b6040518082815260200191505060405180910390f35b3480156101e457600080fd5b506101ed6104a9565b6040518082815260200191505060405180910390f35b34801561020f57600080fd5b5061023c6004803603602081101561022657600080fd5b81019080803590602001909291905050506104af565b6040518082815260200191505060405180910390f35b34801561025e57600080fd5b506102676104c7565b6040518082815260200191505060405180910390f35b34801561028957600080fd5b506102926104cd565b6040518082815260200191505060405180910390f35b3480156102b457600080fd5b506102bd6104d3565b6040518082815260200191505060405180910390f35b3480156102df57600080fd5b506102e86104d9565b6040518082815260200191505060405180910390f35b34801561030a57600080fd5b506103136104df565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561036157600080fd5b5061036a610504565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103b857600080fd5b50610405600480360360408110156103cf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061052a565b6040518082815260200191505060405180910390f35b34801561042757600080fd5b5061043061054f565b604051808260ff1660ff16815260200191505060405180910390f35b34801561045857600080fd5b50610461610562565b6040518082815260200191505060405180910390f35b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b60085481565b600a5481565b600b6020528060005260406000206000915090505481565b60075481565b60095481565b60065481565b60045481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600c602052816000526040600020602052806000526040600020600091509150505481565b600260149054906101000a900460ff1681565b6003548156fea165627a7a7230582052d82f92036ae3d480ca814bd18c547f9ea020394feec8bbcbe34212d46f0ae40029a165627a7a72305820e55ce12d30304ff6b12d7b8357560f2022cfa839a23fd73ba84873da1f468db60029", "sourceMap": "202:1958:26:-;;;685:142;8:9:-1;5:2;;;30:1;27;20:12;5:2;685:142:26;;;;;;;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;685:142:26;;;;;;;;;;;;;;;;795:25;768:24;;:52;;;;;;;;;;;;;;;;;;685:142;202:1958;;;;;;", "deployedSourceMap": "202:1958:26:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;202:1958:26;;;;;;;;;;;;;;;;;;;;;;;;592:46;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;1303:855;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;1303:855:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;592:46;;;;;;;;;;;;;:::o;1303:855::-;1549:29;1679:24;;;;;;;;;;;1718:6;1738:15;1767:16;1797:15;1826;1855:17;1634:248;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1634:248:26;1594:290;;1935:10;1899:252;;;1959:14;1987:6;2007:15;2036:16;2066:15;2095;2124:17;1899:252;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1303:855;;;;;;;;:::o;202:1958::-;;;;;;;;:::o", "source": "pragma solidity ^0.5.0;\nimport \"../Oracles/UltimateOracle.sol\";\n\n\n/// @title Ultimate oracle factory contract - Allows to create ultimate oracle contracts\n/// @author Stefan George - <stefan@gnosis.pm>\ncontract UltimateOracleFactory {\n\n /*\n * Events\n */\n event UltimateOracleCreation(\n address indexed creator,\n UltimateOracle ultimateOracle,\n Oracle oracle,\n ERC20 collateralToken,\n uint8 spreadMultiplier,\n uint challengePeriod,\n uint challengeAmount,\n uint frontRunnerPeriod\n );\n\n /*\n * Storage\n */\n UltimateOracle public ultimateOracleMasterCopy;\n\n /*\n * Public functions\n */\n constructor(UltimateOracle _ultimateOracleMasterCopy)\n public\n {\n ultimateOracleMasterCopy = _ultimateOracleMasterCopy;\n }\n\n /// @dev Creates a new ultimate Oracle contract\n /// @param oracle Oracle address\n /// @param collateralToken Collateral token address\n /// @param spreadMultiplier Defines the spread as a multiple of the money bet on other outcomes\n /// @param challengePeriod Time to challenge oracle outcome\n /// @param challengeAmount Amount to challenge the outcome\n /// @param frontRunnerPeriod Time to overbid the front-runner\n /// @return Oracle contract\n function createUltimateOracle(\n Oracle oracle,\n ERC20 collateralToken,\n uint8 spreadMultiplier,\n uint challengePeriod,\n uint challengeAmount,\n uint frontRunnerPeriod\n )\n public\n returns (UltimateOracle ultimateOracle)\n {\n ultimateOracle = UltimateOracle(address(new UltimateOracleProxy(\n address(ultimateOracleMasterCopy),\n oracle,\n collateralToken,\n spreadMultiplier,\n challengePeriod,\n challengeAmount,\n frontRunnerPeriod\n )));\n emit UltimateOracleCreation(\n msg.sender,\n ultimateOracle,\n oracle,\n collateralToken,\n spreadMultiplier,\n challengePeriod,\n challengeAmount,\n frontRunnerPeriod\n );\n }\n}\n", "sourcePath": "/home/alan/src/github.com/gnosis/pm-contracts/contracts/Oracles/UltimateOracleFactory.sol", "ast": { "absolutePath": "/home/alan/src/github.com/gnosis/pm-contracts/contracts/Oracles/UltimateOracleFactory.sol", "exportedSymbols": { "UltimateOracleFactory": [ 5686 ] }, "id": 5687, "nodeType": "SourceUnit", "nodes": [ { "id": 5605, "literals": [ "solidity", "^", "0.5", ".0" ], "nodeType": "PragmaDirective", "src": "0:23:26" }, { "absolutePath": "/home/alan/src/github.com/gnosis/pm-contracts/contracts/Oracles/UltimateOracle.sol", "file": "../Oracles/UltimateOracle.sol", "id": 5606, "nodeType": "ImportDirective", "scope": 5687, "sourceUnit": 5604, "src": "24:39:26", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [], "contractDependencies": [ 5249 ], "contractKind": "contract", "documentation": "@title Ultimate oracle factory contract - Allows to create ultimate oracle contracts\n @author Stefan George - <stefan@gnosis.pm>", "fullyImplemented": true, "id": 5686, "linearizedBaseContracts": [ 5686 ], "name": "UltimateOracleFactory", "nodeType": "ContractDefinition", "nodes": [ { "anonymous": false, "documentation": null, "id": 5624, "name": "UltimateOracleCreation", "nodeType": "EventDefinition", "parameters": { "id": 5623, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5608, "indexed": true, "name": "creator", "nodeType": "VariableDeclaration", "scope": 5624, "src": "308:23:26", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 5607, "name": "address", "nodeType": "ElementaryTypeName", "src": "308:7:26", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5610, "indexed": false, "name": "ultimateOracle", "nodeType": "VariableDeclaration", "scope": 5624, "src": "341:29:26", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_UltimateOracle_$5603", "typeString": "contract UltimateOracle" }, "typeName": { "contractScope": null, "id": 5609, "name": "UltimateOracle", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 5603, "src": "341:14:26", "typeDescriptions": { "typeIdentifier": "t_contract$_UltimateOracle_$5603", "typeString": "contract UltimateOracle" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5612, "indexed": false, "name": "oracle", "nodeType": "VariableDeclaration", "scope": 5624, "src": "380:13:26", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_Oracle_$4841", "typeString": "contract Oracle" }, "typeName": { "contractScope": null, "id": 5611, "name": "Oracle", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4841, "src": "380:6:26", "typeDescriptions": { "typeIdentifier": "t_contract$_Oracle_$4841", "typeString": "contract Oracle" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5614, "indexed": false, "name": "collateralToken", "nodeType": "VariableDeclaration", "scope": 5624, "src": "403:21:26", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_ERC20_$7778", "typeString": "contract ERC20" }, "typeName": { "contractScope": null, "id": 5613, "name": "ERC20", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 7778, "src": "403:5:26", "typeDescriptions": { "typeIdentifier": "t_contract$_ERC20_$7778", "typeString": "contract ERC20" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5616, "indexed": false, "name": "spreadMultiplier", "nodeType": "VariableDeclaration", "scope": 5624, "src": "434:22:26", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "typeName": { "id": 5615, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "434:5:26", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5618, "indexed": false, "name": "challengePeriod", "nodeType": "VariableDeclaration", "scope": 5624, "src": "466:20:26", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5617, "name": "uint", "nodeType": "ElementaryTypeName", "src": "466:4:26", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5620, "indexed": false, "name": "challengeAmount", "nodeType": "VariableDeclaration", "scope": 5624, "src": "496:20:26", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5619, "name": "uint", "nodeType": "ElementaryTypeName", "src": "496:4:26", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5622, "indexed": false, "name": "frontRunnerPeriod", "nodeType": "VariableDeclaration", "scope": 5624, "src": "526:22:26", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5621, "name": "uint", "nodeType": "ElementaryTypeName", "src": "526:4:26", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "298:256:26" }, "src": "270:285:26" }, { "constant": false, "id": 5626, "name": "ultimateOracleMasterCopy", "nodeType": "VariableDeclaration", "scope": 5686, "src": "592:46:26", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_UltimateOracle_$5603", "typeString": "contract UltimateOracle" }, "typeName": { "contractScope": null, "id": 5625, "name": "UltimateOracle", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 5603, "src": "592:14:26", "typeDescriptions": { "typeIdentifier": "t_contract$_UltimateOracle_$5603", "typeString": "contract UltimateOracle" } }, "value": null, "visibility": "public" }, { "body": { "id": 5635, "nodeType": "Block", "src": "758:69:26", "statements": [ { "expression": { "argumentTypes": null, "id": 5633, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 5631, "name": "ultimateOracleMasterCopy", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5626, "src": "768:24:26", "typeDescriptions": { "typeIdentifier": "t_contract$_UltimateOracle_$5603", "typeString": "contract UltimateOracle" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 5632, "name": "_ultimateOracleMasterCopy", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5628, "src": "795:25:26", "typeDescriptions": { "typeIdentifier": "t_contract$_UltimateOracle_$5603", "typeString": "contract UltimateOracle" } }, "src": "768:52:26", "typeDescriptions": { "typeIdentifier": "t_contract$_UltimateOracle_$5603", "typeString": "contract UltimateOracle" } }, "id": 5634, "nodeType": "ExpressionStatement", "src": "768:52:26" } ] }, "documentation": null, "id": 5636, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 5629, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5628, "name": "_ultimateOracleMasterCopy", "nodeType": "VariableDeclaration", "scope": 5636, "src": "697:40:26", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_UltimateOracle_$5603", "typeString": "contract UltimateOracle" }, "typeName": { "contractScope": null, "id": 5627, "name": "UltimateOracle", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 5603, "src": "697:14:26", "typeDescriptions": { "typeIdentifier": "t_contract$_UltimateOracle_$5603", "typeString": "contract UltimateOracle" } }, "value": null, "visibility": "internal" } ], "src": "696:42:26" }, "returnParameters": { "id": 5630, "nodeType": "ParameterList", "parameters": [], "src": "758:0:26" }, "scope": 5686, "src": "685:142:26", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 5684, "nodeType": "Block", "src": "1584:574:26", "statements": [ { "expression": { "argumentTypes": null, "id": 5670, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 5653, "name": "ultimateOracle", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5651, "src": "1594:14:26", "typeDescriptions": { "typeIdentifier": "t_contract$_UltimateOracle_$5603", "typeString": "contract UltimateOracle" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 5659, "name": "ultimateOracleMasterCopy", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5626, "src": "1679:24:26", "typeDescriptions": { "typeIdentifier": "t_contract$_UltimateOracle_$5603", "typeString": "contract UltimateOracle" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_contract$_UltimateOracle_$5603", "typeString": "contract UltimateOracle" } ], "id": 5658, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "1671:7:26", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 5660, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1671:33:26", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, { "argumentTypes": null, "id": 5661, "name": "oracle", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5638, "src": "1718:6:26", "typeDescriptions": { "typeIdentifier": "t_contract$_Oracle_$4841", "typeString": "contract Oracle" } }, { "argumentTypes": null, "id": 5662, "name": "collateralToken", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5640, "src": "1738:15:26", "typeDescriptions": { "typeIdentifier": "t_contract$_ERC20_$7778", "typeString": "contract ERC20" } }, { "argumentTypes": null, "id": 5663, "name": "spreadMultiplier", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5642, "src": "1767:16:26", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, { "argumentTypes": null, "id": 5664, "name": "challengePeriod", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5644, "src": "1797:15:26", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "id": 5665, "name": "challengeAmount", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5646, "src": "1826:15:26", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "id": 5666, "name": "frontRunnerPeriod", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5648, "src": "1855:17:26", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" }, { "typeIdentifier": "t_contract$_Oracle_$4841", "typeString": "contract Oracle" }, { "typeIdentifier": "t_contract$_ERC20_$7778", "typeString": "contract ERC20" }, { "typeIdentifier": "t_uint8", "typeString": "uint8" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 5657, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "1634:23:26", "typeDescriptions": { "typeIdentifier": "t_function_creation_nonpayable$_t_address_$_t_contract$_Oracle_$4841_$_t_contract$_ERC20_$7778_$_t_uint8_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_contract$_UltimateOracleProxy_$5249_$", "typeString": "function (address,contract Oracle,contract ERC20,uint8,uint256,uint256,uint256) returns (contract UltimateOracleProxy)" }, "typeName": { "contractScope": null, "id": 5656, "name": "UltimateOracleProxy", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 5249, "src": "1638:19:26", "typeDescriptions": { "typeIdentifier": "t_contract$_UltimateOracleProxy_$5249", "typeString": "contract UltimateOracleProxy" } }