{
  "contractName": "LMSRMarketMaker",
  "abi": [
    {
      "constant": true,
      "inputs": [
        {
          "name": "market",
          "type": "address"
        },
        {
          "name": "outcomeTokenAmounts",
          "type": "int256[]"
        }
      ],
      "name": "calcNetCost",
      "outputs": [
        {
          "name": "netCost",
          "type": "int256"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [
        {
          "name": "market",
          "type": "address"
        },
        {
          "name": "outcomeTokenIndex",
          "type": "uint8"
        },
        {
          "name": "outcomeTokenCount",
          "type": "uint256"
        }
      ],
      "name": "calcCost",
      "outputs": [
        {
          "name": "cost",
          "type": "uint256"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [
        {
          "name": "market",
          "type": "address"
        },
        {
          "name": "outcomeTokenIndex",
          "type": "uint8"
        },
        {
          "name": "outcomeTokenCount",
          "type": "uint256"
        }
      ],
      "name": "calcProfit",
      "outputs": [
        {
          "name": "profit",
          "type": "uint256"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [
        {
          "name": "market",
          "type": "address"
        },
        {
          "name": "outcomeTokenIndex",
          "type": "uint8"
        }
      ],
      "name": "calcMarginalPrice",
      "outputs": [
        {
          "name": "price",
          "type": "uint256"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    }
  ],
  "metadata": "{\"compiler\":{\"version\":\"0.5.6+commit.b259423e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[{\"name\":\"market\",\"type\":\"address\"},{\"name\":\"outcomeTokenAmounts\",\"type\":\"int256[]\"}],\"name\":\"calcNetCost\",\"outputs\":[{\"name\":\"netCost\",\"type\":\"int256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"market\",\"type\":\"address\"},{\"name\":\"outcomeTokenIndex\",\"type\":\"uint8\"},{\"name\":\"outcomeTokenCount\",\"type\":\"uint256\"}],\"name\":\"calcProfit\",\"outputs\":[{\"name\":\"profit\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"market\",\"type\":\"address\"},{\"name\":\"outcomeTokenIndex\",\"type\":\"uint8\"},{\"name\":\"outcomeTokenCount\",\"type\":\"uint256\"}],\"name\":\"calcCost\",\"outputs\":[{\"name\":\"cost\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"market\",\"type\":\"address\"},{\"name\":\"outcomeTokenIndex\",\"type\":\"uint8\"}],\"name\":\"calcMarginalPrice\",\"outputs\":[{\"name\":\"price\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Alan Lu - <alan.lu@gnosis.pm>\",\"methods\":{\"calcCost(address,uint8,uint256)\":{\"details\":\"Returns cost to buy given number of outcome tokens\",\"params\":{\"market\":\"Market contract\",\"outcomeTokenCount\":\"Number of outcome tokens to buy\",\"outcomeTokenIndex\":\"Index of outcome to buy\"},\"return\":\"Cost\"},\"calcMarginalPrice(address,uint8)\":{\"details\":\"Returns marginal price of an outcome\",\"params\":{\"market\":\"Market contract\",\"outcomeTokenIndex\":\"Index of outcome to determine marginal price of\"},\"return\":\"Marginal price of an outcome as a fixed point number\"},\"calcNetCost(address,int256[])\":{\"details\":\"Calculates the net cost for executing a given trade.\",\"params\":{\"market\":\"Market contract\",\"outcomeTokenAmounts\":\"Amounts of outcome tokens to buy from the market. If an amount is negative, represents an amount to sell to the market.\"},\"return\":\"Net cost of trade. If positive, represents amount of collateral which would be paid to the market for the trade. If negative, represents amount of collateral which would be received from the market for the trade.\"},\"calcProfit(address,uint8,uint256)\":{\"details\":\"Returns profit for selling given number of outcome tokens\",\"params\":{\"market\":\"Market contract\",\"outcomeTokenCount\":\"Number of outcome tokens to sell\",\"outcomeTokenIndex\":\"Index of outcome to sell\"},\"return\":\"Profit\"}},\"title\":\"LMSR market maker contract - Calculates share prices based on share distribution and initial funding\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/home/alan/src/github.com/gnosis/pm-contracts/contracts/MarketMakers/LMSRMarketMaker.sol\":\"LMSRMarketMaker\"},\"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/LMSRMarketMaker.sol\":{\"keccak256\":\"0xcf8c9b164ae8ce9d08348c8751a5a1465456af9a40954e4d97b73590b098f8a7\",\"urls\":[\"bzzr://11c580dfdb542c3514f30cecf9cdfbaafb716f95f3650257f2438e8063496958\"]},\"/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/Fixed192x64Math.sol\":{\"keccak256\":\"0xad15b641bf8f5862034749b679ab91cb2c330c2ca997da4455863dc169ab82d4\",\"urls\":[\"bzzr://a37b3d23f367b7f0ba4669c417af754260f0dbedad21294079aed622222427f5\"]},\"@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": "0x608060405234801561001057600080fd5b506117a6806100206000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806338bf0452146100515780634091c6a91461013d578063bd8ff817146101ac578063d812d3461461021b575b600080fd5b6101276004803603604081101561006757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156100a457600080fd5b8201836020820111156100b657600080fd5b803590602001918460208302840111640100000000831117156100d857600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610280565b6040518082815260200191505060405180910390f35b6101966004803603606081101561015357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190803590602001909291905050506105fa565b6040518082815260200191505060405180910390f35b610205600480360360608110156101c257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190803590602001909291905050506108f1565b6040518082815260200191505060405180910390f35b61026a6004803603604081101561023157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610c32565b6040518082815260200191505060405180910390f35b600060018373ffffffffffffffffffffffffffffffffffffffff1663e274fd246040518163ffffffff1660e01b815260040160206040518083038186803b1580156102ca57600080fd5b505afa1580156102de573d6000803e3d6000fd5b505050506040513d60208110156102f457600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff16637dc8f0866040518163ffffffff1660e01b815260040160206040518083038186803b15801561034a57600080fd5b505afa15801561035e573d6000803e3d6000fd5b505050506040513d602081101561037457600080fd5b810190808051906020019092919050505060ff161161039257600080fd5b606061039d84610ec6565b9050600073__Fixed192x64Math_______________________63137bf7986801000000000000000084510260016040518363ffffffff1660e01b8152600401808381526020018260028111156103ef57fe5b60ff1681526020019250505060206040518083038186803b15801561041357600080fd5b505af4158015610427573d6000803e3d6000fd5b505050506040513d602081101561043d57600080fd5b8101908080519060200190929190505050905060008573ffffffffffffffffffffffffffffffffffffffff1663cb4c86b76040518163ffffffff1660e01b815260040160206040518083038186803b15801561049857600080fd5b505afa1580156104ac573d6000803e3d6000fd5b505050506040513d60208110156104c257600080fd5b8101908080519060200190929190505050905060006104e483858460006110cc565b905085518451146104f457600080fd5b60008090505b84518160ff16101561056d57610545878260ff168151811061051857fe5b6020026020010151868360ff168151811061052f57fe5b60200260200101516111de90919063ffffffff16565b858260ff168151811061055457fe5b60200260200101818152505080806001019150506104fa565b50600061057d84868560016110cc565b9050610592828261126c90919063ffffffff16565b95506000861315806105b7575085680100000000000000008088816105b357fe5b0502145b156105d6576801000000000000000086816105ce57fe5b0595506105ef565b60016801000000000000000087816105ea57fe5b050195505b505050505092915050565b600060018473ffffffffffffffffffffffffffffffffffffffff1663e274fd246040518163ffffffff1660e01b815260040160206040518083038186803b15801561064457600080fd5b505afa158015610658573d6000803e3d6000fd5b505050506040513d602081101561066e57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff16637dc8f0866040518163ffffffff1660e01b815260040160206040518083038186803b1580156106c457600080fd5b505afa1580156106d8573d6000803e3d6000fd5b505050506040513d60208110156106ee57600080fd5b810190808051906020019092919050505060ff161161070c57600080fd5b606061071785610ec6565b9050600073__Fixed192x64Math_______________________63137bf7986801000000000000000084510260016040518363ffffffff1660e01b81526004018083815260200182600281111561076957fe5b60ff1681526020019250505060206040518083038186803b15801561078d57600080fd5b505af41580156107a1573d6000803e3d6000fd5b505050506040513d60208110156107b757600080fd5b8101908080519060200190929190505050905060008673ffffffffffffffffffffffffffffffffffffffff1663cb4c86b76040518163ffffffff1660e01b815260040160206040518083038186803b15801561081257600080fd5b505afa158015610826573d6000803e3d6000fd5b505050506040513d602081101561083c57600080fd5b81019080805190602001909291905050509050600061085e83858460006110cc565b9050600086121561086e57600080fd5b61089786858960ff168151811061088157fe5b602002602001015161126c90919063ffffffff16565b848860ff16815181106108a657fe5b60200260200101818152505060006108c184868560016110cc565b90508082136108ce578091505b68010000000000000000818303816108e257fe5b04955050505050509392505050565b600060018473ffffffffffffffffffffffffffffffffffffffff1663e274fd246040518163ffffffff1660e01b815260040160206040518083038186803b15801561093b57600080fd5b505afa15801561094f573d6000803e3d6000fd5b505050506040513d602081101561096557600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff16637dc8f0866040518163ffffffff1660e01b815260040160206040518083038186803b1580156109bb57600080fd5b505afa1580156109cf573d6000803e3d6000fd5b505050506040513d60208110156109e557600080fd5b810190808051906020019092919050505060ff1611610a0357600080fd5b6060610a0e85610ec6565b9050600073__Fixed192x64Math_______________________63137bf7986801000000000000000084510260016040518363ffffffff1660e01b815260040180838152602001826002811115610a6057fe5b60ff1681526020019250505060206040518083038186803b158015610a8457600080fd5b505af4158015610a98573d6000803e3d6000fd5b505050506040513d6020811015610aae57600080fd5b8101908080519060200190929190505050905060008673ffffffffffffffffffffffffffffffffffffffff1663cb4c86b76040518163ffffffff1660e01b815260040160206040518083038186803b158015610b0957600080fd5b505afa158015610b1d573d6000803e3d6000fd5b505050506040513d6020811015610b3357600080fd5b810190808051906020019092919050505090506000610b5583858460006110cc565b90506000861215610b6557600080fd5b610b8e86858960ff1681518110610b7857fe5b60200260200101516111de90919063ffffffff16565b848860ff1681518110610b9d57fe5b6020026020010181815250506000610bb884868560016110cc565b905081811215610bc6578190505b81810395508568010000000000000000808881610bdf57fe5b04021415610c0157680100000000000000008681610bf957fe5b049550610c1a565b6001680100000000000000008781610c1557fe5b040195505b86861115610c26578695505b50505050509392505050565b600060018373ffffffffffffffffffffffffffffffffffffffff1663e274fd246040518163ffffffff1660e01b815260040160206040518083038186803b158015610c7c57600080fd5b505afa158015610c90573d6000803e3d6000fd5b505050506040513d6020811015610ca657600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff16637dc8f0866040518163ffffffff1660e01b815260040160206040518083038186803b158015610cfc57600080fd5b505afa158015610d10573d6000803e3d6000fd5b505050506040513d6020811015610d2657600080fd5b810190808051906020019092919050505060ff1611610d4457600080fd5b6060610d4f84610ec6565b9050600073__Fixed192x64Math_______________________63137bf7986801000000000000000084510260026040518363ffffffff1660e01b815260040180838152602001826002811115610da157fe5b60ff1681526020019250505060206040518083038186803b158015610dc557600080fd5b505af4158015610dd9573d6000803e3d6000fd5b505050506040513d6020811015610def57600080fd5b8101908080519060200190929190505050905060008573ffffffffffffffffffffffffffffffffffffffff1663cb4c86b76040518163ffffffff1660e01b815260040160206040518083038186803b158015610e4a57600080fd5b505afa158015610e5e573d6000803e3d6000fd5b505050506040513d6020811015610e7457600080fd5b81019080805190602001909291905050509050600080610e988486858a60026112fa565b9250509150680100000000000000008281610eaf57fe5b048181610eb857fe5b049550505050505092915050565b60608173ffffffffffffffffffffffffffffffffffffffff1663e274fd246040518163ffffffff1660e01b815260040160206040518083038186803b158015610f0e57600080fd5b505afa158015610f22573d6000803e3d6000fd5b505050506040513d6020811015610f3857600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff16637dc8f0866040518163ffffffff1660e01b815260040160206040518083038186803b158015610f8e57600080fd5b505afa158015610fa2573d6000803e3d6000fd5b505050506040513d6020811015610fb857600080fd5b810190808051906020019092919050505060ff16604051908082528060200260200182016040528015610ffa5781602001602082028038833980820191505090505b50905060008090505b81518160ff1610156110c6578273ffffffffffffffffffffffffffffffffffffffff1663a157979c826040518263ffffffff1660e01b8152600401808260ff16815260200191505060206040518083038186803b15801561106357600080fd5b505afa158015611077573d6000803e3d6000fd5b505050506040513d602081101561108d57600080fd5b8101908080519060200190929190505050828260ff16815181106110ad57fe5b6020026020010181815250508080600101915050611003565b50919050565b60008060006110df8787876000886112fa565b509150915073__Fixed192x64Math_______________________63137bf79883866040518363ffffffff1660e01b81526004018083815260200182600281111561112557fe5b60ff1681526020019250505060206040518083038186803b15801561114957600080fd5b505af415801561115d573d6000803e3d6000fd5b505050506040513d602081101561117357600080fd5b8101908080519060200190929190505050925061119981846111de90919063ffffffff16565b92506111d285886111bc680100000000000000008761155c90919063ffffffff16565b816111c357fe5b0561155c90919063ffffffff16565b92505050949350505050565b6000808284019050600083121580156111f75750838112155b8061120d575060008312801561120c57508381125b5b611262576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061170f6021913960400191505060405180910390fd5b8091505092915050565b6000808284039050600083121580156112855750838113155b8061129b575060008312801561129a57508381135b5b6112f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806117576024913960400191505060405180910390fd5b8091505092915050565b6000806000808812158015611310575060008612155b61131957600080fd5b73__Fixed192x64Math_______________________63ccc13814886040518263ffffffff1660e01b81526004018080602001828103825283818151815260200191508051906020019060200280838360005b8381101561138657808201518184015260208101905061136b565b505050509050019250505060206040518083038186803b1580156113a957600080fd5b505af41580156113bd573d6000803e3d6000fd5b505050506040513d60208110156113d357600080fd5b81019080805190602001909291905050509150856113fa898461155c90919063ffffffff16565b8161140157fe5b05915061142068b800000000000000008361126c90919063ffffffff16565b9150600080600090505b88518160ff16101561154f5773__Fixed192x64Math_______________________631d580123611494868b61147e8f8f8860ff168151811061146857fe5b602002602001015161155c90919063ffffffff16565b8161148557fe5b0561126c90919063ffffffff16565b886040518363ffffffff1660e01b8152600401808381526020018260028111156114ba57fe5b60ff1681526020019250505060206040518083038186803b1580156114de57600080fd5b505af41580156114f2573d6000803e3d6000fd5b505050506040513d602081101561150857600080fd5b810190808051906020019092919050505091508660ff168160ff16141561152d578192505b611540828661168690919063ffffffff16565b9450808060010191505061142a565b5050955095509592505050565b60008083141561156f5760009050611680565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831480156115bd57507f800000000000000000000000000000000000000000000000000000000000000082145b15611613576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806117306027913960400191505060405180910390fd5b600082840290508284828161162457fe5b051461167b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806117306027913960400191505060405180910390fd5b809150505b92915050565b600080828401905083811015611704576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe5369676e6564536166654d6174683a206164646974696f6e206f766572666c6f775369676e6564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775369676e6564536166654d6174683a207375627472616374696f6e206f766572666c6f77a165627a7a723058202e3aace01203b4e2a833f95ca344b0c3ad857069549785196995710f6669eeea0029",
  "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806338bf0452146100515780634091c6a91461013d578063bd8ff817146101ac578063d812d3461461021b575b600080fd5b6101276004803603604081101561006757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156100a457600080fd5b8201836020820111156100b657600080fd5b803590602001918460208302840111640100000000831117156100d857600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610280565b6040518082815260200191505060405180910390f35b6101966004803603606081101561015357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190803590602001909291905050506105fa565b6040518082815260200191505060405180910390f35b610205600480360360608110156101c257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190803590602001909291905050506108f1565b6040518082815260200191505060405180910390f35b61026a6004803603604081101561023157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610c32565b6040518082815260200191505060405180910390f35b600060018373ffffffffffffffffffffffffffffffffffffffff1663e274fd246040518163ffffffff1660e01b815260040160206040518083038186803b1580156102ca57600080fd5b505afa1580156102de573d6000803e3d6000fd5b505050506040513d60208110156102f457600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff16637dc8f0866040518163ffffffff1660e01b815260040160206040518083038186803b15801561034a57600080fd5b505afa15801561035e573d6000803e3d6000fd5b505050506040513d602081101561037457600080fd5b810190808051906020019092919050505060ff161161039257600080fd5b606061039d84610ec6565b9050600073__Fixed192x64Math_______________________63137bf7986801000000000000000084510260016040518363ffffffff1660e01b8152600401808381526020018260028111156103ef57fe5b60ff1681526020019250505060206040518083038186803b15801561041357600080fd5b505af4158015610427573d6000803e3d6000fd5b505050506040513d602081101561043d57600080fd5b8101908080519060200190929190505050905060008573ffffffffffffffffffffffffffffffffffffffff1663cb4c86b76040518163ffffffff1660e01b815260040160206040518083038186803b15801561049857600080fd5b505afa1580156104ac573d6000803e3d6000fd5b505050506040513d60208110156104c257600080fd5b8101908080519060200190929190505050905060006104e483858460006110cc565b905085518451146104f457600080fd5b60008090505b84518160ff16101561056d57610545878260ff168151811061051857fe5b6020026020010151868360ff168151811061052f57fe5b60200260200101516111de90919063ffffffff16565b858260ff168151811061055457fe5b60200260200101818152505080806001019150506104fa565b50600061057d84868560016110cc565b9050610592828261126c90919063ffffffff16565b95506000861315806105b7575085680100000000000000008088816105b357fe5b0502145b156105d6576801000000000000000086816105ce57fe5b0595506105ef565b60016801000000000000000087816105ea57fe5b050195505b505050505092915050565b600060018473ffffffffffffffffffffffffffffffffffffffff1663e274fd246040518163ffffffff1660e01b815260040160206040518083038186803b15801561064457600080fd5b505afa158015610658573d6000803e3d6000fd5b505050506040513d602081101561066e57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff16637dc8f0866040518163ffffffff1660e01b815260040160206040518083038186803b1580156106c457600080fd5b505afa1580156106d8573d6000803e3d6000fd5b505050506040513d60208110156106ee57600080fd5b810190808051906020019092919050505060ff161161070c57600080fd5b606061071785610ec6565b9050600073__Fixed192x64Math_______________________63137bf7986801000000000000000084510260016040518363ffffffff1660e01b81526004018083815260200182600281111561076957fe5b60ff1681526020019250505060206040518083038186803b15801561078d57600080fd5b505af41580156107a1573d6000803e3d6000fd5b505050506040513d60208110156107b757600080fd5b8101908080519060200190929190505050905060008673ffffffffffffffffffffffffffffffffffffffff1663cb4c86b76040518163ffffffff1660e01b815260040160206040518083038186803b15801561081257600080fd5b505afa158015610826573d6000803e3d6000fd5b505050506040513d602081101561083c57600080fd5b81019080805190602001909291905050509050600061085e83858460006110cc565b9050600086121561086e57600080fd5b61089786858960ff168151811061088157fe5b602002602001015161126c90919063ffffffff16565b848860ff16815181106108a657fe5b60200260200101818152505060006108c184868560016110cc565b90508082136108ce578091505b68010000000000000000818303816108e257fe5b04955050505050509392505050565b600060018473ffffffffffffffffffffffffffffffffffffffff1663e274fd246040518163ffffffff1660e01b815260040160206040518083038186803b15801561093b57600080fd5b505afa15801561094f573d6000803e3d6000fd5b505050506040513d602081101561096557600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff16637dc8f0866040518163ffffffff1660e01b815260040160206040518083038186803b1580156109bb57600080fd5b505afa1580156109cf573d6000803e3d6000fd5b505050506040513d60208110156109e557600080fd5b810190808051906020019092919050505060ff1611610a0357600080fd5b6060610a0e85610ec6565b9050600073__Fixed192x64Math_______________________63137bf7986801000000000000000084510260016040518363ffffffff1660e01b815260040180838152602001826002811115610a6057fe5b60ff1681526020019250505060206040518083038186803b158015610a8457600080fd5b505af4158015610a98573d6000803e3d6000fd5b505050506040513d6020811015610aae57600080fd5b8101908080519060200190929190505050905060008673ffffffffffffffffffffffffffffffffffffffff1663cb4c86b76040518163ffffffff1660e01b815260040160206040518083038186803b158015610b0957600080fd5b505afa158015610b1d573d6000803e3d6000fd5b505050506040513d6020811015610b3357600080fd5b810190808051906020019092919050505090506000610b5583858460006110cc565b90506000861215610b6557600080fd5b610b8e86858960ff1681518110610b7857fe5b60200260200101516111de90919063ffffffff16565b848860ff1681518110610b9d57fe5b6020026020010181815250506000610bb884868560016110cc565b905081811215610bc6578190505b81810395508568010000000000000000808881610bdf57fe5b04021415610c0157680100000000000000008681610bf957fe5b049550610c1a565b6001680100000000000000008781610c1557fe5b040195505b86861115610c26578695505b50505050509392505050565b600060018373ffffffffffffffffffffffffffffffffffffffff1663e274fd246040518163ffffffff1660e01b815260040160206040518083038186803b158015610c7c57600080fd5b505afa158015610c90573d6000803e3d6000fd5b505050506040513d6020811015610ca657600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff16637dc8f0866040518163ffffffff1660e01b815260040160206040518083038186803b158015610cfc57600080fd5b505afa158015610d10573d6000803e3d6000fd5b505050506040513d6020811015610d2657600080fd5b810190808051906020019092919050505060ff1611610d4457600080fd5b6060610d4f84610ec6565b9050600073__Fixed192x64Math_______________________63137bf7986801000000000000000084510260026040518363ffffffff1660e01b815260040180838152602001826002811115610da157fe5b60ff1681526020019250505060206040518083038186803b158015610dc557600080fd5b505af4158015610dd9573d6000803e3d6000fd5b505050506040513d6020811015610def57600080fd5b8101908080519060200190929190505050905060008573ffffffffffffffffffffffffffffffffffffffff1663cb4c86b76040518163ffffffff1660e01b815260040160206040518083038186803b158015610e4a57600080fd5b505afa158015610e5e573d6000803e3d6000fd5b505050506040513d6020811015610e7457600080fd5b81019080805190602001909291905050509050600080610e988486858a60026112fa565b9250509150680100000000000000008281610eaf57fe5b048181610eb857fe5b049550505050505092915050565b60608173ffffffffffffffffffffffffffffffffffffffff1663e274fd246040518163ffffffff1660e01b815260040160206040518083038186803b158015610f0e57600080fd5b505afa158015610f22573d6000803e3d6000fd5b505050506040513d6020811015610f3857600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff16637dc8f0866040518163ffffffff1660e01b815260040160206040518083038186803b158015610f8e57600080fd5b505afa158015610fa2573d6000803e3d6000fd5b505050506040513d6020811015610fb857600080fd5b810190808051906020019092919050505060ff16604051908082528060200260200182016040528015610ffa5781602001602082028038833980820191505090505b50905060008090505b81518160ff1610156110c6578273ffffffffffffffffffffffffffffffffffffffff1663a157979c826040518263ffffffff1660e01b8152600401808260ff16815260200191505060206040518083038186803b15801561106357600080fd5b505afa158015611077573d6000803e3d6000fd5b505050506040513d602081101561108d57600080fd5b8101908080519060200190929190505050828260ff16815181106110ad57fe5b6020026020010181815250508080600101915050611003565b50919050565b60008060006110df8787876000886112fa565b509150915073__Fixed192x64Math_______________________63137bf79883866040518363ffffffff1660e01b81526004018083815260200182600281111561112557fe5b60ff1681526020019250505060206040518083038186803b15801561114957600080fd5b505af415801561115d573d6000803e3d6000fd5b505050506040513d602081101561117357600080fd5b8101908080519060200190929190505050925061119981846111de90919063ffffffff16565b92506111d285886111bc680100000000000000008761155c90919063ffffffff16565b816111c357fe5b0561155c90919063ffffffff16565b92505050949350505050565b6000808284019050600083121580156111f75750838112155b8061120d575060008312801561120c57508381125b5b611262576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061170f6021913960400191505060405180910390fd5b8091505092915050565b6000808284039050600083121580156112855750838113155b8061129b575060008312801561129a57508381135b5b6112f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806117576024913960400191505060405180910390fd5b8091505092915050565b6000806000808812158015611310575060008612155b61131957600080fd5b73__Fixed192x64Math_______________________63ccc13814886040518263ffffffff1660e01b81526004018080602001828103825283818151815260200191508051906020019060200280838360005b8381101561138657808201518184015260208101905061136b565b505050509050019250505060206040518083038186803b1580156113a957600080fd5b505af41580156113bd573d6000803e3d6000fd5b505050506040513d60208110156113d357600080fd5b81019080805190602001909291905050509150856113fa898461155c90919063ffffffff16565b8161140157fe5b05915061142068b800000000000000008361126c90919063ffffffff16565b9150600080600090505b88518160ff16101561154f5773__Fixed192x64Math_______________________631d580123611494868b61147e8f8f8860ff168151811061146857fe5b602002602001015161155c90919063ffffffff16565b8161148557fe5b0561126c90919063ffffffff16565b886040518363ffffffff1660e01b8152600401808381526020018260028111156114ba57fe5b60ff1681526020019250505060206040518083038186803b1580156114de57600080fd5b505af41580156114f2573d6000803e3d6000fd5b505050506040513d602081101561150857600080fd5b810190808051906020019092919050505091508660ff168160ff16141561152d578192505b611540828661168690919063ffffffff16565b9450808060010191505061142a565b5050955095509592505050565b60008083141561156f5760009050611680565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831480156115bd57507f800000000000000000000000000000000000000000000000000000000000000082145b15611613576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806117306027913960400191505060405180910390fd5b600082840290508284828161162457fe5b051461167b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806117306027913960400191505060405180910390fd5b809150505b92915050565b600080828401905083811015611704576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe5369676e6564536166654d6174683a206164646974696f6e206f766572666c6f775369676e6564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775369676e6564536166654d6174683a207375627472616374696f6e206f766572666c6f77a165627a7a723058202e3aace01203b4e2a833f95ca344b0c3ad857069549785196995710f6669eeea0029",
  "sourceMap": "416:10946:4:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;416:10946:4;;;;;;;",
  "deployedSourceMap": "416:10946:4:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;416:10946:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1186:1574;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1186:1574:4;;;;;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;1186:1574:4;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;1186:1574:4;;;;;;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;1186:1574:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;1186:1574:4;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;4897:1310;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;4897:1310:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;3011:1624;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3011:1624:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;6451:859;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;6451:859:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1186:1574;1301:11;1379:1;1336:6;:20;;;:22;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1336:22:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1336:22:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1336:22:4;;;;;;;;;;;;;;;;:38;;;:40;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1336:40:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1336:40:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1336:40:4;;;;;;;;;;;;;;;;:44;;;1328:53;;;;;;1391:33;1427:31;1451:6;1427:23;:31::i;:::-;1391:67;;1537:9;1549:15;:25;579:19;1575:20;:27;:33;1610:41;1549:103;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1549:103:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1549:103:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1549:103:4;;;;;;;;;;;;;;;;1537:115;;1662:12;1677:6;:14;;;:16;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1677:16:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1677:16:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1677:16:4;;;;;;;;;;;;;;;;1662:31;;1703:19;1725:94;1739:5;1746:20;1768:7;1777:41;1725:13;:94::i;:::-;1703:116;;1934:19;:26;1903:20;:27;:57;1895:66;;;;;;1976:7;1986:1;1976:11;;1971:158;1993:20;:27;1989:1;:31;;;1971:158;;;2067:51;2095:19;2115:1;2095:22;;;;;;;;;;;;;;;;2067:20;2088:1;2067:23;;;;;;;;;;;;;;;;:27;;:51;;;;:::i;:::-;2041:20;2062:1;2041:23;;;;;;;;;;;;;;;:77;;;;;2022:3;;;;;;;1971:158;;;;2197:18;2218:94;2232:5;2239:20;2261:7;2270:41;2218:13;:94::i;:::-;2197:115;;2405:35;2424:15;2405:14;:18;;:35;;;;:::i;:::-;2395:45;;2600:1;2589:7;:12;;:56;;;;2638:7;579:19;;2605:7;:18;;;;;;:29;:40;2589:56;2586:168;;;579:19;2661;;;;;;;;;2586:168;;;2742:1;579:19;2721:7;:18;;;;;;:22;2711:32;;2586:168;1186:1574;;;;;;;;;:::o;4897:1310::-;5026:11;5104:1;5061:6;:20;;;:22;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5061:22:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5061:22:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;5061:22:4;;;;;;;;;;;;;;;;:38;;;:40;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5061:40:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5061:40:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;5061:40:4;;;;;;;;;;;;;;;;:44;;;5053:53;;;;;;5116:33;5152:31;5176:6;5152:23;:31::i;:::-;5116:67;;5261:9;5273:15;:25;579:19;5299:20;:27;:33;5334:41;5273:103;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5273:103:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5273:103:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;5273:103:4;;;;;;;;;;;;;;;;5261:115;;5386:12;5401:6;:14;;;:16;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5401:16:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5401:16:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;5401:16:4;;;;;;;;;;;;;;;;5386:31;;5427:19;5449:94;5463:5;5470:20;5492:7;5501:41;5449:13;:94::i;:::-;5427:116;;5662:1;5640:17;5636:27;;5628:36;;;;;;5716:67;5764:17;5716:20;5737:17;5716:39;;;;;;;;;;;;;;;;:43;;:67;;;;:::i;:::-;5674:20;5695:17;5674:39;;;;;;;;;;;;;;;:109;;;;;5851:18;5872:94;5886:5;5893:20;5915:7;5924:41;5872:13;:94::i;:::-;5851:115;;6051:14;6032:15;:33;6029:82;;6097:14;6079:32;;6029:82;579:19;6179:14;6161:15;:32;6156:44;;;;;;6147:53;;4897:1310;;;;;;;;;;:::o;3011:1624::-;3138:9;3214:1;3171:6;:20;;;:22;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3171:22:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3171:22:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3171:22:4;;;;;;;;;;;;;;;;:38;;;:40;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3171:40:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3171:40:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3171:40:4;;;;;;;;;;;;;;;;:44;;;3163:53;;;;;;3226:33;3262:31;3286:6;3262:23;:31::i;:::-;3226:67;;3371:9;3383:15;:25;579:19;3409:20;:27;:33;3444:41;3383:103;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3383:103:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3383:103:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3383:103:4;;;;;;;;;;;;;;;;3371:115;;3496:12;3511:6;:14;;;:16;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3511:16:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3511:16:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3511:16:4;;;;;;;;;;;;;;;;3496:31;;3537:19;3559:94;3573:5;3580:20;3602:7;3611:41;3559:13;:94::i;:::-;3537:116;;3761:1;3739:17;3735:27;;3727:36;;;;;;3815:67;3863:17;3815:20;3836:17;3815:39;;;;;;;;;;;;;;;;:43;;:67;;;;:::i;:::-;3773:20;3794:17;3773:39;;;;;;;;;;;;;;;:109;;;;;3950:18;3971:94;3985:5;3992:20;4014:7;4023:41;3971:13;:94::i;:::-;3950:115;;4146:15;4129:14;:32;4126:81;;;4192:15;4175:32;;4126:81;4246:15;4229:14;:32;4217:45;;4348:4;579:19;;4328:4;:10;;;;;;:16;:24;4324:171;;;579:19;4366:11;;;;;;;;;4324:171;;;4494:1;579:19;4481:4;:10;;;;;;:14;4474:21;;4324:171;4573:17;4566:4;:24;4562:66;;;4611:17;4604:24;;4562:66;3011:1624;;;;;;;;;;:::o;6451:859::-;6563:10;6640:1;6597:6;:20;;;:22;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;6597:22:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;6597:22:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;6597:22:4;;;;;;;;;;;;;;;;:38;;;:40;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;6597:40:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;6597:40:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;6597:40:4;;;;;;;;;;;;;;;;:44;;;6589:53;;;;;;6652:33;6688:31;6712:6;6688:23;:31::i;:::-;6652:67;;6729:8;6740:15;:25;579:19;6766:20;:27;:33;6801:39;6740:101;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;6740:101:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;6740:101:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;6740:101:4;;;;;;;;;;;;;;;;6729:112;;6851:12;6866:6;:14;;;:16;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;6866:16:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;6866:16:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;6866:16:4;;;;;;;;;;;;;;;;6851:31;;7114:8;7126:19;7149:109;7162:4;7168:20;7190:7;7199:17;7218:39;7149:12;:109::i;:::-;7113:145;;;;;579:19;7293:3;:9;;;;;;7275:14;:28;;;;;;7268:35;;;;;;;6451:859;;;;:::o;11042:318::-;11136:23;11198:6;:20;;;:22;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;11198:22:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;11198:22:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;11198:22:4;;;;;;;;;;;;;;;;:38;;;:40;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;11198:40:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;11198:40:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;11198:40:4;;;;;;;;;;;;;;;;11188:51;;;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;148:4;140:6;136:17;126:27;;0:157;11188:51:4;;;;11175:64;;11254:7;11264:1;11254:11;;11249:104;11271:10;:17;11267:1;:21;;;11249:104;;;11323:6;:27;;;11351:1;11323:30;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;11323:30:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;11323:30:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;11323:30:4;;;;;;;;;;;;;;;;11307:10;11318:1;11307:13;;;;;;;;;;;;;;;:46;;;;;11290:3;;;;;;;11249:104;;;;11042:318;;;:::o;7687:717::-;7861:13;8120:8;8130:10;8146:68;8159:4;8165:20;8187:7;8196:1;8199:14;8146:12;:68::i;:::-;8119:95;;;;;8236:15;:25;8262:3;8267:14;8236:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;8236:46:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;8236:46:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;8236:46:4;;;;;;;;;;;;;;;;8224:58;;8304:21;8318:6;8304:9;:13;;:21;;;;:::i;:::-;8292:33;;8347:50;8388:7;8374:4;8348:23;579:19;8348:9;:13;;:23;;;;:::i;:::-;:30;;;;;;8347:36;;:50;;;;:::i;:::-;8335:62;;7687:717;;;;;;;;:::o;1614:210:31:-;1670:6;1688:8;1703:1;1699;:5;1688:16;;1728:1;1723;:6;;:16;;;;;1738:1;1733;:6;;1723:16;1722:38;;;;1749:1;1745;:5;:14;;;;;1758:1;1754;:5;1745:14;1722:38;1714:84;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1816:1;1809:8;;;1614:210;;;;:::o;1320:213::-;1376:6;1394:8;1409:1;1405;:5;1394:16;;1434:1;1429;:6;;:16;;;;;1444:1;1439;:6;;1429:16;1428:38;;;;1455:1;1451;:5;:14;;;;;1464:1;1460;:5;1451:14;1428:38;1420:87;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1525:1;1518:8;;;1320:213;;;;:::o;8950:1612:4:-;9144:8;9154:10;9166:19;10059:1;10051:4;:9;;:30;;;;;10080:1;10068:7;10064:17;;10051:30;10043:39;;;;;;10101:15;:19;10121:20;10101:41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;10101:41:4;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;10101:41:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;10101:41:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;10101:41:4;;;;;;;;;;;;;;;;10092:50;;10184:7;10161:16;10172:4;10161:6;:10;;:16;;;;:::i;:::-;:31;;;;;;10152:40;;10211:21;629:22;10211:6;:10;;:21;;;;:::i;:::-;10202:30;;10242:9;10266:7;10276:1;10266:11;;10261:295;10283:20;:27;10279:1;:31;;;10261:295;;;10338:15;:20;10359:62;10414:6;10400:7;10360:33;10388:4;10360:20;10381:1;10360:23;;;;;;;;;;;;;;;;:27;;:33;;;;:::i;:::-;:48;;;;;;10359:54;;:62;;;;:::i;:::-;10423:14;10338:100;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;10338:100:4;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;10338:100:4;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;10338:100:4;;;;;;;;;;;;;;;;10331:107;;10461:12;10456:17;;:1;:17;;;10452:60;;;10508:4;10491:21;;10452:60;10532:13;10540:4;10532:3;:7;;:13;;;;:::i;:::-;10526:19;;10312:3;;;;;;;10261:295;;;;8950:1612;;;;;;;;;;:::o;291:552:31:-;347:6;591:1;586;:6;582:45;;;615:1;608:8;;;;582:45;652:2;647:1;:7;:26;;;;;196:7;658:1;:15;647:26;645:29;637:81;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;729:8;744:1;740;:5;729:16;;772:1;767;763;:5;;;;;;:10;755:62;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;835:1;828:8;;;291:552;;;;;:::o;834:176:32:-;892:7;911:9;927:1;923;:5;911:17;;951:1;946;:6;;938:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1002:1;995:8;;;834:176;;;;:::o",
  "source": "pragma solidity ^0.5.0;\nimport \"openzeppelin-solidity/contracts/math/SafeMath.sol\";\nimport \"openzeppelin-solidity/contracts/drafts/SignedSafeMath.sol\";\nimport \"@gnosis.pm/util-contracts/contracts/Fixed192x64Math.sol\";\nimport \"../MarketMakers/MarketMaker.sol\";\n\n\n/// @title LMSR market maker contract - Calculates share prices based on share distribution and initial funding\n/// @author Alan Lu - <alan.lu@gnosis.pm>\ncontract LMSRMarketMaker is MarketMaker {\n    using SignedSafeMath for int;\n    using SafeMath for uint;\n\n    /*\n     *  Constants\n     */\n    uint constant ONE = 0x10000000000000000;\n    int constant EXP_LIMIT = 3394200909562557497344;\n\n    /*\n     *  Public functions\n     */\n    /// @dev Calculates the net cost for executing a given trade.\n    /// @param market Market contract\n    /// @param outcomeTokenAmounts Amounts of outcome tokens to buy from the market. If an amount is negative, represents an amount to sell to the market.\n    /// @return Net cost of trade. If positive, represents amount of collateral which would be paid to the market for the trade. If negative, represents amount of collateral which would be received from the market for the trade.\n    function calcNetCost(Market market, int[] memory outcomeTokenAmounts)\n        public\n        view\n        returns (int netCost)\n    {\n        require(market.eventContract().getOutcomeCount() > 1);\n        int[] memory netOutcomeTokensSold = getNetOutcomeTokensSold(market);\n\n        // Calculate cost level based on net outcome token balances\n        int log2N = Fixed192x64Math.binaryLog(netOutcomeTokensSold.length * ONE, Fixed192x64Math.EstimationMode.UpperBound);\n        uint funding = market.funding();\n        int costLevelBefore = calcCostLevel(log2N, netOutcomeTokensSold, funding, Fixed192x64Math.EstimationMode.LowerBound);\n\n        // Change amounts based on outcomeTokenAmounts passed in\n        require(netOutcomeTokensSold.length == outcomeTokenAmounts.length);\n        for (uint8 i = 0; i < netOutcomeTokensSold.length; i++) {\n            netOutcomeTokensSold[i] = netOutcomeTokensSold[i].add(outcomeTokenAmounts[i]);\n        }\n\n        // Calculate cost level after balance was updated\n        int costLevelAfter = calcCostLevel(log2N, netOutcomeTokensSold, funding, Fixed192x64Math.EstimationMode.UpperBound);\n\n        // Calculate net cost as cost level difference and use the ceil\n        netCost = costLevelAfter.sub(costLevelBefore);\n        // Integer division for negative numbers already uses ceiling,\n        // so only check boundary condition for positive numbers\n        if(netCost <= 0 || netCost / int(ONE) * int(ONE) == netCost) {\n            netCost /= int(ONE);\n        } else {\n            netCost = netCost / int(ONE) + 1;\n        }\n    }\n\n    /// @dev Returns cost to buy given number of outcome tokens\n    /// @param market Market contract\n    /// @param outcomeTokenIndex Index of outcome to buy\n    /// @param outcomeTokenCount Number of outcome tokens to buy\n    /// @return Cost\n    function calcCost(Market market, uint8 outcomeTokenIndex, uint outcomeTokenCount)\n        public\n        view\n        returns (uint cost)\n    {\n        require(market.eventContract().getOutcomeCount() > 1);\n        int[] memory netOutcomeTokensSold = getNetOutcomeTokensSold(market);\n        // Calculate cost level based on net outcome token balances\n        int log2N = Fixed192x64Math.binaryLog(netOutcomeTokensSold.length * ONE, Fixed192x64Math.EstimationMode.UpperBound);\n        uint funding = market.funding();\n        int costLevelBefore = calcCostLevel(log2N, netOutcomeTokensSold, funding, Fixed192x64Math.EstimationMode.LowerBound);\n        // Add outcome token count to net outcome token balance\n        require(int(outcomeTokenCount) >= 0);\n        netOutcomeTokensSold[outcomeTokenIndex] = netOutcomeTokensSold[outcomeTokenIndex].add(int(outcomeTokenCount));\n        // Calculate cost level after balance was updated\n        int costLevelAfter = calcCostLevel(log2N, netOutcomeTokensSold, funding, Fixed192x64Math.EstimationMode.UpperBound);\n        // Calculate cost as cost level difference\n        if(costLevelAfter < costLevelBefore)\n            costLevelAfter = costLevelBefore;\n        cost = uint(costLevelAfter - costLevelBefore);\n        // Take the ceiling to account for rounding\n        if (cost / ONE * ONE == cost)\n            cost /= ONE;\n        else\n            // Integer division by ONE ensures there is room to (+ 1)\n            cost = cost / ONE + 1;\n        // Make sure cost is not bigger than 1 per share\n        if (cost > outcomeTokenCount)\n            cost = outcomeTokenCount;\n    }\n\n    /// @dev Returns profit for selling given number of outcome tokens\n    /// @param market Market contract\n    /// @param outcomeTokenIndex Index of outcome to sell\n    /// @param outcomeTokenCount Number of outcome tokens to sell\n    /// @return Profit\n    function calcProfit(Market market, uint8 outcomeTokenIndex, uint outcomeTokenCount)\n        public\n        view\n        returns (uint profit)\n    {\n        require(market.eventContract().getOutcomeCount() > 1);\n        int[] memory netOutcomeTokensSold = getNetOutcomeTokensSold(market);\n        // Calculate cost level based on net outcome token balances\n        int log2N = Fixed192x64Math.binaryLog(netOutcomeTokensSold.length * ONE, Fixed192x64Math.EstimationMode.UpperBound);\n        uint funding = market.funding();\n        int costLevelBefore = calcCostLevel(log2N, netOutcomeTokensSold, funding, Fixed192x64Math.EstimationMode.LowerBound);\n        // Subtract outcome token count from the net outcome token balance\n        require(int(outcomeTokenCount) >= 0);\n        netOutcomeTokensSold[outcomeTokenIndex] = netOutcomeTokensSold[outcomeTokenIndex].sub(int(outcomeTokenCount));\n        // Calculate cost level after balance was updated\n        int costLevelAfter = calcCostLevel(log2N, netOutcomeTokensSold, funding, Fixed192x64Math.EstimationMode.UpperBound);\n        // Calculate profit as cost level difference\n        if(costLevelBefore <= costLevelAfter)\n            costLevelBefore = costLevelAfter;\n        // Take the floor\n        profit = uint(costLevelBefore - costLevelAfter) / ONE;\n    }\n\n    /// @dev Returns marginal price of an outcome\n    /// @param market Market contract\n    /// @param outcomeTokenIndex Index of outcome to determine marginal price of\n    /// @return Marginal price of an outcome as a fixed point number\n    function calcMarginalPrice(Market market, uint8 outcomeTokenIndex)\n        public\n        view\n        returns (uint price)\n    {\n        require(market.eventContract().getOutcomeCount() > 1);\n        int[] memory netOutcomeTokensSold = getNetOutcomeTokensSold(market);\n        int logN = Fixed192x64Math.binaryLog(netOutcomeTokensSold.length * ONE, Fixed192x64Math.EstimationMode.Midpoint);\n        uint funding = market.funding();\n        // The price function is exp(quantities[i]/b) / sum(exp(q/b) for q in quantities)\n        // To avoid overflow, calculate with\n        // exp(quantities[i]/b - offset) / sum(exp(q/b - offset) for q in quantities)\n        (uint sum, , uint outcomeExpTerm) = sumExpOffset(logN, netOutcomeTokensSold, funding, outcomeTokenIndex, Fixed192x64Math.EstimationMode.Midpoint);\n        return outcomeExpTerm / (sum / ONE);\n    }\n\n    /*\n     *  Private functions\n     */\n    /// @dev Calculates the result of the LMSR cost function which is used to\n    ///      derive prices from the market state\n    /// @param logN Logarithm of the number of outcomes\n    /// @param netOutcomeTokensSold Net outcome tokens sold by market\n    /// @param funding Initial funding for market\n    /// @return Cost level\n    function calcCostLevel(int logN, int[] memory netOutcomeTokensSold, uint funding, Fixed192x64Math.EstimationMode estimationMode)\n        private\n        pure\n        returns(int costLevel)\n    {\n        // The cost function is C = b * log(sum(exp(q/b) for q in quantities)).\n        // To avoid overflow, we need to calc with an exponent offset:\n        // C = b * (offset + log(sum(exp(q/b - offset) for q in quantities)))\n        (uint sum, int offset, ) = sumExpOffset(logN, netOutcomeTokensSold, funding, 0, estimationMode);\n        costLevel = Fixed192x64Math.binaryLog(sum, estimationMode);\n        costLevel = costLevel.add(offset);\n        costLevel = (costLevel.mul(int(ONE)) / logN).mul(int(funding));\n    }\n\n    /// @dev Calculates sum(exp(q/b - offset) for q in quantities), where offset is set\n    ///      so that the sum fits in 248-256 bits\n    /// @param logN Logarithm of the number of outcomes\n    /// @param netOutcomeTokensSold Net outcome tokens sold by market\n    /// @param funding Initial funding for market\n    /// @param outcomeIndex Index of exponential term to extract (for use by marginal price function)\n    /// @return A result structure composed of the sum, the offset used, and the summand associated with the supplied index\n    function sumExpOffset(int logN, int[] memory netOutcomeTokensSold, uint funding, uint8 outcomeIndex, Fixed192x64Math.EstimationMode estimationMode)\n        private\n        pure\n        returns (uint sum, int offset, uint outcomeExpTerm)\n    {\n        // Naive calculation of this causes an overflow\n        // since anything above a bit over 133*ONE supplied to exp will explode\n        // as exp(133) just about fits into 192 bits of whole number data.\n\n        // The choice of this offset is subject to another limit:\n        // computing the inner sum successfully.\n        // Since the index is 8 bits, there has to be 8 bits of headroom for\n        // each summand, meaning q/b - offset <= exponential_limit,\n        // where that limit can be found with `mp.floor(mp.log((2**248 - 1) / ONE) * ONE)`\n        // That is what EXP_LIMIT is set to: it is about 127.5\n\n        // finally, if the distribution looks like [BIG, tiny, tiny...], using a\n        // BIG offset will cause the tiny quantities to go really negative\n        // causing the associated exponentials to vanish.\n\n        require(logN >= 0 && int(funding) >= 0);\n        offset = Fixed192x64Math.max(netOutcomeTokensSold);\n        offset = offset.mul(logN) / int(funding);\n        offset = offset.sub(EXP_LIMIT);\n        uint term;\n        for (uint8 i = 0; i < netOutcomeTokensSold.length; i++) {\n            term = Fixed192x64Math.pow2((netOutcomeTokensSold[i].mul(logN) / int(funding)).sub(offset), estimationMode);\n            if (i == outcomeIndex)\n                outcomeExpTerm = term;\n            sum = sum.add(term);\n        }\n    }\n\n    /// @dev Gets net outcome tokens sold by market. Since all sets of outcome tokens are backed by\n    ///      corresponding collateral tokens, the net quantity of a token sold by the market is the\n    ///      number of collateral tokens (which is the same as the number of outcome tokens the\n    ///      market created) subtracted by the quantity of that token held by the market.\n    /// @param market Market contract\n    /// @return Net outcome tokens sold by market\n    function getNetOutcomeTokensSold(Market market)\n        private\n        view\n        returns (int[] memory quantities)\n    {\n        quantities = new int[](market.eventContract().getOutcomeCount());\n        for (uint8 i = 0; i < quantities.length; i++)\n            quantities[i] = market.netOutcomeTokensSold(i);\n    }\n}",
  "sourcePath": "/home/alan/src/github.com/gnosis/pm-contracts/contracts/MarketMakers/LMSRMarketMaker.sol",
  "ast": {
    "absolutePath": "/home/alan/src/github.com/gnosis/pm-contracts/contracts/MarketMakers/LMSRMarketMaker.sol",
    "exportedSymbols": {
      "LMSRMarketMaker": [
        1561
      ]
    },
    "id": 1562,
    "nodeType": "SourceUnit",
    "nodes": [
      {
        "id": 872,
        "literals": [
          "solidity",
          "^",
          "0.5",
          ".0"
        ],
        "nodeType": "PragmaDirective",
        "src": "0:23:4"
      },
      {
        "absolutePath": "openzeppelin-solidity/contracts/math/SafeMath.sol",
        "file": "openzeppelin-solidity/contracts/math/SafeMath.sol",
        "id": 873,
        "nodeType": "ImportDirective",
        "scope": 1562,
        "sourceUnit": 7382,
        "src": "24:59:4",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "absolutePath": "openzeppelin-solidity/contracts/drafts/SignedSafeMath.sol",
        "file": "openzeppelin-solidity/contracts/drafts/SignedSafeMath.sol",
        "id": 874,
        "nodeType": "ImportDirective",
        "scope": 1562,
        "sourceUnit": 7249,
        "src": "84:67:4",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "absolutePath": "@gnosis.pm/util-contracts/contracts/Fixed192x64Math.sol",
        "file": "@gnosis.pm/util-contracts/contracts/Fixed192x64Math.sol",
        "id": 875,
        "nodeType": "ImportDirective",
        "scope": 1562,
        "sourceUnit": 6794,
        "src": "152:65:4",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "absolutePath": "/home/alan/src/github.com/gnosis/pm-contracts/contracts/MarketMakers/MarketMaker.sol",
        "file": "../MarketMakers/MarketMaker.sol",
        "id": 876,
        "nodeType": "ImportDirective",
        "scope": 1562,
        "sourceUnit": 1607,
        "src": "218:41:4",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "baseContracts": [
          {
            "arguments": null,
            "baseName": {
              "contractScope": null,
              "id": 877,
              "name": "MarketMaker",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 1606,
              "src": "444:11:4",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_MarketMaker_$1606",
                "typeString": "contract MarketMaker"
              }
            },
            "id": 878,
            "nodeType": "InheritanceSpecifier",
            "src": "444:11:4"
          }
        ],
        "contractDependencies": [
          1606
        ],
        "contractKind": "contract",
        "documentation": "@title LMSR market maker contract - Calculates share prices based on share distribution and initial funding\n @author Alan Lu - <alan.lu@gnosis.pm>",
        "fullyImplemented": true,
        "id": 1561,
        "linearizedBaseContracts": [
          1561,
          1606
        ],
        "name": "LMSRMarketMaker",
        "nodeType": "ContractDefinition",
        "nodes": [
          {
            "id": 881,
            "libraryName": {
              "contractScope": null,
              "id": 879,
              "name": "SignedSafeMath",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 7248,
              "src": "468:14:4",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_SignedSafeMath_$7248",
                "typeString": "library SignedSafeMath"
              }
            },
            "nodeType": "UsingForDirective",
            "src": "462:29:4",
            "typeName": {
              "id": 880,
              "name": "int",
              "nodeType": "ElementaryTypeName",
              "src": "487:3:4",
              "typeDescriptions": {
                "typeIdentifier": "t_int256",
                "typeString": "int256"
              }
            }
          },
          {
            "id": 884,
            "libraryName": {
              "contractScope": null,
              "id": 882,
              "name": "SafeMath",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 7381,
              "src": "502:8:4",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_SafeMath_$7381",
                "typeString": "library SafeMath"
              }
            },
            "nodeType": "UsingForDirective",
            "src": "496:24:4",
            "typeName": {
              "id": 883,
              "name": "uint",
              "nodeType": "ElementaryTypeName",
              "src": "515:4:4",
              "typeDescriptions": {
                "typeIdentifier": "t_uint256",
                "typeString": "uint256"
              }
            }
          },
          {
            "constant": true,
            "id": 887,
            "name": "ONE",
            "nodeType": "VariableDeclaration",
            "scope": 1561,
            "src": "559:39:4",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_uint256",
              "typeString": "uint256"
            },
            "typeName": {
              "id": 885,
              "name": "uint",
              "nodeType": "ElementaryTypeName",
              "src": "559:4:4",
              "typeDescriptions": {
                "typeIdentifier": "t_uint256",
                "typeString": "uint256"
              }
            },
            "value": {
              "argumentTypes": null,
              "hexValue": "30783130303030303030303030303030303030",
              "id": 886,
              "isConstant": false,
              "isLValue": false,
              "isPure": true,
              "kind": "number",
              "lValueRequested": false,
              "nodeType": "Literal",
              "src": "579:19:4",
              "subdenomination": null,
              "typeDescriptions": {
                "typeIdentifier": "t_rational_18446744073709551616_by_1",
                "typeString": "int_const 18446744073709551616"
              },
              "value": "0x10000000000000000"
            },
            "visibility": "internal"
          },
          {
            "constant": true,
            "id": 890,
            "name": "EXP_LIMIT",
            "nodeType": "VariableDeclaration",
            "scope": 1561,
            "src": "604:47:4",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_int256",
              "typeString": "int256"
            },
            "typeName": {
              "id": 888,
              "name": "int",
              "nodeType": "ElementaryTypeName",
              "src": "604:3:4",
              "typeDescriptions": {
                "typeIdentifier": "t_int256",
                "typeString": "int256"
              }
            },
            "value": {
              "argumentTypes": null,
              "hexValue": "33333934323030393039353632353537343937333434",
              "id": 889,
              "isConstant": false,
              "isLValue": false,
              "isPure": true,
              "kind": "number",
              "lValueRequested": false,
              "nodeType": "Literal",
              "src": "629:22:4",
              "subdenomination": null,
              "typeDescriptions": {
                "typeIdentifier": "t_rational_3394200909562557497344_by_1",
                "typeString": "int_const 3394200909562557497344"
              },
              "value": "3394200909562557497344"
            },
            "visibility": "internal"
          },
          {
            "body": {
              "id": 1034,
              "nodeType": "Block",
              "src": "1318:1442:4",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "id": 907,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [],
                          "expression": {
                            "argumentTypes": [],
                            "expression": {
                              "argumentTypes": null,
                              "arguments": [],
                              "expression": {
                                "argumentTypes": [],
                                "expression": {
                                  "argumentTypes": null,
                                  "id": 901,
                                  "name": "market",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 892,
                                  "src": "1336:6:4",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_Market_$2296",
                                    "typeString": "contract Market"
                                  }
                                },
                                "id": 902,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "eventContract",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 2214,
                                "src": "1336:20:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_function_external_view$__$returns$_t_contract$_Event_$392_$",
                                  "typeString": "function () view external returns (contract Event)"
                                }
                              },
                              "id": 903,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "functionCall",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "1336:22:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_Event_$392",
                                "typeString": "contract Event"
                              }
                            },
                            "id": 904,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "getOutcomeCount",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 331,
                            "src": "1336:38:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_view$__$returns$_t_uint8_$",
                              "typeString": "function () view external returns (uint8)"
                            }
                          },
                          "id": 905,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "1336:40:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "31",
                          "id": 906,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "1379:1:4",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_1_by_1",
                            "typeString": "int_const 1"
                          },
                          "value": "1"
                        },
                        "src": "1336:44:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 900,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        7923,
                        7924
                      ],
                      "referencedDeclaration": 7923,
                      "src": "1328:7:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 908,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1328:53:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 909,
                  "nodeType": "ExpressionStatement",
                  "src": "1328:53:4"
                },
                {
                  "assignments": [
                    913
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 913,
                      "name": "netOutcomeTokensSold",
                      "nodeType": "VariableDeclaration",
                      "scope": 1034,
                      "src": "1391:33:4",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                        "typeString": "int256[]"
                      },
                      "typeName": {
                        "baseType": {
                          "id": 911,
                          "name": "int",
                          "nodeType": "ElementaryTypeName",
                          "src": "1391:3:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 912,
                        "length": null,
                        "nodeType": "ArrayTypeName",
                        "src": "1391:5:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                          "typeString": "int256[]"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 917,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 915,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 892,
                        "src": "1451:6:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$2296",
                          "typeString": "contract Market"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_contract$_Market_$2296",
                          "typeString": "contract Market"
                        }
                      ],
                      "id": 914,
                      "name": "getNetOutcomeTokensSold",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1560,
                      "src": "1427:23:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_contract$_Market_$2296_$returns$_t_array$_t_int256_$dyn_memory_ptr_$",
                        "typeString": "function (contract Market) view returns (int256[] memory)"
                      }
                    },
                    "id": 916,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1427:31:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                      "typeString": "int256[] memory"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1391:67:4"
                },
                {
                  "assignments": [
                    919
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 919,
                      "name": "log2N",
                      "nodeType": "VariableDeclaration",
                      "scope": 1034,
                      "src": "1537:9:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 918,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "1537:3:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 930,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 925,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 922,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 913,
                            "src": "1575:20:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 923,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "length",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": null,
                          "src": "1575:27:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "*",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 924,
                          "name": "ONE",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 887,
                          "src": "1605:3:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "1575:33:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 926,
                            "name": "Fixed192x64Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 6793,
                            "src": "1610:15:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                              "typeString": "type(library Fixed192x64Math)"
                            }
                          },
                          "id": 927,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 5799,
                          "src": "1610:30:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$5799_$",
                            "typeString": "type(enum Fixed192x64Math.EstimationMode)"
                          }
                        },
                        "id": 928,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "UpperBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "1610:41:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 920,
                        "name": "Fixed192x64Math",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 6793,
                        "src": "1549:15:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                          "typeString": "type(library Fixed192x64Math)"
                        }
                      },
                      "id": 921,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "binaryLog",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 6566,
                      "src": "1549:25:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_delegatecall_pure$_t_uint256_$_t_enum$_EstimationMode_$5799_$returns$_t_int256_$",
                        "typeString": "function (uint256,enum Fixed192x64Math.EstimationMode) pure returns (int256)"
                      }
                    },
                    "id": 929,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1549:103:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1537:115:4"
                },
                {
                  "assignments": [
                    932
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 932,
                      "name": "funding",
                      "nodeType": "VariableDeclaration",
                      "scope": 1034,
                      "src": "1662:12:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 931,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "1662:4:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 936,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 933,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 892,
                        "src": "1677:6:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$2296",
                          "typeString": "contract Market"
                        }
                      },
                      "id": 934,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "funding",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 2220,
                      "src": "1677:14:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                        "typeString": "function () view external returns (uint256)"
                      }
                    },
                    "id": 935,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1677:16:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1662:31:4"
                },
                {
                  "assignments": [
                    938
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 938,
                      "name": "costLevelBefore",
                      "nodeType": "VariableDeclaration",
                      "scope": 1034,
                      "src": "1703:19:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 937,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "1703:3:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 947,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 940,
                        "name": "log2N",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 919,
                        "src": "1739:5:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 941,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 913,
                        "src": "1746:20:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 942,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 932,
                        "src": "1768:7:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 943,
                            "name": "Fixed192x64Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 6793,
                            "src": "1777:15:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                              "typeString": "type(library Fixed192x64Math)"
                            }
                          },
                          "id": 944,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 5799,
                          "src": "1777:30:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$5799_$",
                            "typeString": "type(enum Fixed192x64Math.EstimationMode)"
                          }
                        },
                        "id": 945,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "LowerBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "1777:41:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        },
                        {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      ],
                      "id": 939,
                      "name": "calcCostLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1408,
                      "src": "1725:13:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_enum$_EstimationMode_$5799_$returns$_t_int256_$",
                        "typeString": "function (int256,int256[] memory,uint256,enum Fixed192x64Math.EstimationMode) pure returns (int256)"
                      }
                    },
                    "id": 946,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1725:94:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1703:116:4"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 953,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 949,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 913,
                            "src": "1903:20:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 950,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "length",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": null,
                          "src": "1903:27:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "==",
                        "rightExpression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 951,
                            "name": "outcomeTokenAmounts",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 895,
                            "src": "1934:19:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 952,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "length",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": null,
                          "src": "1934:26:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "1903:57:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 948,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        7923,
                        7924
                      ],
                      "referencedDeclaration": 7923,
                      "src": "1895:7:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 954,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1895:66:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 955,
                  "nodeType": "ExpressionStatement",
                  "src": "1895:66:4"
                },
                {
                  "body": {
                    "id": 980,
                    "nodeType": "Block",
                    "src": "2027:102:4",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 978,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "baseExpression": {
                              "argumentTypes": null,
                              "id": 967,
                              "name": "netOutcomeTokensSold",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 913,
                              "src": "2041:20:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                                "typeString": "int256[] memory"
                              }
                            },
                            "id": 969,
                            "indexExpression": {
                              "argumentTypes": null,
                              "id": 968,
                              "name": "i",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 957,
                              "src": "2062:1:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint8",
                                "typeString": "uint8"
                              }
                            },
                            "isConstant": false,
                            "isLValue": true,
                            "isPure": false,
                            "lValueRequested": true,
                            "nodeType": "IndexAccess",
                            "src": "2041:23:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "baseExpression": {
                                  "argumentTypes": null,
                                  "id": 974,
                                  "name": "outcomeTokenAmounts",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 895,
                                  "src": "2095:19:4",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                                    "typeString": "int256[] memory"
                                  }
                                },
                                "id": 976,
                                "indexExpression": {
                                  "argumentTypes": null,
                                  "id": 975,
                                  "name": "i",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 957,
                                  "src": "2115:1:4",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_uint8",
                                    "typeString": "uint8"
                                  }
                                },
                                "isConstant": false,
                                "isLValue": true,
                                "isPure": false,
                                "lValueRequested": false,
                                "nodeType": "IndexAccess",
                                "src": "2095:22:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                }
                              ],
                              "expression": {
                                "argumentTypes": null,
                                "baseExpression": {
                                  "argumentTypes": null,
                                  "id": 970,
                                  "name": "netOutcomeTokensSold",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 913,
                                  "src": "2067:20:4",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                                    "typeString": "int256[] memory"
                                  }
                                },
                                "id": 972,
                                "indexExpression": {
                                  "argumentTypes": null,
                                  "id": 971,
                                  "name": "i",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 957,
                                  "src": "2088:1:4",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_uint8",
                                    "typeString": "uint8"
                                  }
                                },
                                "isConstant": false,
                                "isLValue": true,
                                "isPure": false,
                                "lValueRequested": false,
                                "nodeType": "IndexAccess",
                                "src": "2067:23:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                }
                              },
                              "id": 973,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "add",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 7247,
                              "src": "2067:27:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                                "typeString": "function (int256,int256) pure returns (int256)"
                              }
                            },
                            "id": 977,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "2067:51:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "src": "2041:77:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 979,
                        "nodeType": "ExpressionStatement",
                        "src": "2041:77:4"
                      }
                    ]
                  },
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 963,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 960,
                      "name": "i",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 957,
                      "src": "1989:1:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint8",
                        "typeString": "uint8"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 961,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 913,
                        "src": "1993:20:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      "id": 962,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "length",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": null,
                      "src": "1993:27:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "1989:31:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "id": 981,
                  "initializationExpression": {
                    "assignments": [
                      957
                    ],
                    "declarations": [
                      {
                        "constant": false,
                        "id": 957,
                        "name": "i",
                        "nodeType": "VariableDeclaration",
                        "scope": 981,
                        "src": "1976:7:4",
                        "stateVariable": false,
                        "storageLocation": "default",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "typeName": {
                          "id": 956,
                          "name": "uint8",
                          "nodeType": "ElementaryTypeName",
                          "src": "1976:5:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "value": null,
                        "visibility": "internal"
                      }
                    ],
                    "id": 959,
                    "initialValue": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 958,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "1986:1:4",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "nodeType": "VariableDeclarationStatement",
                    "src": "1976:11:4"
                  },
                  "loopExpression": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 965,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "nodeType": "UnaryOperation",
                      "operator": "++",
                      "prefix": false,
                      "src": "2022:3:4",
                      "subExpression": {
                        "argumentTypes": null,
                        "id": 964,
                        "name": "i",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 957,
                        "src": "2022:1:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      },
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint8",
                        "typeString": "uint8"
                      }
                    },
                    "id": 966,
                    "nodeType": "ExpressionStatement",
                    "src": "2022:3:4"
                  },
                  "nodeType": "ForStatement",
                  "src": "1971:158:4"
                },
                {
                  "assignments": [
                    983
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 983,
                      "name": "costLevelAfter",
                      "nodeType": "VariableDeclaration",
                      "scope": 1034,
                      "src": "2197:18:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 982,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "2197:3:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 992,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 985,
                        "name": "log2N",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 919,
                        "src": "2232:5:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 986,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 913,
                        "src": "2239:20:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 987,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 932,
                        "src": "2261:7:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 988,
                            "name": "Fixed192x64Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 6793,
                            "src": "2270:15:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                              "typeString": "type(library Fixed192x64Math)"
                            }
                          },
                          "id": 989,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 5799,
                          "src": "2270:30:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$5799_$",
                            "typeString": "type(enum Fixed192x64Math.EstimationMode)"
                          }
                        },
                        "id": 990,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "UpperBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "2270:41:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        },
                        {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      ],
                      "id": 984,
                      "name": "calcCostLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1408,
                      "src": "2218:13:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_enum$_EstimationMode_$5799_$returns$_t_int256_$",
                        "typeString": "function (int256,int256[] memory,uint256,enum Fixed192x64Math.EstimationMode) pure returns (int256)"
                      }
                    },
                    "id": 991,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "2218:94:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "2197:115:4"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 998,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 993,
                      "name": "netCost",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 898,
                      "src": "2395:7:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "id": 996,
                          "name": "costLevelBefore",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 938,
                          "src": "2424:15:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "id": 994,
                          "name": "costLevelAfter",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 983,
                          "src": "2405:14:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 995,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sub",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 7208,
                        "src": "2405:18:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                          "typeString": "function (int256,int256) pure returns (int256)"
                        }
                      },
                      "id": 997,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "2405:35:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "2395:45:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 999,
                  "nodeType": "ExpressionStatement",
                  "src": "2395:45:4"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    },
                    "id": 1014,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "id": 1002,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 1000,
                        "name": "netCost",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 898,
                        "src": "2589:7:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "<=",
                      "rightExpression": {
                        "argumentTypes": null,
                        "hexValue": "30",
                        "id": 1001,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "2600:1:4",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_0_by_1",
                          "typeString": "int_const 0"
                        },
                        "value": "0"
                      },
                      "src": "2589:12:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "||",
                    "rightExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "id": 1013,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        },
                        "id": 1011,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          },
                          "id": 1007,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 1003,
                            "name": "netCost",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 898,
                            "src": "2605:7:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "/",
                          "rightExpression": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "id": 1005,
                                "name": "ONE",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 887,
                                "src": "2619:3:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              ],
                              "id": 1004,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "lValueRequested": false,
                              "nodeType": "ElementaryTypeNameExpression",
                              "src": "2615:3:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_type$_t_int256_$",
                                "typeString": "type(int256)"
                              },
                              "typeName": "int"
                            },
                            "id": 1006,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "typeConversion",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "2615:8:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "src": "2605:18:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "*",
                        "rightExpression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 1009,
                              "name": "ONE",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 887,
                              "src": "2630:3:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 1008,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "2626:3:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_int256_$",
                              "typeString": "type(int256)"
                            },
                            "typeName": "int"
                          },
                          "id": 1010,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "2626:8:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "src": "2605:29:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "==",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 1012,
                        "name": "netCost",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 898,
                        "src": "2638:7:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "src": "2605:40:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      }
                    },
                    "src": "2589:56:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": {
                    "id": 1032,
                    "nodeType": "Block",
                    "src": "2697:57:4",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 1030,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 1022,
                            "name": "netCost",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 898,
                            "src": "2711:7:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "commonType": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            },
                            "id": 1029,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftExpression": {
                              "argumentTypes": null,
                              "commonType": {
                                "typeIdentifier": "t_int256",
                                "typeString": "int256"
                              },
                              "id": 1027,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "leftExpression": {
                                "argumentTypes": null,
                                "id": 1023,
                                "name": "netCost",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 898,
                                "src": "2721:7:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                }
                              },
                              "nodeType": "BinaryOperation",
                              "operator": "/",
                              "rightExpression": {
                                "argumentTypes": null,
                                "arguments": [
                                  {
                                    "argumentTypes": null,
                                    "id": 1025,
                                    "name": "ONE",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 887,
                                    "src": "2735:3:4",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  }
                                ],
                                "expression": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  ],
                                  "id": 1024,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": true,
                                  "lValueRequested": false,
                                  "nodeType": "ElementaryTypeNameExpression",
                                  "src": "2731:3:4",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_type$_t_int256_$",
                                    "typeString": "type(int256)"
                                  },
                                  "typeName": "int"
                                },
                                "id": 1026,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": true,
                                "kind": "typeConversion",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "2731:8:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                }
                              },
                              "src": "2721:18:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_int256",
                                "typeString": "int256"
                              }
                            },
                            "nodeType": "BinaryOperation",
                            "operator": "+",
                            "rightExpression": {
                              "argumentTypes": null,
                              "hexValue": "31",
                              "id": 1028,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "number",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "2742:1:4",
                              "subdenomination": null,
                              "typeDescriptions": {
                                "typeIdentifier": "t_rational_1_by_1",
                                "typeString": "int_const 1"
                              },
                              "value": "1"
                            },
                            "src": "2721:22:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "src": "2711:32:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 1031,
                        "nodeType": "ExpressionStatement",
                        "src": "2711:32:4"
                      }
                    ]
                  },
                  "id": 1033,
                  "nodeType": "IfStatement",
                  "src": "2586:168:4",
                  "trueBody": {
                    "id": 1021,
                    "nodeType": "Block",
                    "src": "2647:44:4",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 1019,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 1015,
                            "name": "netCost",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 898,
                            "src": "2661:7:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "/=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "id": 1017,
                                "name": "ONE",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 887,
                                "src": "2676:3:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              ],
                              "id": 1016,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "lValueRequested": false,
                              "nodeType": "ElementaryTypeNameExpression",
                              "src": "2672:3:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_type$_t_int256_$",
                                "typeString": "type(int256)"
                              },
                              "typeName": "int"
                            },
                            "id": 1018,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "typeConversion",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "2672:8:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "src": "2661:19:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 1020,
                        "nodeType": "ExpressionStatement",
                        "src": "2661:19:4"
                      }
                    ]
                  }
                }
              ]
            },
            "documentation": "@dev Calculates the net cost for executing a given trade.\n @param market Market contract\n @param outcomeTokenAmounts Amounts of outcome tokens to buy from the market. If an amount is negative, represents an amount to sell to the market.\n @return Net cost of trade. If positive, represents amount of collateral which would be paid to the market for the trade. If negative, represents amount of collateral which would be received from the market for the trade.",
            "id": 1035,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "calcNetCost",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 896,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 892,
                  "name": "market",
                  "nodeType": "VariableDeclaration",
                  "scope": 1035,
                  "src": "1207:13:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_contract$_Market_$2296",
                    "typeString": "contract Market"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 891,
                    "name": "Market",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 2296,
                    "src": "1207:6:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_Market_$2296",
                      "typeString": "contract Market"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 895,
                  "name": "outcomeTokenAmounts",
                  "nodeType": "VariableDeclaration",
                  "scope": 1035,
                  "src": "1222:32:4",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                    "typeString": "int256[]"
                  },
                  "typeName": {
                    "baseType": {
                      "id": 893,
                      "name": "int",
                      "nodeType": "ElementaryTypeName",
                      "src": "1222:3:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 894,
                    "length": null,
                    "nodeType": "ArrayTypeName",
                    "src": "1222:5:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                      "typeString": "int256[]"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1206:49:4"
            },
            "returnParameters": {
              "id": 899,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 898,
                  "name": "netCost",
                  "nodeType": "VariableDeclaration",
                  "scope": 1035,
                  "src": "1301:11:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_int256",
                    "typeString": "int256"
                  },
                  "typeName": {
                    "id": 897,
                    "name": "int",
                    "nodeType": "ElementaryTypeName",
                    "src": "1301:3:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1300:13:4"
            },
            "scope": 1561,
            "src": "1186:1574:4",
            "stateMutability": "view",
            "superFunction": 1596,
            "visibility": "public"
          },
          {
            "body": {
              "id": 1170,
              "nodeType": "Block",
              "src": "3153:1482:4",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "id": 1053,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [],
                          "expression": {
                            "argumentTypes": [],
                            "expression": {
                              "argumentTypes": null,
                              "arguments": [],
                              "expression": {
                                "argumentTypes": [],
                                "expression": {
                                  "argumentTypes": null,
                                  "id": 1047,
                                  "name": "market",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1037,
                                  "src": "3171:6:4",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_Market_$2296",
                                    "typeString": "contract Market"
                                  }
                                },
                                "id": 1048,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "eventContract",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 2214,
                                "src": "3171:20:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_function_external_view$__$returns$_t_contract$_Event_$392_$",
                                  "typeString": "function () view external returns (contract Event)"
                                }
                              },
                              "id": 1049,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "functionCall",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "3171:22:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_Event_$392",
                                "typeString": "contract Event"
                              }
                            },
                            "id": 1050,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "getOutcomeCount",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 331,
                            "src": "3171:38:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_view$__$returns$_t_uint8_$",
                              "typeString": "function () view external returns (uint8)"
                            }
                          },
                          "id": 1051,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "3171:40:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "31",
                          "id": 1052,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "3214:1:4",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_1_by_1",
                            "typeString": "int_const 1"
                          },
                          "value": "1"
                        },
                        "src": "3171:44:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 1046,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        7923,
                        7924
                      ],
                      "referencedDeclaration": 7923,
                      "src": "3163:7:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 1054,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3163:53:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1055,
                  "nodeType": "ExpressionStatement",
                  "src": "3163:53:4"
                },
                {
                  "assignments": [
                    1059
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1059,
                      "name": "netOutcomeTokensSold",
                      "nodeType": "VariableDeclaration",
                      "scope": 1170,
                      "src": "3226:33:4",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                        "typeString": "int256[]"
                      },
                      "typeName": {
                        "baseType": {
                          "id": 1057,
                          "name": "int",
                          "nodeType": "ElementaryTypeName",
                          "src": "3226:3:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 1058,
                        "length": null,
                        "nodeType": "ArrayTypeName",
                        "src": "3226:5:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                          "typeString": "int256[]"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1063,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1061,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1037,
                        "src": "3286:6:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$2296",
                          "typeString": "contract Market"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_contract$_Market_$2296",
                          "typeString": "contract Market"
                        }
                      ],
                      "id": 1060,
                      "name": "getNetOutcomeTokensSold",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1560,
                      "src": "3262:23:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_contract$_Market_$2296_$returns$_t_array$_t_int256_$dyn_memory_ptr_$",
                        "typeString": "function (contract Market) view returns (int256[] memory)"
                      }
                    },
                    "id": 1062,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3262:31:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                      "typeString": "int256[] memory"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3226:67:4"
                },
                {
                  "assignments": [
                    1065
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1065,
                      "name": "log2N",
                      "nodeType": "VariableDeclaration",
                      "scope": 1170,
                      "src": "3371:9:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 1064,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "3371:3:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1076,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 1071,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1068,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1059,
                            "src": "3409:20:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 1069,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "length",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": null,
                          "src": "3409:27:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "*",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 1070,
                          "name": "ONE",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 887,
                          "src": "3439:3:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "3409:33:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1072,
                            "name": "Fixed192x64Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 6793,
                            "src": "3444:15:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                              "typeString": "type(library Fixed192x64Math)"
                            }
                          },
                          "id": 1073,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 5799,
                          "src": "3444:30:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$5799_$",
                            "typeString": "type(enum Fixed192x64Math.EstimationMode)"
                          }
                        },
                        "id": 1074,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "UpperBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "3444:41:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1066,
                        "name": "Fixed192x64Math",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 6793,
                        "src": "3383:15:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                          "typeString": "type(library Fixed192x64Math)"
                        }
                      },
                      "id": 1067,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "binaryLog",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 6566,
                      "src": "3383:25:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_delegatecall_pure$_t_uint256_$_t_enum$_EstimationMode_$5799_$returns$_t_int256_$",
                        "typeString": "function (uint256,enum Fixed192x64Math.EstimationMode) pure returns (int256)"
                      }
                    },
                    "id": 1075,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3383:103:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3371:115:4"
                },
                {
                  "assignments": [
                    1078
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1078,
                      "name": "funding",
                      "nodeType": "VariableDeclaration",
                      "scope": 1170,
                      "src": "3496:12:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1077,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "3496:4:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1082,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1079,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1037,
                        "src": "3511:6:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$2296",
                          "typeString": "contract Market"
                        }
                      },
                      "id": 1080,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "funding",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 2220,
                      "src": "3511:14:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                        "typeString": "function () view external returns (uint256)"
                      }
                    },
                    "id": 1081,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3511:16:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3496:31:4"
                },
                {
                  "assignments": [
                    1084
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1084,
                      "name": "costLevelBefore",
                      "nodeType": "VariableDeclaration",
                      "scope": 1170,
                      "src": "3537:19:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 1083,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "3537:3:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1093,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1086,
                        "name": "log2N",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1065,
                        "src": "3573:5:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1087,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1059,
                        "src": "3580:20:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1088,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1078,
                        "src": "3602:7:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1089,
                            "name": "Fixed192x64Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 6793,
                            "src": "3611:15:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                              "typeString": "type(library Fixed192x64Math)"
                            }
                          },
                          "id": 1090,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 5799,
                          "src": "3611:30:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$5799_$",
                            "typeString": "type(enum Fixed192x64Math.EstimationMode)"
                          }
                        },
                        "id": 1091,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "LowerBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "3611:41:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        },
                        {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      ],
                      "id": 1085,
                      "name": "calcCostLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1408,
                      "src": "3559:13:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_enum$_EstimationMode_$5799_$returns$_t_int256_$",
                        "typeString": "function (int256,int256[] memory,uint256,enum Fixed192x64Math.EstimationMode) pure returns (int256)"
                      }
                    },
                    "id": 1092,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3559:94:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3537:116:4"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        },
                        "id": 1099,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 1096,
                              "name": "outcomeTokenCount",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1041,
                              "src": "3739:17:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 1095,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "3735:3:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_int256_$",
                              "typeString": "type(int256)"
                            },
                            "typeName": "int"
                          },
                          "id": 1097,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "3735:22:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">=",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "30",
                          "id": 1098,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "3761:1:4",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_0_by_1",
                            "typeString": "int_const 0"
                          },
                          "value": "0"
                        },
                        "src": "3735:27:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 1094,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        7923,
                        7924
                      ],
                      "referencedDeclaration": 7923,
                      "src": "3727:7:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 1100,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3727:36:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1101,
                  "nodeType": "ExpressionStatement",
                  "src": "3727:36:4"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1113,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "baseExpression": {
                        "argumentTypes": null,
                        "id": 1102,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1059,
                        "src": "3773:20:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      "id": 1104,
                      "indexExpression": {
                        "argumentTypes": null,
                        "id": 1103,
                        "name": "outcomeTokenIndex",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1039,
                        "src": "3794:17:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      },
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "nodeType": "IndexAccess",
                      "src": "3773:39:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 1110,
                              "name": "outcomeTokenCount",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1041,
                              "src": "3863:17:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 1109,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "3859:3:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_int256_$",
                              "typeString": "type(int256)"
                            },
                            "typeName": "int"
                          },
                          "id": 1111,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "3859:22:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "baseExpression": {
                            "argumentTypes": null,
                            "id": 1105,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1059,
                            "src": "3815:20:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 1107,
                          "indexExpression": {
                            "argumentTypes": null,
                            "id": 1106,
                            "name": "outcomeTokenIndex",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1039,
                            "src": "3836:17:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          },
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "nodeType": "IndexAccess",
                          "src": "3815:39:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 1108,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "add",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 7247,
                        "src": "3815:43:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                          "typeString": "function (int256,int256) pure returns (int256)"
                        }
                      },
                      "id": 1112,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "3815:67:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "3773:109:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 1114,
                  "nodeType": "ExpressionStatement",
                  "src": "3773:109:4"
                },
                {
                  "assignments": [
                    1116
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1116,
                      "name": "costLevelAfter",
                      "nodeType": "VariableDeclaration",
                      "scope": 1170,
                      "src": "3950:18:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 1115,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "3950:3:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1125,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1118,
                        "name": "log2N",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1065,
                        "src": "3985:5:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1119,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1059,
                        "src": "3992:20:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1120,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1078,
                        "src": "4014:7:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1121,
                            "name": "Fixed192x64Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 6793,
                            "src": "4023:15:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                              "typeString": "type(library Fixed192x64Math)"
                            }
                          },
                          "id": 1122,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 5799,
                          "src": "4023:30:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$5799_$",
                            "typeString": "type(enum Fixed192x64Math.EstimationMode)"
                          }
                        },
                        "id": 1123,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "UpperBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "4023:41:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        },
                        {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      ],
                      "id": 1117,
                      "name": "calcCostLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1408,
                      "src": "3971:13:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_enum$_EstimationMode_$5799_$returns$_t_int256_$",
                        "typeString": "function (int256,int256[] memory,uint256,enum Fixed192x64Math.EstimationMode) pure returns (int256)"
                      }
                    },
                    "id": 1124,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3971:94:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3950:115:4"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    },
                    "id": 1128,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 1126,
                      "name": "costLevelAfter",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1116,
                      "src": "4129:14:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 1127,
                      "name": "costLevelBefore",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1084,
                      "src": "4146:15:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "4129:32:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 1133,
                  "nodeType": "IfStatement",
                  "src": "4126:81:4",
                  "trueBody": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1131,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 1129,
                        "name": "costLevelAfter",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1116,
                        "src": "4175:14:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "id": 1130,
                        "name": "costLevelBefore",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1084,
                        "src": "4192:15:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "src": "4175:32:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 1132,
                    "nodeType": "ExpressionStatement",
                    "src": "4175:32:4"
                  }
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1140,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1134,
                      "name": "cost",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1044,
                      "src": "4217:4:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          },
                          "id": 1138,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 1136,
                            "name": "costLevelAfter",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1116,
                            "src": "4229:14:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "-",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 1137,
                            "name": "costLevelBefore",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1084,
                            "src": "4246:15:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "src": "4229:32:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "id": 1135,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "nodeType": "ElementaryTypeNameExpression",
                        "src": "4224:4:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_uint256_$",
                          "typeString": "type(uint256)"
                        },
                        "typeName": "uint"
                      },
                      "id": 1139,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "typeConversion",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "4224:38:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "4217:45:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 1141,
                  "nodeType": "ExpressionStatement",
                  "src": "4217:45:4"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 1148,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 1146,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 1144,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 1142,
                          "name": "cost",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1044,
                          "src": "4328:4:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "/",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 1143,
                          "name": "ONE",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 887,
                          "src": "4335:3:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "4328:10:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "*",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 1145,
                        "name": "ONE",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 887,
                        "src": "4341:3:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "4328:16:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "==",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 1147,
                      "name": "cost",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1044,
                      "src": "4348:4:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "4328:24:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1159,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 1153,
                        "name": "cost",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1044,
                        "src": "4474:4:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 1158,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          "id": 1156,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 1154,
                            "name": "cost",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1044,
                            "src": "4481:4:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "/",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 1155,
                            "name": "ONE",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 887,
                            "src": "4488:3:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "4481:10:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "+",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "31",
                          "id": 1157,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "4494:1:4",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_1_by_1",
                            "typeString": "int_const 1"
                          },
                          "value": "1"
                        },
                        "src": "4481:14:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "4474:21:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "id": 1160,
                    "nodeType": "ExpressionStatement",
                    "src": "4474:21:4"
                  },
                  "id": 1161,
                  "nodeType": "IfStatement",
                  "src": "4324:171:4",
                  "trueBody": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1151,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 1149,
                        "name": "cost",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1044,
                        "src": "4366:4:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "/=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "id": 1150,
                        "name": "ONE",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 887,
                        "src": "4374:3:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "4366:11:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "id": 1152,
                    "nodeType": "ExpressionStatement",
                    "src": "4366:11:4"
                  }
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 1164,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 1162,
                      "name": "cost",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1044,
                      "src": "4566:4:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 1163,
                      "name": "outcomeTokenCount",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1041,
                      "src": "4573:17:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "4566:24:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 1169,
                  "nodeType": "IfStatement",
                  "src": "4562:66:4",
                  "trueBody": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1167,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 1165,
                        "name": "cost",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1044,
                        "src": "4604:4:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "id": 1166,
                        "name": "outcomeTokenCount",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1041,
                        "src": "4611:17:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "4604:24:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "id": 1168,
                    "nodeType": "ExpressionStatement",
                    "src": "4604:24:4"
                  }
                }
              ]
            },
            "documentation": "@dev Returns cost to buy given number of outcome tokens\n @param market Market contract\n @param outcomeTokenIndex Index of outcome to buy\n @param outcomeTokenCount Number of outcome tokens to buy\n @return Cost",
            "id": 1171,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "calcCost",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1042,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1037,
                  "name": "market",
                  "nodeType": "VariableDeclaration",
                  "scope": 1171,
                  "src": "3029:13:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_contract$_Market_$2296",
                    "typeString": "contract Market"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 1036,
                    "name": "Market",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 2296,
                    "src": "3029:6:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_Market_$2296",
                      "typeString": "contract Market"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1039,
                  "name": "outcomeTokenIndex",
                  "nodeType": "VariableDeclaration",
                  "scope": 1171,
                  "src": "3044:23:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint8",
                    "typeString": "uint8"
                  },
                  "typeName": {
                    "id": 1038,
                    "name": "uint8",
                    "nodeType": "ElementaryTypeName",
                    "src": "3044:5:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint8",
                      "typeString": "uint8"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1041,
                  "name": "outcomeTokenCount",
                  "nodeType": "VariableDeclaration",
                  "scope": 1171,
                  "src": "3069:22:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1040,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "3069:4:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "3028:64:4"
            },
            "returnParameters": {
              "id": 1045,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1044,
                  "name": "cost",
                  "nodeType": "VariableDeclaration",
                  "scope": 1171,
                  "src": "3138:9:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1043,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "3138:4:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "3137:11:4"
            },
            "scope": 1561,
            "src": "3011:1624:4",
            "stateMutability": "view",
            "superFunction": 1575,
            "visibility": "public"
          },
          {
            "body": {
              "id": 1280,
              "nodeType": "Block",
              "src": "5043:1164:4",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "id": 1189,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [],
                          "expression": {
                            "argumentTypes": [],
                            "expression": {
                              "argumentTypes": null,
                              "arguments": [],
                              "expression": {
                                "argumentTypes": [],
                                "expression": {
                                  "argumentTypes": null,
                                  "id": 1183,
                                  "name": "market",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1173,
                                  "src": "5061:6:4",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_Market_$2296",
                                    "typeString": "contract Market"
                                  }
                                },
                                "id": 1184,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "eventContract",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 2214,
                                "src": "5061:20:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_function_external_view$__$returns$_t_contract$_Event_$392_$",
                                  "typeString": "function () view external returns (contract Event)"
                                }
                              },
                              "id": 1185,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "functionCall",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "5061:22:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_Event_$392",
                                "typeString": "contract Event"
                              }
                            },
                            "id": 1186,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "getOutcomeCount",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 331,
                            "src": "5061:38:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_view$__$returns$_t_uint8_$",
                              "typeString": "function () view external returns (uint8)"
                            }
                          },
                          "id": 1187,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "5061:40:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "31",
                          "id": 1188,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "5104:1:4",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_1_by_1",
                            "typeString": "int_const 1"
                          },
                          "value": "1"
                        },
                        "src": "5061:44:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 1182,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        7923,
                        7924
                      ],
                      "referencedDeclaration": 7923,
                      "src": "5053:7:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 1190,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "5053:53:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1191,
                  "nodeType": "ExpressionStatement",
                  "src": "5053:53:4"
                },
                {
                  "assignments": [
                    1195
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1195,
                      "name": "netOutcomeTokensSold",
                      "nodeType": "VariableDeclaration",
                      "scope": 1280,
                      "src": "5116:33:4",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                        "typeString": "int256[]"
                      },
                      "typeName": {
                        "baseType": {
                          "id": 1193,
                          "name": "int",
                          "nodeType": "ElementaryTypeName",
                          "src": "5116:3:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 1194,
                        "length": null,
                        "nodeType": "ArrayTypeName",
                        "src": "5116:5:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                          "typeString": "int256[]"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1199,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1197,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1173,
                        "src": "5176:6:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$2296",
                          "typeString": "contract Market"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_contract$_Market_$2296",
                          "typeString": "contract Market"
                        }
                      ],
                      "id": 1196,
                      "name": "getNetOutcomeTokensSold",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1560,
                      "src": "5152:23:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_contract$_Market_$2296_$returns$_t_array$_t_int256_$dyn_memory_ptr_$",
                        "typeString": "function (contract Market) view returns (int256[] memory)"
                      }
                    },
                    "id": 1198,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "5152:31:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                      "typeString": "int256[] memory"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "5116:67:4"
                },
                {
                  "assignments": [
                    1201
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1201,
                      "name": "log2N",
                      "nodeType": "VariableDeclaration",
                      "scope": 1280,
                      "src": "5261:9:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 1200,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "5261:3:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1212,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 1207,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1204,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1195,
                            "src": "5299:20:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 1205,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "length",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": null,
                          "src": "5299:27:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "*",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 1206,
                          "name": "ONE",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 887,
                          "src": "5329:3:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "5299:33:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1208,
                            "name": "Fixed192x64Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 6793,
                            "src": "5334:15:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                              "typeString": "type(library Fixed192x64Math)"
                            }
                          },
                          "id": 1209,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 5799,
                          "src": "5334:30:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$5799_$",
                            "typeString": "type(enum Fixed192x64Math.EstimationMode)"
                          }
                        },
                        "id": 1210,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "UpperBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "5334:41:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1202,
                        "name": "Fixed192x64Math",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 6793,
                        "src": "5273:15:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                          "typeString": "type(library Fixed192x64Math)"
                        }
                      },
                      "id": 1203,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "binaryLog",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 6566,
                      "src": "5273:25:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_delegatecall_pure$_t_uint256_$_t_enum$_EstimationMode_$5799_$returns$_t_int256_$",
                        "typeString": "function (uint256,enum Fixed192x64Math.EstimationMode) pure returns (int256)"
                      }
                    },
                    "id": 1211,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "5273:103:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "5261:115:4"
                },
                {
                  "assignments": [
                    1214
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1214,
                      "name": "funding",
                      "nodeType": "VariableDeclaration",
                      "scope": 1280,
                      "src": "5386:12:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1213,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "5386:4:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1218,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1215,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1173,
                        "src": "5401:6:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$2296",
                          "typeString": "contract Market"
                        }
                      },
                      "id": 1216,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "funding",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 2220,
                      "src": "5401:14:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                        "typeString": "function () view external returns (uint256)"
                      }
                    },
                    "id": 1217,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "5401:16:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "5386:31:4"
                },
                {
                  "assignments": [
                    1220
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1220,
                      "name": "costLevelBefore",
                      "nodeType": "VariableDeclaration",
                      "scope": 1280,
                      "src": "5427:19:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 1219,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "5427:3:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1229,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1222,
                        "name": "log2N",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1201,
                        "src": "5463:5:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1223,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1195,
                        "src": "5470:20:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1224,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1214,
                        "src": "5492:7:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1225,
                            "name": "Fixed192x64Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 6793,
                            "src": "5501:15:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                              "typeString": "type(library Fixed192x64Math)"
                            }
                          },
                          "id": 1226,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 5799,
                          "src": "5501:30:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$5799_$",
                            "typeString": "type(enum Fixed192x64Math.EstimationMode)"
                          }
                        },
                        "id": 1227,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "LowerBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "5501:41:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        },
                        {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      ],
                      "id": 1221,
                      "name": "calcCostLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1408,
                      "src": "5449:13:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_enum$_EstimationMode_$5799_$returns$_t_int256_$",
                        "typeString": "function (int256,int256[] memory,uint256,enum Fixed192x64Math.EstimationMode) pure returns (int256)"
                      }
                    },
                    "id": 1228,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "5449:94:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "5427:116:4"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        },
                        "id": 1235,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 1232,
                              "name": "outcomeTokenCount",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1177,
                              "src": "5640:17:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 1231,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "5636:3:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_int256_$",
                              "typeString": "type(int256)"
                            },
                            "typeName": "int"
                          },
                          "id": 1233,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "5636:22:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">=",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "30",
                          "id": 1234,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "5662:1:4",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_0_by_1",
                            "typeString": "int_const 0"
                          },
                          "value": "0"
                        },
                        "src": "5636:27:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 1230,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        7923,
                        7924
                      ],
                      "referencedDeclaration": 7923,
                      "src": "5628:7:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 1236,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "5628:36:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1237,
                  "nodeType": "ExpressionStatement",
                  "src": "5628:36:4"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1249,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "baseExpression": {
                        "argumentTypes": null,
                        "id": 1238,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1195,
                        "src": "5674:20:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      "id": 1240,
                      "indexExpression": {
                        "argumentTypes": null,
                        "id": 1239,
                        "name": "outcomeTokenIndex",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1175,
                        "src": "5695:17:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      },
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "nodeType": "IndexAccess",
                      "src": "5674:39:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 1246,
                              "name": "outcomeTokenCount",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1177,
                              "src": "5764:17:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 1245,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "5760:3:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_int256_$",
                              "typeString": "type(int256)"
                            },
                            "typeName": "int"
                          },
                          "id": 1247,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "5760:22:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "baseExpression": {
                            "argumentTypes": null,
                            "id": 1241,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1195,
                            "src": "5716:20:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 1243,
                          "indexExpression": {
                            "argumentTypes": null,
                            "id": 1242,
                            "name": "outcomeTokenIndex",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1175,
                            "src": "5737:17:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          },
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "nodeType": "IndexAccess",
                          "src": "5716:39:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 1244,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sub",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 7208,
                        "src": "5716:43:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                          "typeString": "function (int256,int256) pure returns (int256)"
                        }
                      },
                      "id": 1248,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "5716:67:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "5674:109:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 1250,
                  "nodeType": "ExpressionStatement",
                  "src": "5674:109:4"
                },
                {
                  "assignments": [
                    1252
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1252,
                      "name": "costLevelAfter",
                      "nodeType": "VariableDeclaration",
                      "scope": 1280,
                      "src": "5851:18:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 1251,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "5851:3:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1261,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1254,
                        "name": "log2N",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1201,
                        "src": "5886:5:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1255,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1195,
                        "src": "5893:20:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1256,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1214,
                        "src": "5915:7:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1257,
                            "name": "Fixed192x64Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 6793,
                            "src": "5924:15:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                              "typeString": "type(library Fixed192x64Math)"
                            }
                          },
                          "id": 1258,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 5799,
                          "src": "5924:30:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$5799_$",
                            "typeString": "type(enum Fixed192x64Math.EstimationMode)"
                          }
                        },
                        "id": 1259,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "UpperBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "5924:41:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        },
                        {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      ],
                      "id": 1253,
                      "name": "calcCostLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1408,
                      "src": "5872:13:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_enum$_EstimationMode_$5799_$returns$_t_int256_$",
                        "typeString": "function (int256,int256[] memory,uint256,enum Fixed192x64Math.EstimationMode) pure returns (int256)"
                      }
                    },
                    "id": 1260,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "5872:94:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "5851:115:4"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    },
                    "id": 1264,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 1262,
                      "name": "costLevelBefore",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1220,
                      "src": "6032:15:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<=",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 1263,
                      "name": "costLevelAfter",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1252,
                      "src": "6051:14:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "6032:33:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 1269,
                  "nodeType": "IfStatement",
                  "src": "6029:82:4",
                  "trueBody": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1267,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 1265,
                        "name": "costLevelBefore",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1220,
                        "src": "6079:15:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "id": 1266,
                        "name": "costLevelAfter",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1252,
                        "src": "6097:14:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "src": "6079:32:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 1268,
                    "nodeType": "ExpressionStatement",
                    "src": "6079:32:4"
                  }
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1278,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1270,
                      "name": "profit",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1180,
                      "src": "6147:6:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 1277,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "commonType": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            },
                            "id": 1274,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftExpression": {
                              "argumentTypes": null,
                              "id": 1272,
                              "name": "costLevelBefore",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1220,
                              "src": "6161:15:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_int256",
                                "typeString": "int256"
                              }
                            },
                            "nodeType": "BinaryOperation",
                            "operator": "-",
                            "rightExpression": {
                              "argumentTypes": null,
                              "id": 1273,
                              "name": "costLevelAfter",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1252,
                              "src": "6179:14:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_int256",
                                "typeString": "int256"
                              }
                            },
                            "src": "6161:32:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          ],
                          "id": 1271,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "lValueRequested": false,
                          "nodeType": "ElementaryTypeNameExpression",
                          "src": "6156:4:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_uint256_$",
                            "typeString": "type(uint256)"
                          },
                          "typeName": "uint"
                        },
                        "id": 1275,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "typeConversion",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "6156:38:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "/",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 1276,
                        "name": "ONE",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 887,
                        "src": "6197:3:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "6156:44:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "6147:53:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 1279,
                  "nodeType": "ExpressionStatement",
                  "src": "6147:53:4"
                }
              ]
            },
            "documentation": "@dev Returns profit for selling given number of outcome tokens\n @param market Market contract\n @param outcomeTokenIndex Index of outcome to sell\n @param outcomeTokenCount Number of outcome tokens to sell\n @return Profit",
            "id": 1281,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "calcProfit",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1178,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1173,
                  "name": "market",
                  "nodeType": "VariableDeclaration",
                  "scope": 1281,
                  "src": "4917:13:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_contract$_Market_$2296",
                    "typeString": "contract Market"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 1172,
                    "name": "Market",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 2296,
                    "src": "4917:6:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_Market_$2296",
                      "typeString": "contract Market"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1175,
                  "name": "outcomeTokenIndex",
                  "nodeType": "VariableDeclaration",
                  "scope": 1281,
                  "src": "4932:23:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint8",
                    "typeString": "uint8"
                  },
                  "typeName": {
                    "id": 1174,
                    "name": "uint8",
                    "nodeType": "ElementaryTypeName",
                    "src": "4932:5:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint8",
                      "typeString": "uint8"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1177,
                  "name": "outcomeTokenCount",
                  "nodeType": "VariableDeclaration",
                  "scope": 1281,
                  "src": "4957:22:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1176,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "4957:4:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "4916:64:4"
            },
            "returnParameters": {
              "id": 1181,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1180,
                  "name": "profit",
                  "nodeType": "VariableDeclaration",
                  "scope": 1281,
                  "src": "5026:11:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1179,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "5026:4:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "5025:13:4"
            },
            "scope": 1561,
            "src": "4897:1310:4",
            "stateMutability": "view",
            "superFunction": 1586,
            "visibility": "public"
          },
          {
            "body": {
              "id": 1348,
              "nodeType": "Block",
              "src": "6579:731:4",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "id": 1297,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [],
                          "expression": {
                            "argumentTypes": [],
                            "expression": {
                              "argumentTypes": null,
                              "arguments": [],
                              "expression": {
                                "argumentTypes": [],
                                "expression": {
                                  "argumentTypes": null,
                                  "id": 1291,
                                  "name": "market",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1283,
                                  "src": "6597:6:4",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_Market_$2296",
                                    "typeString": "contract Market"
                                  }
                                },
                                "id": 1292,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "eventContract",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 2214,
                                "src": "6597:20:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_function_external_view$__$returns$_t_contract$_Event_$392_$",
                                  "typeString": "function () view external returns (contract Event)"
                                }
                              },
                              "id": 1293,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "functionCall",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "6597:22:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_Event_$392",
                                "typeString": "contract Event"
                              }
                            },
                            "id": 1294,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "getOutcomeCount",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 331,
                            "src": "6597:38:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_view$__$returns$_t_uint8_$",
                              "typeString": "function () view external returns (uint8)"
                            }
                          },
                          "id": 1295,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "6597:40:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "31",
                          "id": 1296,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "6640:1:4",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_1_by_1",
                            "typeString": "int_const 1"
                          },
                          "value": "1"
                        },
                        "src": "6597:44:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 1290,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        7923,
                        7924
                      ],
                      "referencedDeclaration": 7923,
                      "src": "6589:7:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 1298,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "6589:53:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1299,
                  "nodeType": "ExpressionStatement",
                  "src": "6589:53:4"
                },
                {
                  "assignments": [
                    1303
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1303,
                      "name": "netOutcomeTokensSold",
                      "nodeType": "VariableDeclaration",
                      "scope": 1348,
                      "src": "6652:33:4",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                        "typeString": "int256[]"
                      },
                      "typeName": {
                        "baseType": {
                          "id": 1301,
                          "name": "int",
                          "nodeType": "ElementaryTypeName",
                          "src": "6652:3:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 1302,
                        "length": null,
                        "nodeType": "ArrayTypeName",
                        "src": "6652:5:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                          "typeString": "int256[]"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1307,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1305,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1283,
                        "src": "6712:6:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$2296",
                          "typeString": "contract Market"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_contract$_Market_$2296",
                          "typeString": "contract Market"
                        }
                      ],
                      "id": 1304,
                      "name": "getNetOutcomeTokensSold",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1560,
                      "src": "6688:23:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_contract$_Market_$2296_$returns$_t_array$_t_int256_$dyn_memory_ptr_$",
                        "typeString": "function (contract Market) view returns (int256[] memory)"
                      }
                    },
                    "id": 1306,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "6688:31:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                      "typeString": "int256[] memory"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "6652:67:4"
                },
                {
                  "assignments": [
                    1309
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1309,
                      "name": "logN",
                      "nodeType": "VariableDeclaration",
                      "scope": 1348,
                      "src": "6729:8:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 1308,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "6729:3:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1320,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 1315,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1312,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1303,
                            "src": "6766:20:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 1313,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "length",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": null,
                          "src": "6766:27:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "*",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 1314,
                          "name": "ONE",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 887,
                          "src": "6796:3:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "6766:33:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1316,
                            "name": "Fixed192x64Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 6793,
                            "src": "6801:15:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                              "typeString": "type(library Fixed192x64Math)"
                            }
                          },
                          "id": 1317,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 5799,
                          "src": "6801:30:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$5799_$",
                            "typeString": "type(enum Fixed192x64Math.EstimationMode)"
                          }
                        },
                        "id": 1318,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "Midpoint",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "6801:39:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1310,
                        "name": "Fixed192x64Math",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 6793,
                        "src": "6740:15:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                          "typeString": "type(library Fixed192x64Math)"
                        }
                      },
                      "id": 1311,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "binaryLog",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 6566,
                      "src": "6740:25:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_delegatecall_pure$_t_uint256_$_t_enum$_EstimationMode_$5799_$returns$_t_int256_$",
                        "typeString": "function (uint256,enum Fixed192x64Math.EstimationMode) pure returns (int256)"
                      }
                    },
                    "id": 1319,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "6740:101:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "6729:112:4"
                },
                {
                  "assignments": [
                    1322
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1322,
                      "name": "funding",
                      "nodeType": "VariableDeclaration",
                      "scope": 1348,
                      "src": "6851:12:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1321,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "6851:4:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1326,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1323,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1283,
                        "src": "6866:6:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$2296",
                          "typeString": "contract Market"
                        }
                      },
                      "id": 1324,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "funding",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 2220,
                      "src": "6866:14:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                        "typeString": "function () view external returns (uint256)"
                      }
                    },
                    "id": 1325,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "6866:16:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "6851:31:4"
                },
                {
                  "assignments": [
                    1328,
                    null,
                    1330
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1328,
                      "name": "sum",
                      "nodeType": "VariableDeclaration",
                      "scope": 1348,
                      "src": "7114:8:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1327,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "7114:4:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    },
                    null,
                    {
                      "constant": false,
                      "id": 1330,
                      "name": "outcomeExpTerm",
                      "nodeType": "VariableDeclaration",
                      "scope": 1348,
                      "src": "7126:19:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1329,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "7126:4:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1340,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1332,
                        "name": "logN",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1309,
                        "src": "7162:4:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1333,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1303,
                        "src": "7168:20:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1334,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1322,
                        "src": "7190:7:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1335,
                        "name": "outcomeTokenIndex",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1285,
                        "src": "7199:17:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1336,
                            "name": "Fixed192x64Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 6793,
                            "src": "7218:15:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                              "typeString": "type(library Fixed192x64Math)"
                            }
                          },
                          "id": 1337,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 5799,
                          "src": "7218:30:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$5799_$",
                            "typeString": "type(enum Fixed192x64Math.EstimationMode)"
                          }
                        },
                        "id": 1338,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "Midpoint",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "7218:39:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        },
                        {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      ],
                      "id": 1331,
                      "name": "sumExpOffset",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1518,
                      "src": "7149:12:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_uint8_$_t_enum$_EstimationMode_$5799_$returns$_t_uint256_$_t_int256_$_t_uint256_$",
                        "typeString": "function (int256,int256[] memory,uint256,uint8,enum Fixed192x64Math.EstimationMode) pure returns (uint256,int256,uint256)"
                      }
                    },
                    "id": 1339,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "7149:109:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$_t_uint256_$_t_int256_$_t_uint256_$",
                      "typeString": "tuple(uint256,int256,uint256)"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "7113:145:4"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 1346,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 1341,
                      "name": "outcomeExpTerm",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1330,
                      "src": "7275:14:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "/",
                    "rightExpression": {
                      "argumentTypes": null,
                      "components": [
                        {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          "id": 1344,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 1342,
                            "name": "sum",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1328,
                            "src": "7293:3:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "/",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 1343,
                            "name": "ONE",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 887,
                            "src": "7299:3:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "7293:9:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        }
                      ],
                      "id": 1345,
                      "isConstant": false,
                      "isInlineArray": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "nodeType": "TupleExpression",
                      "src": "7292:11:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "7275:28:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "functionReturnParameters": 1289,
                  "id": 1347,
                  "nodeType": "Return",
                  "src": "7268:35:4"
                }
              ]
            },
            "documentation": "@dev Returns marginal price of an outcome\n @param market Market contract\n @param outcomeTokenIndex Index of outcome to determine marginal price of\n @return Marginal price of an outcome as a fixed point number",
            "id": 1349,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "calcMarginalPrice",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1286,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1283,
                  "name": "market",
                  "nodeType": "VariableDeclaration",
                  "scope": 1349,
                  "src": "6478:13:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_contract$_Market_$2296",
                    "typeString": "contract Market"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 1282,
                    "name": "Market",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 2296,
                    "src": "6478:6:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_Market_$2296",
                      "typeString": "contract Market"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1285,
                  "name": "outcomeTokenIndex",
                  "nodeType": "VariableDeclaration",
                  "scope": 1349,
                  "src": "6493:23:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint8",
                    "typeString": "uint8"
                  },
                  "typeName": {
                    "id": 1284,
                    "name": "uint8",
                    "nodeType": "ElementaryTypeName",
                    "src": "6493:5:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint8",
                      "typeString": "uint8"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6477:40:4"
            },
            "returnParameters": {
              "id": 1289,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1288,
                  "name": "price",
                  "nodeType": "VariableDeclaration",
                  "scope": 1349,
                  "src": "6563:10:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1287,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "6563:4:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6562:12:4"
            },
            "scope": 1561,
            "src": "6451:859:4",
            "stateMutability": "view",
            "superFunction": 1605,
            "visibility": "public"
          },
          {
            "body": {
              "id": 1407,
              "nodeType": "Block",
              "src": "7880:524:4",
              "statements": [
                {
                  "assignments": [
                    1364,
                    1366,
                    null
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1364,
                      "name": "sum",
                      "nodeType": "VariableDeclaration",
                      "scope": 1407,
                      "src": "8120:8:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1363,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "8120:4:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    },
                    {
                      "constant": false,
                      "id": 1366,
                      "name": "offset",
                      "nodeType": "VariableDeclaration",
                      "scope": 1407,
                      "src": "8130:10:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 1365,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "8130:3:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    },
                    null
                  ],
                  "id": 1374,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1368,
                        "name": "logN",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1351,
                        "src": "8159:4:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1369,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1354,
                        "src": "8165:20:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1370,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1356,
                        "src": "8187:7:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "30",
                        "id": 1371,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "8196:1:4",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_0_by_1",
                          "typeString": "int_const 0"
                        },
                        "value": "0"
                      },
                      {
                        "argumentTypes": null,
                        "id": 1372,
                        "name": "estimationMode",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1358,
                        "src": "8199:14:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        },
                        {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_rational_0_by_1",
                          "typeString": "int_const 0"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      ],
                      "id": 1367,
                      "name": "sumExpOffset",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1518,
                      "src": "8146:12:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_uint8_$_t_enum$_EstimationMode_$5799_$returns$_t_uint256_$_t_int256_$_t_uint256_$",
                        "typeString": "function (int256,int256[] memory,uint256,uint8,enum Fixed192x64Math.EstimationMode) pure returns (uint256,int256,uint256)"
                      }
                    },
                    "id": 1373,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "8146:68:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$_t_uint256_$_t_int256_$_t_uint256_$",
                      "typeString": "tuple(uint256,int256,uint256)"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "8119:95:4"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1381,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1375,
                      "name": "costLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1361,
                      "src": "8224:9:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "id": 1378,
                          "name": "sum",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1364,
                          "src": "8262:3:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        {
                          "argumentTypes": null,
                          "id": 1379,
                          "name": "estimationMode",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1358,
                          "src": "8267:14:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_enum$_EstimationMode_$5799",
                            "typeString": "enum Fixed192x64Math.EstimationMode"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          {
                            "typeIdentifier": "t_enum$_EstimationMode_$5799",
                            "typeString": "enum Fixed192x64Math.EstimationMode"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "id": 1376,
                          "name": "Fixed192x64Math",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 6793,
                          "src": "8236:15:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                            "typeString": "type(library Fixed192x64Math)"
                          }
                        },
                        "id": 1377,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "binaryLog",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 6566,
                        "src": "8236:25:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_delegatecall_pure$_t_uint256_$_t_enum$_EstimationMode_$5799_$returns$_t_int256_$",
                          "typeString": "function (uint256,enum Fixed192x64Math.EstimationMode) pure returns (int256)"
                        }
                      },
                      "id": 1380,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "8236:46:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "8224:58:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 1382,
                  "nodeType": "ExpressionStatement",
                  "src": "8224:58:4"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1388,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1383,
                      "name": "costLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1361,
                      "src": "8292:9:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "id": 1386,
                          "name": "offset",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1366,
                          "src": "8318:6:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "id": 1384,
                          "name": "costLevel",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1361,
                          "src": "8304:9:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 1385,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "add",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 7247,
                        "src": "8304:13:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                          "typeString": "function (int256,int256) pure returns (int256)"
                        }
                      },
                      "id": 1387,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "8304:21:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "8292:33:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 1389,
                  "nodeType": "ExpressionStatement",
                  "src": "8292:33:4"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1405,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1390,
                      "name": "costLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1361,
                      "src": "8335:9:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 1402,
                              "name": "funding",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1356,
                              "src": "8388:7:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 1401,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "8384:3:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_int256_$",
                              "typeString": "type(int256)"
                            },
                            "typeName": "int"
                          },
                          "id": 1403,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "8384:12:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "components": [
                            {
                              "argumentTypes": null,
                              "commonType": {
                                "typeIdentifier": "t_int256",
                                "typeString": "int256"
                              },
                              "id": 1398,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "leftExpression": {
                                "argumentTypes": null,
                                "arguments": [
                                  {
                                    "argumentTypes": null,
                                    "arguments": [
                                      {
                                        "argumentTypes": null,
                                        "id": 1394,
                                        "name": "ONE",
                                        "nodeType": "Identifier",
                                        "overloadedDeclarations": [],
                                        "referencedDeclaration": 887,
                                        "src": "8366:3:4",
                                        "typeDescriptions": {
                                          "typeIdentifier": "t_uint256",
                                          "typeString": "uint256"
                                        }
                                      }
                                    ],
                                    "expression": {
                                      "argumentTypes": [
                                        {
                                          "typeIdentifier": "t_uint256",
                                          "typeString": "uint256"
                                        }
                                      ],
                                      "id": 1393,
                                      "isConstant": false,
                                      "isLValue": false,
                                      "isPure": true,
                                      "lValueRequested": false,
                                      "nodeType": "ElementaryTypeNameExpression",
                                      "src": "8362:3:4",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_type$_t_int256_$",
                                        "typeString": "type(int256)"
                                      },
                                      "typeName": "int"
                                    },
                                    "id": 1395,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": true,
                                    "kind": "typeConversion",
                                    "lValueRequested": false,
                                    "names": [],
                                    "nodeType": "FunctionCall",
                                    "src": "8362:8:4",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_int256",
                                      "typeString": "int256"
                                    }
                                  }
                                ],
                                "expression": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_int256",
                                      "typeString": "int256"
                                    }
                                  ],
                                  "expression": {
                                    "argumentTypes": null,
                                    "id": 1391,
                                    "name": "costLevel",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 1361,
                                    "src": "8348:9:4",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_int256",
                                      "typeString": "int256"
                                    }
                                  },
                                  "id": 1392,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "mul",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 7130,
                                  "src": "8348:13:4",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                                    "typeString": "function (int256,int256) pure returns (int256)"
                                  }
                                },
                                "id": 1396,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "8348:23:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                }
                              },
                              "nodeType": "BinaryOperation",
                              "operator": "/",
                              "rightExpression": {
                                "argumentTypes": null,
                                "id": 1397,
                                "name": "logN",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 1351,
                                "src": "8374:4:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                }
                              },
                              "src": "8348:30:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_int256",
                                "typeString": "int256"
                              }
                            }
                          ],
                          "id": 1399,
                          "isConstant": false,
                          "isInlineArray": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "nodeType": "TupleExpression",
                          "src": "8347:32:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 1400,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "mul",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 7130,
                        "src": "8347:36:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                          "typeString": "function (int256,int256) pure returns (int256)"
                        }
                      },
                      "id": 1404,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "8347:50:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "8335:62:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 1406,
                  "nodeType": "ExpressionStatement",
                  "src": "8335:62:4"
                }
              ]
            },
            "documentation": "@dev Calculates the result of the LMSR cost function which is used to\n      derive prices from the market state\n @param logN Logarithm of the number of outcomes\n @param netOutcomeTokensSold Net outcome tokens sold by market\n @param funding Initial funding for market\n @return Cost level",
            "id": 1408,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "calcCostLevel",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1359,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1351,
                  "name": "logN",
                  "nodeType": "VariableDeclaration",
                  "scope": 1408,
                  "src": "7710:8:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_int256",
                    "typeString": "int256"
                  },
                  "typeName": {
                    "id": 1350,
                    "name": "int",
                    "nodeType": "ElementaryTypeName",
                    "src": "7710:3:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1354,
                  "name": "netOutcomeTokensSold",
                  "nodeType": "VariableDeclaration",
                  "scope": 1408,
                  "src": "7720:33:4",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                    "typeString": "int256[]"
                  },
                  "typeName": {
                    "baseType": {
                      "id": 1352,
                      "name": "int",
                      "nodeType": "ElementaryTypeName",
                      "src": "7720:3:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 1353,
                    "length": null,
                    "nodeType": "ArrayTypeName",
                    "src": "7720:5:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                      "typeString": "int256[]"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1356,
                  "name": "funding",
                  "nodeType": "VariableDeclaration",
                  "scope": 1408,
                  "src": "7755:12:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1355,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "7755:4:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1358,
                  "name": "estimationMode",
                  "nodeType": "VariableDeclaration",
                  "scope": 1408,
                  "src": "7769:45:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_enum$_EstimationMode_$5799",
                    "typeString": "enum Fixed192x64Math.EstimationMode"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 1357,
                    "name": "Fixed192x64Math.EstimationMode",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 5799,
                    "src": "7769:30:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_enum$_EstimationMode_$5799",
                      "typeString": "enum Fixed192x64Math.EstimationMode"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "7709:106:4"
            },
            "returnParameters": {
              "id": 1362,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1361,
                  "name": "costLevel",
                  "nodeType": "VariableDeclaration",
                  "scope": 1408,
                  "src": "7861:13:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_int256",
                    "typeString": "int256"
                  },
                  "typeName": {
                    "id": 1360,
                    "name": "int",
                    "nodeType": "ElementaryTypeName",
                    "src": "7861:3:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "7860:15:4"
            },
            "scope": 1561,
            "src": "7687:717:4",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "private"
          },
          {
            "body": {
              "id": 1517,
              "nodeType": "Block",
              "src": "9191:1371:4",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        "id": 1437,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          },
                          "id": 1431,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 1429,
                            "name": "logN",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1410,
                            "src": "10051:4:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": ">=",
                          "rightExpression": {
                            "argumentTypes": null,
                            "hexValue": "30",
                            "id": 1430,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "10059:1:4",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_0_by_1",
                              "typeString": "int_const 0"
                            },
                            "value": "0"
                          },
                          "src": "10051:9:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "&&",
                        "rightExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          },
                          "id": 1436,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "id": 1433,
                                "name": "funding",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 1415,
                                "src": "10068:7:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              ],
                              "id": 1432,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "lValueRequested": false,
                              "nodeType": "ElementaryTypeNameExpression",
                              "src": "10064:3:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_type$_t_int256_$",
                                "typeString": "type(int256)"
                              },
                              "typeName": "int"
                            },
                            "id": 1434,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "typeConversion",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "10064:12:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": ">=",
                          "rightExpression": {
                            "argumentTypes": null,
                            "hexValue": "30",
                            "id": 1435,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "10080:1:4",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_0_by_1",
                              "typeString": "int_const 0"
                            },
                            "value": "0"
                          },
                          "src": "10064:17:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "src": "10051:30:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 1428,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        7923,
                        7924
                      ],
                      "referencedDeclaration": 7923,
                      "src": "10043:7:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 1438,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "10043:39:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1439,
                  "nodeType": "ExpressionStatement",
                  "src": "10043:39:4"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1445,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1440,
                      "name": "offset",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1424,
                      "src": "10092:6:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "id": 1443,
                          "name": "netOutcomeTokensSold",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1413,
                          "src": "10121:20:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                            "typeString": "int256[] memory"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                            "typeString": "int256[] memory"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "id": 1441,
                          "name": "Fixed192x64Math",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 6793,
                          "src": "10101:15:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                            "typeString": "type(library Fixed192x64Math)"
                          }
                        },
                        "id": 1442,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "max",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 6792,
                        "src": "10101:19:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_delegatecall_pure$_t_array$_t_int256_$dyn_memory_ptr_$returns$_t_int256_$",
                          "typeString": "function (int256[] memory) pure returns (int256)"
                        }
                      },
                      "id": 1444,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "10101:41:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "10092:50:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 1446,
                  "nodeType": "ExpressionStatement",
                  "src": "10092:50:4"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1456,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1447,
                      "name": "offset",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1424,
                      "src": "10152:6:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "id": 1455,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 1450,
                            "name": "logN",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1410,
                            "src": "10172:4:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          ],
                          "expression": {
                            "argumentTypes": null,
                            "id": 1448,
                            "name": "offset",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1424,
                            "src": "10161:6:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "id": 1449,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "mul",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 7130,
                          "src": "10161:10:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                            "typeString": "function (int256,int256) pure returns (int256)"
                          }
                        },
                        "id": 1451,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "10161:16:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "/",
                      "rightExpression": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 1453,
                            "name": "funding",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1415,
                            "src": "10184:7:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          ],
                          "id": 1452,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "lValueRequested": false,
                          "nodeType": "ElementaryTypeNameExpression",
                          "src": "10180:3:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_int256_$",
                            "typeString": "type(int256)"
                          },
                          "typeName": "int"
                        },
                        "id": 1454,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "typeConversion",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "10180:12:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "src": "10161:31:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "10152:40:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 1457,
                  "nodeType": "ExpressionStatement",
                  "src": "10152:40:4"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1463,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1458,
                      "name": "offset",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1424,
                      "src": "10202:6:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "id": 1461,
                          "name": "EXP_LIMIT",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 890,
                          "src": "10222:9:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "id": 1459,
                          "name": "offset",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1424,
                          "src": "10211:6:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 1460,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sub",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 7208,
                        "src": "10211:10:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                          "typeString": "function (int256,int256) pure returns (int256)"
                        }
                      },
                      "id": 1462,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "10211:21:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "10202:30:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 1464,
                  "nodeType": "ExpressionStatement",
                  "src": "10202:30:4"
                },
                {
                  "assignments": [
                    1466
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1466,
                      "name": "term",
                      "nodeType": "VariableDeclaration",
                      "scope": 1517,
                      "src": "10242:9:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1465,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "10242:4:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1467,
                  "initialValue": null,
                  "nodeType": "VariableDeclarationStatement",
                  "src": "10242:9:4"
                },
                {
                  "body": {
                    "id": 1515,
                    "nodeType": "Block",
                    "src": "10317:239:4",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 1498,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 1479,
                            "name": "term",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1466,
                            "src": "10331:4:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "arguments": [
                                  {
                                    "argumentTypes": null,
                                    "id": 1494,
                                    "name": "offset",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 1424,
                                    "src": "10414:6:4",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_int256",
                                      "typeString": "int256"
                                    }
                                  }
                                ],
                                "expression": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_int256",
                                      "typeString": "int256"
                                    }
                                  ],
                                  "expression": {
                                    "argumentTypes": null,
                                    "components": [
                                      {
                                        "argumentTypes": null,
                                        "commonType": {
                                          "typeIdentifier": "t_int256",
                                          "typeString": "int256"
                                        },
                                        "id": 1491,
                                        "isConstant": false,
                                        "isLValue": false,
                                        "isPure": false,
                                        "lValueRequested": false,
                                        "leftExpression": {
                                          "argumentTypes": null,
                                          "arguments": [
                                            {
                                              "argumentTypes": null,
                                              "id": 1486,
                                              "name": "logN",
                                              "nodeType": "Identifier",
                                              "overloadedDeclarations": [],
                                              "referencedDeclaration": 1410,
                                              "src": "10388:4:4",
                                              "typeDescriptions": {
                                                "typeIdentifier": "t_int256",
                                                "typeString": "int256"
                                              }
                                            }
                                          ],
                                          "expression": {
                                            "argumentTypes": [
                                              {
                                                "typeIdentifier": "t_int256",
                                                "typeString": "int256"
                                              }
                                            ],
                                            "expression": {
                                              "argumentTypes": null,
                                              "baseExpression": {
                                                "argumentTypes": null,
                                                "id": 1482,
                                                "name": "netOutcomeTokensSold",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 1413,
                                                "src": "10360:20:4",
                                                "typeDescriptions": {
                                                  "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                                                  "typeString": "int256[] memory"
                                                }
                                              },
                                              "id": 1484,
                                              "indexExpression": {
                                                "argumentTypes": null,
                                                "id": 1483,
                                                "name": "i",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 1469,
                                                "src": "10381:1:4",
                                                "typeDescriptions": {
                                                  "typeIdentifier": "t_uint8",
                                                  "typeString": "uint8"
                                                }
                                              },
                                              "isConstant": false,
                                              "isLValue": true,
                                              "isPure": false,
                                              "lValueRequested": false,
                                              "nodeType": "IndexAccess",
                                              "src": "10360:23:4",
                                              "typeDescriptions": {
                                                "typeIdentifier": "t_int256",
                                                "typeString": "int256"
                                              }
                                            },
                                            "id": 1485,
                                            "isConstant": false,
                                            "isLValue": false,
                                            "isPure": false,
                                            "lValueRequested": false,
                                            "memberName": "mul",
                                            "nodeType": "MemberAccess",
                                            "referencedDeclaration": 7130,
                                            "src": "10360:27:4",
                                            "typeDescriptions": {
                                              "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                                              "typeString": "function (int256,int256) pure returns (int256)"
                                            }
                                          },
                                          "id": 1487,
                                          "isConstant": false,
                                          "isLValue": false,
                                          "isPure": false,
                                          "kind": "functionCall",
                                          "lValueRequested": false,
                                          "names": [],
                                          "nodeType": "FunctionCall",
                                          "src": "10360:33:4",
                                          "typeDescriptions": {
                                            "typeIdentifier": "t_int256",
                                            "typeString": "int256"
                                          }
                                        },
                                        "nodeType": "BinaryOperation",
                                        "operator": "/",
                                        "rightExpression": {
                                          "argumentTypes": null,
                                          "arguments": [
                                            {
                                              "argumentTypes": null,
                                              "id": 1489,
                                              "name": "funding",
                                              "nodeType": "Identifier",
                                              "overloadedDeclarations": [],
                                              "referencedDeclaration": 1415,
                                              "src": "10400:7:4",
                                              "typeDescriptions": {
                                                "typeIdentifier": "t_uint256",
                                                "typeString": "uint256"
                                              }
                                            }
                                          ],
                                          "expression": {
                                            "argumentTypes": [
                                              {
                                                "typeIdentifier": "t_uint256",
                                                "typeString": "uint256"
                                              }
                                            ],
                                            "id": 1488,
                                            "isConstant": false,
                                            "isLValue": false,
                                            "isPure": true,
                                            "lValueRequested": false,
                                            "nodeType": "ElementaryTypeNameExpression",
                                            "src": "10396:3:4",
                                            "typeDescriptions": {
                                              "typeIdentifier": "t_type$_t_int256_$",
                                              "typeString": "type(int256)"
                                            },
                                            "typeName": "int"
                                          },
                                          "id": 1490,
                                          "isConstant": false,
                                          "isLValue": false,
                                          "isPure": false,
                                          "kind": "typeConversion",
                                          "lValueRequested": false,
                                          "names": [],
                                          "nodeType": "FunctionCall",
                                          "src": "10396:12:4",
                                          "typeDescriptions": {
                                            "typeIdentifier": "t_int256",
                                            "typeString": "int256"
                                          }
                                        },
                                        "src": "10360:48:4",
                                        "typeDescriptions": {
                                          "typeIdentifier": "t_int256",
                                          "typeString": "int256"
                                        }
                                      }
                                    ],
                                    "id": 1492,
                                    "isConstant": false,
                                    "isInlineArray": false,
                                    "isLValue": false,
                                    "isPure": false,
                                    "lValueRequested": false,
                                    "nodeType": "TupleExpression",
                                    "src": "10359:50:4",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_int256",
                                      "typeString": "int256"
                                    }
                                  },
                                  "id": 1493,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "sub",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 7208,
                                  "src": "10359:54:4",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                                    "typeString": "function (int256,int256) pure returns (int256)"
                                  }
                                },
                                "id": 1495,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "10359:62:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                }
                              },
                              {
                                "argumentTypes": null,
                                "id": 1496,
                                "name": "estimationMode",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 1419,
                                "src": "10423:14:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_enum$_EstimationMode_$5799",
                                  "typeString": "enum Fixed192x64Math.EstimationMode"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                },
                                {
                                  "typeIdentifier": "t_enum$_EstimationMode_$5799",
                                  "typeString": "enum Fixed192x64Math.EstimationMode"
                                }
                              ],
                              "expression": {
                                "argumentTypes": null,
                                "id": 1480,
                                "name": "Fixed192x64Math",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 6793,
                                "src": "10338:15:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                                  "typeString": "type(library Fixed192x64Math)"
                                }
                              },
                              "id": 1481,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "pow2",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 5906,
                              "src": "10338:20:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_delegatecall_pure$_t_int256_$_t_enum$_EstimationMode_$5799_$returns$_t_uint256_$",
                                "typeString": "function (int256,enum Fixed192x64Math.EstimationMode) pure returns (uint256)"
                              }
                            },
                            "id": 1497,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "10338:100:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "10331:107:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 1499,
                        "nodeType": "ExpressionStatement",
                        "src": "10331:107:4"
                      },
                      {
                        "condition": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          },
                          "id": 1502,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 1500,
                            "name": "i",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1469,
                            "src": "10456:1:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "==",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 1501,
                            "name": "outcomeIndex",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1417,
                            "src": "10461:12:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          },
                          "src": "10456:17:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "falseBody": null,
                        "id": 1507,
                        "nodeType": "IfStatement",
                        "src": "10452:60:4",
                        "trueBody": {
                          "expression": {
                            "argumentTypes": null,
                            "id": 1505,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftHandSide": {
                              "argumentTypes": null,
                              "id": 1503,
                              "name": "outcomeExpTerm",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1426,
                              "src": "10491:14:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "nodeType": "Assignment",
                            "operator": "=",
                            "rightHandSide": {
                              "argumentTypes": null,
                              "id": 1504,
                              "name": "term",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1466,
                              "src": "10508:4:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "src": "10491:21:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "id": 1506,
                          "nodeType": "ExpressionStatement",
                          "src": "10491:21:4"
                        }
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 1513,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 1508,
                            "name": "sum",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1422,
                            "src": "10526:3:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "id": 1511,
                                "name": "term",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 1466,
                                "src": "10540:4:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              ],
                              "expression": {
                                "argumentTypes": null,
                                "id": 1509,
                                "name": "sum",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 1422,
                                "src": "10532:3:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "id": 1510,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "add",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 7275,
                              "src": "10532:7:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                                "typeString": "function (uint256,uint256) pure returns (uint256)"
                              }
                            },
                            "id": 1512,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "10532:13:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "10526:19:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 1514,
                        "nodeType": "ExpressionStatement",
                        "src": "10526:19:4"
                      }
                    ]
                  },
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 1475,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 1472,
                      "name": "i",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1469,
                      "src": "10279:1:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint8",
                        "typeString": "uint8"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 1473,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1413,
                        "src": "10283:20:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      "id": 1474,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "length",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": null,
                      "src": "10283:27:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "10279:31:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "id": 1516,
                  "initializationExpression": {
                    "assignments": [
                      1469
                    ],
                    "declarations": [
                      {
                        "constant": false,
                        "id": 1469,
                        "name": "i",
                        "nodeType": "VariableDeclaration",
                        "scope": 1516,
                        "src": "10266:7:4",
                        "stateVariable": false,
                        "storageLocation": "default",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "typeName": {
                          "id": 1468,
                          "name": "uint8",
                          "nodeType": "ElementaryTypeName",
                          "src": "10266:5:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "value": null,
                        "visibility": "internal"
                      }
                    ],
                    "id": 1471,
                    "initialValue": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 1470,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "10276:1:4",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "nodeType": "VariableDeclarationStatement",
                    "src": "10266:11:4"
                  },
                  "loopExpression": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1477,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "nodeType": "UnaryOperation",
                      "operator": "++",
                      "prefix": false,
                      "src": "10312:3:4",
                      "subExpression": {
                        "argumentTypes": null,
                        "id": 1476,
                        "name": "i",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1469,
                        "src": "10312:1:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      },
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint8",
                        "typeString": "uint8"
                      }
                    },
                    "id": 1478,
                    "nodeType": "ExpressionStatement",
                    "src": "10312:3:4"
                  },
                  "nodeType": "ForStatement",
                  "src": "10261:295:4"
                }
              ]
            },
            "documentation": "@dev Calculates sum(exp(q/b - offset) for q in quantities), where offset is set\n      so that the sum fits in 248-256 bits\n @param logN Logarithm of the number of outcomes\n @param netOutcomeTokensSold Net outcome tokens sold by market\n @param funding Initial funding for market\n @param outcomeIndex Index of exponential term to extract (for use by marginal price function)\n @return A result structure composed of the sum, the offset used, and the summand associated with the supplied index",
            "id": 1518,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "sumExpOffset",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1420,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1410,
                  "name": "logN",
                  "nodeType": "VariableDeclaration",
                  "scope": 1518,
                  "src": "8972:8:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_int256",
                    "typeString": "int256"
                  },
                  "typeName": {
                    "id": 1409,
                    "name": "int",
                    "nodeType": "ElementaryTypeName",
                    "src": "8972:3:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1413,
                  "name": "netOutcomeTokensSold",
                  "nodeType": "VariableDeclaration",
                  "scope": 1518,
                  "src": "8982:33:4",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                    "typeString": "int256[]"
                  },
                  "typeName": {
                    "baseType": {
                      "id": 1411,
                      "name": "int",
                      "nodeType": "ElementaryTypeName",
                      "src": "8982:3:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 1412,
                    "length": null,
                    "nodeType": "ArrayTypeName",
                    "src": "8982:5:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                      "typeString": "int256[]"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1415,
                  "name": "funding",
                  "nodeType": "VariableDeclaration",
                  "scope": 1518,
                  "src": "9017:12:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1414,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "9017:4:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1417,
                  "name": "outcomeIndex",
                  "nodeType": "VariableDeclaration",
                  "scope": 1518,
                  "src": "9031:18:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint8",
                    "typeString": "uint8"
                  },
                  "typeName": {
                    "id": 1416,
                    "name": "uint8",
                    "nodeType": "ElementaryTypeName",
                    "src": "9031:5:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint8",
                      "typeString": "uint8"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1419,
                  "name": "estimationMode",
                  "nodeType": "VariableDeclaration",
                  "scope": 1518,
                  "src": "9051:45:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_enum$_EstimationMode_$5799",
                    "typeString": "enum Fixed192x64Math.EstimationMode"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 1418,
                    "name": "Fixed192x64Math.EstimationMode",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 5799,
                    "src": "9051:30:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_enum$_EstimationMode_$5799",
                      "typeString": "enum Fixed192x64Math.EstimationMode"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8971:126:4"
            },
            "returnParameters": {
              "id": 1427,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1422,
                  "name": "sum",
                  "nodeType": "VariableDeclaration",
                  "scope": 1518,
                  "src": "9144:8:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1421,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "9144:4:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1424,
                  "name": "offset",
                  "nodeType": "VariableDeclaration",
                  "scope": 1518,
                  "src": "9154:10:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_int256",
                    "typeString": "int256"
                  },
                  "typeName": {
                    "id": 1423,
                    "name": "int",
                    "nodeType": "ElementaryTypeName",
                    "src": "9154:3:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1426,
                  "name": "outcomeExpTerm",
                  "nodeType": "VariableDeclaration",
                  "scope": 1518,
                  "src": "9166:19:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1425,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "9166:4:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "9143:43:4"
            },
            "scope": 1561,
            "src": "8950:1612:4",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "private"
          },
          {
            "body": {
              "id": 1559,
              "nodeType": "Block",
              "src": "11165:195:4",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1536,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1526,
                      "name": "quantities",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1524,
                      "src": "11175:10:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                        "typeString": "int256[] memory"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "arguments": [],
                          "expression": {
                            "argumentTypes": [],
                            "expression": {
                              "argumentTypes": null,
                              "arguments": [],
                              "expression": {
                                "argumentTypes": [],
                                "expression": {
                                  "argumentTypes": null,
                                  "id": 1530,
                                  "name": "market",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1520,
                                  "src": "11198:6:4",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_Market_$2296",
                                    "typeString": "contract Market"
                                  }
                                },
                                "id": 1531,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "eventContract",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 2214,
                                "src": "11198:20:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_function_external_view$__$returns$_t_contract$_Event_$392_$",
                                  "typeString": "function () view external returns (contract Event)"
                                }
                              },
                              "id": 1532,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "functionCall",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "11198:22:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_Event_$392",
                                "typeString": "contract Event"
                              }
                            },
                            "id": 1533,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "getOutcomeCount",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 331,
                            "src": "11198:38:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_view$__$returns$_t_uint8_$",
                              "typeString": "function () view external returns (uint8)"
                            }
                          },
                          "id": 1534,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "11198:40:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        ],
                        "id": 1529,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "nodeType": "NewExpression",
                        "src": "11188:9:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_int256_$dyn_memory_$",
                          "typeString": "function (uint256) pure returns (int256[] memory)"
                        },
                        "typeName": {
                          "baseType": {
                            "id": 1527,
                            "name": "int",
                            "nodeType": "ElementaryTypeName",
                            "src": "11192:3:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "id": 1528,
                          "length": null,
                          "nodeType": "ArrayTypeName",
                          "src": "11192:5:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                            "typeString": "int256[]"
                          }
                        }
                      },
                      "id": 1535,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "11188:51:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_array$_t_int256_$dyn_memory",
                        "typeString": "int256[] memory"
                      }
                    },
                    "src": "11175:64:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                      "typeString": "int256[] memory"
                    }
                  },
                  "id": 1537,
                  "nodeType": "ExpressionStatement",
                  "src": "11175:64:4"
                },
                {
                  "body": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1556,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "baseExpression": {
                          "argumentTypes": null,
                          "id": 1549,
                          "name": "quantities",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1524,
                          "src": "11307:10:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                            "typeString": "int256[] memory"
                          }
                        },
                        "id": 1551,
                        "indexExpression": {
                          "argumentTypes": null,
                          "id": 1550,
                          "name": "i",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1539,
                          "src": "11318:1:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "isConstant": false,
                        "isLValue": true,
                        "isPure": false,
                        "lValueRequested": true,
                        "nodeType": "IndexAccess",
                        "src": "11307:13:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 1554,
                            "name": "i",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1539,
                            "src": "11351:1:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          ],
                          "expression": {
                            "argumentTypes": null,
                            "id": 1552,
                            "name": "market",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1520,
                            "src": "11323:6:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_contract$_Market_$2296",
                              "typeString": "contract Market"
                            }
                          },
                          "id": 1553,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "netOutcomeTokensSold",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 2223,
                          "src": "11323:27:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_external_view$_t_uint256_$returns$_t_int256_$",
                            "typeString": "function (uint256) view external returns (int256)"
                          }
                        },
                        "id": 1555,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "11323:30:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "src": "11307:46:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 1557,
                    "nodeType": "ExpressionStatement",
                    "src": "11307:46:4"
                  },
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 1545,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 1542,
                      "name": "i",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1539,
                      "src": "11267:1:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint8",
                        "typeString": "uint8"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 1543,
                        "name": "quantities",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1524,
                        "src": "11271:10:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      "id": 1544,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "length",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": null,
                      "src": "11271:17:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "11267:21:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "id": 1558,
                  "initializationExpression": {
                    "assignments": [
                      1539
                    ],
                    "declarations": [
                      {
                        "constant": false,
                        "id": 1539,
                        "name": "i",
                        "nodeType": "VariableDeclaration",
                        "scope": 1558,
                        "src": "11254:7:4",
                        "stateVariable": false,
                        "storageLocation": "default",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "typeName": {
                          "id": 1538,
                          "name": "uint8",
                          "nodeType": "ElementaryTypeName",
                          "src": "11254:5:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "value": null,
                        "visibility": "internal"
                      }
                    ],
                    "id": 1541,
                    "initialValue": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 1540,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "11264:1:4",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "nodeType": "VariableDeclarationStatement",
                    "src": "11254:11:4"
                  },
                  "loopExpression": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1547,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "nodeType": "UnaryOperation",
                      "operator": "++",
                      "prefix": false,
                      "src": "11290:3:4",
                      "subExpression": {
                        "argumentTypes": null,
                        "id": 1546,
                        "name": "i",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1539,
                        "src": "11290:1:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      },
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint8",
                        "typeString": "uint8"
                      }
                    },
                    "id": 1548,
                    "nodeType": "ExpressionStatement",
                    "src": "11290:3:4"
                  },
                  "nodeType": "ForStatement",
                  "src": "11249:104:4"
                }
              ]
            },
            "documentation": "@dev Gets net outcome tokens sold by market. Since all sets of outcome tokens are backed by\n      corresponding collateral tokens, the net quantity of a token sold by the market is the\n      number of collateral tokens (which is the same as the number of outcome tokens the\n      market created) subtracted by the quantity of that token held by the market.\n @param market Market contract\n @return Net outcome tokens sold by market",
            "id": 1560,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "getNetOutcomeTokensSold",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1521,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1520,
                  "name": "market",
                  "nodeType": "VariableDeclaration",
                  "scope": 1560,
                  "src": "11075:13:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_contract$_Market_$2296",
                    "typeString": "contract Market"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 1519,
                    "name": "Market",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 2296,
                    "src": "11075:6:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_Market_$2296",
                      "typeString": "contract Market"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "11074:15:4"
            },
            "returnParameters": {
              "id": 1525,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1524,
                  "name": "quantities",
                  "nodeType": "VariableDeclaration",
                  "scope": 1560,
                  "src": "11136:23:4",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                    "typeString": "int256[]"
                  },
                  "typeName": {
                    "baseType": {
                      "id": 1522,
                      "name": "int",
                      "nodeType": "ElementaryTypeName",
                      "src": "11136:3:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 1523,
                    "length": null,
                    "nodeType": "ArrayTypeName",
                    "src": "11136:5:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                      "typeString": "int256[]"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "11135:25:4"
            },
            "scope": 1561,
            "src": "11042:318:4",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "private"
          }
        ],
        "scope": 1562,
        "src": "416:10946:4"
      }
    ],
    "src": "0:11362:4"
  },
  "legacyAST": {
    "absolutePath": "/home/alan/src/github.com/gnosis/pm-contracts/contracts/MarketMakers/LMSRMarketMaker.sol",
    "exportedSymbols": {
      "LMSRMarketMaker": [
        1561
      ]
    },
    "id": 1562,
    "nodeType": "SourceUnit",
    "nodes": [
      {
        "id": 872,
        "literals": [
          "solidity",
          "^",
          "0.5",
          ".0"
        ],
        "nodeType": "PragmaDirective",
        "src": "0:23:4"
      },
      {
        "absolutePath": "openzeppelin-solidity/contracts/math/SafeMath.sol",
        "file": "openzeppelin-solidity/contracts/math/SafeMath.sol",
        "id": 873,
        "nodeType": "ImportDirective",
        "scope": 1562,
        "sourceUnit": 7382,
        "src": "24:59:4",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "absolutePath": "openzeppelin-solidity/contracts/drafts/SignedSafeMath.sol",
        "file": "openzeppelin-solidity/contracts/drafts/SignedSafeMath.sol",
        "id": 874,
        "nodeType": "ImportDirective",
        "scope": 1562,
        "sourceUnit": 7249,
        "src": "84:67:4",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "absolutePath": "@gnosis.pm/util-contracts/contracts/Fixed192x64Math.sol",
        "file": "@gnosis.pm/util-contracts/contracts/Fixed192x64Math.sol",
        "id": 875,
        "nodeType": "ImportDirective",
        "scope": 1562,
        "sourceUnit": 6794,
        "src": "152:65:4",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "absolutePath": "/home/alan/src/github.com/gnosis/pm-contracts/contracts/MarketMakers/MarketMaker.sol",
        "file": "../MarketMakers/MarketMaker.sol",
        "id": 876,
        "nodeType": "ImportDirective",
        "scope": 1562,
        "sourceUnit": 1607,
        "src": "218:41:4",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "baseContracts": [
          {
            "arguments": null,
            "baseName": {
              "contractScope": null,
              "id": 877,
              "name": "MarketMaker",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 1606,
              "src": "444:11:4",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_MarketMaker_$1606",
                "typeString": "contract MarketMaker"
              }
            },
            "id": 878,
            "nodeType": "InheritanceSpecifier",
            "src": "444:11:4"
          }
        ],
        "contractDependencies": [
          1606
        ],
        "contractKind": "contract",
        "documentation": "@title LMSR market maker contract - Calculates share prices based on share distribution and initial funding\n @author Alan Lu - <alan.lu@gnosis.pm>",
        "fullyImplemented": true,
        "id": 1561,
        "linearizedBaseContracts": [
          1561,
          1606
        ],
        "name": "LMSRMarketMaker",
        "nodeType": "ContractDefinition",
        "nodes": [
          {
            "id": 881,
            "libraryName": {
              "contractScope": null,
              "id": 879,
              "name": "SignedSafeMath",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 7248,
              "src": "468:14:4",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_SignedSafeMath_$7248",
                "typeString": "library SignedSafeMath"
              }
            },
            "nodeType": "UsingForDirective",
            "src": "462:29:4",
            "typeName": {
              "id": 880,
              "name": "int",
              "nodeType": "ElementaryTypeName",
              "src": "487:3:4",
              "typeDescriptions": {
                "typeIdentifier": "t_int256",
                "typeString": "int256"
              }
            }
          },
          {
            "id": 884,
            "libraryName": {
              "contractScope": null,
              "id": 882,
              "name": "SafeMath",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 7381,
              "src": "502:8:4",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_SafeMath_$7381",
                "typeString": "library SafeMath"
              }
            },
            "nodeType": "UsingForDirective",
            "src": "496:24:4",
            "typeName": {
              "id": 883,
              "name": "uint",
              "nodeType": "ElementaryTypeName",
              "src": "515:4:4",
              "typeDescriptions": {
                "typeIdentifier": "t_uint256",
                "typeString": "uint256"
              }
            }
          },
          {
            "constant": true,
            "id": 887,
            "name": "ONE",
            "nodeType": "VariableDeclaration",
            "scope": 1561,
            "src": "559:39:4",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_uint256",
              "typeString": "uint256"
            },
            "typeName": {
              "id": 885,
              "name": "uint",
              "nodeType": "ElementaryTypeName",
              "src": "559:4:4",
              "typeDescriptions": {
                "typeIdentifier": "t_uint256",
                "typeString": "uint256"
              }
            },
            "value": {
              "argumentTypes": null,
              "hexValue": "30783130303030303030303030303030303030",
              "id": 886,
              "isConstant": false,
              "isLValue": false,
              "isPure": true,
              "kind": "number",
              "lValueRequested": false,
              "nodeType": "Literal",
              "src": "579:19:4",
              "subdenomination": null,
              "typeDescriptions": {
                "typeIdentifier": "t_rational_18446744073709551616_by_1",
                "typeString": "int_const 18446744073709551616"
              },
              "value": "0x10000000000000000"
            },
            "visibility": "internal"
          },
          {
            "constant": true,
            "id": 890,
            "name": "EXP_LIMIT",
            "nodeType": "VariableDeclaration",
            "scope": 1561,
            "src": "604:47:4",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_int256",
              "typeString": "int256"
            },
            "typeName": {
              "id": 888,
              "name": "int",
              "nodeType": "ElementaryTypeName",
              "src": "604:3:4",
              "typeDescriptions": {
                "typeIdentifier": "t_int256",
                "typeString": "int256"
              }
            },
            "value": {
              "argumentTypes": null,
              "hexValue": "33333934323030393039353632353537343937333434",
              "id": 889,
              "isConstant": false,
              "isLValue": false,
              "isPure": true,
              "kind": "number",
              "lValueRequested": false,
              "nodeType": "Literal",
              "src": "629:22:4",
              "subdenomination": null,
              "typeDescriptions": {
                "typeIdentifier": "t_rational_3394200909562557497344_by_1",
                "typeString": "int_const 3394200909562557497344"
              },
              "value": "3394200909562557497344"
            },
            "visibility": "internal"
          },
          {
            "body": {
              "id": 1034,
              "nodeType": "Block",
              "src": "1318:1442:4",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "id": 907,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [],
                          "expression": {
                            "argumentTypes": [],
                            "expression": {
                              "argumentTypes": null,
                              "arguments": [],
                              "expression": {
                                "argumentTypes": [],
                                "expression": {
                                  "argumentTypes": null,
                                  "id": 901,
                                  "name": "market",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 892,
                                  "src": "1336:6:4",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_Market_$2296",
                                    "typeString": "contract Market"
                                  }
                                },
                                "id": 902,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "eventContract",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 2214,
                                "src": "1336:20:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_function_external_view$__$returns$_t_contract$_Event_$392_$",
                                  "typeString": "function () view external returns (contract Event)"
                                }
                              },
                              "id": 903,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "functionCall",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "1336:22:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_Event_$392",
                                "typeString": "contract Event"
                              }
                            },
                            "id": 904,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "getOutcomeCount",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 331,
                            "src": "1336:38:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_view$__$returns$_t_uint8_$",
                              "typeString": "function () view external returns (uint8)"
                            }
                          },
                          "id": 905,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "1336:40:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "31",
                          "id": 906,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "1379:1:4",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_1_by_1",
                            "typeString": "int_const 1"
                          },
                          "value": "1"
                        },
                        "src": "1336:44:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 900,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        7923,
                        7924
                      ],
                      "referencedDeclaration": 7923,
                      "src": "1328:7:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 908,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1328:53:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 909,
                  "nodeType": "ExpressionStatement",
                  "src": "1328:53:4"
                },
                {
                  "assignments": [
                    913
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 913,
                      "name": "netOutcomeTokensSold",
                      "nodeType": "VariableDeclaration",
                      "scope": 1034,
                      "src": "1391:33:4",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                        "typeString": "int256[]"
                      },
                      "typeName": {
                        "baseType": {
                          "id": 911,
                          "name": "int",
                          "nodeType": "ElementaryTypeName",
                          "src": "1391:3:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 912,
                        "length": null,
                        "nodeType": "ArrayTypeName",
                        "src": "1391:5:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                          "typeString": "int256[]"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 917,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 915,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 892,
                        "src": "1451:6:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$2296",
                          "typeString": "contract Market"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_contract$_Market_$2296",
                          "typeString": "contract Market"
                        }
                      ],
                      "id": 914,
                      "name": "getNetOutcomeTokensSold",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1560,
                      "src": "1427:23:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_contract$_Market_$2296_$returns$_t_array$_t_int256_$dyn_memory_ptr_$",
                        "typeString": "function (contract Market) view returns (int256[] memory)"
                      }
                    },
                    "id": 916,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1427:31:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                      "typeString": "int256[] memory"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1391:67:4"
                },
                {
                  "assignments": [
                    919
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 919,
                      "name": "log2N",
                      "nodeType": "VariableDeclaration",
                      "scope": 1034,
                      "src": "1537:9:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 918,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "1537:3:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 930,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 925,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 922,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 913,
                            "src": "1575:20:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 923,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "length",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": null,
                          "src": "1575:27:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "*",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 924,
                          "name": "ONE",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 887,
                          "src": "1605:3:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "1575:33:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 926,
                            "name": "Fixed192x64Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 6793,
                            "src": "1610:15:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                              "typeString": "type(library Fixed192x64Math)"
                            }
                          },
                          "id": 927,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 5799,
                          "src": "1610:30:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$5799_$",
                            "typeString": "type(enum Fixed192x64Math.EstimationMode)"
                          }
                        },
                        "id": 928,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "UpperBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "1610:41:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 920,
                        "name": "Fixed192x64Math",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 6793,
                        "src": "1549:15:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                          "typeString": "type(library Fixed192x64Math)"
                        }
                      },
                      "id": 921,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "binaryLog",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 6566,
                      "src": "1549:25:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_delegatecall_pure$_t_uint256_$_t_enum$_EstimationMode_$5799_$returns$_t_int256_$",
                        "typeString": "function (uint256,enum Fixed192x64Math.EstimationMode) pure returns (int256)"
                      }
                    },
                    "id": 929,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1549:103:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1537:115:4"
                },
                {
                  "assignments": [
                    932
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 932,
                      "name": "funding",
                      "nodeType": "VariableDeclaration",
                      "scope": 1034,
                      "src": "1662:12:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 931,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "1662:4:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 936,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 933,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 892,
                        "src": "1677:6:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$2296",
                          "typeString": "contract Market"
                        }
                      },
                      "id": 934,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "funding",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 2220,
                      "src": "1677:14:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                        "typeString": "function () view external returns (uint256)"
                      }
                    },
                    "id": 935,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1677:16:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1662:31:4"
                },
                {
                  "assignments": [
                    938
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 938,
                      "name": "costLevelBefore",
                      "nodeType": "VariableDeclaration",
                      "scope": 1034,
                      "src": "1703:19:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 937,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "1703:3:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 947,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 940,
                        "name": "log2N",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 919,
                        "src": "1739:5:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 941,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 913,
                        "src": "1746:20:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 942,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 932,
                        "src": "1768:7:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 943,
                            "name": "Fixed192x64Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 6793,
                            "src": "1777:15:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                              "typeString": "type(library Fixed192x64Math)"
                            }
                          },
                          "id": 944,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 5799,
                          "src": "1777:30:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$5799_$",
                            "typeString": "type(enum Fixed192x64Math.EstimationMode)"
                          }
                        },
                        "id": 945,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "LowerBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "1777:41:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        },
                        {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      ],
                      "id": 939,
                      "name": "calcCostLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1408,
                      "src": "1725:13:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_enum$_EstimationMode_$5799_$returns$_t_int256_$",
                        "typeString": "function (int256,int256[] memory,uint256,enum Fixed192x64Math.EstimationMode) pure returns (int256)"
                      }
                    },
                    "id": 946,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1725:94:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1703:116:4"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 953,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 949,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 913,
                            "src": "1903:20:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 950,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "length",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": null,
                          "src": "1903:27:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "==",
                        "rightExpression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 951,
                            "name": "outcomeTokenAmounts",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 895,
                            "src": "1934:19:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 952,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "length",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": null,
                          "src": "1934:26:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "1903:57:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 948,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        7923,
                        7924
                      ],
                      "referencedDeclaration": 7923,
                      "src": "1895:7:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 954,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1895:66:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 955,
                  "nodeType": "ExpressionStatement",
                  "src": "1895:66:4"
                },
                {
                  "body": {
                    "id": 980,
                    "nodeType": "Block",
                    "src": "2027:102:4",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 978,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "baseExpression": {
                              "argumentTypes": null,
                              "id": 967,
                              "name": "netOutcomeTokensSold",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 913,
                              "src": "2041:20:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                                "typeString": "int256[] memory"
                              }
                            },
                            "id": 969,
                            "indexExpression": {
                              "argumentTypes": null,
                              "id": 968,
                              "name": "i",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 957,
                              "src": "2062:1:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint8",
                                "typeString": "uint8"
                              }
                            },
                            "isConstant": false,
                            "isLValue": true,
                            "isPure": false,
                            "lValueRequested": true,
                            "nodeType": "IndexAccess",
                            "src": "2041:23:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "baseExpression": {
                                  "argumentTypes": null,
                                  "id": 974,
                                  "name": "outcomeTokenAmounts",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 895,
                                  "src": "2095:19:4",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                                    "typeString": "int256[] memory"
                                  }
                                },
                                "id": 976,
                                "indexExpression": {
                                  "argumentTypes": null,
                                  "id": 975,
                                  "name": "i",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 957,
                                  "src": "2115:1:4",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_uint8",
                                    "typeString": "uint8"
                                  }
                                },
                                "isConstant": false,
                                "isLValue": true,
                                "isPure": false,
                                "lValueRequested": false,
                                "nodeType": "IndexAccess",
                                "src": "2095:22:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                }
                              ],
                              "expression": {
                                "argumentTypes": null,
                                "baseExpression": {
                                  "argumentTypes": null,
                                  "id": 970,
                                  "name": "netOutcomeTokensSold",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 913,
                                  "src": "2067:20:4",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                                    "typeString": "int256[] memory"
                                  }
                                },
                                "id": 972,
                                "indexExpression": {
                                  "argumentTypes": null,
                                  "id": 971,
                                  "name": "i",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 957,
                                  "src": "2088:1:4",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_uint8",
                                    "typeString": "uint8"
                                  }
                                },
                                "isConstant": false,
                                "isLValue": true,
                                "isPure": false,
                                "lValueRequested": false,
                                "nodeType": "IndexAccess",
                                "src": "2067:23:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                }
                              },
                              "id": 973,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "add",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 7247,
                              "src": "2067:27:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                                "typeString": "function (int256,int256) pure returns (int256)"
                              }
                            },
                            "id": 977,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "2067:51:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "src": "2041:77:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 979,
                        "nodeType": "ExpressionStatement",
                        "src": "2041:77:4"
                      }
                    ]
                  },
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 963,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 960,
                      "name": "i",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 957,
                      "src": "1989:1:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint8",
                        "typeString": "uint8"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 961,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 913,
                        "src": "1993:20:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      "id": 962,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "length",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": null,
                      "src": "1993:27:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "1989:31:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "id": 981,
                  "initializationExpression": {
                    "assignments": [
                      957
                    ],
                    "declarations": [
                      {
                        "constant": false,
                        "id": 957,
                        "name": "i",
                        "nodeType": "VariableDeclaration",
                        "scope": 981,
                        "src": "1976:7:4",
                        "stateVariable": false,
                        "storageLocation": "default",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "typeName": {
                          "id": 956,
                          "name": "uint8",
                          "nodeType": "ElementaryTypeName",
                          "src": "1976:5:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "value": null,
                        "visibility": "internal"
                      }
                    ],
                    "id": 959,
                    "initialValue": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 958,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "1986:1:4",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "nodeType": "VariableDeclarationStatement",
                    "src": "1976:11:4"
                  },
                  "loopExpression": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 965,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "nodeType": "UnaryOperation",
                      "operator": "++",
                      "prefix": false,
                      "src": "2022:3:4",
                      "subExpression": {
                        "argumentTypes": null,
                        "id": 964,
                        "name": "i",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 957,
                        "src": "2022:1:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      },
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint8",
                        "typeString": "uint8"
                      }
                    },
                    "id": 966,
                    "nodeType": "ExpressionStatement",
                    "src": "2022:3:4"
                  },
                  "nodeType": "ForStatement",
                  "src": "1971:158:4"
                },
                {
                  "assignments": [
                    983
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 983,
                      "name": "costLevelAfter",
                      "nodeType": "VariableDeclaration",
                      "scope": 1034,
                      "src": "2197:18:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 982,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "2197:3:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 992,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 985,
                        "name": "log2N",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 919,
                        "src": "2232:5:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 986,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 913,
                        "src": "2239:20:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 987,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 932,
                        "src": "2261:7:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 988,
                            "name": "Fixed192x64Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 6793,
                            "src": "2270:15:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                              "typeString": "type(library Fixed192x64Math)"
                            }
                          },
                          "id": 989,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 5799,
                          "src": "2270:30:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$5799_$",
                            "typeString": "type(enum Fixed192x64Math.EstimationMode)"
                          }
                        },
                        "id": 990,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "UpperBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "2270:41:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        },
                        {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      ],
                      "id": 984,
                      "name": "calcCostLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1408,
                      "src": "2218:13:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_enum$_EstimationMode_$5799_$returns$_t_int256_$",
                        "typeString": "function (int256,int256[] memory,uint256,enum Fixed192x64Math.EstimationMode) pure returns (int256)"
                      }
                    },
                    "id": 991,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "2218:94:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "2197:115:4"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 998,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 993,
                      "name": "netCost",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 898,
                      "src": "2395:7:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "id": 996,
                          "name": "costLevelBefore",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 938,
                          "src": "2424:15:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "id": 994,
                          "name": "costLevelAfter",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 983,
                          "src": "2405:14:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 995,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sub",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 7208,
                        "src": "2405:18:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                          "typeString": "function (int256,int256) pure returns (int256)"
                        }
                      },
                      "id": 997,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "2405:35:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "2395:45:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 999,
                  "nodeType": "ExpressionStatement",
                  "src": "2395:45:4"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    },
                    "id": 1014,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "id": 1002,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 1000,
                        "name": "netCost",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 898,
                        "src": "2589:7:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "<=",
                      "rightExpression": {
                        "argumentTypes": null,
                        "hexValue": "30",
                        "id": 1001,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "2600:1:4",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_0_by_1",
                          "typeString": "int_const 0"
                        },
                        "value": "0"
                      },
                      "src": "2589:12:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "||",
                    "rightExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "id": 1013,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        },
                        "id": 1011,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          },
                          "id": 1007,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 1003,
                            "name": "netCost",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 898,
                            "src": "2605:7:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "/",
                          "rightExpression": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "id": 1005,
                                "name": "ONE",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 887,
                                "src": "2619:3:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              ],
                              "id": 1004,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "lValueRequested": false,
                              "nodeType": "ElementaryTypeNameExpression",
                              "src": "2615:3:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_type$_t_int256_$",
                                "typeString": "type(int256)"
                              },
                              "typeName": "int"
                            },
                            "id": 1006,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "typeConversion",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "2615:8:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "src": "2605:18:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "*",
                        "rightExpression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 1009,
                              "name": "ONE",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 887,
                              "src": "2630:3:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 1008,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "2626:3:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_int256_$",
                              "typeString": "type(int256)"
                            },
                            "typeName": "int"
                          },
                          "id": 1010,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "2626:8:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "src": "2605:29:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "==",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 1012,
                        "name": "netCost",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 898,
                        "src": "2638:7:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "src": "2605:40:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      }
                    },
                    "src": "2589:56:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": {
                    "id": 1032,
                    "nodeType": "Block",
                    "src": "2697:57:4",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 1030,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 1022,
                            "name": "netCost",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 898,
                            "src": "2711:7:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "commonType": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            },
                            "id": 1029,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftExpression": {
                              "argumentTypes": null,
                              "commonType": {
                                "typeIdentifier": "t_int256",
                                "typeString": "int256"
                              },
                              "id": 1027,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "leftExpression": {
                                "argumentTypes": null,
                                "id": 1023,
                                "name": "netCost",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 898,
                                "src": "2721:7:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                }
                              },
                              "nodeType": "BinaryOperation",
                              "operator": "/",
                              "rightExpression": {
                                "argumentTypes": null,
                                "arguments": [
                                  {
                                    "argumentTypes": null,
                                    "id": 1025,
                                    "name": "ONE",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 887,
                                    "src": "2735:3:4",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  }
                                ],
                                "expression": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  ],
                                  "id": 1024,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": true,
                                  "lValueRequested": false,
                                  "nodeType": "ElementaryTypeNameExpression",
                                  "src": "2731:3:4",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_type$_t_int256_$",
                                    "typeString": "type(int256)"
                                  },
                                  "typeName": "int"
                                },
                                "id": 1026,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": true,
                                "kind": "typeConversion",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "2731:8:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                }
                              },
                              "src": "2721:18:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_int256",
                                "typeString": "int256"
                              }
                            },
                            "nodeType": "BinaryOperation",
                            "operator": "+",
                            "rightExpression": {
                              "argumentTypes": null,
                              "hexValue": "31",
                              "id": 1028,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "number",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "2742:1:4",
                              "subdenomination": null,
                              "typeDescriptions": {
                                "typeIdentifier": "t_rational_1_by_1",
                                "typeString": "int_const 1"
                              },
                              "value": "1"
                            },
                            "src": "2721:22:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "src": "2711:32:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 1031,
                        "nodeType": "ExpressionStatement",
                        "src": "2711:32:4"
                      }
                    ]
                  },
                  "id": 1033,
                  "nodeType": "IfStatement",
                  "src": "2586:168:4",
                  "trueBody": {
                    "id": 1021,
                    "nodeType": "Block",
                    "src": "2647:44:4",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 1019,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 1015,
                            "name": "netCost",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 898,
                            "src": "2661:7:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "/=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "id": 1017,
                                "name": "ONE",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 887,
                                "src": "2676:3:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              ],
                              "id": 1016,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "lValueRequested": false,
                              "nodeType": "ElementaryTypeNameExpression",
                              "src": "2672:3:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_type$_t_int256_$",
                                "typeString": "type(int256)"
                              },
                              "typeName": "int"
                            },
                            "id": 1018,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "typeConversion",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "2672:8:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "src": "2661:19:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 1020,
                        "nodeType": "ExpressionStatement",
                        "src": "2661:19:4"
                      }
                    ]
                  }
                }
              ]
            },
            "documentation": "@dev Calculates the net cost for executing a given trade.\n @param market Market contract\n @param outcomeTokenAmounts Amounts of outcome tokens to buy from the market. If an amount is negative, represents an amount to sell to the market.\n @return Net cost of trade. If positive, represents amount of collateral which would be paid to the market for the trade. If negative, represents amount of collateral which would be received from the market for the trade.",
            "id": 1035,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "calcNetCost",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 896,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 892,
                  "name": "market",
                  "nodeType": "VariableDeclaration",
                  "scope": 1035,
                  "src": "1207:13:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_contract$_Market_$2296",
                    "typeString": "contract Market"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 891,
                    "name": "Market",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 2296,
                    "src": "1207:6:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_Market_$2296",
                      "typeString": "contract Market"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 895,
                  "name": "outcomeTokenAmounts",
                  "nodeType": "VariableDeclaration",
                  "scope": 1035,
                  "src": "1222:32:4",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                    "typeString": "int256[]"
                  },
                  "typeName": {
                    "baseType": {
                      "id": 893,
                      "name": "int",
                      "nodeType": "ElementaryTypeName",
                      "src": "1222:3:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 894,
                    "length": null,
                    "nodeType": "ArrayTypeName",
                    "src": "1222:5:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                      "typeString": "int256[]"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1206:49:4"
            },
            "returnParameters": {
              "id": 899,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 898,
                  "name": "netCost",
                  "nodeType": "VariableDeclaration",
                  "scope": 1035,
                  "src": "1301:11:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_int256",
                    "typeString": "int256"
                  },
                  "typeName": {
                    "id": 897,
                    "name": "int",
                    "nodeType": "ElementaryTypeName",
                    "src": "1301:3:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1300:13:4"
            },
            "scope": 1561,
            "src": "1186:1574:4",
            "stateMutability": "view",
            "superFunction": 1596,
            "visibility": "public"
          },
          {
            "body": {
              "id": 1170,
              "nodeType": "Block",
              "src": "3153:1482:4",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "id": 1053,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [],
                          "expression": {
                            "argumentTypes": [],
                            "expression": {
                              "argumentTypes": null,
                              "arguments": [],
                              "expression": {
                                "argumentTypes": [],
                                "expression": {
                                  "argumentTypes": null,
                                  "id": 1047,
                                  "name": "market",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1037,
                                  "src": "3171:6:4",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_Market_$2296",
                                    "typeString": "contract Market"
                                  }
                                },
                                "id": 1048,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "eventContract",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 2214,
                                "src": "3171:20:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_function_external_view$__$returns$_t_contract$_Event_$392_$",
                                  "typeString": "function () view external returns (contract Event)"
                                }
                              },
                              "id": 1049,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "functionCall",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "3171:22:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_Event_$392",
                                "typeString": "contract Event"
                              }
                            },
                            "id": 1050,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "getOutcomeCount",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 331,
                            "src": "3171:38:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_view$__$returns$_t_uint8_$",
                              "typeString": "function () view external returns (uint8)"
                            }
                          },
                          "id": 1051,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "3171:40:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "31",
                          "id": 1052,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "3214:1:4",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_1_by_1",
                            "typeString": "int_const 1"
                          },
                          "value": "1"
                        },
                        "src": "3171:44:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 1046,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        7923,
                        7924
                      ],
                      "referencedDeclaration": 7923,
                      "src": "3163:7:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 1054,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3163:53:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1055,
                  "nodeType": "ExpressionStatement",
                  "src": "3163:53:4"
                },
                {
                  "assignments": [
                    1059
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1059,
                      "name": "netOutcomeTokensSold",
                      "nodeType": "VariableDeclaration",
                      "scope": 1170,
                      "src": "3226:33:4",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                        "typeString": "int256[]"
                      },
                      "typeName": {
                        "baseType": {
                          "id": 1057,
                          "name": "int",
                          "nodeType": "ElementaryTypeName",
                          "src": "3226:3:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 1058,
                        "length": null,
                        "nodeType": "ArrayTypeName",
                        "src": "3226:5:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                          "typeString": "int256[]"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1063,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1061,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1037,
                        "src": "3286:6:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$2296",
                          "typeString": "contract Market"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_contract$_Market_$2296",
                          "typeString": "contract Market"
                        }
                      ],
                      "id": 1060,
                      "name": "getNetOutcomeTokensSold",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1560,
                      "src": "3262:23:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_contract$_Market_$2296_$returns$_t_array$_t_int256_$dyn_memory_ptr_$",
                        "typeString": "function (contract Market) view returns (int256[] memory)"
                      }
                    },
                    "id": 1062,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3262:31:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                      "typeString": "int256[] memory"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3226:67:4"
                },
                {
                  "assignments": [
                    1065
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1065,
                      "name": "log2N",
                      "nodeType": "VariableDeclaration",
                      "scope": 1170,
                      "src": "3371:9:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 1064,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "3371:3:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1076,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 1071,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1068,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1059,
                            "src": "3409:20:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 1069,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "length",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": null,
                          "src": "3409:27:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "*",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 1070,
                          "name": "ONE",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 887,
                          "src": "3439:3:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "3409:33:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1072,
                            "name": "Fixed192x64Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 6793,
                            "src": "3444:15:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                              "typeString": "type(library Fixed192x64Math)"
                            }
                          },
                          "id": 1073,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 5799,
                          "src": "3444:30:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$5799_$",
                            "typeString": "type(enum Fixed192x64Math.EstimationMode)"
                          }
                        },
                        "id": 1074,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "UpperBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "3444:41:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1066,
                        "name": "Fixed192x64Math",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 6793,
                        "src": "3383:15:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                          "typeString": "type(library Fixed192x64Math)"
                        }
                      },
                      "id": 1067,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "binaryLog",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 6566,
                      "src": "3383:25:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_delegatecall_pure$_t_uint256_$_t_enum$_EstimationMode_$5799_$returns$_t_int256_$",
                        "typeString": "function (uint256,enum Fixed192x64Math.EstimationMode) pure returns (int256)"
                      }
                    },
                    "id": 1075,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3383:103:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3371:115:4"
                },
                {
                  "assignments": [
                    1078
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1078,
                      "name": "funding",
                      "nodeType": "VariableDeclaration",
                      "scope": 1170,
                      "src": "3496:12:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1077,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "3496:4:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1082,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1079,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1037,
                        "src": "3511:6:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$2296",
                          "typeString": "contract Market"
                        }
                      },
                      "id": 1080,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "funding",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 2220,
                      "src": "3511:14:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                        "typeString": "function () view external returns (uint256)"
                      }
                    },
                    "id": 1081,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3511:16:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3496:31:4"
                },
                {
                  "assignments": [
                    1084
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1084,
                      "name": "costLevelBefore",
                      "nodeType": "VariableDeclaration",
                      "scope": 1170,
                      "src": "3537:19:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 1083,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "3537:3:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1093,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1086,
                        "name": "log2N",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1065,
                        "src": "3573:5:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1087,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1059,
                        "src": "3580:20:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1088,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1078,
                        "src": "3602:7:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1089,
                            "name": "Fixed192x64Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 6793,
                            "src": "3611:15:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                              "typeString": "type(library Fixed192x64Math)"
                            }
                          },
                          "id": 1090,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 5799,
                          "src": "3611:30:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$5799_$",
                            "typeString": "type(enum Fixed192x64Math.EstimationMode)"
                          }
                        },
                        "id": 1091,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "LowerBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "3611:41:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        },
                        {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      ],
                      "id": 1085,
                      "name": "calcCostLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1408,
                      "src": "3559:13:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_enum$_EstimationMode_$5799_$returns$_t_int256_$",
                        "typeString": "function (int256,int256[] memory,uint256,enum Fixed192x64Math.EstimationMode) pure returns (int256)"
                      }
                    },
                    "id": 1092,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3559:94:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3537:116:4"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        },
                        "id": 1099,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 1096,
                              "name": "outcomeTokenCount",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1041,
                              "src": "3739:17:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 1095,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "3735:3:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_int256_$",
                              "typeString": "type(int256)"
                            },
                            "typeName": "int"
                          },
                          "id": 1097,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "3735:22:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">=",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "30",
                          "id": 1098,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "3761:1:4",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_0_by_1",
                            "typeString": "int_const 0"
                          },
                          "value": "0"
                        },
                        "src": "3735:27:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 1094,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        7923,
                        7924
                      ],
                      "referencedDeclaration": 7923,
                      "src": "3727:7:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 1100,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3727:36:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1101,
                  "nodeType": "ExpressionStatement",
                  "src": "3727:36:4"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1113,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "baseExpression": {
                        "argumentTypes": null,
                        "id": 1102,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1059,
                        "src": "3773:20:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      "id": 1104,
                      "indexExpression": {
                        "argumentTypes": null,
                        "id": 1103,
                        "name": "outcomeTokenIndex",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1039,
                        "src": "3794:17:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      },
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "nodeType": "IndexAccess",
                      "src": "3773:39:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 1110,
                              "name": "outcomeTokenCount",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1041,
                              "src": "3863:17:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 1109,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "3859:3:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_int256_$",
                              "typeString": "type(int256)"
                            },
                            "typeName": "int"
                          },
                          "id": 1111,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "3859:22:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "baseExpression": {
                            "argumentTypes": null,
                            "id": 1105,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1059,
                            "src": "3815:20:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 1107,
                          "indexExpression": {
                            "argumentTypes": null,
                            "id": 1106,
                            "name": "outcomeTokenIndex",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1039,
                            "src": "3836:17:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          },
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "nodeType": "IndexAccess",
                          "src": "3815:39:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 1108,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "add",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 7247,
                        "src": "3815:43:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                          "typeString": "function (int256,int256) pure returns (int256)"
                        }
                      },
                      "id": 1112,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "3815:67:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "3773:109:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 1114,
                  "nodeType": "ExpressionStatement",
                  "src": "3773:109:4"
                },
                {
                  "assignments": [
                    1116
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1116,
                      "name": "costLevelAfter",
                      "nodeType": "VariableDeclaration",
                      "scope": 1170,
                      "src": "3950:18:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 1115,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "3950:3:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1125,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1118,
                        "name": "log2N",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1065,
                        "src": "3985:5:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1119,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1059,
                        "src": "3992:20:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1120,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1078,
                        "src": "4014:7:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1121,
                            "name": "Fixed192x64Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 6793,
                            "src": "4023:15:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                              "typeString": "type(library Fixed192x64Math)"
                            }
                          },
                          "id": 1122,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 5799,
                          "src": "4023:30:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$5799_$",
                            "typeString": "type(enum Fixed192x64Math.EstimationMode)"
                          }
                        },
                        "id": 1123,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "UpperBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "4023:41:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        },
                        {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      ],
                      "id": 1117,
                      "name": "calcCostLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1408,
                      "src": "3971:13:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_enum$_EstimationMode_$5799_$returns$_t_int256_$",
                        "typeString": "function (int256,int256[] memory,uint256,enum Fixed192x64Math.EstimationMode) pure returns (int256)"
                      }
                    },
                    "id": 1124,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3971:94:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3950:115:4"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    },
                    "id": 1128,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 1126,
                      "name": "costLevelAfter",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1116,
                      "src": "4129:14:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 1127,
                      "name": "costLevelBefore",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1084,
                      "src": "4146:15:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "4129:32:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 1133,
                  "nodeType": "IfStatement",
                  "src": "4126:81:4",
                  "trueBody": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1131,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 1129,
                        "name": "costLevelAfter",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1116,
                        "src": "4175:14:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "id": 1130,
                        "name": "costLevelBefore",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1084,
                        "src": "4192:15:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "src": "4175:32:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 1132,
                    "nodeType": "ExpressionStatement",
                    "src": "4175:32:4"
                  }
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1140,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1134,
                      "name": "cost",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1044,
                      "src": "4217:4:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          },
                          "id": 1138,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 1136,
                            "name": "costLevelAfter",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1116,
                            "src": "4229:14:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "-",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 1137,
                            "name": "costLevelBefore",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1084,
                            "src": "4246:15:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "src": "4229:32:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "id": 1135,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "nodeType": "ElementaryTypeNameExpression",
                        "src": "4224:4:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_uint256_$",
                          "typeString": "type(uint256)"
                        },
                        "typeName": "uint"
                      },
                      "id": 1139,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "typeConversion",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "4224:38:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "4217:45:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 1141,
                  "nodeType": "ExpressionStatement",
                  "src": "4217:45:4"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 1148,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 1146,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 1144,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 1142,
                          "name": "cost",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1044,
                          "src": "4328:4:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "/",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 1143,
                          "name": "ONE",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 887,
                          "src": "4335:3:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "4328:10:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "*",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 1145,
                        "name": "ONE",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 887,
                        "src": "4341:3:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "4328:16:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "==",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 1147,
                      "name": "cost",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1044,
                      "src": "4348:4:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "4328:24:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1159,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 1153,
                        "name": "cost",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1044,
                        "src": "4474:4:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 1158,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          "id": 1156,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 1154,
                            "name": "cost",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1044,
                            "src": "4481:4:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "/",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 1155,
                            "name": "ONE",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 887,
                            "src": "4488:3:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "4481:10:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "+",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "31",
                          "id": 1157,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "4494:1:4",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_1_by_1",
                            "typeString": "int_const 1"
                          },
                          "value": "1"
                        },
                        "src": "4481:14:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "4474:21:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "id": 1160,
                    "nodeType": "ExpressionStatement",
                    "src": "4474:21:4"
                  },
                  "id": 1161,
                  "nodeType": "IfStatement",
                  "src": "4324:171:4",
                  "trueBody": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1151,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 1149,
                        "name": "cost",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1044,
                        "src": "4366:4:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "/=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "id": 1150,
                        "name": "ONE",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 887,
                        "src": "4374:3:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "4366:11:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "id": 1152,
                    "nodeType": "ExpressionStatement",
                    "src": "4366:11:4"
                  }
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 1164,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 1162,
                      "name": "cost",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1044,
                      "src": "4566:4:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 1163,
                      "name": "outcomeTokenCount",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1041,
                      "src": "4573:17:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "4566:24:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 1169,
                  "nodeType": "IfStatement",
                  "src": "4562:66:4",
                  "trueBody": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1167,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 1165,
                        "name": "cost",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1044,
                        "src": "4604:4:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "id": 1166,
                        "name": "outcomeTokenCount",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1041,
                        "src": "4611:17:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "4604:24:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "id": 1168,
                    "nodeType": "ExpressionStatement",
                    "src": "4604:24:4"
                  }
                }
              ]
            },
            "documentation": "@dev Returns cost to buy given number of outcome tokens\n @param market Market contract\n @param outcomeTokenIndex Index of outcome to buy\n @param outcomeTokenCount Number of outcome tokens to buy\n @return Cost",
            "id": 1171,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "calcCost",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1042,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1037,
                  "name": "market",
                  "nodeType": "VariableDeclaration",
                  "scope": 1171,
                  "src": "3029:13:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_contract$_Market_$2296",
                    "typeString": "contract Market"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 1036,
                    "name": "Market",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 2296,
                    "src": "3029:6:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_Market_$2296",
                      "typeString": "contract Market"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1039,
                  "name": "outcomeTokenIndex",
                  "nodeType": "VariableDeclaration",
                  "scope": 1171,
                  "src": "3044:23:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint8",
                    "typeString": "uint8"
                  },
                  "typeName": {
                    "id": 1038,
                    "name": "uint8",
                    "nodeType": "ElementaryTypeName",
                    "src": "3044:5:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint8",
                      "typeString": "uint8"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1041,
                  "name": "outcomeTokenCount",
                  "nodeType": "VariableDeclaration",
                  "scope": 1171,
                  "src": "3069:22:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1040,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "3069:4:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "3028:64:4"
            },
            "returnParameters": {
              "id": 1045,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1044,
                  "name": "cost",
                  "nodeType": "VariableDeclaration",
                  "scope": 1171,
                  "src": "3138:9:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1043,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "3138:4:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "3137:11:4"
            },
            "scope": 1561,
            "src": "3011:1624:4",
            "stateMutability": "view",
            "superFunction": 1575,
            "visibility": "public"
          },
          {
            "body": {
              "id": 1280,
              "nodeType": "Block",
              "src": "5043:1164:4",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "id": 1189,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [],
                          "expression": {
                            "argumentTypes": [],
                            "expression": {
                              "argumentTypes": null,
                              "arguments": [],
                              "expression": {
                                "argumentTypes": [],
                                "expression": {
                                  "argumentTypes": null,
                                  "id": 1183,
                                  "name": "market",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1173,
                                  "src": "5061:6:4",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_Market_$2296",
                                    "typeString": "contract Market"
                                  }
                                },
                                "id": 1184,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "eventContract",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 2214,
                                "src": "5061:20:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_function_external_view$__$returns$_t_contract$_Event_$392_$",
                                  "typeString": "function () view external returns (contract Event)"
                                }
                              },
                              "id": 1185,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "functionCall",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "5061:22:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_Event_$392",
                                "typeString": "contract Event"
                              }
                            },
                            "id": 1186,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "getOutcomeCount",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 331,
                            "src": "5061:38:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_view$__$returns$_t_uint8_$",
                              "typeString": "function () view external returns (uint8)"
                            }
                          },
                          "id": 1187,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "5061:40:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "31",
                          "id": 1188,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "5104:1:4",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_1_by_1",
                            "typeString": "int_const 1"
                          },
                          "value": "1"
                        },
                        "src": "5061:44:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 1182,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        7923,
                        7924
                      ],
                      "referencedDeclaration": 7923,
                      "src": "5053:7:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 1190,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "5053:53:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1191,
                  "nodeType": "ExpressionStatement",
                  "src": "5053:53:4"
                },
                {
                  "assignments": [
                    1195
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1195,
                      "name": "netOutcomeTokensSold",
                      "nodeType": "VariableDeclaration",
                      "scope": 1280,
                      "src": "5116:33:4",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                        "typeString": "int256[]"
                      },
                      "typeName": {
                        "baseType": {
                          "id": 1193,
                          "name": "int",
                          "nodeType": "ElementaryTypeName",
                          "src": "5116:3:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 1194,
                        "length": null,
                        "nodeType": "ArrayTypeName",
                        "src": "5116:5:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                          "typeString": "int256[]"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1199,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1197,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1173,
                        "src": "5176:6:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$2296",
                          "typeString": "contract Market"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_contract$_Market_$2296",
                          "typeString": "contract Market"
                        }
                      ],
                      "id": 1196,
                      "name": "getNetOutcomeTokensSold",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1560,
                      "src": "5152:23:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_contract$_Market_$2296_$returns$_t_array$_t_int256_$dyn_memory_ptr_$",
                        "typeString": "function (contract Market) view returns (int256[] memory)"
                      }
                    },
                    "id": 1198,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "5152:31:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                      "typeString": "int256[] memory"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "5116:67:4"
                },
                {
                  "assignments": [
                    1201
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1201,
                      "name": "log2N",
                      "nodeType": "VariableDeclaration",
                      "scope": 1280,
                      "src": "5261:9:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 1200,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "5261:3:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1212,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 1207,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1204,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1195,
                            "src": "5299:20:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 1205,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "length",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": null,
                          "src": "5299:27:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "*",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 1206,
                          "name": "ONE",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 887,
                          "src": "5329:3:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "5299:33:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1208,
                            "name": "Fixed192x64Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 6793,
                            "src": "5334:15:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                              "typeString": "type(library Fixed192x64Math)"
                            }
                          },
                          "id": 1209,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 5799,
                          "src": "5334:30:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$5799_$",
                            "typeString": "type(enum Fixed192x64Math.EstimationMode)"
                          }
                        },
                        "id": 1210,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "UpperBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "5334:41:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1202,
                        "name": "Fixed192x64Math",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 6793,
                        "src": "5273:15:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                          "typeString": "type(library Fixed192x64Math)"
                        }
                      },
                      "id": 1203,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "binaryLog",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 6566,
                      "src": "5273:25:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_delegatecall_pure$_t_uint256_$_t_enum$_EstimationMode_$5799_$returns$_t_int256_$",
                        "typeString": "function (uint256,enum Fixed192x64Math.EstimationMode) pure returns (int256)"
                      }
                    },
                    "id": 1211,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "5273:103:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "5261:115:4"
                },
                {
                  "assignments": [
                    1214
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1214,
                      "name": "funding",
                      "nodeType": "VariableDeclaration",
                      "scope": 1280,
                      "src": "5386:12:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1213,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "5386:4:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1218,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1215,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1173,
                        "src": "5401:6:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$2296",
                          "typeString": "contract Market"
                        }
                      },
                      "id": 1216,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "funding",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 2220,
                      "src": "5401:14:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                        "typeString": "function () view external returns (uint256)"
                      }
                    },
                    "id": 1217,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "5401:16:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "5386:31:4"
                },
                {
                  "assignments": [
                    1220
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1220,
                      "name": "costLevelBefore",
                      "nodeType": "VariableDeclaration",
                      "scope": 1280,
                      "src": "5427:19:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 1219,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "5427:3:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1229,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1222,
                        "name": "log2N",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1201,
                        "src": "5463:5:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1223,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1195,
                        "src": "5470:20:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1224,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1214,
                        "src": "5492:7:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1225,
                            "name": "Fixed192x64Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 6793,
                            "src": "5501:15:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                              "typeString": "type(library Fixed192x64Math)"
                            }
                          },
                          "id": 1226,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 5799,
                          "src": "5501:30:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$5799_$",
                            "typeString": "type(enum Fixed192x64Math.EstimationMode)"
                          }
                        },
                        "id": 1227,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "LowerBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "5501:41:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        },
                        {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      ],
                      "id": 1221,
                      "name": "calcCostLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1408,
                      "src": "5449:13:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_enum$_EstimationMode_$5799_$returns$_t_int256_$",
                        "typeString": "function (int256,int256[] memory,uint256,enum Fixed192x64Math.EstimationMode) pure returns (int256)"
                      }
                    },
                    "id": 1228,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "5449:94:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "5427:116:4"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        },
                        "id": 1235,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 1232,
                              "name": "outcomeTokenCount",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1177,
                              "src": "5640:17:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 1231,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "5636:3:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_int256_$",
                              "typeString": "type(int256)"
                            },
                            "typeName": "int"
                          },
                          "id": 1233,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "5636:22:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">=",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "30",
                          "id": 1234,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "5662:1:4",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_0_by_1",
                            "typeString": "int_const 0"
                          },
                          "value": "0"
                        },
                        "src": "5636:27:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 1230,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        7923,
                        7924
                      ],
                      "referencedDeclaration": 7923,
                      "src": "5628:7:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 1236,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "5628:36:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1237,
                  "nodeType": "ExpressionStatement",
                  "src": "5628:36:4"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1249,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "baseExpression": {
                        "argumentTypes": null,
                        "id": 1238,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1195,
                        "src": "5674:20:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      "id": 1240,
                      "indexExpression": {
                        "argumentTypes": null,
                        "id": 1239,
                        "name": "outcomeTokenIndex",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1175,
                        "src": "5695:17:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      },
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "nodeType": "IndexAccess",
                      "src": "5674:39:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 1246,
                              "name": "outcomeTokenCount",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1177,
                              "src": "5764:17:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 1245,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "5760:3:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_int256_$",
                              "typeString": "type(int256)"
                            },
                            "typeName": "int"
                          },
                          "id": 1247,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "5760:22:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "baseExpression": {
                            "argumentTypes": null,
                            "id": 1241,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1195,
                            "src": "5716:20:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 1243,
                          "indexExpression": {
                            "argumentTypes": null,
                            "id": 1242,
                            "name": "outcomeTokenIndex",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1175,
                            "src": "5737:17:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          },
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "nodeType": "IndexAccess",
                          "src": "5716:39:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 1244,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sub",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 7208,
                        "src": "5716:43:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                          "typeString": "function (int256,int256) pure returns (int256)"
                        }
                      },
                      "id": 1248,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "5716:67:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "5674:109:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 1250,
                  "nodeType": "ExpressionStatement",
                  "src": "5674:109:4"
                },
                {
                  "assignments": [
                    1252
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1252,
                      "name": "costLevelAfter",
                      "nodeType": "VariableDeclaration",
                      "scope": 1280,
                      "src": "5851:18:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 1251,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "5851:3:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1261,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1254,
                        "name": "log2N",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1201,
                        "src": "5886:5:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1255,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1195,
                        "src": "5893:20:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1256,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1214,
                        "src": "5915:7:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1257,
                            "name": "Fixed192x64Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 6793,
                            "src": "5924:15:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                              "typeString": "type(library Fixed192x64Math)"
                            }
                          },
                          "id": 1258,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 5799,
                          "src": "5924:30:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$5799_$",
                            "typeString": "type(enum Fixed192x64Math.EstimationMode)"
                          }
                        },
                        "id": 1259,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "UpperBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "5924:41:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        },
                        {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      ],
                      "id": 1253,
                      "name": "calcCostLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1408,
                      "src": "5872:13:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_enum$_EstimationMode_$5799_$returns$_t_int256_$",
                        "typeString": "function (int256,int256[] memory,uint256,enum Fixed192x64Math.EstimationMode) pure returns (int256)"
                      }
                    },
                    "id": 1260,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "5872:94:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "5851:115:4"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    },
                    "id": 1264,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 1262,
                      "name": "costLevelBefore",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1220,
                      "src": "6032:15:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<=",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 1263,
                      "name": "costLevelAfter",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1252,
                      "src": "6051:14:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "6032:33:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 1269,
                  "nodeType": "IfStatement",
                  "src": "6029:82:4",
                  "trueBody": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1267,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 1265,
                        "name": "costLevelBefore",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1220,
                        "src": "6079:15:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "id": 1266,
                        "name": "costLevelAfter",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1252,
                        "src": "6097:14:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "src": "6079:32:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 1268,
                    "nodeType": "ExpressionStatement",
                    "src": "6079:32:4"
                  }
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1278,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1270,
                      "name": "profit",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1180,
                      "src": "6147:6:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 1277,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "commonType": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            },
                            "id": 1274,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftExpression": {
                              "argumentTypes": null,
                              "id": 1272,
                              "name": "costLevelBefore",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1220,
                              "src": "6161:15:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_int256",
                                "typeString": "int256"
                              }
                            },
                            "nodeType": "BinaryOperation",
                            "operator": "-",
                            "rightExpression": {
                              "argumentTypes": null,
                              "id": 1273,
                              "name": "costLevelAfter",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1252,
                              "src": "6179:14:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_int256",
                                "typeString": "int256"
                              }
                            },
                            "src": "6161:32:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          ],
                          "id": 1271,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "lValueRequested": false,
                          "nodeType": "ElementaryTypeNameExpression",
                          "src": "6156:4:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_uint256_$",
                            "typeString": "type(uint256)"
                          },
                          "typeName": "uint"
                        },
                        "id": 1275,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "typeConversion",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "6156:38:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "/",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 1276,
                        "name": "ONE",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 887,
                        "src": "6197:3:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "6156:44:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "6147:53:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 1279,
                  "nodeType": "ExpressionStatement",
                  "src": "6147:53:4"
                }
              ]
            },
            "documentation": "@dev Returns profit for selling given number of outcome tokens\n @param market Market contract\n @param outcomeTokenIndex Index of outcome to sell\n @param outcomeTokenCount Number of outcome tokens to sell\n @return Profit",
            "id": 1281,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "calcProfit",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1178,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1173,
                  "name": "market",
                  "nodeType": "VariableDeclaration",
                  "scope": 1281,
                  "src": "4917:13:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_contract$_Market_$2296",
                    "typeString": "contract Market"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 1172,
                    "name": "Market",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 2296,
                    "src": "4917:6:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_Market_$2296",
                      "typeString": "contract Market"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1175,
                  "name": "outcomeTokenIndex",
                  "nodeType": "VariableDeclaration",
                  "scope": 1281,
                  "src": "4932:23:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint8",
                    "typeString": "uint8"
                  },
                  "typeName": {
                    "id": 1174,
                    "name": "uint8",
                    "nodeType": "ElementaryTypeName",
                    "src": "4932:5:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint8",
                      "typeString": "uint8"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1177,
                  "name": "outcomeTokenCount",
                  "nodeType": "VariableDeclaration",
                  "scope": 1281,
                  "src": "4957:22:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1176,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "4957:4:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "4916:64:4"
            },
            "returnParameters": {
              "id": 1181,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1180,
                  "name": "profit",
                  "nodeType": "VariableDeclaration",
                  "scope": 1281,
                  "src": "5026:11:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1179,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "5026:4:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "5025:13:4"
            },
            "scope": 1561,
            "src": "4897:1310:4",
            "stateMutability": "view",
            "superFunction": 1586,
            "visibility": "public"
          },
          {
            "body": {
              "id": 1348,
              "nodeType": "Block",
              "src": "6579:731:4",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "id": 1297,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [],
                          "expression": {
                            "argumentTypes": [],
                            "expression": {
                              "argumentTypes": null,
                              "arguments": [],
                              "expression": {
                                "argumentTypes": [],
                                "expression": {
                                  "argumentTypes": null,
                                  "id": 1291,
                                  "name": "market",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1283,
                                  "src": "6597:6:4",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_Market_$2296",
                                    "typeString": "contract Market"
                                  }
                                },
                                "id": 1292,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "eventContract",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 2214,
                                "src": "6597:20:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_function_external_view$__$returns$_t_contract$_Event_$392_$",
                                  "typeString": "function () view external returns (contract Event)"
                                }
                              },
                              "id": 1293,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "functionCall",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "6597:22:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_Event_$392",
                                "typeString": "contract Event"
                              }
                            },
                            "id": 1294,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "getOutcomeCount",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 331,
                            "src": "6597:38:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_view$__$returns$_t_uint8_$",
                              "typeString": "function () view external returns (uint8)"
                            }
                          },
                          "id": 1295,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "6597:40:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "31",
                          "id": 1296,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "6640:1:4",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_1_by_1",
                            "typeString": "int_const 1"
                          },
                          "value": "1"
                        },
                        "src": "6597:44:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 1290,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        7923,
                        7924
                      ],
                      "referencedDeclaration": 7923,
                      "src": "6589:7:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 1298,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "6589:53:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1299,
                  "nodeType": "ExpressionStatement",
                  "src": "6589:53:4"
                },
                {
                  "assignments": [
                    1303
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1303,
                      "name": "netOutcomeTokensSold",
                      "nodeType": "VariableDeclaration",
                      "scope": 1348,
                      "src": "6652:33:4",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                        "typeString": "int256[]"
                      },
                      "typeName": {
                        "baseType": {
                          "id": 1301,
                          "name": "int",
                          "nodeType": "ElementaryTypeName",
                          "src": "6652:3:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 1302,
                        "length": null,
                        "nodeType": "ArrayTypeName",
                        "src": "6652:5:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                          "typeString": "int256[]"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1307,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1305,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1283,
                        "src": "6712:6:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$2296",
                          "typeString": "contract Market"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_contract$_Market_$2296",
                          "typeString": "contract Market"
                        }
                      ],
                      "id": 1304,
                      "name": "getNetOutcomeTokensSold",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1560,
                      "src": "6688:23:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_contract$_Market_$2296_$returns$_t_array$_t_int256_$dyn_memory_ptr_$",
                        "typeString": "function (contract Market) view returns (int256[] memory)"
                      }
                    },
                    "id": 1306,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "6688:31:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                      "typeString": "int256[] memory"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "6652:67:4"
                },
                {
                  "assignments": [
                    1309
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1309,
                      "name": "logN",
                      "nodeType": "VariableDeclaration",
                      "scope": 1348,
                      "src": "6729:8:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 1308,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "6729:3:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1320,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 1315,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1312,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1303,
                            "src": "6766:20:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 1313,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "length",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": null,
                          "src": "6766:27:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "*",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 1314,
                          "name": "ONE",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 887,
                          "src": "6796:3:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "6766:33:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1316,
                            "name": "Fixed192x64Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 6793,
                            "src": "6801:15:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                              "typeString": "type(library Fixed192x64Math)"
                            }
                          },
                          "id": 1317,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 5799,
                          "src": "6801:30:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$5799_$",
                            "typeString": "type(enum Fixed192x64Math.EstimationMode)"
                          }
                        },
                        "id": 1318,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "Midpoint",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "6801:39:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1310,
                        "name": "Fixed192x64Math",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 6793,
                        "src": "6740:15:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                          "typeString": "type(library Fixed192x64Math)"
                        }
                      },
                      "id": 1311,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "binaryLog",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 6566,
                      "src": "6740:25:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_delegatecall_pure$_t_uint256_$_t_enum$_EstimationMode_$5799_$returns$_t_int256_$",
                        "typeString": "function (uint256,enum Fixed192x64Math.EstimationMode) pure returns (int256)"
                      }
                    },
                    "id": 1319,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "6740:101:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "6729:112:4"
                },
                {
                  "assignments": [
                    1322
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1322,
                      "name": "funding",
                      "nodeType": "VariableDeclaration",
                      "scope": 1348,
                      "src": "6851:12:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1321,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "6851:4:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1326,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1323,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1283,
                        "src": "6866:6:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$2296",
                          "typeString": "contract Market"
                        }
                      },
                      "id": 1324,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "funding",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 2220,
                      "src": "6866:14:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                        "typeString": "function () view external returns (uint256)"
                      }
                    },
                    "id": 1325,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "6866:16:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "6851:31:4"
                },
                {
                  "assignments": [
                    1328,
                    null,
                    1330
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1328,
                      "name": "sum",
                      "nodeType": "VariableDeclaration",
                      "scope": 1348,
                      "src": "7114:8:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1327,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "7114:4:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    },
                    null,
                    {
                      "constant": false,
                      "id": 1330,
                      "name": "outcomeExpTerm",
                      "nodeType": "VariableDeclaration",
                      "scope": 1348,
                      "src": "7126:19:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1329,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "7126:4:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1340,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1332,
                        "name": "logN",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1309,
                        "src": "7162:4:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1333,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1303,
                        "src": "7168:20:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1334,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1322,
                        "src": "7190:7:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1335,
                        "name": "outcomeTokenIndex",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1285,
                        "src": "7199:17:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1336,
                            "name": "Fixed192x64Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 6793,
                            "src": "7218:15:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                              "typeString": "type(library Fixed192x64Math)"
                            }
                          },
                          "id": 1337,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 5799,
                          "src": "7218:30:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$5799_$",
                            "typeString": "type(enum Fixed192x64Math.EstimationMode)"
                          }
                        },
                        "id": 1338,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "Midpoint",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "7218:39:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        },
                        {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      ],
                      "id": 1331,
                      "name": "sumExpOffset",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1518,
                      "src": "7149:12:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_uint8_$_t_enum$_EstimationMode_$5799_$returns$_t_uint256_$_t_int256_$_t_uint256_$",
                        "typeString": "function (int256,int256[] memory,uint256,uint8,enum Fixed192x64Math.EstimationMode) pure returns (uint256,int256,uint256)"
                      }
                    },
                    "id": 1339,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "7149:109:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$_t_uint256_$_t_int256_$_t_uint256_$",
                      "typeString": "tuple(uint256,int256,uint256)"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "7113:145:4"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 1346,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 1341,
                      "name": "outcomeExpTerm",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1330,
                      "src": "7275:14:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "/",
                    "rightExpression": {
                      "argumentTypes": null,
                      "components": [
                        {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          "id": 1344,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 1342,
                            "name": "sum",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1328,
                            "src": "7293:3:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "/",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 1343,
                            "name": "ONE",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 887,
                            "src": "7299:3:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "7293:9:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        }
                      ],
                      "id": 1345,
                      "isConstant": false,
                      "isInlineArray": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "nodeType": "TupleExpression",
                      "src": "7292:11:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "7275:28:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "functionReturnParameters": 1289,
                  "id": 1347,
                  "nodeType": "Return",
                  "src": "7268:35:4"
                }
              ]
            },
            "documentation": "@dev Returns marginal price of an outcome\n @param market Market contract\n @param outcomeTokenIndex Index of outcome to determine marginal price of\n @return Marginal price of an outcome as a fixed point number",
            "id": 1349,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "calcMarginalPrice",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1286,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1283,
                  "name": "market",
                  "nodeType": "VariableDeclaration",
                  "scope": 1349,
                  "src": "6478:13:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_contract$_Market_$2296",
                    "typeString": "contract Market"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 1282,
                    "name": "Market",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 2296,
                    "src": "6478:6:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_Market_$2296",
                      "typeString": "contract Market"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1285,
                  "name": "outcomeTokenIndex",
                  "nodeType": "VariableDeclaration",
                  "scope": 1349,
                  "src": "6493:23:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint8",
                    "typeString": "uint8"
                  },
                  "typeName": {
                    "id": 1284,
                    "name": "uint8",
                    "nodeType": "ElementaryTypeName",
                    "src": "6493:5:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint8",
                      "typeString": "uint8"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6477:40:4"
            },
            "returnParameters": {
              "id": 1289,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1288,
                  "name": "price",
                  "nodeType": "VariableDeclaration",
                  "scope": 1349,
                  "src": "6563:10:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1287,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "6563:4:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6562:12:4"
            },
            "scope": 1561,
            "src": "6451:859:4",
            "stateMutability": "view",
            "superFunction": 1605,
            "visibility": "public"
          },
          {
            "body": {
              "id": 1407,
              "nodeType": "Block",
              "src": "7880:524:4",
              "statements": [
                {
                  "assignments": [
                    1364,
                    1366,
                    null
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1364,
                      "name": "sum",
                      "nodeType": "VariableDeclaration",
                      "scope": 1407,
                      "src": "8120:8:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1363,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "8120:4:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    },
                    {
                      "constant": false,
                      "id": 1366,
                      "name": "offset",
                      "nodeType": "VariableDeclaration",
                      "scope": 1407,
                      "src": "8130:10:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 1365,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "8130:3:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    },
                    null
                  ],
                  "id": 1374,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1368,
                        "name": "logN",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1351,
                        "src": "8159:4:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1369,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1354,
                        "src": "8165:20:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1370,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1356,
                        "src": "8187:7:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "30",
                        "id": 1371,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "8196:1:4",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_0_by_1",
                          "typeString": "int_const 0"
                        },
                        "value": "0"
                      },
                      {
                        "argumentTypes": null,
                        "id": 1372,
                        "name": "estimationMode",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1358,
                        "src": "8199:14:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        },
                        {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_rational_0_by_1",
                          "typeString": "int_const 0"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$5799",
                          "typeString": "enum Fixed192x64Math.EstimationMode"
                        }
                      ],
                      "id": 1367,
                      "name": "sumExpOffset",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1518,
                      "src": "8146:12:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_uint8_$_t_enum$_EstimationMode_$5799_$returns$_t_uint256_$_t_int256_$_t_uint256_$",
                        "typeString": "function (int256,int256[] memory,uint256,uint8,enum Fixed192x64Math.EstimationMode) pure returns (uint256,int256,uint256)"
                      }
                    },
                    "id": 1373,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "8146:68:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$_t_uint256_$_t_int256_$_t_uint256_$",
                      "typeString": "tuple(uint256,int256,uint256)"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "8119:95:4"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1381,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1375,
                      "name": "costLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1361,
                      "src": "8224:9:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "id": 1378,
                          "name": "sum",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1364,
                          "src": "8262:3:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        {
                          "argumentTypes": null,
                          "id": 1379,
                          "name": "estimationMode",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1358,
                          "src": "8267:14:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_enum$_EstimationMode_$5799",
                            "typeString": "enum Fixed192x64Math.EstimationMode"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          {
                            "typeIdentifier": "t_enum$_EstimationMode_$5799",
                            "typeString": "enum Fixed192x64Math.EstimationMode"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "id": 1376,
                          "name": "Fixed192x64Math",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 6793,
                          "src": "8236:15:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                            "typeString": "type(library Fixed192x64Math)"
                          }
                        },
                        "id": 1377,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "binaryLog",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 6566,
                        "src": "8236:25:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_delegatecall_pure$_t_uint256_$_t_enum$_EstimationMode_$5799_$returns$_t_int256_$",
                          "typeString": "function (uint256,enum Fixed192x64Math.EstimationMode) pure returns (int256)"
                        }
                      },
                      "id": 1380,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "8236:46:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "8224:58:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 1382,
                  "nodeType": "ExpressionStatement",
                  "src": "8224:58:4"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1388,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1383,
                      "name": "costLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1361,
                      "src": "8292:9:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "id": 1386,
                          "name": "offset",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1366,
                          "src": "8318:6:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "id": 1384,
                          "name": "costLevel",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1361,
                          "src": "8304:9:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 1385,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "add",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 7247,
                        "src": "8304:13:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                          "typeString": "function (int256,int256) pure returns (int256)"
                        }
                      },
                      "id": 1387,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "8304:21:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "8292:33:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 1389,
                  "nodeType": "ExpressionStatement",
                  "src": "8292:33:4"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1405,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1390,
                      "name": "costLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1361,
                      "src": "8335:9:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 1402,
                              "name": "funding",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1356,
                              "src": "8388:7:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 1401,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "8384:3:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_int256_$",
                              "typeString": "type(int256)"
                            },
                            "typeName": "int"
                          },
                          "id": 1403,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "8384:12:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "components": [
                            {
                              "argumentTypes": null,
                              "commonType": {
                                "typeIdentifier": "t_int256",
                                "typeString": "int256"
                              },
                              "id": 1398,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "leftExpression": {
                                "argumentTypes": null,
                                "arguments": [
                                  {
                                    "argumentTypes": null,
                                    "arguments": [
                                      {
                                        "argumentTypes": null,
                                        "id": 1394,
                                        "name": "ONE",
                                        "nodeType": "Identifier",
                                        "overloadedDeclarations": [],
                                        "referencedDeclaration": 887,
                                        "src": "8366:3:4",
                                        "typeDescriptions": {
                                          "typeIdentifier": "t_uint256",
                                          "typeString": "uint256"
                                        }
                                      }
                                    ],
                                    "expression": {
                                      "argumentTypes": [
                                        {
                                          "typeIdentifier": "t_uint256",
                                          "typeString": "uint256"
                                        }
                                      ],
                                      "id": 1393,
                                      "isConstant": false,
                                      "isLValue": false,
                                      "isPure": true,
                                      "lValueRequested": false,
                                      "nodeType": "ElementaryTypeNameExpression",
                                      "src": "8362:3:4",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_type$_t_int256_$",
                                        "typeString": "type(int256)"
                                      },
                                      "typeName": "int"
                                    },
                                    "id": 1395,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": true,
                                    "kind": "typeConversion",
                                    "lValueRequested": false,
                                    "names": [],
                                    "nodeType": "FunctionCall",
                                    "src": "8362:8:4",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_int256",
                                      "typeString": "int256"
                                    }
                                  }
                                ],
                                "expression": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_int256",
                                      "typeString": "int256"
                                    }
                                  ],
                                  "expression": {
                                    "argumentTypes": null,
                                    "id": 1391,
                                    "name": "costLevel",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 1361,
                                    "src": "8348:9:4",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_int256",
                                      "typeString": "int256"
                                    }
                                  },
                                  "id": 1392,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "mul",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 7130,
                                  "src": "8348:13:4",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                                    "typeString": "function (int256,int256) pure returns (int256)"
                                  }
                                },
                                "id": 1396,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "8348:23:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                }
                              },
                              "nodeType": "BinaryOperation",
                              "operator": "/",
                              "rightExpression": {
                                "argumentTypes": null,
                                "id": 1397,
                                "name": "logN",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 1351,
                                "src": "8374:4:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                }
                              },
                              "src": "8348:30:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_int256",
                                "typeString": "int256"
                              }
                            }
                          ],
                          "id": 1399,
                          "isConstant": false,
                          "isInlineArray": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "nodeType": "TupleExpression",
                          "src": "8347:32:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 1400,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "mul",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 7130,
                        "src": "8347:36:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                          "typeString": "function (int256,int256) pure returns (int256)"
                        }
                      },
                      "id": 1404,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "8347:50:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "8335:62:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 1406,
                  "nodeType": "ExpressionStatement",
                  "src": "8335:62:4"
                }
              ]
            },
            "documentation": "@dev Calculates the result of the LMSR cost function which is used to\n      derive prices from the market state\n @param logN Logarithm of the number of outcomes\n @param netOutcomeTokensSold Net outcome tokens sold by market\n @param funding Initial funding for market\n @return Cost level",
            "id": 1408,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "calcCostLevel",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1359,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1351,
                  "name": "logN",
                  "nodeType": "VariableDeclaration",
                  "scope": 1408,
                  "src": "7710:8:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_int256",
                    "typeString": "int256"
                  },
                  "typeName": {
                    "id": 1350,
                    "name": "int",
                    "nodeType": "ElementaryTypeName",
                    "src": "7710:3:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1354,
                  "name": "netOutcomeTokensSold",
                  "nodeType": "VariableDeclaration",
                  "scope": 1408,
                  "src": "7720:33:4",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                    "typeString": "int256[]"
                  },
                  "typeName": {
                    "baseType": {
                      "id": 1352,
                      "name": "int",
                      "nodeType": "ElementaryTypeName",
                      "src": "7720:3:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 1353,
                    "length": null,
                    "nodeType": "ArrayTypeName",
                    "src": "7720:5:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                      "typeString": "int256[]"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1356,
                  "name": "funding",
                  "nodeType": "VariableDeclaration",
                  "scope": 1408,
                  "src": "7755:12:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1355,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "7755:4:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1358,
                  "name": "estimationMode",
                  "nodeType": "VariableDeclaration",
                  "scope": 1408,
                  "src": "7769:45:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_enum$_EstimationMode_$5799",
                    "typeString": "enum Fixed192x64Math.EstimationMode"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 1357,
                    "name": "Fixed192x64Math.EstimationMode",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 5799,
                    "src": "7769:30:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_enum$_EstimationMode_$5799",
                      "typeString": "enum Fixed192x64Math.EstimationMode"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "7709:106:4"
            },
            "returnParameters": {
              "id": 1362,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1361,
                  "name": "costLevel",
                  "nodeType": "VariableDeclaration",
                  "scope": 1408,
                  "src": "7861:13:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_int256",
                    "typeString": "int256"
                  },
                  "typeName": {
                    "id": 1360,
                    "name": "int",
                    "nodeType": "ElementaryTypeName",
                    "src": "7861:3:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "7860:15:4"
            },
            "scope": 1561,
            "src": "7687:717:4",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "private"
          },
          {
            "body": {
              "id": 1517,
              "nodeType": "Block",
              "src": "9191:1371:4",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        "id": 1437,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          },
                          "id": 1431,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 1429,
                            "name": "logN",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1410,
                            "src": "10051:4:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": ">=",
                          "rightExpression": {
                            "argumentTypes": null,
                            "hexValue": "30",
                            "id": 1430,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "10059:1:4",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_0_by_1",
                              "typeString": "int_const 0"
                            },
                            "value": "0"
                          },
                          "src": "10051:9:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "&&",
                        "rightExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          },
                          "id": 1436,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "id": 1433,
                                "name": "funding",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 1415,
                                "src": "10068:7:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              ],
                              "id": 1432,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "lValueRequested": false,
                              "nodeType": "ElementaryTypeNameExpression",
                              "src": "10064:3:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_type$_t_int256_$",
                                "typeString": "type(int256)"
                              },
                              "typeName": "int"
                            },
                            "id": 1434,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "typeConversion",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "10064:12:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": ">=",
                          "rightExpression": {
                            "argumentTypes": null,
                            "hexValue": "30",
                            "id": 1435,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "10080:1:4",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_0_by_1",
                              "typeString": "int_const 0"
                            },
                            "value": "0"
                          },
                          "src": "10064:17:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "src": "10051:30:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 1428,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        7923,
                        7924
                      ],
                      "referencedDeclaration": 7923,
                      "src": "10043:7:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 1438,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "10043:39:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1439,
                  "nodeType": "ExpressionStatement",
                  "src": "10043:39:4"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1445,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1440,
                      "name": "offset",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1424,
                      "src": "10092:6:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "id": 1443,
                          "name": "netOutcomeTokensSold",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1413,
                          "src": "10121:20:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                            "typeString": "int256[] memory"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                            "typeString": "int256[] memory"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "id": 1441,
                          "name": "Fixed192x64Math",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 6793,
                          "src": "10101:15:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                            "typeString": "type(library Fixed192x64Math)"
                          }
                        },
                        "id": 1442,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "max",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 6792,
                        "src": "10101:19:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_delegatecall_pure$_t_array$_t_int256_$dyn_memory_ptr_$returns$_t_int256_$",
                          "typeString": "function (int256[] memory) pure returns (int256)"
                        }
                      },
                      "id": 1444,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "10101:41:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "10092:50:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 1446,
                  "nodeType": "ExpressionStatement",
                  "src": "10092:50:4"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1456,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1447,
                      "name": "offset",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1424,
                      "src": "10152:6:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "id": 1455,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 1450,
                            "name": "logN",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1410,
                            "src": "10172:4:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          ],
                          "expression": {
                            "argumentTypes": null,
                            "id": 1448,
                            "name": "offset",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1424,
                            "src": "10161:6:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "id": 1449,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "mul",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 7130,
                          "src": "10161:10:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                            "typeString": "function (int256,int256) pure returns (int256)"
                          }
                        },
                        "id": 1451,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "10161:16:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "/",
                      "rightExpression": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 1453,
                            "name": "funding",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1415,
                            "src": "10184:7:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          ],
                          "id": 1452,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "lValueRequested": false,
                          "nodeType": "ElementaryTypeNameExpression",
                          "src": "10180:3:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_int256_$",
                            "typeString": "type(int256)"
                          },
                          "typeName": "int"
                        },
                        "id": 1454,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "typeConversion",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "10180:12:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "src": "10161:31:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "10152:40:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 1457,
                  "nodeType": "ExpressionStatement",
                  "src": "10152:40:4"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1463,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1458,
                      "name": "offset",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1424,
                      "src": "10202:6:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "id": 1461,
                          "name": "EXP_LIMIT",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 890,
                          "src": "10222:9:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "id": 1459,
                          "name": "offset",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1424,
                          "src": "10211:6:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 1460,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sub",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 7208,
                        "src": "10211:10:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                          "typeString": "function (int256,int256) pure returns (int256)"
                        }
                      },
                      "id": 1462,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "10211:21:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "10202:30:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 1464,
                  "nodeType": "ExpressionStatement",
                  "src": "10202:30:4"
                },
                {
                  "assignments": [
                    1466
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1466,
                      "name": "term",
                      "nodeType": "VariableDeclaration",
                      "scope": 1517,
                      "src": "10242:9:4",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1465,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "10242:4:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1467,
                  "initialValue": null,
                  "nodeType": "VariableDeclarationStatement",
                  "src": "10242:9:4"
                },
                {
                  "body": {
                    "id": 1515,
                    "nodeType": "Block",
                    "src": "10317:239:4",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 1498,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 1479,
                            "name": "term",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1466,
                            "src": "10331:4:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "arguments": [
                                  {
                                    "argumentTypes": null,
                                    "id": 1494,
                                    "name": "offset",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 1424,
                                    "src": "10414:6:4",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_int256",
                                      "typeString": "int256"
                                    }
                                  }
                                ],
                                "expression": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_int256",
                                      "typeString": "int256"
                                    }
                                  ],
                                  "expression": {
                                    "argumentTypes": null,
                                    "components": [
                                      {
                                        "argumentTypes": null,
                                        "commonType": {
                                          "typeIdentifier": "t_int256",
                                          "typeString": "int256"
                                        },
                                        "id": 1491,
                                        "isConstant": false,
                                        "isLValue": false,
                                        "isPure": false,
                                        "lValueRequested": false,
                                        "leftExpression": {
                                          "argumentTypes": null,
                                          "arguments": [
                                            {
                                              "argumentTypes": null,
                                              "id": 1486,
                                              "name": "logN",
                                              "nodeType": "Identifier",
                                              "overloadedDeclarations": [],
                                              "referencedDeclaration": 1410,
                                              "src": "10388:4:4",
                                              "typeDescriptions": {
                                                "typeIdentifier": "t_int256",
                                                "typeString": "int256"
                                              }
                                            }
                                          ],
                                          "expression": {
                                            "argumentTypes": [
                                              {
                                                "typeIdentifier": "t_int256",
                                                "typeString": "int256"
                                              }
                                            ],
                                            "expression": {
                                              "argumentTypes": null,
                                              "baseExpression": {
                                                "argumentTypes": null,
                                                "id": 1482,
                                                "name": "netOutcomeTokensSold",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 1413,
                                                "src": "10360:20:4",
                                                "typeDescriptions": {
                                                  "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                                                  "typeString": "int256[] memory"
                                                }
                                              },
                                              "id": 1484,
                                              "indexExpression": {
                                                "argumentTypes": null,
                                                "id": 1483,
                                                "name": "i",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 1469,
                                                "src": "10381:1:4",
                                                "typeDescriptions": {
                                                  "typeIdentifier": "t_uint8",
                                                  "typeString": "uint8"
                                                }
                                              },
                                              "isConstant": false,
                                              "isLValue": true,
                                              "isPure": false,
                                              "lValueRequested": false,
                                              "nodeType": "IndexAccess",
                                              "src": "10360:23:4",
                                              "typeDescriptions": {
                                                "typeIdentifier": "t_int256",
                                                "typeString": "int256"
                                              }
                                            },
                                            "id": 1485,
                                            "isConstant": false,
                                            "isLValue": false,
                                            "isPure": false,
                                            "lValueRequested": false,
                                            "memberName": "mul",
                                            "nodeType": "MemberAccess",
                                            "referencedDeclaration": 7130,
                                            "src": "10360:27:4",
                                            "typeDescriptions": {
                                              "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                                              "typeString": "function (int256,int256) pure returns (int256)"
                                            }
                                          },
                                          "id": 1487,
                                          "isConstant": false,
                                          "isLValue": false,
                                          "isPure": false,
                                          "kind": "functionCall",
                                          "lValueRequested": false,
                                          "names": [],
                                          "nodeType": "FunctionCall",
                                          "src": "10360:33:4",
                                          "typeDescriptions": {
                                            "typeIdentifier": "t_int256",
                                            "typeString": "int256"
                                          }
                                        },
                                        "nodeType": "BinaryOperation",
                                        "operator": "/",
                                        "rightExpression": {
                                          "argumentTypes": null,
                                          "arguments": [
                                            {
                                              "argumentTypes": null,
                                              "id": 1489,
                                              "name": "funding",
                                              "nodeType": "Identifier",
                                              "overloadedDeclarations": [],
                                              "referencedDeclaration": 1415,
                                              "src": "10400:7:4",
                                              "typeDescriptions": {
                                                "typeIdentifier": "t_uint256",
                                                "typeString": "uint256"
                                              }
                                            }
                                          ],
                                          "expression": {
                                            "argumentTypes": [
                                              {
                                                "typeIdentifier": "t_uint256",
                                                "typeString": "uint256"
                                              }
                                            ],
                                            "id": 1488,
                                            "isConstant": false,
                                            "isLValue": false,
                                            "isPure": true,
                                            "lValueRequested": false,
                                            "nodeType": "ElementaryTypeNameExpression",
                                            "src": "10396:3:4",
                                            "typeDescriptions": {
                                              "typeIdentifier": "t_type$_t_int256_$",
                                              "typeString": "type(int256)"
                                            },
                                            "typeName": "int"
                                          },
                                          "id": 1490,
                                          "isConstant": false,
                                          "isLValue": false,
                                          "isPure": false,
                                          "kind": "typeConversion",
                                          "lValueRequested": false,
                                          "names": [],
                                          "nodeType": "FunctionCall",
                                          "src": "10396:12:4",
                                          "typeDescriptions": {
                                            "typeIdentifier": "t_int256",
                                            "typeString": "int256"
                                          }
                                        },
                                        "src": "10360:48:4",
                                        "typeDescriptions": {
                                          "typeIdentifier": "t_int256",
                                          "typeString": "int256"
                                        }
                                      }
                                    ],
                                    "id": 1492,
                                    "isConstant": false,
                                    "isInlineArray": false,
                                    "isLValue": false,
                                    "isPure": false,
                                    "lValueRequested": false,
                                    "nodeType": "TupleExpression",
                                    "src": "10359:50:4",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_int256",
                                      "typeString": "int256"
                                    }
                                  },
                                  "id": 1493,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "sub",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 7208,
                                  "src": "10359:54:4",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_internal_pure$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                                    "typeString": "function (int256,int256) pure returns (int256)"
                                  }
                                },
                                "id": 1495,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "10359:62:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                }
                              },
                              {
                                "argumentTypes": null,
                                "id": 1496,
                                "name": "estimationMode",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 1419,
                                "src": "10423:14:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_enum$_EstimationMode_$5799",
                                  "typeString": "enum Fixed192x64Math.EstimationMode"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                },
                                {
                                  "typeIdentifier": "t_enum$_EstimationMode_$5799",
                                  "typeString": "enum Fixed192x64Math.EstimationMode"
                                }
                              ],
                              "expression": {
                                "argumentTypes": null,
                                "id": 1480,
                                "name": "Fixed192x64Math",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 6793,
                                "src": "10338:15:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_type$_t_contract$_Fixed192x64Math_$6793_$",
                                  "typeString": "type(library Fixed192x64Math)"
                                }
                              },
                              "id": 1481,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "pow2",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 5906,
                              "src": "10338:20:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_delegatecall_pure$_t_int256_$_t_enum$_EstimationMode_$5799_$returns$_t_uint256_$",
                                "typeString": "function (int256,enum Fixed192x64Math.EstimationMode) pure returns (uint256)"
                              }
                            },
                            "id": 1497,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "10338:100:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "10331:107:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 1499,
                        "nodeType": "ExpressionStatement",
                        "src": "10331:107:4"
                      },
                      {
                        "condition": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          },
                          "id": 1502,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 1500,
                            "name": "i",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1469,
                            "src": "10456:1:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "==",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 1501,
                            "name": "outcomeIndex",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1417,
                            "src": "10461:12:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          },
                          "src": "10456:17:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "falseBody": null,
                        "id": 1507,
                        "nodeType": "IfStatement",
                        "src": "10452:60:4",
                        "trueBody": {
                          "expression": {
                            "argumentTypes": null,
                            "id": 1505,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftHandSide": {
                              "argumentTypes": null,
                              "id": 1503,
                              "name": "outcomeExpTerm",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1426,
                              "src": "10491:14:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "nodeType": "Assignment",
                            "operator": "=",
                            "rightHandSide": {
                              "argumentTypes": null,
                              "id": 1504,
                              "name": "term",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1466,
                              "src": "10508:4:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "src": "10491:21:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "id": 1506,
                          "nodeType": "ExpressionStatement",
                          "src": "10491:21:4"
                        }
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 1513,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 1508,
                            "name": "sum",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1422,
                            "src": "10526:3:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "id": 1511,
                                "name": "term",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 1466,
                                "src": "10540:4:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              ],
                              "expression": {
                                "argumentTypes": null,
                                "id": 1509,
                                "name": "sum",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 1422,
                                "src": "10532:3:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "id": 1510,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "add",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 7275,
                              "src": "10532:7:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                                "typeString": "function (uint256,uint256) pure returns (uint256)"
                              }
                            },
                            "id": 1512,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "10532:13:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "10526:19:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 1514,
                        "nodeType": "ExpressionStatement",
                        "src": "10526:19:4"
                      }
                    ]
                  },
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 1475,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 1472,
                      "name": "i",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1469,
                      "src": "10279:1:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint8",
                        "typeString": "uint8"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 1473,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1413,
                        "src": "10283:20:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      "id": 1474,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "length",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": null,
                      "src": "10283:27:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "10279:31:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "id": 1516,
                  "initializationExpression": {
                    "assignments": [
                      1469
                    ],
                    "declarations": [
                      {
                        "constant": false,
                        "id": 1469,
                        "name": "i",
                        "nodeType": "VariableDeclaration",
                        "scope": 1516,
                        "src": "10266:7:4",
                        "stateVariable": false,
                        "storageLocation": "default",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "typeName": {
                          "id": 1468,
                          "name": "uint8",
                          "nodeType": "ElementaryTypeName",
                          "src": "10266:5:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "value": null,
                        "visibility": "internal"
                      }
                    ],
                    "id": 1471,
                    "initialValue": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 1470,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "10276:1:4",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "nodeType": "VariableDeclarationStatement",
                    "src": "10266:11:4"
                  },
                  "loopExpression": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1477,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "nodeType": "UnaryOperation",
                      "operator": "++",
                      "prefix": false,
                      "src": "10312:3:4",
                      "subExpression": {
                        "argumentTypes": null,
                        "id": 1476,
                        "name": "i",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1469,
                        "src": "10312:1:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      },
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint8",
                        "typeString": "uint8"
                      }
                    },
                    "id": 1478,
                    "nodeType": "ExpressionStatement",
                    "src": "10312:3:4"
                  },
                  "nodeType": "ForStatement",
                  "src": "10261:295:4"
                }
              ]
            },
            "documentation": "@dev Calculates sum(exp(q/b - offset) for q in quantities), where offset is set\n      so that the sum fits in 248-256 bits\n @param logN Logarithm of the number of outcomes\n @param netOutcomeTokensSold Net outcome tokens sold by market\n @param funding Initial funding for market\n @param outcomeIndex Index of exponential term to extract (for use by marginal price function)\n @return A result structure composed of the sum, the offset used, and the summand associated with the supplied index",
            "id": 1518,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "sumExpOffset",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1420,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1410,
                  "name": "logN",
                  "nodeType": "VariableDeclaration",
                  "scope": 1518,
                  "src": "8972:8:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_int256",
                    "typeString": "int256"
                  },
                  "typeName": {
                    "id": 1409,
                    "name": "int",
                    "nodeType": "ElementaryTypeName",
                    "src": "8972:3:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1413,
                  "name": "netOutcomeTokensSold",
                  "nodeType": "VariableDeclaration",
                  "scope": 1518,
                  "src": "8982:33:4",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                    "typeString": "int256[]"
                  },
                  "typeName": {
                    "baseType": {
                      "id": 1411,
                      "name": "int",
                      "nodeType": "ElementaryTypeName",
                      "src": "8982:3:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 1412,
                    "length": null,
                    "nodeType": "ArrayTypeName",
                    "src": "8982:5:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                      "typeString": "int256[]"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1415,
                  "name": "funding",
                  "nodeType": "VariableDeclaration",
                  "scope": 1518,
                  "src": "9017:12:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1414,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "9017:4:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1417,
                  "name": "outcomeIndex",
                  "nodeType": "VariableDeclaration",
                  "scope": 1518,
                  "src": "9031:18:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint8",
                    "typeString": "uint8"
                  },
                  "typeName": {
                    "id": 1416,
                    "name": "uint8",
                    "nodeType": "ElementaryTypeName",
                    "src": "9031:5:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint8",
                      "typeString": "uint8"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1419,
                  "name": "estimationMode",
                  "nodeType": "VariableDeclaration",
                  "scope": 1518,
                  "src": "9051:45:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_enum$_EstimationMode_$5799",
                    "typeString": "enum Fixed192x64Math.EstimationMode"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 1418,
                    "name": "Fixed192x64Math.EstimationMode",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 5799,
                    "src": "9051:30:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_enum$_EstimationMode_$5799",
                      "typeString": "enum Fixed192x64Math.EstimationMode"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8971:126:4"
            },
            "returnParameters": {
              "id": 1427,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1422,
                  "name": "sum",
                  "nodeType": "VariableDeclaration",
                  "scope": 1518,
                  "src": "9144:8:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1421,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "9144:4:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1424,
                  "name": "offset",
                  "nodeType": "VariableDeclaration",
                  "scope": 1518,
                  "src": "9154:10:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_int256",
                    "typeString": "int256"
                  },
                  "typeName": {
                    "id": 1423,
                    "name": "int",
                    "nodeType": "ElementaryTypeName",
                    "src": "9154:3:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1426,
                  "name": "outcomeExpTerm",
                  "nodeType": "VariableDeclaration",
                  "scope": 1518,
                  "src": "9166:19:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1425,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "9166:4:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "9143:43:4"
            },
            "scope": 1561,
            "src": "8950:1612:4",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "private"
          },
          {
            "body": {
              "id": 1559,
              "nodeType": "Block",
              "src": "11165:195:4",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1536,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1526,
                      "name": "quantities",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1524,
                      "src": "11175:10:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                        "typeString": "int256[] memory"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "arguments": [],
                          "expression": {
                            "argumentTypes": [],
                            "expression": {
                              "argumentTypes": null,
                              "arguments": [],
                              "expression": {
                                "argumentTypes": [],
                                "expression": {
                                  "argumentTypes": null,
                                  "id": 1530,
                                  "name": "market",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1520,
                                  "src": "11198:6:4",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_Market_$2296",
                                    "typeString": "contract Market"
                                  }
                                },
                                "id": 1531,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "eventContract",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 2214,
                                "src": "11198:20:4",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_function_external_view$__$returns$_t_contract$_Event_$392_$",
                                  "typeString": "function () view external returns (contract Event)"
                                }
                              },
                              "id": 1532,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "functionCall",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "11198:22:4",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_Event_$392",
                                "typeString": "contract Event"
                              }
                            },
                            "id": 1533,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "getOutcomeCount",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 331,
                            "src": "11198:38:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_view$__$returns$_t_uint8_$",
                              "typeString": "function () view external returns (uint8)"
                            }
                          },
                          "id": 1534,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "11198:40:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        ],
                        "id": 1529,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "nodeType": "NewExpression",
                        "src": "11188:9:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_int256_$dyn_memory_$",
                          "typeString": "function (uint256) pure returns (int256[] memory)"
                        },
                        "typeName": {
                          "baseType": {
                            "id": 1527,
                            "name": "int",
                            "nodeType": "ElementaryTypeName",
                            "src": "11192:3:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "id": 1528,
                          "length": null,
                          "nodeType": "ArrayTypeName",
                          "src": "11192:5:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                            "typeString": "int256[]"
                          }
                        }
                      },
                      "id": 1535,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "11188:51:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_array$_t_int256_$dyn_memory",
                        "typeString": "int256[] memory"
                      }
                    },
                    "src": "11175:64:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                      "typeString": "int256[] memory"
                    }
                  },
                  "id": 1537,
                  "nodeType": "ExpressionStatement",
                  "src": "11175:64:4"
                },
                {
                  "body": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1556,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "baseExpression": {
                          "argumentTypes": null,
                          "id": 1549,
                          "name": "quantities",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1524,
                          "src": "11307:10:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                            "typeString": "int256[] memory"
                          }
                        },
                        "id": 1551,
                        "indexExpression": {
                          "argumentTypes": null,
                          "id": 1550,
                          "name": "i",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1539,
                          "src": "11318:1:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "isConstant": false,
                        "isLValue": true,
                        "isPure": false,
                        "lValueRequested": true,
                        "nodeType": "IndexAccess",
                        "src": "11307:13:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 1554,
                            "name": "i",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1539,
                            "src": "11351:1:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          ],
                          "expression": {
                            "argumentTypes": null,
                            "id": 1552,
                            "name": "market",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1520,
                            "src": "11323:6:4",
                            "typeDescriptions": {
                              "typeIdentifier": "t_contract$_Market_$2296",
                              "typeString": "contract Market"
                            }
                          },
                          "id": 1553,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "netOutcomeTokensSold",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 2223,
                          "src": "11323:27:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_external_view$_t_uint256_$returns$_t_int256_$",
                            "typeString": "function (uint256) view external returns (int256)"
                          }
                        },
                        "id": 1555,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "11323:30:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "src": "11307:46:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 1557,
                    "nodeType": "ExpressionStatement",
                    "src": "11307:46:4"
                  },
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 1545,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 1542,
                      "name": "i",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1539,
                      "src": "11267:1:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint8",
                        "typeString": "uint8"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 1543,
                        "name": "quantities",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1524,
                        "src": "11271:10:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      "id": 1544,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "length",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": null,
                      "src": "11271:17:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "11267:21:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "id": 1558,
                  "initializationExpression": {
                    "assignments": [
                      1539
                    ],
                    "declarations": [
                      {
                        "constant": false,
                        "id": 1539,
                        "name": "i",
                        "nodeType": "VariableDeclaration",
                        "scope": 1558,
                        "src": "11254:7:4",
                        "stateVariable": false,
                        "storageLocation": "default",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "typeName": {
                          "id": 1538,
                          "name": "uint8",
                          "nodeType": "ElementaryTypeName",
                          "src": "11254:5:4",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "value": null,
                        "visibility": "internal"
                      }
                    ],
                    "id": 1541,
                    "initialValue": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 1540,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "11264:1:4",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "nodeType": "VariableDeclarationStatement",
                    "src": "11254:11:4"
                  },
                  "loopExpression": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1547,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "nodeType": "UnaryOperation",
                      "operator": "++",
                      "prefix": false,
                      "src": "11290:3:4",
                      "subExpression": {
                        "argumentTypes": null,
                        "id": 1546,
                        "name": "i",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1539,
                        "src": "11290:1:4",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      },
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint8",
                        "typeString": "uint8"
                      }
                    },
                    "id": 1548,
                    "nodeType": "ExpressionStatement",
                    "src": "11290:3:4"
                  },
                  "nodeType": "ForStatement",
                  "src": "11249:104:4"
                }
              ]
            },
            "documentation": "@dev Gets net outcome tokens sold by market. Since all sets of outcome tokens are backed by\n      corresponding collateral tokens, the net quantity of a token sold by the market is the\n      number of collateral tokens (which is the same as the number of outcome tokens the\n      market created) subtracted by the quantity of that token held by the market.\n @param market Market contract\n @return Net outcome tokens sold by market",
            "id": 1560,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "getNetOutcomeTokensSold",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1521,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1520,
                  "name": "market",
                  "nodeType": "VariableDeclaration",
                  "scope": 1560,
                  "src": "11075:13:4",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_contract$_Market_$2296",
                    "typeString": "contract Market"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 1519,
                    "name": "Market",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 2296,
                    "src": "11075:6:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_Market_$2296",
                      "typeString": "contract Market"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "11074:15:4"
            },
            "returnParameters": {
              "id": 1525,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1524,
                  "name": "quantities",
                  "nodeType": "VariableDeclaration",
                  "scope": 1560,
                  "src": "11136:23:4",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                    "typeString": "int256[]"
                  },
                  "typeName": {
                    "baseType": {
                      "id": 1522,
                      "name": "int",
                      "nodeType": "ElementaryTypeName",
                      "src": "11136:3:4",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 1523,
                    "length": null,
                    "nodeType": "ArrayTypeName",
                    "src": "11136:5:4",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                      "typeString": "int256[]"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "11135:25:4"
            },
            "scope": 1561,
            "src": "11042:318:4",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "private"
          }
        ],
        "scope": 1562,
        "src": "416:10946:4"
      }
    ],
    "src": "0:11362:4"
  },
  "compiler": {
    "name": "solc",
    "version": "0.5.6+commit.b259423e.Emscripten.clang"
  },
  "networks": {
    "1": {
      "events": {},
      "links": {
        "Fixed192x64Math": "0x11c59b10ebe450cf403e1a07255da5cd2aef2084"
      },
      "address": "0xad5c33f474239d9a7da38730f5837e7c7db3cb98",
      "transactionHash": "0xa3f88100fea3ee1aa25e1fd9d6179851c306af618b1cd8f8546a3ecff5dc69f0"
    },
    "3": {
      "events": {},
      "links": {
        "Fixed192x64Math": "0x265e6694f83fbcfd037be0126fbafc0fcfd5b181"
      },
      "address": "0xe7d655d64f43f9eb8fe6f2193ced87578910b8aa",
      "transactionHash": "0x1b1045ba57ec05ab2e40d010b53a3c66fa24d46f7ee324b7a12c6023dfe73664"
    },
    "4": {
      "events": {},
      "links": {
        "Fixed192x64Math": "0xce036308718c3f704cb6cc492fa405c6d811d627"
      },
      "address": "0x137a20882b7e66955a29ff3d16675f27bc5a4752",
      "transactionHash": "0xb03d7d8037fe2b6f0cb41e3ec6cdce8d758e910086b4b4b43820666841836773"
    },
    "42": {
      "events": {},
      "links": {
        "Fixed192x64Math": "0x09d7ffa61ad04acb47b27043335018a92e539b2c"
      },
      "address": "0x235a12029e6366f649c4a4a817a2fbc5a79aa532",
      "transactionHash": "0xb4e53e669700ed541f09bf5a728768d7094325f10c811d7eba1ff1912b88e851"
    },
    "437894314312": {
      "events": {},
      "links": {
        "Fixed192x64Math": "0x5b1869d9a4c187f2eaa108f3062412ecf0526b24"
      },
      "address": "0x254dffcd3277c0b1660f6d42efbb754edababc2b",
      "transactionHash": "0xdb9a94a5238bd36f707497474f6e36a2f222d3c8443f29eb2c8ecb6a39c9b969"
    }
  },
  "schemaVersion": "3.0.11",
  "updatedAt": "2019-09-20T17:46:52.125Z",
  "devdoc": {
    "author": "Alan Lu - <alan.lu@gnosis.pm>",
    "methods": {
      "calcCost(address,uint8,uint256)": {
        "details": "Returns cost to buy given number of outcome tokens",
        "params": {
          "market": "Market contract",
          "outcomeTokenCount": "Number of outcome tokens to buy",
          "outcomeTokenIndex": "Index of outcome to buy"
        },
        "return": "Cost"
      },
      "calcMarginalPrice(address,uint8)": {
        "details": "Returns marginal price of an outcome",
        "params": {
          "market": "Market contract",
          "outcomeTokenIndex": "Index of outcome to determine marginal price of"
        },
        "return": "Marginal price of an outcome as a fixed point number"
      },
      "calcNetCost(address,int256[])": {
        "details": "Calculates the net cost for executing a given trade.",
        "params": {
          "market": "Market contract",
          "outcomeTokenAmounts": "Amounts of outcome tokens to buy from the market. If an amount is negative, represents an amount to sell to the market."
        },
        "return": "Net cost of trade. If positive, represents amount of collateral which would be paid to the market for the trade. If negative, represents amount of collateral which would be received from the market for the trade."
      },
      "calcProfit(address,uint8,uint256)": {
        "details": "Returns profit for selling given number of outcome tokens",
        "params": {
          "market": "Market contract",
          "outcomeTokenCount": "Number of outcome tokens to sell",
          "outcomeTokenIndex": "Index of outcome to sell"
        },
        "return": "Profit"
      }
    },
    "title": "LMSR market maker contract - Calculates share prices based on share distribution and initial funding"
  },
  "userdoc": {
    "methods": {}
  }
}