UNPKG

@gnosis.pm/pm-contracts

Version:

Collection of smart contracts for the Gnosis prediction market platform

1,342 lines (1,341 loc) 140 kB
{ "contractName": "Market", "abi": [ { "constant": true, "inputs": [], "name": "creator", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "marketMaker", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "createdAtBlock", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "", "type": "uint256" } ], "name": "netOutcomeTokensSold", "outputs": [ { "name": "", "type": "int256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "stage", "outputs": [ { "name": "", "type": "uint8" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "funding", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "fee", "outputs": [ { "name": "", "type": "uint24" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "eventContract", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "anonymous": false, "inputs": [ { "indexed": false, "name": "funding", "type": "uint256" } ], "name": "MarketFunding", "type": "event" }, { "anonymous": false, "inputs": [], "name": "MarketClosing", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "name": "fees", "type": "uint256" } ], "name": "FeeWithdrawal", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "buyer", "type": "address" }, { "indexed": false, "name": "outcomeTokenIndex", "type": "uint8" }, { "indexed": false, "name": "outcomeTokenCount", "type": "uint256" }, { "indexed": false, "name": "outcomeTokenCost", "type": "uint256" }, { "indexed": false, "name": "marketFees", "type": "uint256" } ], "name": "OutcomeTokenPurchase", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "seller", "type": "address" }, { "indexed": false, "name": "outcomeTokenIndex", "type": "uint8" }, { "indexed": false, "name": "outcomeTokenCount", "type": "uint256" }, { "indexed": false, "name": "outcomeTokenProfit", "type": "uint256" }, { "indexed": false, "name": "marketFees", "type": "uint256" } ], "name": "OutcomeTokenSale", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "buyer", "type": "address" }, { "indexed": false, "name": "outcomeTokenIndex", "type": "uint8" }, { "indexed": false, "name": "outcomeTokenCount", "type": "uint256" }, { "indexed": false, "name": "cost", "type": "uint256" } ], "name": "OutcomeTokenShortSale", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "transactor", "type": "address" }, { "indexed": false, "name": "outcomeTokenAmounts", "type": "int256[]" }, { "indexed": false, "name": "outcomeTokenNetCost", "type": "int256" }, { "indexed": false, "name": "marketFees", "type": "uint256" } ], "name": "OutcomeTokenTrade", "type": "event" }, { "constant": false, "inputs": [ { "name": "_funding", "type": "uint256" } ], "name": "fund", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [], "name": "close", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [], "name": "withdrawFees", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "outcomeTokenIndex", "type": "uint8" }, { "name": "outcomeTokenCount", "type": "uint256" }, { "name": "maxCost", "type": "uint256" } ], "name": "buy", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "outcomeTokenIndex", "type": "uint8" }, { "name": "outcomeTokenCount", "type": "uint256" }, { "name": "minProfit", "type": "uint256" } ], "name": "sell", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "outcomeTokenIndex", "type": "uint8" }, { "name": "outcomeTokenCount", "type": "uint256" }, { "name": "minProfit", "type": "uint256" } ], "name": "shortSell", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "outcomeTokenAmounts", "type": "int256[]" }, { "name": "costLimit", "type": "int256" } ], "name": "trade", "outputs": [ { "name": "", "type": "int256" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [ { "name": "outcomeTokenCost", "type": "uint256" } ], "name": "calcMarketFee", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.5.6+commit.b259423e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[],\"name\":\"creator\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"outcomeTokenAmounts\",\"type\":\"int256[]\"},{\"name\":\"costLimit\",\"type\":\"int256\"}],\"name\":\"trade\",\"outputs\":[{\"name\":\"\",\"type\":\"int256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"marketMaker\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"outcomeTokenIndex\",\"type\":\"uint8\"},{\"name\":\"outcomeTokenCount\",\"type\":\"uint256\"},{\"name\":\"minProfit\",\"type\":\"uint256\"}],\"name\":\"shortSell\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"close\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"outcomeTokenIndex\",\"type\":\"uint8\"},{\"name\":\"outcomeTokenCount\",\"type\":\"uint256\"},{\"name\":\"minProfit\",\"type\":\"uint256\"}],\"name\":\"sell\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"withdrawFees\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"createdAtBlock\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"netOutcomeTokensSold\",\"outputs\":[{\"name\":\"\",\"type\":\"int256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"outcomeTokenCost\",\"type\":\"uint256\"}],\"name\":\"calcMarketFee\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"stage\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_funding\",\"type\":\"uint256\"}],\"name\":\"fund\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"funding\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"fee\",\"outputs\":[{\"name\":\"\",\"type\":\"uint24\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"eventContract\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"outcomeTokenIndex\",\"type\":\"uint8\"},{\"name\":\"outcomeTokenCount\",\"type\":\"uint256\"},{\"name\":\"maxCost\",\"type\":\"uint256\"}],\"name\":\"buy\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"funding\",\"type\":\"uint256\"}],\"name\":\"MarketFunding\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"MarketClosing\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"fees\",\"type\":\"uint256\"}],\"name\":\"FeeWithdrawal\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"buyer\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"outcomeTokenIndex\",\"type\":\"uint8\"},{\"indexed\":false,\"name\":\"outcomeTokenCount\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"outcomeTokenCost\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"marketFees\",\"type\":\"uint256\"}],\"name\":\"OutcomeTokenPurchase\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"seller\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"outcomeTokenIndex\",\"type\":\"uint8\"},{\"indexed\":false,\"name\":\"outcomeTokenCount\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"outcomeTokenProfit\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"marketFees\",\"type\":\"uint256\"}],\"name\":\"OutcomeTokenSale\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"buyer\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"outcomeTokenIndex\",\"type\":\"uint8\"},{\"indexed\":false,\"name\":\"outcomeTokenCount\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"cost\",\"type\":\"uint256\"}],\"name\":\"OutcomeTokenShortSale\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"transactor\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"outcomeTokenAmounts\",\"type\":\"int256[]\"},{\"indexed\":false,\"name\":\"outcomeTokenNetCost\",\"type\":\"int256\"},{\"indexed\":false,\"name\":\"marketFees\",\"type\":\"uint256\"}],\"name\":\"OutcomeTokenTrade\",\"type\":\"event\"}],\"devdoc\":{\"methods\":{},\"title\":\"Abstract market contract - Functions to be implemented by market contracts\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/home/alan/src/github.com/gnosis/pm-contracts/contracts/Markets/Market.sol\":\"Market\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/home/alan/src/github.com/gnosis/pm-contracts/contracts/Events/Event.sol\":{\"keccak256\":\"0xdcacfa25145426b5681ad7d8bafb3c117c92a37b7a0175d72a10b42f130fb8c1\",\"urls\":[\"bzzr://bd10fbdb82f0d50866442c9e95317b3176c8ee067def27d764529973fb36420a\"]},\"/home/alan/src/github.com/gnosis/pm-contracts/contracts/MarketMakers/MarketMaker.sol\":{\"keccak256\":\"0xa71f8ce92412033d0900d44c01f0702aefced87d860cf116c6a4d3efe86913cf\",\"urls\":[\"bzzr://63c5bf60b931bb032fcab23514a3db171b680b11d8c6c05ac8caa88752e3be41\"]},\"/home/alan/src/github.com/gnosis/pm-contracts/contracts/Markets/Market.sol\":{\"keccak256\":\"0x7bc1ebf0ea0f4cd9b6e9bfff6c6ac9088c253bcfca4e27f31e5845799f0278d8\",\"urls\":[\"bzzr://5e3f86d96ab269d284b34563501469d539cc436d62f070dd0abda2519d5e60c0\"]},\"/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/Tokens/OutcomeToken.sol\":{\"keccak256\":\"0x3d4c9ec14a60cf7577d366da5116e919a4331da8d6d993174f7d599f84ae74e0\",\"urls\":[\"bzzr://20f87450259a3af24ff1769faa9ab3b714d01921e9d8fa4efa75a0c277837a8a\"]},\"@gnosis.pm/util-contracts/contracts/Proxy.sol\":{\"keccak256\":\"0xeab0e83a9ec9e7f052c0455a11577061ec6d1994db08dae429abd6faaabf6555\",\"urls\":[\"bzzr://b2c1273d4ec30e2f9e768eea8c510f8493a7359b03e01923d93eea86b57ec145\"]},\"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": "0x", "deployedBytecode": "0x", "sourceMap": "", "deployedSourceMap": "", "source": "pragma solidity ^0.5.0;\nimport \"../Events/Event.sol\";\nimport \"../MarketMakers/MarketMaker.sol\";\nimport \"@gnosis.pm/util-contracts/contracts/Proxy.sol\";\n\n\ncontract MarketData {\n /*\n * Events\n */\n event MarketFunding(uint funding);\n event MarketClosing();\n event FeeWithdrawal(uint fees);\n event OutcomeTokenPurchase(address indexed buyer, uint8 outcomeTokenIndex, uint outcomeTokenCount, uint outcomeTokenCost, uint marketFees);\n event OutcomeTokenSale(address indexed seller, uint8 outcomeTokenIndex, uint outcomeTokenCount, uint outcomeTokenProfit, uint marketFees);\n event OutcomeTokenShortSale(address indexed buyer, uint8 outcomeTokenIndex, uint outcomeTokenCount, uint cost);\n event OutcomeTokenTrade(address indexed transactor, int[] outcomeTokenAmounts, int outcomeTokenNetCost, uint marketFees);\n\n /*\n * Storage\n */\n address public creator;\n uint public createdAtBlock;\n Event public eventContract;\n MarketMaker public marketMaker;\n uint24 public fee;\n uint public funding;\n int[] public netOutcomeTokensSold;\n Stages public stage;\n\n enum Stages {\n MarketCreated,\n MarketFunded,\n MarketClosed\n }\n}\n\n/// @title Abstract market contract - Functions to be implemented by market contracts\ncontract Market is MarketData {\n /*\n * Public functions\n */\n function fund(uint _funding) public;\n function close() public;\n function withdrawFees() public returns (uint);\n function buy(uint8 outcomeTokenIndex, uint outcomeTokenCount, uint maxCost) public returns (uint);\n function sell(uint8 outcomeTokenIndex, uint outcomeTokenCount, uint minProfit) public returns (uint);\n function shortSell(uint8 outcomeTokenIndex, uint outcomeTokenCount, uint minProfit) public returns (uint);\n function trade(int[] memory outcomeTokenAmounts, int costLimit) public returns (int);\n function calcMarketFee(uint outcomeTokenCost) public view returns (uint);\n}\n", "sourcePath": "/home/alan/src/github.com/gnosis/pm-contracts/contracts/Markets/Market.sol", "ast": { "absolutePath": "/home/alan/src/github.com/gnosis/pm-contracts/contracts/Markets/Market.sol", "exportedSymbols": { "Market": [ 2296 ], "MarketData": [ 2230 ] }, "id": 2297, "nodeType": "SourceUnit", "nodes": [ { "id": 2150, "literals": [ "solidity", "^", "0.5", ".0" ], "nodeType": "PragmaDirective", "src": "0:23:8" }, { "absolutePath": "/home/alan/src/github.com/gnosis/pm-contracts/contracts/Events/Event.sol", "file": "../Events/Event.sol", "id": 2151, "nodeType": "ImportDirective", "scope": 2297, "sourceUnit": 393, "src": "24:29:8", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/home/alan/src/github.com/gnosis/pm-contracts/contracts/MarketMakers/MarketMaker.sol", "file": "../MarketMakers/MarketMaker.sol", "id": 2152, "nodeType": "ImportDirective", "scope": 2297, "sourceUnit": 1607, "src": "54:41:8", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "@gnosis.pm/util-contracts/contracts/Proxy.sol", "file": "@gnosis.pm/util-contracts/contracts/Proxy.sol", "id": 2153, "nodeType": "ImportDirective", "scope": 2297, "sourceUnit": 6829, "src": "96:55:8", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 2230, "linearizedBaseContracts": [ 2230 ], "name": "MarketData", "nodeType": "ContractDefinition", "nodes": [ { "anonymous": false, "documentation": null, "id": 2157, "name": "MarketFunding", "nodeType": "EventDefinition", "parameters": { "id": 2156, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2155, "indexed": false, "name": "funding", "nodeType": "VariableDeclaration", "scope": 2157, "src": "230:12:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2154, "name": "uint", "nodeType": "ElementaryTypeName", "src": "230:4:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "229:14:8" }, "src": "210:34:8" }, { "anonymous": false, "documentation": null, "id": 2159, "name": "MarketClosing", "nodeType": "EventDefinition", "parameters": { "id": 2158, "nodeType": "ParameterList", "parameters": [], "src": "268:2:8" }, "src": "249:22:8" }, { "anonymous": false, "documentation": null, "id": 2163, "name": "FeeWithdrawal", "nodeType": "EventDefinition", "parameters": { "id": 2162, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2161, "indexed": false, "name": "fees", "nodeType": "VariableDeclaration", "scope": 2163, "src": "296:9:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2160, "name": "uint", "nodeType": "ElementaryTypeName", "src": "296:4:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "295:11:8" }, "src": "276:31:8" }, { "anonymous": false, "documentation": null, "id": 2175, "name": "OutcomeTokenPurchase", "nodeType": "EventDefinition", "parameters": { "id": 2174, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2165, "indexed": true, "name": "buyer", "nodeType": "VariableDeclaration", "scope": 2175, "src": "339:21:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2164, "name": "address", "nodeType": "ElementaryTypeName", "src": "339:7:8", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2167, "indexed": false, "name": "outcomeTokenIndex", "nodeType": "VariableDeclaration", "scope": 2175, "src": "362:23:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "typeName": { "id": 2166, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "362:5:8", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2169, "indexed": false, "name": "outcomeTokenCount", "nodeType": "VariableDeclaration", "scope": 2175, "src": "387:22:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2168, "name": "uint", "nodeType": "ElementaryTypeName", "src": "387:4:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2171, "indexed": false, "name": "outcomeTokenCost", "nodeType": "VariableDeclaration", "scope": 2175, "src": "411:21:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2170, "name": "uint", "nodeType": "ElementaryTypeName", "src": "411:4:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2173, "indexed": false, "name": "marketFees", "nodeType": "VariableDeclaration", "scope": 2175, "src": "434:15:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2172, "name": "uint", "nodeType": "ElementaryTypeName", "src": "434:4:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "338:112:8" }, "src": "312:139:8" }, { "anonymous": false, "documentation": null, "id": 2187, "name": "OutcomeTokenSale", "nodeType": "EventDefinition", "parameters": { "id": 2186, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2177, "indexed": true, "name": "seller", "nodeType": "VariableDeclaration", "scope": 2187, "src": "479:22:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2176, "name": "address", "nodeType": "ElementaryTypeName", "src": "479:7:8", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2179, "indexed": false, "name": "outcomeTokenIndex", "nodeType": "VariableDeclaration", "scope": 2187, "src": "503:23:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "typeName": { "id": 2178, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "503:5:8", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2181, "indexed": false, "name": "outcomeTokenCount", "nodeType": "VariableDeclaration", "scope": 2187, "src": "528:22:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2180, "name": "uint", "nodeType": "ElementaryTypeName", "src": "528:4:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2183, "indexed": false, "name": "outcomeTokenProfit", "nodeType": "VariableDeclaration", "scope": 2187, "src": "552:23:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2182, "name": "uint", "nodeType": "ElementaryTypeName", "src": "552:4:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2185, "indexed": false, "name": "marketFees", "nodeType": "VariableDeclaration", "scope": 2187, "src": "577:15:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2184, "name": "uint", "nodeType": "ElementaryTypeName", "src": "577:4:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "478:115:8" }, "src": "456:138:8" }, { "anonymous": false, "documentation": null, "id": 2197, "name": "OutcomeTokenShortSale", "nodeType": "EventDefinition", "parameters": { "id": 2196, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2189, "indexed": true, "name": "buyer", "nodeType": "VariableDeclaration", "scope": 2197, "src": "627:21:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2188, "name": "address", "nodeType": "ElementaryTypeName", "src": "627:7:8", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2191, "indexed": false, "name": "outcomeTokenIndex", "nodeType": "VariableDeclaration", "scope": 2197, "src": "650:23:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "typeName": { "id": 2190, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "650:5:8", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2193, "indexed": false, "name": "outcomeTokenCount", "nodeType": "VariableDeclaration", "scope": 2197, "src": "675:22:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2192, "name": "uint", "nodeType": "ElementaryTypeName", "src": "675:4:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2195, "indexed": false, "name": "cost", "nodeType": "VariableDeclaration", "scope": 2197, "src": "699:9:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2194, "name": "uint", "nodeType": "ElementaryTypeName", "src": "699:4:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "626:83:8" }, "src": "599:111:8" }, { "anonymous": false, "documentation": null, "id": 2208, "name": "OutcomeTokenTrade", "nodeType": "EventDefinition", "parameters": { "id": 2207, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2199, "indexed": true, "name": "transactor", "nodeType": "VariableDeclaration", "scope": 2208, "src": "739:26:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2198, "name": "address", "nodeType": "ElementaryTypeName", "src": "739:7:8", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2202, "indexed": false, "name": "outcomeTokenAmounts", "nodeType": "VariableDeclaration", "scope": 2208, "src": "767:25:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr", "typeString": "int256[]" }, "typeName": { "baseType": { "id": 2200, "name": "int", "nodeType": "ElementaryTypeName", "src": "767:3:8", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "id": 2201, "length": null, "nodeType": "ArrayTypeName", "src": "767:5:8", "typeDescriptions": { "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr", "typeString": "int256[]" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2204, "indexed": false, "name": "outcomeTokenNetCost", "nodeType": "VariableDeclaration", "scope": 2208, "src": "794:23:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" }, "typeName": { "id": 2203, "name": "int", "nodeType": "ElementaryTypeName", "src": "794:3:8", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2206, "indexed": false, "name": "marketFees", "nodeType": "VariableDeclaration", "scope": 2208, "src": "819:15:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2205, "name": "uint", "nodeType": "ElementaryTypeName", "src": "819:4:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "738:97:8" }, "src": "715:121:8" }, { "constant": false, "id": 2210, "name": "creator", "nodeType": "VariableDeclaration", "scope": 2230, "src": "873:22:8", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2209, "name": "address", "nodeType": "ElementaryTypeName", "src": "873:7:8", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 2212, "name": "createdAtBlock", "nodeType": "VariableDeclaration", "scope": 2230, "src": "901:26:8", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2211, "name": "uint", "nodeType": "ElementaryTypeName", "src": "901:4:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 2214, "name": "eventContract", "nodeType": "VariableDeclaration", "scope": 2230, "src": "933:26:8", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_Event_$392", "typeString": "contract Event" }, "typeName": { "contractScope": null, "id": 2213, "name": "Event", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 392, "src": "933:5:8", "typeDescriptions": { "typeIdentifier": "t_contract$_Event_$392", "typeString": "contract Event" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 2216, "name": "marketMaker", "nodeType": "VariableDeclaration", "scope": 2230, "src": "965:30:8", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_MarketMaker_$1606", "typeString": "contract MarketMaker" }, "typeName": { "contractScope": null, "id": 2215, "name": "MarketMaker", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 1606, "src": "965:11:8", "typeDescriptions": { "typeIdentifier": "t_contract$_MarketMaker_$1606", "typeString": "contract MarketMaker" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 2218, "name": "fee", "nodeType": "VariableDeclaration", "scope": 2230, "src": "1001:17:8", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint24", "typeString": "uint24" }, "typeName": { "id": 2217, "name": "uint24", "nodeType": "ElementaryTypeName", "src": "1001:6:8", "typeDescriptions": { "typeIdentifier": "t_uint24", "typeString": "uint24" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 2220, "name": "funding", "nodeType": "VariableDeclaration", "scope": 2230, "src": "1024:19:8", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2219, "name": "uint", "nodeType": "ElementaryTypeName", "src": "1024:4:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 2223, "name": "netOutcomeTokensSold", "nodeType": "VariableDeclaration", "scope": 2230, "src": "1049:33:8", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_array$_t_int256_$dyn_storage", "typeString": "int256[]" }, "typeName": { "baseType": { "id": 2221,