{
  "contractName": "LMSRMarketMaker",
  "abi": [
    {
      "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",
      "signature": "0xbd8ff817"
    },
    {
      "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",
      "signature": "0x4091c6a9"
    },
    {
      "constant": true,
      "inputs": [
        {
          "name": "market",
          "type": "address"
        },
        {
          "name": "outcomeTokenIndex",
          "type": "uint8"
        }
      ],
      "name": "calcMarginalPrice",
      "outputs": [
        {
          "name": "price",
          "type": "uint256"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function",
      "signature": "0xd812d346"
    }
  ],
  "bytecode": "0x608060405234801561001057600080fd5b50611375806100206000396000f30060806040526004361061003d5763ffffffff60e060020a6000350416634091c6a98114610042578063bd8ff8171461007e578063d812d346146100a8575b600080fd5b34801561004e57600080fd5b5061006c600160a060020a036004351660ff602435166044356100cf565b60408051918252519081900360200190f35b34801561008a57600080fd5b5061006c600160a060020a036004351660ff6024351660443561041e565b3480156100b457600080fd5b5061006c600160a060020a036004351660ff602435166107ac565b60006060600080600080600189600160a060020a031663e274fd246040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561011957600080fd5b505af115801561012d573d6000803e3d6000fd5b505050506040513d602081101561014357600080fd5b50516040805160e160020a633ee478430281529051600160a060020a0390921691637dc8f086916004808201926020929091908290030181600087803b15801561018c57600080fd5b505af11580156101a0573d6000803e3d6000fd5b505050506040513d60208110156101b657600080fd5b505160ff16116101c557600080fd5b6101ce89610a1a565b945073__Math__________________________________6320ddd2556801000000000000000087510260016040518363ffffffff1660e060020a0281526004018083815260200182600281111561022157fe5b60ff1681526020019250505060206040518083038186803b15801561024557600080fd5b505af4158015610259573d6000803e3d6000fd5b505050506040513d602081101561026f57600080fd5b5051604080517fcb4c86b70000000000000000000000000000000000000000000000000000000081529051919550600160a060020a038b169163cb4c86b7916004808201926020929091908290030181600087803b1580156102d057600080fd5b505af11580156102e4573d6000803e3d6000fd5b505050506040513d60208110156102fa57600080fd5b5051925061030b8486856000610bdd565b9150600087121561031b57600080fd5b848860ff1681518110151561032c57fe5b6020908102909101810151604080517fadefc37b0000000000000000000000000000000000000000000000000000000081526004810192909252602482018a90525173__Math__________________________________9263adefc37b9260448082019391829003018186803b1580156103a557600080fd5b505af41580156103b9573d6000803e3d6000fd5b505050506040513d60208110156103cf57600080fd5b50518551869060ff8b169081106103e257fe5b602090810290910101526103f98486856001610bdd565b9050808213610406578091505b68010000000000000000910304979650505050505050565b60006060600080600080600189600160a060020a031663e274fd246040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561046857600080fd5b505af115801561047c573d6000803e3d6000fd5b505050506040513d602081101561049257600080fd5b50516040805160e160020a633ee478430281529051600160a060020a0390921691637dc8f086916004808201926020929091908290030181600087803b1580156104db57600080fd5b505af11580156104ef573d6000803e3d6000fd5b505050506040513d602081101561050557600080fd5b505160ff161161051457600080fd5b61051d89610a1a565b945073__Math__________________________________6320ddd2556801000000000000000087510260016040518363ffffffff1660e060020a0281526004018083815260200182600281111561057057fe5b60ff1681526020019250505060206040518083038186803b15801561059457600080fd5b505af41580156105a8573d6000803e3d6000fd5b505050506040513d60208110156105be57600080fd5b5051604080517fcb4c86b70000000000000000000000000000000000000000000000000000000081529051919550600160a060020a038b169163cb4c86b7916004808201926020929091908290030181600087803b15801561061f57600080fd5b505af1158015610633573d6000803e3d6000fd5b505050506040513d602081101561064957600080fd5b5051925061065a8486856000610bdd565b9150600087121561066a57600080fd5b848860ff1681518110151561067b57fe5b6020908102909101810151604080517fa5f3c23b0000000000000000000000000000000000000000000000000000000081526004810192909252602482018a90525173__Math__________________________________9263a5f3c23b9260448082019391829003018186803b1580156106f457600080fd5b505af4158015610708573d6000803e3d6000fd5b505050506040513d602081101561071e57600080fd5b50518551869060ff8b1690811061073157fe5b602090810290910101526107488486856001610bdd565b9050818112156107555750805b81810395508568010000000000000000808204021415610782576801000000000000000086049550610794565b68010000000000000000860460010195505b868611156107a0578695505b50505050509392505050565b60006060600080600080600188600160a060020a031663e274fd246040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156107f657600080fd5b505af115801561080a573d6000803e3d6000fd5b505050506040513d602081101561082057600080fd5b50516040805160e160020a633ee478430281529051600160a060020a0390921691637dc8f086916004808201926020929091908290030181600087803b15801561086957600080fd5b505af115801561087d573d6000803e3d6000fd5b505050506040513d602081101561089357600080fd5b505160ff16116108a257600080fd5b6108ab88610a1a565b945073__Math__________________________________6320ddd2556801000000000000000087510260026040518363ffffffff1660e060020a028152600401808381526020018260028111156108fe57fe5b60ff1681526020019250505060206040518083038186803b15801561092257600080fd5b505af4158015610936573d6000803e3d6000fd5b505050506040513d602081101561094c57600080fd5b5051604080517fcb4c86b70000000000000000000000000000000000000000000000000000000081529051919550600160a060020a038a169163cb4c86b7916004808201926020929091908290030181600087803b1580156109ad57600080fd5b505af11580156109c1573d6000803e3d6000fd5b505050506040513d60208110156109d757600080fd5b505192506109e98486858a6002610e72565b92505091506801000000000000000082811515610a0257fe5b0481811515610a0d57fe5b0498975050505050505050565b6060600082600160a060020a031663e274fd246040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015610a5c57600080fd5b505af1158015610a70573d6000803e3d6000fd5b505050506040513d6020811015610a8657600080fd5b50516040805160e160020a633ee478430281529051600160a060020a0390921691637dc8f086916004808201926020929091908290030181600087803b158015610acf57600080fd5b505af1158015610ae3573d6000803e3d6000fd5b505050506040513d6020811015610af957600080fd5b50516040805160ff90921680835260208181028401019091528015610b28578160200160208202803883390190505b509150600090505b81518160ff161015610bd75782600160a060020a031663a157979c826040518263ffffffff1660e060020a028152600401808260ff168152602001915050602060405180830381600087803b158015610b8857600080fd5b505af1158015610b9c573d6000803e3d6000fd5b505050506040513d6020811015610bb257600080fd5b50518251839060ff8416908110610bc557fe5b60209081029091010152600101610b30565b50919050565b6000806000610bf0878787600088610e72565b509150915073__Math__________________________________6320ddd25583866040518363ffffffff1660e060020a02815260040180838152602001826002811115610c3957fe5b60ff1681526020019250505060206040518083038186803b158015610c5d57600080fd5b505af4158015610c71573d6000803e3d6000fd5b505050506040513d6020811015610c8757600080fd5b5051604080517fa5f3c23b0000000000000000000000000000000000000000000000000000000081526004810183905260248101849052905191945073__Math__________________________________9163a5f3c23b91604480820192602092909190829003018186803b158015610cff57600080fd5b505af4158015610d13573d6000803e3d6000fd5b505050506040513d6020811015610d2957600080fd5b5051604080517fbbe93d91000000000000000000000000000000000000000000000000000000008152600481018390526801000000000000000060248201529051919450889173__Math__________________________________9163bbe93d91916044808301926020929190829003018186803b158015610daa57600080fd5b505af4158015610dbe573d6000803e3d6000fd5b505050506040513d6020811015610dd457600080fd5b5051811515610ddf57fe5b0573__Math__________________________________63bbe93d919091876040518363ffffffff1660e060020a028152600401808381526020018281526020019250505060206040518083038186803b158015610e3b57600080fd5b505af4158015610e4f573d6000803e3d6000fd5b505050506040513d6020811015610e6557600080fd5b5051979650505050505050565b6000806000806000808a12158015610e8b575060008812155b1515610e9657600080fd5b6040517fccc138140000000000000000000000000000000000000000000000000000000081526020600482018181528b5160248401528b5173__Math__________________________________9363ccc13814938e9392839260440191808601910280838360005b83811015610f16578181015183820152602001610efe565b505050509050019250505060206040518083038186803b158015610f3957600080fd5b505af4158015610f4d573d6000803e3d6000fd5b505050506040513d6020811015610f6357600080fd5b5051604080517fbbe93d9100000000000000000000000000000000000000000000000000000000815260048101839052602481018d90529051919550899173__Math__________________________________9163bbe93d91916044808301926020929190829003018186803b158015610fdc57600080fd5b505af4158015610ff0573d6000803e3d6000fd5b505050506040513d602081101561100657600080fd5b505181151561101157fe5b0593508373__Math__________________________________63adefc37b909168b800000000000000006040518363ffffffff1660e060020a028152600401808381526020018281526020019250505060206040518083038186803b15801561107957600080fd5b505af415801561108d573d6000803e3d6000fd5b505050506040513d60208110156110a357600080fd5b50519350600090505b88518160ff16101561133c5773__Math__________________________________6384059dd0898b8460ff168151811015156110e457fe5b9060200190602002015173__Math__________________________________63bbe93d9190918f6040518363ffffffff1660e060020a028152600401808381526020018281526020019250505060206040518083038186803b15801561114957600080fd5b505af415801561115d573d6000803e3d6000fd5b505050506040513d602081101561117357600080fd5b505181151561117e57fe5b0573__Math__________________________________63adefc37b9091886040518363ffffffff1660e060020a028152600401808381526020018281526020019250505060206040518083038186803b1580156111da57600080fd5b505af41580156111ee573d6000803e3d6000fd5b505050506040513d602081101561120457600080fd5b505160405160e060020a63ffffffff8416028152600481018281528a9160240182600281111561123057fe5b60ff1681526020019250505060206040518083038186803b15801561125457600080fd5b505af4158015611268573d6000803e3d6000fd5b505050506040513d602081101561127e57600080fd5b5051915060ff8181169088161415611294578192505b604080517f771602f70000000000000000000000000000000000000000000000000000000081526004810187905260248101849052905173__Math__________________________________9163771602f7916044808301926020929190829003018186803b15801561130657600080fd5b505af415801561131a573d6000803e3d6000fd5b505050506040513d602081101561133057600080fd5b505194506001016110ac565b50509550955095925050505600a165627a7a72305820125637eb737d4d0603abeab033313dbd2ca44fbeba1990b67daeacde5444589b0029",
  "deployedBytecode": "0x60806040526004361061003d5763ffffffff60e060020a6000350416634091c6a98114610042578063bd8ff8171461007e578063d812d346146100a8575b600080fd5b34801561004e57600080fd5b5061006c600160a060020a036004351660ff602435166044356100cf565b60408051918252519081900360200190f35b34801561008a57600080fd5b5061006c600160a060020a036004351660ff6024351660443561041e565b3480156100b457600080fd5b5061006c600160a060020a036004351660ff602435166107ac565b60006060600080600080600189600160a060020a031663e274fd246040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561011957600080fd5b505af115801561012d573d6000803e3d6000fd5b505050506040513d602081101561014357600080fd5b50516040805160e160020a633ee478430281529051600160a060020a0390921691637dc8f086916004808201926020929091908290030181600087803b15801561018c57600080fd5b505af11580156101a0573d6000803e3d6000fd5b505050506040513d60208110156101b657600080fd5b505160ff16116101c557600080fd5b6101ce89610a1a565b945073__Math__________________________________6320ddd2556801000000000000000087510260016040518363ffffffff1660e060020a0281526004018083815260200182600281111561022157fe5b60ff1681526020019250505060206040518083038186803b15801561024557600080fd5b505af4158015610259573d6000803e3d6000fd5b505050506040513d602081101561026f57600080fd5b5051604080517fcb4c86b70000000000000000000000000000000000000000000000000000000081529051919550600160a060020a038b169163cb4c86b7916004808201926020929091908290030181600087803b1580156102d057600080fd5b505af11580156102e4573d6000803e3d6000fd5b505050506040513d60208110156102fa57600080fd5b5051925061030b8486856000610bdd565b9150600087121561031b57600080fd5b848860ff1681518110151561032c57fe5b6020908102909101810151604080517fadefc37b0000000000000000000000000000000000000000000000000000000081526004810192909252602482018a90525173__Math__________________________________9263adefc37b9260448082019391829003018186803b1580156103a557600080fd5b505af41580156103b9573d6000803e3d6000fd5b505050506040513d60208110156103cf57600080fd5b50518551869060ff8b169081106103e257fe5b602090810290910101526103f98486856001610bdd565b9050808213610406578091505b68010000000000000000910304979650505050505050565b60006060600080600080600189600160a060020a031663e274fd246040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561046857600080fd5b505af115801561047c573d6000803e3d6000fd5b505050506040513d602081101561049257600080fd5b50516040805160e160020a633ee478430281529051600160a060020a0390921691637dc8f086916004808201926020929091908290030181600087803b1580156104db57600080fd5b505af11580156104ef573d6000803e3d6000fd5b505050506040513d602081101561050557600080fd5b505160ff161161051457600080fd5b61051d89610a1a565b945073__Math__________________________________6320ddd2556801000000000000000087510260016040518363ffffffff1660e060020a0281526004018083815260200182600281111561057057fe5b60ff1681526020019250505060206040518083038186803b15801561059457600080fd5b505af41580156105a8573d6000803e3d6000fd5b505050506040513d60208110156105be57600080fd5b5051604080517fcb4c86b70000000000000000000000000000000000000000000000000000000081529051919550600160a060020a038b169163cb4c86b7916004808201926020929091908290030181600087803b15801561061f57600080fd5b505af1158015610633573d6000803e3d6000fd5b505050506040513d602081101561064957600080fd5b5051925061065a8486856000610bdd565b9150600087121561066a57600080fd5b848860ff1681518110151561067b57fe5b6020908102909101810151604080517fa5f3c23b0000000000000000000000000000000000000000000000000000000081526004810192909252602482018a90525173__Math__________________________________9263a5f3c23b9260448082019391829003018186803b1580156106f457600080fd5b505af4158015610708573d6000803e3d6000fd5b505050506040513d602081101561071e57600080fd5b50518551869060ff8b1690811061073157fe5b602090810290910101526107488486856001610bdd565b9050818112156107555750805b81810395508568010000000000000000808204021415610782576801000000000000000086049550610794565b68010000000000000000860460010195505b868611156107a0578695505b50505050509392505050565b60006060600080600080600188600160a060020a031663e274fd246040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156107f657600080fd5b505af115801561080a573d6000803e3d6000fd5b505050506040513d602081101561082057600080fd5b50516040805160e160020a633ee478430281529051600160a060020a0390921691637dc8f086916004808201926020929091908290030181600087803b15801561086957600080fd5b505af115801561087d573d6000803e3d6000fd5b505050506040513d602081101561089357600080fd5b505160ff16116108a257600080fd5b6108ab88610a1a565b945073__Math__________________________________6320ddd2556801000000000000000087510260026040518363ffffffff1660e060020a028152600401808381526020018260028111156108fe57fe5b60ff1681526020019250505060206040518083038186803b15801561092257600080fd5b505af4158015610936573d6000803e3d6000fd5b505050506040513d602081101561094c57600080fd5b5051604080517fcb4c86b70000000000000000000000000000000000000000000000000000000081529051919550600160a060020a038a169163cb4c86b7916004808201926020929091908290030181600087803b1580156109ad57600080fd5b505af11580156109c1573d6000803e3d6000fd5b505050506040513d60208110156109d757600080fd5b505192506109e98486858a6002610e72565b92505091506801000000000000000082811515610a0257fe5b0481811515610a0d57fe5b0498975050505050505050565b6060600082600160a060020a031663e274fd246040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015610a5c57600080fd5b505af1158015610a70573d6000803e3d6000fd5b505050506040513d6020811015610a8657600080fd5b50516040805160e160020a633ee478430281529051600160a060020a0390921691637dc8f086916004808201926020929091908290030181600087803b158015610acf57600080fd5b505af1158015610ae3573d6000803e3d6000fd5b505050506040513d6020811015610af957600080fd5b50516040805160ff90921680835260208181028401019091528015610b28578160200160208202803883390190505b509150600090505b81518160ff161015610bd75782600160a060020a031663a157979c826040518263ffffffff1660e060020a028152600401808260ff168152602001915050602060405180830381600087803b158015610b8857600080fd5b505af1158015610b9c573d6000803e3d6000fd5b505050506040513d6020811015610bb257600080fd5b50518251839060ff8416908110610bc557fe5b60209081029091010152600101610b30565b50919050565b6000806000610bf0878787600088610e72565b509150915073__Math__________________________________6320ddd25583866040518363ffffffff1660e060020a02815260040180838152602001826002811115610c3957fe5b60ff1681526020019250505060206040518083038186803b158015610c5d57600080fd5b505af4158015610c71573d6000803e3d6000fd5b505050506040513d6020811015610c8757600080fd5b5051604080517fa5f3c23b0000000000000000000000000000000000000000000000000000000081526004810183905260248101849052905191945073__Math__________________________________9163a5f3c23b91604480820192602092909190829003018186803b158015610cff57600080fd5b505af4158015610d13573d6000803e3d6000fd5b505050506040513d6020811015610d2957600080fd5b5051604080517fbbe93d91000000000000000000000000000000000000000000000000000000008152600481018390526801000000000000000060248201529051919450889173__Math__________________________________9163bbe93d91916044808301926020929190829003018186803b158015610daa57600080fd5b505af4158015610dbe573d6000803e3d6000fd5b505050506040513d6020811015610dd457600080fd5b5051811515610ddf57fe5b0573__Math__________________________________63bbe93d919091876040518363ffffffff1660e060020a028152600401808381526020018281526020019250505060206040518083038186803b158015610e3b57600080fd5b505af4158015610e4f573d6000803e3d6000fd5b505050506040513d6020811015610e6557600080fd5b5051979650505050505050565b6000806000806000808a12158015610e8b575060008812155b1515610e9657600080fd5b6040517fccc138140000000000000000000000000000000000000000000000000000000081526020600482018181528b5160248401528b5173__Math__________________________________9363ccc13814938e9392839260440191808601910280838360005b83811015610f16578181015183820152602001610efe565b505050509050019250505060206040518083038186803b158015610f3957600080fd5b505af4158015610f4d573d6000803e3d6000fd5b505050506040513d6020811015610f6357600080fd5b5051604080517fbbe93d9100000000000000000000000000000000000000000000000000000000815260048101839052602481018d90529051919550899173__Math__________________________________9163bbe93d91916044808301926020929190829003018186803b158015610fdc57600080fd5b505af4158015610ff0573d6000803e3d6000fd5b505050506040513d602081101561100657600080fd5b505181151561101157fe5b0593508373__Math__________________________________63adefc37b909168b800000000000000006040518363ffffffff1660e060020a028152600401808381526020018281526020019250505060206040518083038186803b15801561107957600080fd5b505af415801561108d573d6000803e3d6000fd5b505050506040513d60208110156110a357600080fd5b50519350600090505b88518160ff16101561133c5773__Math__________________________________6384059dd0898b8460ff168151811015156110e457fe5b9060200190602002015173__Math__________________________________63bbe93d9190918f6040518363ffffffff1660e060020a028152600401808381526020018281526020019250505060206040518083038186803b15801561114957600080fd5b505af415801561115d573d6000803e3d6000fd5b505050506040513d602081101561117357600080fd5b505181151561117e57fe5b0573__Math__________________________________63adefc37b9091886040518363ffffffff1660e060020a028152600401808381526020018281526020019250505060206040518083038186803b1580156111da57600080fd5b505af41580156111ee573d6000803e3d6000fd5b505050506040513d602081101561120457600080fd5b505160405160e060020a63ffffffff8416028152600481018281528a9160240182600281111561123057fe5b60ff1681526020019250505060206040518083038186803b15801561125457600080fd5b505af4158015611268573d6000803e3d6000fd5b505050506040513d602081101561127e57600080fd5b5051915060ff8181169088161415611294578192505b604080517f771602f70000000000000000000000000000000000000000000000000000000081526004810187905260248101849052905173__Math__________________________________9163771602f7916044808301926020929190829003018186803b15801561130657600080fd5b505af415801561131a573d6000803e3d6000fd5b505050506040513d602081101561133057600080fd5b505194506001016110ac565b50509550955095925050505600a165627a7a72305820125637eb737d4d0603abeab033313dbd2ca44fbeba1990b67daeacde5444589b0029",
  "sourceMap": "268:8633:1:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;268:8633:1;;;;;;;",
  "deployedSourceMap": "268:8633:1:-;;;;;;;;;-1:-1:-1;;;268:8633:1;;;;;;;;;;;;;;;;;;;;;;;2595:1265;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2595:1265:1;-1:-1:-1;;;;;2595:1265:1;;;;;;;;;;;;;;;;;;;;;;;;;;;754:1579;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;754:1579:1;-1:-1:-1;;;;;754:1579:1;;;;;;;;;;;4104:819;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4104:819:1;-1:-1:-1;;;;;4104:819:1;;;;;;;;;2595:1265;2728:11;2818:33;2963:9;3061:12;3102:19;3515:18;2806:1;2763:6;-1:-1:-1;;;;;2763:20:1;;:22;;;;;-1:-1:-1;;;2763:22:1;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2763:22:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2763:22:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2763:22:1;:40;;;-1:-1:-1;;;;;2763:40:1;;;;-1:-1:-1;;;;;2763:38:1;;;;;;:40;;;;;:22;;:40;;;;;;;;;:38;:40;;;5:2:-1;;;;30:1;27;20:12;5:2;2763:40:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2763:40:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2763:40:1;:44;;;2755:53;;;;;;2854:31;2878:6;2854:23;:31::i;:::-;2818:67;;2975:4;:9;390:19;2985:20;:27;:33;3020:30;2975:76;;;;;-1:-1:-1;;;2975:76:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2975:76:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2975:76:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2975:76:1;3076:16;;;;;;;;2975:76;;-1:-1:-1;;;;;;3076:14:1;;;;;:16;;;;;2975:76;;3076:16;;;;;;;;;:14;:16;;;5:2:-1;;;;30:1;27;20:12;5:2;3076:16:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3076:16:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3076:16:1;;-1:-1:-1;3124:83:1;3138:5;3145:20;3076:16;3176:30;3124:13;:83::i;:::-;3102:105;-1:-1:-1;3326:1:1;3300:27;;;3292:36;;;;;;3380:20;3401:17;3380:39;;;;;;;;;;;;;;;;;;;;;;:67;;;;;;;;;;;;;;;;;;;;:43;;;;:67;;;;;;;;;;;:43;:67;;;5:2:-1;;;;30:1;27;20:12;5:2;3380:67:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3380:67:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3380:67:1;3338:39;;:20;;:39;;;;;;;;;;;;;;;;;;:109;3536:83;3550:5;3557:20;3579:7;3588:30;3536:13;:83::i;:::-;3515:104;-1:-1:-1;3685:33:1;;;3682:82;;3750:14;3732:32;;3682:82;390:19;3814:32;;3809:44;;;-1:-1:-1;;;;;;;2595:1265:1:o;754:1579::-;885:9;973:33;1118:9;1216:12;1257:19;1659:18;961:1;918:6;-1:-1:-1;;;;;918:20:1;;:22;;;;;-1:-1:-1;;;918:22:1;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;918:22:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;918:22:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;918:22:1;:40;;;-1:-1:-1;;;;;918:40:1;;;;-1:-1:-1;;;;;918:38:1;;;;;;:40;;;;;:22;;:40;;;;;;;;;:38;:40;;;5:2:-1;;;;30:1;27;20:12;5:2;918:40:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;918:40:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;918:40:1;:44;;;910:53;;;;;;1009:31;1033:6;1009:23;:31::i;:::-;973:67;;1130:4;:9;390:19;1140:20;:27;:33;1175:30;1130:76;;;;;-1:-1:-1;;;1130:76:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1130:76:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1130:76:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1130:76:1;1231:16;;;;;;;;1130:76;;-1:-1:-1;;;;;;1231:14:1;;;;;:16;;;;;1130:76;;1231:16;;;;;;;;;:14;:16;;;5:2:-1;;;;30:1;27;20:12;5:2;1231:16:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1231:16:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1231:16:1;;-1:-1:-1;1279:83:1;1293:5;1300:20;1231:16;1331:30;1279:13;:83::i;:::-;1257:105;-1:-1:-1;1470:1:1;1444:27;;;1436:36;;;;;;1524:20;1545:17;1524:39;;;;;;;;;;;;;;;;;;;;;;:67;;;;;;;;;;;;;;;;;;;;:43;;;;:67;;;;;;;;;;;:43;:67;;;5:2:-1;;;;30:1;27;20:12;5:2;1524:67:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1524:67:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1524:67:1;1482:39;;:20;;:39;;;;;;;;;;;;;;;;;;:109;1680:83;1694:5;1701:20;1723:7;1732:30;1680:13;:83::i;:::-;1659:104;;1844:15;1827:14;:32;1824:81;;;-1:-1:-1;1890:15:1;1824:81;1927:32;;;;-1:-1:-1;1927:32:1;390:19;;1927:32;2026:10;:16;:24;2022:171;;;390:19;2064:11;;;;2022:171;;;390:19;2179:4;:10;2192:1;2179:14;2172:21;;2022:171;2271:17;2264:4;:24;2260:66;;;2309:17;2302:24;;2260:66;754:1579;;;;;;;;;;:::o;4104:819::-;4220:10;4309:33;4386:8;4481:12;4748:3;4755:14;4297:1;4254:6;-1:-1:-1;;;;;4254:20:1;;:22;;;;;-1:-1:-1;;;4254:22:1;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4254:22:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4254:22:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4254:22:1;:40;;;-1:-1:-1;;;;;4254:40:1;;;;-1:-1:-1;;;;;4254:38:1;;;;;;:40;;;;;:22;;:40;;;;;;;;;:38;:40;;;5:2:-1;;;;30:1;27;20:12;5:2;4254:40:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4254:40:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4254:40:1;:44;;;4246:53;;;;;;4345:31;4369:6;4345:23;:31::i;:::-;4309:67;;4397:4;:9;390:19;4407:20;:27;:33;4442:28;4397:74;;;;;-1:-1:-1;;;4397:74:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4397:74:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4397:74:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4397:74:1;4496:16;;;;;;;;4397:74;;-1:-1:-1;;;;;;4496:14:1;;;;;:16;;;;;4397:74;;4496:16;;;;;;;;;:14;:16;;;5:2:-1;;;;30:1;27;20:12;5:2;4496:16:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4496:16:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4496:16:1;;-1:-1:-1;4773:98:1;4786:4;4792:20;4496:16;4823:17;4842:28;4773:12;:98::i;:::-;4743:128;;;;;390:19;4906:3;:9;;;;;;;;4888:14;:28;;;;;;;;;4104:819;-1:-1:-1;;;;;;;;4104:819:1:o;8584:315::-;8682:16;8793:7;8737:6;-1:-1:-1;;;;;8737:20:1;;:22;;;;;-1:-1:-1;;;8737:22:1;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;8737:22:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;8737:22:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;8737:22:1;:40;;;-1:-1:-1;;;;;8737:40:1;;;;-1:-1:-1;;;;;8737:38:1;;;;;;:40;;;;;:22;;:40;;;;;;;;;:38;:40;;;5:2:-1;;;;30:1;27;20:12;5:2;8737:40:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;8737:40:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;8737:40:1;8727:51;;;;;;;;;;8737:40;8727:51;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;136:17;;-1:-1;8727:51:1;;8714:64;;8803:1;8793:11;;8788:104;8810:10;:17;8806:1;:21;;;8788:104;;;8862:6;-1:-1:-1;;;;;8862:27:1;;8890:1;8862:30;;;;;-1:-1:-1;;;8862:30:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;8862:30:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;8862:30:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;8862:30:1;8846:13;;:10;;:13;;;;;;;;;;;;;;;;;;:46;8829:3;;8788:104;;;8584:315;;;;:::o;5300:682::-;5460:13;5723:3;5728:6;5740:68;5753:4;5759:20;5781:7;5790:1;5793:14;5740:12;:68::i;:::-;5718:90;;;;;5830:4;:9;5840:3;5845:14;5830:30;;;;;-1:-1:-1;;;5830:30:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5830:30:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5830:30:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5830:30:1;5882:21;;;;;;;;;;;;;;;;;;;;5830:30;;-1:-1:-1;5882:13:1;;;;:21;;;;;5830:30;;5882:21;;;;;;;;:13;:21;;;5:2:-1;;;;30:1;27;20:12;5:2;5882:21:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5882:21:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5882:21:1;5926:23;;;;;;;;;;;;390:19;5926:23;;;;;;5882:21;;-1:-1:-1;5952:4:1;;5926:13;;;;:23;;;;;5882:21;;5926:23;;;;;;;:13;:23;;;5:2:-1;;;;30:1;27;20:12;5:2;5926:23:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5926:23:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5926:23:1;:30;;;;;;;;5925:36;;;;5966:7;5925:50;;;;;-1:-1:-1;;;5925:50:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5925:50:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5925:50:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5925:50:1;;5300:682;-1:-1:-1;;;;;;;5300:682:1:o;6528:1576::-;6708:8;6718:10;6730:19;7795:9;7819:7;7623:1;7615:4;:9;;:30;;;;;7644:1;7632:7;7628:17;;7615:30;7607:39;;;;;;;;7665:30;;;;;;;;;;;;;;;;;;;;:4;;:8;;7674:20;;7665:30;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;7665:30:1;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;7665:30:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;7665:30:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;7665:30:1;7714:16;;;;;;;;;;;;;;;;;;;;7665:30;;-1:-1:-1;7737:7:1;;7714:10;;;;:16;;;;;7665:30;;7714:16;;;;;;;:10;:16;;;5:2:-1;;;;30:1;27;20:12;5:2;7714:16:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;7714:16:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;7714:16:1;:31;;;;;;;;7705:40;;7764:6;:10;;;;440:22;7764:21;;;;;-1:-1:-1;;;7764:21:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;7764:21:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;7764:21:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;7764:21:1;;-1:-1:-1;7829:1:1;;-1:-1:-1;7814:284:1;7836:20;:27;7832:1;:31;;;7814:284;;;7891:4;:9;7942:7;7902:20;7923:1;7902:23;;;;;;;;;;;;;;;;;;;;:27;;;;7930:4;7902:33;;;;;-1:-1:-1;;;7902:33:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;7902:33:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;7902:33:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;7902:33:1;:48;;;;;;;;7901:54;;;;7956:6;7901:62;;;;;-1:-1:-1;;;7901:62:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;7901:62:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;7901:62:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;7901:62:1;7891:89;;-1:-1:-1;;;7891:89:1;;;;;;;;;;;;7965:14;;7891:89;;7965:14;7891:89;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;7891:89:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;7891:89:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;7891:89:1;;-1:-1:-1;7998:17:1;;;;;;;;7994:60;;;8050:4;8033:21;;7994:60;8074:13;;;;;;;;;;;;;;;;;;;;:7;;;;:13;;;;;;;;;;;;;;:7;:13;;;5:2:-1;;;;30:1;27;20:12;5:2;8074:13:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;8074:13:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;8074:13:1;;-1:-1:-1;7865:3:1;;7814:284;;;6528:1576;;;;;;;;;;;:::o",
  "source": "pragma solidity ^0.4.15;\nimport \"@gnosis.pm/pm-contracts/contracts/Utils/Math.sol\";\nimport \"./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 Math for *;\n\n    /*\n     *  Constants\n     */\n    uint constant ONE = 0x10000000000000000;\n    int constant EXP_LIMIT = 3394200909562557497344;\n\n    /*\n     *  Public functions\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        constant\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 = Math.log2(netOutcomeTokensSold.length * ONE, Math.EstimationMode.UpperBound);\n        uint funding = market.funding();\n        int costLevelBefore = calcCostLevel(log2N, netOutcomeTokensSold, funding, Math.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, Math.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        constant\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 = Math.log2(netOutcomeTokensSold.length * ONE, Math.EstimationMode.UpperBound);\n        uint funding = market.funding();\n        int costLevelBefore = calcCostLevel(log2N, netOutcomeTokensSold, funding, Math.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, Math.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        constant\n        returns (uint price)\n    {\n        require(market.eventContract().getOutcomeCount() > 1);\n        int[] memory netOutcomeTokensSold = getNetOutcomeTokensSold(market);\n        int logN = Math.log2(netOutcomeTokensSold.length * ONE, Math.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        var (sum, , outcomeExpTerm) = sumExpOffset(logN, netOutcomeTokensSold, funding, outcomeTokenIndex, Math.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[] netOutcomeTokensSold, uint funding, Math.EstimationMode estimationMode)\n        private\n        constant\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        var (sum, offset, ) = sumExpOffset(logN, netOutcomeTokensSold, funding, 0, estimationMode);\n        costLevel = Math.log2(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[] netOutcomeTokensSold, uint funding, uint8 outcomeIndex, Math.EstimationMode estimationMode)\n        private\n        constant\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 = Math.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 = Math.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        constant\n        returns (int[] 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}\n",
  "sourcePath": "/home/josojo/reality/tokenized-events/contracts/Market/LMSRMarketMaker.sol",
  "ast": {
    "absolutePath": "/home/josojo/reality/tokenized-events/contracts/Market/LMSRMarketMaker.sol",
    "exportedSymbols": {
      "LMSRMarketMaker": [
        815
      ]
    },
    "id": 816,
    "nodeType": "SourceUnit",
    "nodes": [
      {
        "id": 281,
        "literals": [
          "solidity",
          "^",
          "0.4",
          ".15"
        ],
        "nodeType": "PragmaDirective",
        "src": "0:24:1"
      },
      {
        "absolutePath": "@gnosis.pm/pm-contracts/contracts/Utils/Math.sol",
        "file": "@gnosis.pm/pm-contracts/contracts/Utils/Math.sol",
        "id": 282,
        "nodeType": "ImportDirective",
        "scope": 816,
        "sourceUnit": 3955,
        "src": "25:58:1",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "absolutePath": "/home/josojo/reality/tokenized-events/contracts/Market/MarketMaker.sol",
        "file": "./MarketMaker.sol",
        "id": 283,
        "nodeType": "ImportDirective",
        "scope": 816,
        "sourceUnit": 921,
        "src": "84:27:1",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "baseContracts": [
          {
            "arguments": null,
            "baseName": {
              "contractScope": null,
              "id": 284,
              "name": "MarketMaker",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 920,
              "src": "296:11:1",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_MarketMaker_$920",
                "typeString": "contract MarketMaker"
              }
            },
            "id": 285,
            "nodeType": "InheritanceSpecifier",
            "src": "296:11:1"
          }
        ],
        "contractDependencies": [
          920
        ],
        "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": 815,
        "linearizedBaseContracts": [
          815,
          920
        ],
        "name": "LMSRMarketMaker",
        "nodeType": "ContractDefinition",
        "nodes": [
          {
            "id": 287,
            "libraryName": {
              "contractScope": null,
              "id": 286,
              "name": "Math",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 3954,
              "src": "320:4:1",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_Math_$3954",
                "typeString": "library Math"
              }
            },
            "nodeType": "UsingForDirective",
            "src": "314:17:1",
            "typeName": null
          },
          {
            "constant": true,
            "id": 290,
            "name": "ONE",
            "nodeType": "VariableDeclaration",
            "scope": 815,
            "src": "370:39:1",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_uint256",
              "typeString": "uint256"
            },
            "typeName": {
              "id": 288,
              "name": "uint",
              "nodeType": "ElementaryTypeName",
              "src": "370:4:1",
              "typeDescriptions": {
                "typeIdentifier": "t_uint256",
                "typeString": "uint256"
              }
            },
            "value": {
              "argumentTypes": null,
              "hexValue": "30783130303030303030303030303030303030",
              "id": 289,
              "isConstant": false,
              "isLValue": false,
              "isPure": true,
              "kind": "number",
              "lValueRequested": false,
              "nodeType": "Literal",
              "src": "390:19:1",
              "subdenomination": null,
              "typeDescriptions": {
                "typeIdentifier": "t_rational_18446744073709551616_by_1",
                "typeString": "int_const 18446744073709551616"
              },
              "value": "0x10000000000000000"
            },
            "visibility": "internal"
          },
          {
            "constant": true,
            "id": 293,
            "name": "EXP_LIMIT",
            "nodeType": "VariableDeclaration",
            "scope": 815,
            "src": "415:47:1",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_int256",
              "typeString": "int256"
            },
            "typeName": {
              "id": 291,
              "name": "int",
              "nodeType": "ElementaryTypeName",
              "src": "415:3:1",
              "typeDescriptions": {
                "typeIdentifier": "t_int256",
                "typeString": "int256"
              }
            },
            "value": {
              "argumentTypes": null,
              "hexValue": "33333934323030393039353632353537343937333434",
              "id": 292,
              "isConstant": false,
              "isLValue": false,
              "isPure": true,
              "kind": "number",
              "lValueRequested": false,
              "nodeType": "Literal",
              "src": "440:22:1",
              "subdenomination": null,
              "typeDescriptions": {
                "typeIdentifier": "t_rational_3394200909562557497344_by_1",
                "typeString": "int_const 3394200909562557497344"
              },
              "value": "3394200909562557497344"
            },
            "visibility": "internal"
          },
          {
            "body": {
              "id": 428,
              "nodeType": "Block",
              "src": "900:1433:1",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "id": 311,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [],
                          "expression": {
                            "argumentTypes": [],
                            "expression": {
                              "argumentTypes": null,
                              "arguments": [],
                              "expression": {
                                "argumentTypes": [],
                                "expression": {
                                  "argumentTypes": null,
                                  "id": 305,
                                  "name": "market",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 295,
                                  "src": "918:6:1",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_Market_$885",
                                    "typeString": "contract Market"
                                  }
                                },
                                "id": 306,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "eventContract",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 869,
                                "src": "918:20:1",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_function_external_view$__$returns$_t_contract$_ScalarEvent_$2415_$",
                                  "typeString": "function () view external returns (contract ScalarEvent)"
                                }
                              },
                              "id": 307,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "functionCall",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "918:22:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_ScalarEvent_$2415",
                                "typeString": "contract ScalarEvent"
                              }
                            },
                            "id": 308,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "getOutcomeCount",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 2364,
                            "src": "918:38:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_view$__$returns$_t_uint8_$",
                              "typeString": "function () view external returns (uint8)"
                            }
                          },
                          "id": 309,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "918:40:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "31",
                          "id": 310,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "961:1:1",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_1_by_1",
                            "typeString": "int_const 1"
                          },
                          "value": "1"
                        },
                        "src": "918:44:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 304,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        8526,
                        8527
                      ],
                      "referencedDeclaration": 8526,
                      "src": "910:7:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 312,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "910:53:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 313,
                  "nodeType": "ExpressionStatement",
                  "src": "910:53:1"
                },
                {
                  "assignments": [
                    317
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 317,
                      "name": "netOutcomeTokensSold",
                      "nodeType": "VariableDeclaration",
                      "scope": 429,
                      "src": "973:33:1",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                        "typeString": "int256[]"
                      },
                      "typeName": {
                        "baseType": {
                          "id": 315,
                          "name": "int",
                          "nodeType": "ElementaryTypeName",
                          "src": "973:3:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 316,
                        "length": null,
                        "nodeType": "ArrayTypeName",
                        "src": "973:5:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                          "typeString": "int256[]"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 321,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 319,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 295,
                        "src": "1033:6:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$885",
                          "typeString": "contract Market"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_contract$_Market_$885",
                          "typeString": "contract Market"
                        }
                      ],
                      "id": 318,
                      "name": "getNetOutcomeTokensSold",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 814,
                      "src": "1009:23:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_contract$_Market_$885_$returns$_t_array$_t_int256_$dyn_memory_ptr_$",
                        "typeString": "function (contract Market) view returns (int256[] memory)"
                      }
                    },
                    "id": 320,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1009:31:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                      "typeString": "int256[] memory"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "973:67:1"
                },
                {
                  "assignments": [
                    323
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 323,
                      "name": "log2N",
                      "nodeType": "VariableDeclaration",
                      "scope": 429,
                      "src": "1118:9:1",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 322,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "1118:3:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 334,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 329,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 326,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 317,
                            "src": "1140:20:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 327,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "length",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": null,
                          "src": "1140:27:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "*",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 328,
                          "name": "ONE",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 290,
                          "src": "1170:3:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "1140:33:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 330,
                            "name": "Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 3954,
                            "src": "1175:4:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Math_$3954_$",
                              "typeString": "type(library Math)"
                            }
                          },
                          "id": 331,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 2709,
                          "src": "1175:19:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$2709_$",
                            "typeString": "type(enum Math.EstimationMode)"
                          }
                        },
                        "id": 332,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "UpperBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "1175:30:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$2709",
                          "typeString": "enum Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$2709",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 324,
                        "name": "Math",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 3954,
                        "src": "1130:4:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_contract$_Math_$3954_$",
                          "typeString": "type(library Math)"
                        }
                      },
                      "id": 325,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "log2",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 3461,
                      "src": "1130:9:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_delegatecall_view$_t_uint256_$_t_enum$_EstimationMode_$2709_$returns$_t_int256_$",
                        "typeString": "function (uint256,enum Math.EstimationMode) view returns (int256)"
                      }
                    },
                    "id": 333,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1130:76:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1118:88:1"
                },
                {
                  "assignments": [
                    336
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 336,
                      "name": "funding",
                      "nodeType": "VariableDeclaration",
                      "scope": 429,
                      "src": "1216:12:1",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 335,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "1216:4:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 340,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 337,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 295,
                        "src": "1231:6:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$885",
                          "typeString": "contract Market"
                        }
                      },
                      "id": 338,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "funding",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 875,
                      "src": "1231:14:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                        "typeString": "function () view external returns (uint256)"
                      }
                    },
                    "id": 339,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1231:16:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1216:31:1"
                },
                {
                  "assignments": [
                    342
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 342,
                      "name": "costLevelBefore",
                      "nodeType": "VariableDeclaration",
                      "scope": 429,
                      "src": "1257:19:1",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 341,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "1257:3:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 351,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 344,
                        "name": "log2N",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 323,
                        "src": "1293:5:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 345,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 317,
                        "src": "1300:20:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 346,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 336,
                        "src": "1322:7:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 347,
                            "name": "Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 3954,
                            "src": "1331:4:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Math_$3954_$",
                              "typeString": "type(library Math)"
                            }
                          },
                          "id": 348,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 2709,
                          "src": "1331:19:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$2709_$",
                            "typeString": "type(enum Math.EstimationMode)"
                          }
                        },
                        "id": 349,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "LowerBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "1331:30:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$2709",
                          "typeString": "enum Math.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_$2709",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "id": 343,
                      "name": "calcCostLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 662,
                      "src": "1279:13:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_enum$_EstimationMode_$2709_$returns$_t_int256_$",
                        "typeString": "function (int256,int256[] memory,uint256,enum Math.EstimationMode) view returns (int256)"
                      }
                    },
                    "id": 350,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1279:83:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1257:105:1"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        },
                        "id": 357,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 354,
                              "name": "outcomeTokenCount",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 299,
                              "src": "1448:17:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 353,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "1444:3:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_int256_$",
                              "typeString": "type(int256)"
                            },
                            "typeName": "int"
                          },
                          "id": 355,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "1444:22:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">=",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "30",
                          "id": 356,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "1470:1:1",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_0_by_1",
                            "typeString": "int_const 0"
                          },
                          "value": "0"
                        },
                        "src": "1444:27:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 352,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        8526,
                        8527
                      ],
                      "referencedDeclaration": 8526,
                      "src": "1436:7:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 358,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1436:36:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 359,
                  "nodeType": "ExpressionStatement",
                  "src": "1436:36:1"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 371,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "baseExpression": {
                        "argumentTypes": null,
                        "id": 360,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 317,
                        "src": "1482:20:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      "id": 362,
                      "indexExpression": {
                        "argumentTypes": null,
                        "id": 361,
                        "name": "outcomeTokenIndex",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 297,
                        "src": "1503:17:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      },
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "nodeType": "IndexAccess",
                      "src": "1482:39:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 368,
                              "name": "outcomeTokenCount",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 299,
                              "src": "1572:17:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 367,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "1568:3:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_int256_$",
                              "typeString": "type(int256)"
                            },
                            "typeName": "int"
                          },
                          "id": 369,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "1568:22:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "baseExpression": {
                            "argumentTypes": null,
                            "id": 363,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 317,
                            "src": "1524:20:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 365,
                          "indexExpression": {
                            "argumentTypes": null,
                            "id": 364,
                            "name": "outcomeTokenIndex",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 297,
                            "src": "1545:17:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          },
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "nodeType": "IndexAccess",
                          "src": "1524:39:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 366,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "add",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 3911,
                        "src": "1524:43:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_delegatecall_view$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                          "typeString": "function (int256,int256) view returns (int256)"
                        }
                      },
                      "id": 370,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "1524:67:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "1482:109:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 372,
                  "nodeType": "ExpressionStatement",
                  "src": "1482:109:1"
                },
                {
                  "assignments": [
                    374
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 374,
                      "name": "costLevelAfter",
                      "nodeType": "VariableDeclaration",
                      "scope": 429,
                      "src": "1659:18:1",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 373,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "1659:3:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 383,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 376,
                        "name": "log2N",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 323,
                        "src": "1694:5:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 377,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 317,
                        "src": "1701:20:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 378,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 336,
                        "src": "1723:7:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 379,
                            "name": "Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 3954,
                            "src": "1732:4:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Math_$3954_$",
                              "typeString": "type(library Math)"
                            }
                          },
                          "id": 380,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 2709,
                          "src": "1732:19:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$2709_$",
                            "typeString": "type(enum Math.EstimationMode)"
                          }
                        },
                        "id": 381,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "UpperBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "1732:30:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$2709",
                          "typeString": "enum Math.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_$2709",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "id": 375,
                      "name": "calcCostLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 662,
                      "src": "1680:13:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_enum$_EstimationMode_$2709_$returns$_t_int256_$",
                        "typeString": "function (int256,int256[] memory,uint256,enum Math.EstimationMode) view returns (int256)"
                      }
                    },
                    "id": 382,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1680:83:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1659:104:1"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    },
                    "id": 386,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 384,
                      "name": "costLevelAfter",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 374,
                      "src": "1827:14:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 385,
                      "name": "costLevelBefore",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 342,
                      "src": "1844:15:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "1827:32:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 391,
                  "nodeType": "IfStatement",
                  "src": "1824:81:1",
                  "trueBody": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 389,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 387,
                        "name": "costLevelAfter",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 374,
                        "src": "1873:14:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "id": 388,
                        "name": "costLevelBefore",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 342,
                        "src": "1890:15:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "src": "1873:32:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 390,
                    "nodeType": "ExpressionStatement",
                    "src": "1873:32:1"
                  }
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 398,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 392,
                      "name": "cost",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 302,
                      "src": "1915:4:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          },
                          "id": 396,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 394,
                            "name": "costLevelAfter",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 374,
                            "src": "1927:14:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "-",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 395,
                            "name": "costLevelBefore",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 342,
                            "src": "1944:15:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "src": "1927:32:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "id": 393,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "nodeType": "ElementaryTypeNameExpression",
                        "src": "1922:4:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_uint256_$",
                          "typeString": "type(uint256)"
                        },
                        "typeName": "uint"
                      },
                      "id": 397,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "typeConversion",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "1922:38:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "1915:45:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 399,
                  "nodeType": "ExpressionStatement",
                  "src": "1915:45:1"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 406,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 404,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 402,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 400,
                          "name": "cost",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 302,
                          "src": "2026:4:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "/",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 401,
                          "name": "ONE",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 290,
                          "src": "2033:3:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "2026:10:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "*",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 403,
                        "name": "ONE",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 290,
                        "src": "2039:3:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "2026:16:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "==",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 405,
                      "name": "cost",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 302,
                      "src": "2046:4:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "2026:24:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 417,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 411,
                        "name": "cost",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 302,
                        "src": "2172:4:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 416,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          "id": 414,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 412,
                            "name": "cost",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 302,
                            "src": "2179:4:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "/",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 413,
                            "name": "ONE",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 290,
                            "src": "2186:3:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "2179:10:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "+",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "31",
                          "id": 415,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "2192:1:1",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_1_by_1",
                            "typeString": "int_const 1"
                          },
                          "value": "1"
                        },
                        "src": "2179:14:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "2172:21:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "id": 418,
                    "nodeType": "ExpressionStatement",
                    "src": "2172:21:1"
                  },
                  "id": 419,
                  "nodeType": "IfStatement",
                  "src": "2022:171:1",
                  "trueBody": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 409,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 407,
                        "name": "cost",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 302,
                        "src": "2064:4:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "/=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "id": 408,
                        "name": "ONE",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 290,
                        "src": "2072:3:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "2064:11:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "id": 410,
                    "nodeType": "ExpressionStatement",
                    "src": "2064:11:1"
                  }
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 422,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 420,
                      "name": "cost",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 302,
                      "src": "2264:4:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 421,
                      "name": "outcomeTokenCount",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 299,
                      "src": "2271:17:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "2264:24:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 427,
                  "nodeType": "IfStatement",
                  "src": "2260:66:1",
                  "trueBody": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 425,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 423,
                        "name": "cost",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 302,
                        "src": "2302:4:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "id": 424,
                        "name": "outcomeTokenCount",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 299,
                        "src": "2309:17:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "2302:24:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "id": 426,
                    "nodeType": "ExpressionStatement",
                    "src": "2302:24:1"
                  }
                }
              ]
            },
            "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": 429,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": true,
            "modifiers": [],
            "name": "calcCost",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 300,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 295,
                  "name": "market",
                  "nodeType": "VariableDeclaration",
                  "scope": 429,
                  "src": "772:13:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_contract$_Market_$885",
                    "typeString": "contract Market"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 294,
                    "name": "Market",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 885,
                    "src": "772:6:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_Market_$885",
                      "typeString": "contract Market"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 297,
                  "name": "outcomeTokenIndex",
                  "nodeType": "VariableDeclaration",
                  "scope": 429,
                  "src": "787:23:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint8",
                    "typeString": "uint8"
                  },
                  "typeName": {
                    "id": 296,
                    "name": "uint8",
                    "nodeType": "ElementaryTypeName",
                    "src": "787:5:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint8",
                      "typeString": "uint8"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 299,
                  "name": "outcomeTokenCount",
                  "nodeType": "VariableDeclaration",
                  "scope": 429,
                  "src": "812:22:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 298,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "812:4:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "771:64:1"
            },
            "payable": false,
            "returnParameters": {
              "id": 303,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 302,
                  "name": "cost",
                  "nodeType": "VariableDeclaration",
                  "scope": 429,
                  "src": "885:9:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 301,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "885:4:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "884:11:1"
            },
            "scope": 815,
            "src": "754:1579:1",
            "stateMutability": "view",
            "superFunction": 899,
            "visibility": "public"
          },
          {
            "body": {
              "id": 538,
              "nodeType": "Block",
              "src": "2745:1115:1",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "id": 447,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [],
                          "expression": {
                            "argumentTypes": [],
                            "expression": {
                              "argumentTypes": null,
                              "arguments": [],
                              "expression": {
                                "argumentTypes": [],
                                "expression": {
                                  "argumentTypes": null,
                                  "id": 441,
                                  "name": "market",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 431,
                                  "src": "2763:6:1",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_Market_$885",
                                    "typeString": "contract Market"
                                  }
                                },
                                "id": 442,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "eventContract",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 869,
                                "src": "2763:20:1",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_function_external_view$__$returns$_t_contract$_ScalarEvent_$2415_$",
                                  "typeString": "function () view external returns (contract ScalarEvent)"
                                }
                              },
                              "id": 443,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "functionCall",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "2763:22:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_ScalarEvent_$2415",
                                "typeString": "contract ScalarEvent"
                              }
                            },
                            "id": 444,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "getOutcomeCount",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 2364,
                            "src": "2763:38:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_view$__$returns$_t_uint8_$",
                              "typeString": "function () view external returns (uint8)"
                            }
                          },
                          "id": 445,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "2763:40:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "31",
                          "id": 446,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "2806:1:1",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_1_by_1",
                            "typeString": "int_const 1"
                          },
                          "value": "1"
                        },
                        "src": "2763:44:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 440,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        8526,
                        8527
                      ],
                      "referencedDeclaration": 8526,
                      "src": "2755:7:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 448,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "2755:53:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 449,
                  "nodeType": "ExpressionStatement",
                  "src": "2755:53:1"
                },
                {
                  "assignments": [
                    453
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 453,
                      "name": "netOutcomeTokensSold",
                      "nodeType": "VariableDeclaration",
                      "scope": 539,
                      "src": "2818:33:1",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                        "typeString": "int256[]"
                      },
                      "typeName": {
                        "baseType": {
                          "id": 451,
                          "name": "int",
                          "nodeType": "ElementaryTypeName",
                          "src": "2818:3:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 452,
                        "length": null,
                        "nodeType": "ArrayTypeName",
                        "src": "2818:5:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                          "typeString": "int256[]"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 457,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 455,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 431,
                        "src": "2878:6:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$885",
                          "typeString": "contract Market"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_contract$_Market_$885",
                          "typeString": "contract Market"
                        }
                      ],
                      "id": 454,
                      "name": "getNetOutcomeTokensSold",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 814,
                      "src": "2854:23:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_contract$_Market_$885_$returns$_t_array$_t_int256_$dyn_memory_ptr_$",
                        "typeString": "function (contract Market) view returns (int256[] memory)"
                      }
                    },
                    "id": 456,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "2854:31:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                      "typeString": "int256[] memory"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "2818:67:1"
                },
                {
                  "assignments": [
                    459
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 459,
                      "name": "log2N",
                      "nodeType": "VariableDeclaration",
                      "scope": 539,
                      "src": "2963:9:1",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 458,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "2963:3:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 470,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 465,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 462,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 453,
                            "src": "2985:20:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 463,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "length",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": null,
                          "src": "2985:27:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "*",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 464,
                          "name": "ONE",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 290,
                          "src": "3015:3:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "2985:33:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 466,
                            "name": "Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 3954,
                            "src": "3020:4:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Math_$3954_$",
                              "typeString": "type(library Math)"
                            }
                          },
                          "id": 467,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 2709,
                          "src": "3020:19:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$2709_$",
                            "typeString": "type(enum Math.EstimationMode)"
                          }
                        },
                        "id": 468,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "UpperBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "3020:30:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$2709",
                          "typeString": "enum Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$2709",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 460,
                        "name": "Math",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 3954,
                        "src": "2975:4:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_contract$_Math_$3954_$",
                          "typeString": "type(library Math)"
                        }
                      },
                      "id": 461,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "log2",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 3461,
                      "src": "2975:9:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_delegatecall_view$_t_uint256_$_t_enum$_EstimationMode_$2709_$returns$_t_int256_$",
                        "typeString": "function (uint256,enum Math.EstimationMode) view returns (int256)"
                      }
                    },
                    "id": 469,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "2975:76:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "2963:88:1"
                },
                {
                  "assignments": [
                    472
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 472,
                      "name": "funding",
                      "nodeType": "VariableDeclaration",
                      "scope": 539,
                      "src": "3061:12:1",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 471,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "3061:4:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 476,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 473,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 431,
                        "src": "3076:6:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$885",
                          "typeString": "contract Market"
                        }
                      },
                      "id": 474,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "funding",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 875,
                      "src": "3076:14:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                        "typeString": "function () view external returns (uint256)"
                      }
                    },
                    "id": 475,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3076:16:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3061:31:1"
                },
                {
                  "assignments": [
                    478
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 478,
                      "name": "costLevelBefore",
                      "nodeType": "VariableDeclaration",
                      "scope": 539,
                      "src": "3102:19:1",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 477,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "3102:3:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 487,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 480,
                        "name": "log2N",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 459,
                        "src": "3138:5:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 481,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 453,
                        "src": "3145:20:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 482,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 472,
                        "src": "3167:7:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 483,
                            "name": "Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 3954,
                            "src": "3176:4:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Math_$3954_$",
                              "typeString": "type(library Math)"
                            }
                          },
                          "id": 484,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 2709,
                          "src": "3176:19:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$2709_$",
                            "typeString": "type(enum Math.EstimationMode)"
                          }
                        },
                        "id": 485,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "LowerBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "3176:30:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$2709",
                          "typeString": "enum Math.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_$2709",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "id": 479,
                      "name": "calcCostLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 662,
                      "src": "3124:13:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_enum$_EstimationMode_$2709_$returns$_t_int256_$",
                        "typeString": "function (int256,int256[] memory,uint256,enum Math.EstimationMode) view returns (int256)"
                      }
                    },
                    "id": 486,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3124:83:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3102:105:1"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        },
                        "id": 493,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 490,
                              "name": "outcomeTokenCount",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 435,
                              "src": "3304:17:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 489,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "3300:3:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_int256_$",
                              "typeString": "type(int256)"
                            },
                            "typeName": "int"
                          },
                          "id": 491,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "3300:22:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">=",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "30",
                          "id": 492,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "3326:1:1",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_0_by_1",
                            "typeString": "int_const 0"
                          },
                          "value": "0"
                        },
                        "src": "3300:27:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 488,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        8526,
                        8527
                      ],
                      "referencedDeclaration": 8526,
                      "src": "3292:7:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 494,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3292:36:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 495,
                  "nodeType": "ExpressionStatement",
                  "src": "3292:36:1"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 507,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "baseExpression": {
                        "argumentTypes": null,
                        "id": 496,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 453,
                        "src": "3338:20:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      "id": 498,
                      "indexExpression": {
                        "argumentTypes": null,
                        "id": 497,
                        "name": "outcomeTokenIndex",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 433,
                        "src": "3359:17:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      },
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "nodeType": "IndexAccess",
                      "src": "3338:39:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 504,
                              "name": "outcomeTokenCount",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 435,
                              "src": "3428:17:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 503,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "3424:3:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_int256_$",
                              "typeString": "type(int256)"
                            },
                            "typeName": "int"
                          },
                          "id": 505,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "3424:22:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "baseExpression": {
                            "argumentTypes": null,
                            "id": 499,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 453,
                            "src": "3380:20:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 501,
                          "indexExpression": {
                            "argumentTypes": null,
                            "id": 500,
                            "name": "outcomeTokenIndex",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 433,
                            "src": "3401:17:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          },
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "nodeType": "IndexAccess",
                          "src": "3380:39:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 502,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sub",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 3932,
                        "src": "3380:43:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_delegatecall_view$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                          "typeString": "function (int256,int256) view returns (int256)"
                        }
                      },
                      "id": 506,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "3380:67:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "3338:109:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 508,
                  "nodeType": "ExpressionStatement",
                  "src": "3338:109:1"
                },
                {
                  "assignments": [
                    510
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 510,
                      "name": "costLevelAfter",
                      "nodeType": "VariableDeclaration",
                      "scope": 539,
                      "src": "3515:18:1",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 509,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "3515:3:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 519,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 512,
                        "name": "log2N",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 459,
                        "src": "3550:5:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 513,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 453,
                        "src": "3557:20:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 514,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 472,
                        "src": "3579:7:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 515,
                            "name": "Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 3954,
                            "src": "3588:4:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Math_$3954_$",
                              "typeString": "type(library Math)"
                            }
                          },
                          "id": 516,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 2709,
                          "src": "3588:19:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$2709_$",
                            "typeString": "type(enum Math.EstimationMode)"
                          }
                        },
                        "id": 517,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "UpperBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "3588:30:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$2709",
                          "typeString": "enum Math.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_$2709",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "id": 511,
                      "name": "calcCostLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 662,
                      "src": "3536:13:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_enum$_EstimationMode_$2709_$returns$_t_int256_$",
                        "typeString": "function (int256,int256[] memory,uint256,enum Math.EstimationMode) view returns (int256)"
                      }
                    },
                    "id": 518,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3536:83:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3515:104:1"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    },
                    "id": 522,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 520,
                      "name": "costLevelBefore",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 478,
                      "src": "3685:15:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<=",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 521,
                      "name": "costLevelAfter",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 510,
                      "src": "3704:14:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "3685:33:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 527,
                  "nodeType": "IfStatement",
                  "src": "3682:82:1",
                  "trueBody": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 525,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 523,
                        "name": "costLevelBefore",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 478,
                        "src": "3732:15:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "id": 524,
                        "name": "costLevelAfter",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 510,
                        "src": "3750:14:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "src": "3732:32:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 526,
                    "nodeType": "ExpressionStatement",
                    "src": "3732:32:1"
                  }
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 536,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 528,
                      "name": "profit",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 438,
                      "src": "3800:6:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 535,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "commonType": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            },
                            "id": 532,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftExpression": {
                              "argumentTypes": null,
                              "id": 530,
                              "name": "costLevelBefore",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 478,
                              "src": "3814:15:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_int256",
                                "typeString": "int256"
                              }
                            },
                            "nodeType": "BinaryOperation",
                            "operator": "-",
                            "rightExpression": {
                              "argumentTypes": null,
                              "id": 531,
                              "name": "costLevelAfter",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 510,
                              "src": "3832:14:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_int256",
                                "typeString": "int256"
                              }
                            },
                            "src": "3814:32:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          ],
                          "id": 529,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "lValueRequested": false,
                          "nodeType": "ElementaryTypeNameExpression",
                          "src": "3809:4:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_uint256_$",
                            "typeString": "type(uint256)"
                          },
                          "typeName": "uint"
                        },
                        "id": 533,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "typeConversion",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "3809:38:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "/",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 534,
                        "name": "ONE",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 290,
                        "src": "3850:3:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "3809:44:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "3800:53:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 537,
                  "nodeType": "ExpressionStatement",
                  "src": "3800:53:1"
                }
              ]
            },
            "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": 539,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": true,
            "modifiers": [],
            "name": "calcProfit",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 436,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 431,
                  "name": "market",
                  "nodeType": "VariableDeclaration",
                  "scope": 539,
                  "src": "2615:13:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_contract$_Market_$885",
                    "typeString": "contract Market"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 430,
                    "name": "Market",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 885,
                    "src": "2615:6:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_Market_$885",
                      "typeString": "contract Market"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 433,
                  "name": "outcomeTokenIndex",
                  "nodeType": "VariableDeclaration",
                  "scope": 539,
                  "src": "2630:23:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint8",
                    "typeString": "uint8"
                  },
                  "typeName": {
                    "id": 432,
                    "name": "uint8",
                    "nodeType": "ElementaryTypeName",
                    "src": "2630:5:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint8",
                      "typeString": "uint8"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 435,
                  "name": "outcomeTokenCount",
                  "nodeType": "VariableDeclaration",
                  "scope": 539,
                  "src": "2655:22:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 434,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2655:4:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2614:64:1"
            },
            "payable": false,
            "returnParameters": {
              "id": 439,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 438,
                  "name": "profit",
                  "nodeType": "VariableDeclaration",
                  "scope": 539,
                  "src": "2728:11:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 437,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2728:4:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2727:13:1"
            },
            "scope": 815,
            "src": "2595:1265:1",
            "stateMutability": "view",
            "superFunction": 910,
            "visibility": "public"
          },
          {
            "body": {
              "id": 604,
              "nodeType": "Block",
              "src": "4236:687:1",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "id": 555,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [],
                          "expression": {
                            "argumentTypes": [],
                            "expression": {
                              "argumentTypes": null,
                              "arguments": [],
                              "expression": {
                                "argumentTypes": [],
                                "expression": {
                                  "argumentTypes": null,
                                  "id": 549,
                                  "name": "market",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 541,
                                  "src": "4254:6:1",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_Market_$885",
                                    "typeString": "contract Market"
                                  }
                                },
                                "id": 550,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "eventContract",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 869,
                                "src": "4254:20:1",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_function_external_view$__$returns$_t_contract$_ScalarEvent_$2415_$",
                                  "typeString": "function () view external returns (contract ScalarEvent)"
                                }
                              },
                              "id": 551,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "functionCall",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "4254:22:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_ScalarEvent_$2415",
                                "typeString": "contract ScalarEvent"
                              }
                            },
                            "id": 552,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "getOutcomeCount",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 2364,
                            "src": "4254:38:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_view$__$returns$_t_uint8_$",
                              "typeString": "function () view external returns (uint8)"
                            }
                          },
                          "id": 553,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "4254:40:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "31",
                          "id": 554,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "4297:1:1",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_1_by_1",
                            "typeString": "int_const 1"
                          },
                          "value": "1"
                        },
                        "src": "4254:44:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 548,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        8526,
                        8527
                      ],
                      "referencedDeclaration": 8526,
                      "src": "4246:7:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 556,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4246:53:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 557,
                  "nodeType": "ExpressionStatement",
                  "src": "4246:53:1"
                },
                {
                  "assignments": [
                    561
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 561,
                      "name": "netOutcomeTokensSold",
                      "nodeType": "VariableDeclaration",
                      "scope": 605,
                      "src": "4309:33:1",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                        "typeString": "int256[]"
                      },
                      "typeName": {
                        "baseType": {
                          "id": 559,
                          "name": "int",
                          "nodeType": "ElementaryTypeName",
                          "src": "4309:3:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 560,
                        "length": null,
                        "nodeType": "ArrayTypeName",
                        "src": "4309:5:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                          "typeString": "int256[]"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 565,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 563,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 541,
                        "src": "4369:6:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$885",
                          "typeString": "contract Market"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_contract$_Market_$885",
                          "typeString": "contract Market"
                        }
                      ],
                      "id": 562,
                      "name": "getNetOutcomeTokensSold",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 814,
                      "src": "4345:23:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_contract$_Market_$885_$returns$_t_array$_t_int256_$dyn_memory_ptr_$",
                        "typeString": "function (contract Market) view returns (int256[] memory)"
                      }
                    },
                    "id": 564,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4345:31:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                      "typeString": "int256[] memory"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4309:67:1"
                },
                {
                  "assignments": [
                    567
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 567,
                      "name": "logN",
                      "nodeType": "VariableDeclaration",
                      "scope": 605,
                      "src": "4386:8:1",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 566,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "4386:3:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 578,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 573,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 570,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 561,
                            "src": "4407:20:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 571,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "length",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": null,
                          "src": "4407:27:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "*",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 572,
                          "name": "ONE",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 290,
                          "src": "4437:3:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "4407:33:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 574,
                            "name": "Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 3954,
                            "src": "4442:4:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Math_$3954_$",
                              "typeString": "type(library Math)"
                            }
                          },
                          "id": 575,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 2709,
                          "src": "4442:19:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$2709_$",
                            "typeString": "type(enum Math.EstimationMode)"
                          }
                        },
                        "id": 576,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "Midpoint",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "4442:28:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$2709",
                          "typeString": "enum Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$2709",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 568,
                        "name": "Math",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 3954,
                        "src": "4397:4:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_contract$_Math_$3954_$",
                          "typeString": "type(library Math)"
                        }
                      },
                      "id": 569,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "log2",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 3461,
                      "src": "4397:9:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_delegatecall_view$_t_uint256_$_t_enum$_EstimationMode_$2709_$returns$_t_int256_$",
                        "typeString": "function (uint256,enum Math.EstimationMode) view returns (int256)"
                      }
                    },
                    "id": 577,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4397:74:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4386:85:1"
                },
                {
                  "assignments": [
                    580
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 580,
                      "name": "funding",
                      "nodeType": "VariableDeclaration",
                      "scope": 605,
                      "src": "4481:12:1",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 579,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "4481:4:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 584,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 581,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 541,
                        "src": "4496:6:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$885",
                          "typeString": "contract Market"
                        }
                      },
                      "id": 582,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "funding",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 875,
                      "src": "4496:14:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                        "typeString": "function () view external returns (uint256)"
                      }
                    },
                    "id": 583,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4496:16:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4481:31:1"
                },
                {
                  "assignments": [
                    585,
                    null,
                    586
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 585,
                      "name": "sum",
                      "nodeType": "VariableDeclaration",
                      "scope": 605,
                      "src": "4748:3:1",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": null,
                      "value": null,
                      "visibility": "internal"
                    },
                    null,
                    {
                      "constant": false,
                      "id": 586,
                      "name": "outcomeExpTerm",
                      "nodeType": "VariableDeclaration",
                      "scope": 605,
                      "src": "4755:14:1",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": null,
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 596,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 588,
                        "name": "logN",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 567,
                        "src": "4786:4:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 589,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 561,
                        "src": "4792:20:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 590,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 580,
                        "src": "4814:7:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 591,
                        "name": "outcomeTokenIndex",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 543,
                        "src": "4823:17:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 592,
                            "name": "Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 3954,
                            "src": "4842:4:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Math_$3954_$",
                              "typeString": "type(library Math)"
                            }
                          },
                          "id": 593,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 2709,
                          "src": "4842:19:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$2709_$",
                            "typeString": "type(enum Math.EstimationMode)"
                          }
                        },
                        "id": 594,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "Midpoint",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "4842:28:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$2709",
                          "typeString": "enum Math.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_$2709",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "id": 587,
                      "name": "sumExpOffset",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 772,
                      "src": "4773:12:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_uint8_$_t_enum$_EstimationMode_$2709_$returns$_t_uint256_$_t_int256_$_t_uint256_$",
                        "typeString": "function (int256,int256[] memory,uint256,uint8,enum Math.EstimationMode) view returns (uint256,int256,uint256)"
                      }
                    },
                    "id": 595,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4773:98:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$_t_uint256_$_t_int256_$_t_uint256_$",
                      "typeString": "tuple(uint256,int256,uint256)"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4743:128:1"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 602,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 597,
                      "name": "outcomeExpTerm",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 586,
                      "src": "4888:14:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "/",
                    "rightExpression": {
                      "argumentTypes": null,
                      "components": [
                        {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          "id": 600,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 598,
                            "name": "sum",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 585,
                            "src": "4906:3:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "/",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 599,
                            "name": "ONE",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 290,
                            "src": "4912:3:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "4906:9:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        }
                      ],
                      "id": 601,
                      "isConstant": false,
                      "isInlineArray": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "nodeType": "TupleExpression",
                      "src": "4905:11:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "4888:28:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "functionReturnParameters": 547,
                  "id": 603,
                  "nodeType": "Return",
                  "src": "4881:35:1"
                }
              ]
            },
            "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": 605,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": true,
            "modifiers": [],
            "name": "calcMarginalPrice",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 544,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 541,
                  "name": "market",
                  "nodeType": "VariableDeclaration",
                  "scope": 605,
                  "src": "4131:13:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_contract$_Market_$885",
                    "typeString": "contract Market"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 540,
                    "name": "Market",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 885,
                    "src": "4131:6:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_Market_$885",
                      "typeString": "contract Market"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 543,
                  "name": "outcomeTokenIndex",
                  "nodeType": "VariableDeclaration",
                  "scope": 605,
                  "src": "4146:23:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint8",
                    "typeString": "uint8"
                  },
                  "typeName": {
                    "id": 542,
                    "name": "uint8",
                    "nodeType": "ElementaryTypeName",
                    "src": "4146:5:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint8",
                      "typeString": "uint8"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "4130:40:1"
            },
            "payable": false,
            "returnParameters": {
              "id": 547,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 546,
                  "name": "price",
                  "nodeType": "VariableDeclaration",
                  "scope": 605,
                  "src": "4220:10:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 545,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "4220:4:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "4219:12:1"
            },
            "scope": 815,
            "src": "4104:819:1",
            "stateMutability": "view",
            "superFunction": 919,
            "visibility": "public"
          },
          {
            "body": {
              "id": 661,
              "nodeType": "Block",
              "src": "5479:503:1",
              "statements": [
                {
                  "assignments": [
                    619,
                    620,
                    null
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 619,
                      "name": "sum",
                      "nodeType": "VariableDeclaration",
                      "scope": 662,
                      "src": "5723:3:1",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": null,
                      "value": null,
                      "visibility": "internal"
                    },
                    {
                      "constant": false,
                      "id": 620,
                      "name": "offset",
                      "nodeType": "VariableDeclaration",
                      "scope": 662,
                      "src": "5728:6:1",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": null,
                      "value": null,
                      "visibility": "internal"
                    },
                    null
                  ],
                  "id": 628,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 622,
                        "name": "logN",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 607,
                        "src": "5753:4:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 623,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 610,
                        "src": "5759:20:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 624,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 612,
                        "src": "5781:7:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "30",
                        "id": 625,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "5790:1:1",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_0_by_1",
                          "typeString": "int_const 0"
                        },
                        "value": "0"
                      },
                      {
                        "argumentTypes": null,
                        "id": 626,
                        "name": "estimationMode",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 614,
                        "src": "5793:14:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$2709",
                          "typeString": "enum Math.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_$2709",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "id": 621,
                      "name": "sumExpOffset",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 772,
                      "src": "5740:12:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_uint8_$_t_enum$_EstimationMode_$2709_$returns$_t_uint256_$_t_int256_$_t_uint256_$",
                        "typeString": "function (int256,int256[] memory,uint256,uint8,enum Math.EstimationMode) view returns (uint256,int256,uint256)"
                      }
                    },
                    "id": 627,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "5740:68:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$_t_uint256_$_t_int256_$_t_uint256_$",
                      "typeString": "tuple(uint256,int256,uint256)"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "5718:90:1"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 635,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 629,
                      "name": "costLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 617,
                      "src": "5818:9:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "id": 632,
                          "name": "sum",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 619,
                          "src": "5840:3:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        {
                          "argumentTypes": null,
                          "id": 633,
                          "name": "estimationMode",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 614,
                          "src": "5845:14:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_enum$_EstimationMode_$2709",
                            "typeString": "enum Math.EstimationMode"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          {
                            "typeIdentifier": "t_enum$_EstimationMode_$2709",
                            "typeString": "enum Math.EstimationMode"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "id": 630,
                          "name": "Math",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 3954,
                          "src": "5830:4:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_contract$_Math_$3954_$",
                            "typeString": "type(library Math)"
                          }
                        },
                        "id": 631,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "log2",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 3461,
                        "src": "5830:9:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_delegatecall_view$_t_uint256_$_t_enum$_EstimationMode_$2709_$returns$_t_int256_$",
                          "typeString": "function (uint256,enum Math.EstimationMode) view returns (int256)"
                        }
                      },
                      "id": 634,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "5830:30:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "5818:42:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 636,
                  "nodeType": "ExpressionStatement",
                  "src": "5818:42:1"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 642,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 637,
                      "name": "costLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 617,
                      "src": "5870:9:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "id": 640,
                          "name": "offset",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 620,
                          "src": "5896:6:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "id": 638,
                          "name": "costLevel",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 617,
                          "src": "5882:9:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 639,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "add",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 3911,
                        "src": "5882:13:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_delegatecall_view$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                          "typeString": "function (int256,int256) view returns (int256)"
                        }
                      },
                      "id": 641,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "5882:21:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "5870:33:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 643,
                  "nodeType": "ExpressionStatement",
                  "src": "5870:33:1"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 659,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 644,
                      "name": "costLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 617,
                      "src": "5913:9:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 656,
                              "name": "funding",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 612,
                              "src": "5966:7:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 655,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "5962:3:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_int256_$",
                              "typeString": "type(int256)"
                            },
                            "typeName": "int"
                          },
                          "id": 657,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "5962:12:1",
                          "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": 652,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "leftExpression": {
                                "argumentTypes": null,
                                "arguments": [
                                  {
                                    "argumentTypes": null,
                                    "arguments": [
                                      {
                                        "argumentTypes": null,
                                        "id": 648,
                                        "name": "ONE",
                                        "nodeType": "Identifier",
                                        "overloadedDeclarations": [],
                                        "referencedDeclaration": 290,
                                        "src": "5944:3:1",
                                        "typeDescriptions": {
                                          "typeIdentifier": "t_uint256",
                                          "typeString": "uint256"
                                        }
                                      }
                                    ],
                                    "expression": {
                                      "argumentTypes": [
                                        {
                                          "typeIdentifier": "t_uint256",
                                          "typeString": "uint256"
                                        }
                                      ],
                                      "id": 647,
                                      "isConstant": false,
                                      "isLValue": false,
                                      "isPure": true,
                                      "lValueRequested": false,
                                      "nodeType": "ElementaryTypeNameExpression",
                                      "src": "5940:3:1",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_type$_t_int256_$",
                                        "typeString": "type(int256)"
                                      },
                                      "typeName": "int"
                                    },
                                    "id": 649,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": true,
                                    "kind": "typeConversion",
                                    "lValueRequested": false,
                                    "names": [],
                                    "nodeType": "FunctionCall",
                                    "src": "5940:8:1",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_int256",
                                      "typeString": "int256"
                                    }
                                  }
                                ],
                                "expression": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_int256",
                                      "typeString": "int256"
                                    }
                                  ],
                                  "expression": {
                                    "argumentTypes": null,
                                    "id": 645,
                                    "name": "costLevel",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 617,
                                    "src": "5926:9:1",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_int256",
                                      "typeString": "int256"
                                    }
                                  },
                                  "id": 646,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "mul",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 3953,
                                  "src": "5926:13:1",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_delegatecall_view$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                                    "typeString": "function (int256,int256) view returns (int256)"
                                  }
                                },
                                "id": 650,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "5926:23:1",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                }
                              },
                              "nodeType": "BinaryOperation",
                              "operator": "/",
                              "rightExpression": {
                                "argumentTypes": null,
                                "id": 651,
                                "name": "logN",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 607,
                                "src": "5952:4:1",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                }
                              },
                              "src": "5926:30:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_int256",
                                "typeString": "int256"
                              }
                            }
                          ],
                          "id": 653,
                          "isConstant": false,
                          "isInlineArray": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "nodeType": "TupleExpression",
                          "src": "5925:32:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 654,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "mul",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 3953,
                        "src": "5925:36:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_delegatecall_view$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                          "typeString": "function (int256,int256) view returns (int256)"
                        }
                      },
                      "id": 658,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "5925:50:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "5913:62:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 660,
                  "nodeType": "ExpressionStatement",
                  "src": "5913:62:1"
                }
              ]
            },
            "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": 662,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": true,
            "modifiers": [],
            "name": "calcCostLevel",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 615,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 607,
                  "name": "logN",
                  "nodeType": "VariableDeclaration",
                  "scope": 662,
                  "src": "5323:8:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_int256",
                    "typeString": "int256"
                  },
                  "typeName": {
                    "id": 606,
                    "name": "int",
                    "nodeType": "ElementaryTypeName",
                    "src": "5323:3:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 610,
                  "name": "netOutcomeTokensSold",
                  "nodeType": "VariableDeclaration",
                  "scope": 662,
                  "src": "5333:26:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                    "typeString": "int256[]"
                  },
                  "typeName": {
                    "baseType": {
                      "id": 608,
                      "name": "int",
                      "nodeType": "ElementaryTypeName",
                      "src": "5333:3:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 609,
                    "length": null,
                    "nodeType": "ArrayTypeName",
                    "src": "5333:5:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                      "typeString": "int256[]"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 612,
                  "name": "funding",
                  "nodeType": "VariableDeclaration",
                  "scope": 662,
                  "src": "5361:12:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 611,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "5361:4:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 614,
                  "name": "estimationMode",
                  "nodeType": "VariableDeclaration",
                  "scope": 662,
                  "src": "5375:34:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_enum$_EstimationMode_$2709",
                    "typeString": "enum Math.EstimationMode"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 613,
                    "name": "Math.EstimationMode",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 2709,
                    "src": "5375:19:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_enum$_EstimationMode_$2709",
                      "typeString": "enum Math.EstimationMode"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "5322:88:1"
            },
            "payable": false,
            "returnParameters": {
              "id": 618,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 617,
                  "name": "costLevel",
                  "nodeType": "VariableDeclaration",
                  "scope": 662,
                  "src": "5460:13:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_int256",
                    "typeString": "int256"
                  },
                  "typeName": {
                    "id": 616,
                    "name": "int",
                    "nodeType": "ElementaryTypeName",
                    "src": "5460:3:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "5459:15:1"
            },
            "scope": 815,
            "src": "5300:682:1",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "private"
          },
          {
            "body": {
              "id": 771,
              "nodeType": "Block",
              "src": "6755:1349:1",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        "id": 691,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          },
                          "id": 685,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 683,
                            "name": "logN",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 664,
                            "src": "7615:4:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": ">=",
                          "rightExpression": {
                            "argumentTypes": null,
                            "hexValue": "30",
                            "id": 684,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "7623:1:1",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_0_by_1",
                              "typeString": "int_const 0"
                            },
                            "value": "0"
                          },
                          "src": "7615:9:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "&&",
                        "rightExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          },
                          "id": 690,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "id": 687,
                                "name": "funding",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 669,
                                "src": "7632:7:1",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              ],
                              "id": 686,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "lValueRequested": false,
                              "nodeType": "ElementaryTypeNameExpression",
                              "src": "7628:3:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_type$_t_int256_$",
                                "typeString": "type(int256)"
                              },
                              "typeName": "int"
                            },
                            "id": 688,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "typeConversion",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "7628:12:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": ">=",
                          "rightExpression": {
                            "argumentTypes": null,
                            "hexValue": "30",
                            "id": 689,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "7644:1:1",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_0_by_1",
                              "typeString": "int_const 0"
                            },
                            "value": "0"
                          },
                          "src": "7628:17:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "src": "7615:30:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 682,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        8526,
                        8527
                      ],
                      "referencedDeclaration": 8526,
                      "src": "7607:7:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 692,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "7607:39:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 693,
                  "nodeType": "ExpressionStatement",
                  "src": "7607:39:1"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 699,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 694,
                      "name": "offset",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 678,
                      "src": "7656:6:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "id": 697,
                          "name": "netOutcomeTokensSold",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 667,
                          "src": "7674:20:1",
                          "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": 695,
                          "name": "Math",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 3954,
                          "src": "7665:4:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_contract$_Math_$3954_$",
                            "typeString": "type(library Math)"
                          }
                        },
                        "id": 696,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "max",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 3687,
                        "src": "7665:8:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_delegatecall_view$_t_array$_t_int256_$dyn_memory_ptr_$returns$_t_int256_$",
                          "typeString": "function (int256[] memory) view returns (int256)"
                        }
                      },
                      "id": 698,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "7665:30:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "7656:39:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 700,
                  "nodeType": "ExpressionStatement",
                  "src": "7656:39:1"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 710,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 701,
                      "name": "offset",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 678,
                      "src": "7705:6:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "id": 709,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 704,
                            "name": "logN",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 664,
                            "src": "7725:4:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          ],
                          "expression": {
                            "argumentTypes": null,
                            "id": 702,
                            "name": "offset",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 678,
                            "src": "7714:6:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "id": 703,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "mul",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 3953,
                          "src": "7714:10:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_delegatecall_view$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                            "typeString": "function (int256,int256) view returns (int256)"
                          }
                        },
                        "id": 705,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "7714:16:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "/",
                      "rightExpression": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 707,
                            "name": "funding",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 669,
                            "src": "7737:7:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          ],
                          "id": 706,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "lValueRequested": false,
                          "nodeType": "ElementaryTypeNameExpression",
                          "src": "7733:3:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_int256_$",
                            "typeString": "type(int256)"
                          },
                          "typeName": "int"
                        },
                        "id": 708,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "typeConversion",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "7733:12:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "src": "7714:31:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "7705:40:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 711,
                  "nodeType": "ExpressionStatement",
                  "src": "7705:40:1"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 717,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 712,
                      "name": "offset",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 678,
                      "src": "7755:6:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "id": 715,
                          "name": "EXP_LIMIT",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 293,
                          "src": "7775:9:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "id": 713,
                          "name": "offset",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 678,
                          "src": "7764:6:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 714,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sub",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 3932,
                        "src": "7764:10:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_delegatecall_view$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                          "typeString": "function (int256,int256) view returns (int256)"
                        }
                      },
                      "id": 716,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "7764:21:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "7755:30:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 718,
                  "nodeType": "ExpressionStatement",
                  "src": "7755:30:1"
                },
                {
                  "assignments": [],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 720,
                      "name": "term",
                      "nodeType": "VariableDeclaration",
                      "scope": 772,
                      "src": "7795:9:1",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 719,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "7795:4:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 721,
                  "initialValue": null,
                  "nodeType": "VariableDeclarationStatement",
                  "src": "7795:9:1"
                },
                {
                  "body": {
                    "id": 769,
                    "nodeType": "Block",
                    "src": "7870:228:1",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 752,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 733,
                            "name": "term",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 720,
                            "src": "7884:4:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "arguments": [
                                  {
                                    "argumentTypes": null,
                                    "id": 748,
                                    "name": "offset",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 678,
                                    "src": "7956:6:1",
                                    "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": 745,
                                        "isConstant": false,
                                        "isLValue": false,
                                        "isPure": false,
                                        "lValueRequested": false,
                                        "leftExpression": {
                                          "argumentTypes": null,
                                          "arguments": [
                                            {
                                              "argumentTypes": null,
                                              "id": 740,
                                              "name": "logN",
                                              "nodeType": "Identifier",
                                              "overloadedDeclarations": [],
                                              "referencedDeclaration": 664,
                                              "src": "7930:4:1",
                                              "typeDescriptions": {
                                                "typeIdentifier": "t_int256",
                                                "typeString": "int256"
                                              }
                                            }
                                          ],
                                          "expression": {
                                            "argumentTypes": [
                                              {
                                                "typeIdentifier": "t_int256",
                                                "typeString": "int256"
                                              }
                                            ],
                                            "expression": {
                                              "argumentTypes": null,
                                              "baseExpression": {
                                                "argumentTypes": null,
                                                "id": 736,
                                                "name": "netOutcomeTokensSold",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 667,
                                                "src": "7902:20:1",
                                                "typeDescriptions": {
                                                  "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                                                  "typeString": "int256[] memory"
                                                }
                                              },
                                              "id": 738,
                                              "indexExpression": {
                                                "argumentTypes": null,
                                                "id": 737,
                                                "name": "i",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 723,
                                                "src": "7923:1:1",
                                                "typeDescriptions": {
                                                  "typeIdentifier": "t_uint8",
                                                  "typeString": "uint8"
                                                }
                                              },
                                              "isConstant": false,
                                              "isLValue": true,
                                              "isPure": false,
                                              "lValueRequested": false,
                                              "nodeType": "IndexAccess",
                                              "src": "7902:23:1",
                                              "typeDescriptions": {
                                                "typeIdentifier": "t_int256",
                                                "typeString": "int256"
                                              }
                                            },
                                            "id": 739,
                                            "isConstant": false,
                                            "isLValue": false,
                                            "isPure": false,
                                            "lValueRequested": false,
                                            "memberName": "mul",
                                            "nodeType": "MemberAccess",
                                            "referencedDeclaration": 3953,
                                            "src": "7902:27:1",
                                            "typeDescriptions": {
                                              "typeIdentifier": "t_function_delegatecall_view$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                                              "typeString": "function (int256,int256) view returns (int256)"
                                            }
                                          },
                                          "id": 741,
                                          "isConstant": false,
                                          "isLValue": false,
                                          "isPure": false,
                                          "kind": "functionCall",
                                          "lValueRequested": false,
                                          "names": [],
                                          "nodeType": "FunctionCall",
                                          "src": "7902:33:1",
                                          "typeDescriptions": {
                                            "typeIdentifier": "t_int256",
                                            "typeString": "int256"
                                          }
                                        },
                                        "nodeType": "BinaryOperation",
                                        "operator": "/",
                                        "rightExpression": {
                                          "argumentTypes": null,
                                          "arguments": [
                                            {
                                              "argumentTypes": null,
                                              "id": 743,
                                              "name": "funding",
                                              "nodeType": "Identifier",
                                              "overloadedDeclarations": [],
                                              "referencedDeclaration": 669,
                                              "src": "7942:7:1",
                                              "typeDescriptions": {
                                                "typeIdentifier": "t_uint256",
                                                "typeString": "uint256"
                                              }
                                            }
                                          ],
                                          "expression": {
                                            "argumentTypes": [
                                              {
                                                "typeIdentifier": "t_uint256",
                                                "typeString": "uint256"
                                              }
                                            ],
                                            "id": 742,
                                            "isConstant": false,
                                            "isLValue": false,
                                            "isPure": true,
                                            "lValueRequested": false,
                                            "nodeType": "ElementaryTypeNameExpression",
                                            "src": "7938:3:1",
                                            "typeDescriptions": {
                                              "typeIdentifier": "t_type$_t_int256_$",
                                              "typeString": "type(int256)"
                                            },
                                            "typeName": "int"
                                          },
                                          "id": 744,
                                          "isConstant": false,
                                          "isLValue": false,
                                          "isPure": false,
                                          "kind": "typeConversion",
                                          "lValueRequested": false,
                                          "names": [],
                                          "nodeType": "FunctionCall",
                                          "src": "7938:12:1",
                                          "typeDescriptions": {
                                            "typeIdentifier": "t_int256",
                                            "typeString": "int256"
                                          }
                                        },
                                        "src": "7902:48:1",
                                        "typeDescriptions": {
                                          "typeIdentifier": "t_int256",
                                          "typeString": "int256"
                                        }
                                      }
                                    ],
                                    "id": 746,
                                    "isConstant": false,
                                    "isInlineArray": false,
                                    "isLValue": false,
                                    "isPure": false,
                                    "lValueRequested": false,
                                    "nodeType": "TupleExpression",
                                    "src": "7901:50:1",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_int256",
                                      "typeString": "int256"
                                    }
                                  },
                                  "id": 747,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "sub",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 3932,
                                  "src": "7901:54:1",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_delegatecall_view$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                                    "typeString": "function (int256,int256) view returns (int256)"
                                  }
                                },
                                "id": 749,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "7901:62:1",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                }
                              },
                              {
                                "argumentTypes": null,
                                "id": 750,
                                "name": "estimationMode",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 673,
                                "src": "7965:14:1",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_enum$_EstimationMode_$2709",
                                  "typeString": "enum Math.EstimationMode"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                },
                                {
                                  "typeIdentifier": "t_enum$_EstimationMode_$2709",
                                  "typeString": "enum Math.EstimationMode"
                                }
                              ],
                              "expression": {
                                "argumentTypes": null,
                                "id": 734,
                                "name": "Math",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 3954,
                                "src": "7891:4:1",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_type$_t_contract$_Math_$3954_$",
                                  "typeString": "type(library Math)"
                                }
                              },
                              "id": 735,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "pow2",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 2812,
                              "src": "7891:9:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_delegatecall_view$_t_int256_$_t_enum$_EstimationMode_$2709_$returns$_t_uint256_$",
                                "typeString": "function (int256,enum Math.EstimationMode) view returns (uint256)"
                              }
                            },
                            "id": 751,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "7891:89:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "7884:96:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 753,
                        "nodeType": "ExpressionStatement",
                        "src": "7884:96:1"
                      },
                      {
                        "condition": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          },
                          "id": 756,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 754,
                            "name": "i",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 723,
                            "src": "7998:1:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "==",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 755,
                            "name": "outcomeIndex",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 671,
                            "src": "8003:12:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          },
                          "src": "7998:17:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "falseBody": null,
                        "id": 761,
                        "nodeType": "IfStatement",
                        "src": "7994:60:1",
                        "trueBody": {
                          "expression": {
                            "argumentTypes": null,
                            "id": 759,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftHandSide": {
                              "argumentTypes": null,
                              "id": 757,
                              "name": "outcomeExpTerm",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 680,
                              "src": "8033:14:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "nodeType": "Assignment",
                            "operator": "=",
                            "rightHandSide": {
                              "argumentTypes": null,
                              "id": 758,
                              "name": "term",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 720,
                              "src": "8050:4:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "src": "8033:21:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "id": 760,
                          "nodeType": "ExpressionStatement",
                          "src": "8033:21:1"
                        }
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 767,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 762,
                            "name": "sum",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 676,
                            "src": "8068:3:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "id": 765,
                                "name": "term",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 720,
                                "src": "8082:4:1",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              ],
                              "expression": {
                                "argumentTypes": null,
                                "id": 763,
                                "name": "sum",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 676,
                                "src": "8074:3:1",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "id": 764,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "add",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 3760,
                              "src": "8074:7:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_delegatecall_view$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                                "typeString": "function (uint256,uint256) view returns (uint256)"
                              }
                            },
                            "id": 766,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "8074:13:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "8068:19:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 768,
                        "nodeType": "ExpressionStatement",
                        "src": "8068:19:1"
                      }
                    ]
                  },
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 729,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 726,
                      "name": "i",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 723,
                      "src": "7832:1:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint8",
                        "typeString": "uint8"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 727,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 667,
                        "src": "7836:20:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      "id": 728,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "length",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": null,
                      "src": "7836:27:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "7832:31:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "id": 770,
                  "initializationExpression": {
                    "assignments": [
                      723
                    ],
                    "declarations": [
                      {
                        "constant": false,
                        "id": 723,
                        "name": "i",
                        "nodeType": "VariableDeclaration",
                        "scope": 772,
                        "src": "7819:7:1",
                        "stateVariable": false,
                        "storageLocation": "default",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "typeName": {
                          "id": 722,
                          "name": "uint8",
                          "nodeType": "ElementaryTypeName",
                          "src": "7819:5:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "value": null,
                        "visibility": "internal"
                      }
                    ],
                    "id": 725,
                    "initialValue": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 724,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "7829:1:1",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "nodeType": "VariableDeclarationStatement",
                    "src": "7819:11:1"
                  },
                  "loopExpression": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 731,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "nodeType": "UnaryOperation",
                      "operator": "++",
                      "prefix": false,
                      "src": "7865:3:1",
                      "subExpression": {
                        "argumentTypes": null,
                        "id": 730,
                        "name": "i",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 723,
                        "src": "7865:1:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      },
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint8",
                        "typeString": "uint8"
                      }
                    },
                    "id": 732,
                    "nodeType": "ExpressionStatement",
                    "src": "7865:3:1"
                  },
                  "nodeType": "ForStatement",
                  "src": "7814:284:1"
                }
              ]
            },
            "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": 772,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": true,
            "modifiers": [],
            "name": "sumExpOffset",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 674,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 664,
                  "name": "logN",
                  "nodeType": "VariableDeclaration",
                  "scope": 772,
                  "src": "6550:8:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_int256",
                    "typeString": "int256"
                  },
                  "typeName": {
                    "id": 663,
                    "name": "int",
                    "nodeType": "ElementaryTypeName",
                    "src": "6550:3:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 667,
                  "name": "netOutcomeTokensSold",
                  "nodeType": "VariableDeclaration",
                  "scope": 772,
                  "src": "6560:26:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                    "typeString": "int256[]"
                  },
                  "typeName": {
                    "baseType": {
                      "id": 665,
                      "name": "int",
                      "nodeType": "ElementaryTypeName",
                      "src": "6560:3:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 666,
                    "length": null,
                    "nodeType": "ArrayTypeName",
                    "src": "6560:5:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                      "typeString": "int256[]"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 669,
                  "name": "funding",
                  "nodeType": "VariableDeclaration",
                  "scope": 772,
                  "src": "6588:12:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 668,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "6588:4:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 671,
                  "name": "outcomeIndex",
                  "nodeType": "VariableDeclaration",
                  "scope": 772,
                  "src": "6602:18:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint8",
                    "typeString": "uint8"
                  },
                  "typeName": {
                    "id": 670,
                    "name": "uint8",
                    "nodeType": "ElementaryTypeName",
                    "src": "6602:5:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint8",
                      "typeString": "uint8"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 673,
                  "name": "estimationMode",
                  "nodeType": "VariableDeclaration",
                  "scope": 772,
                  "src": "6622:34:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_enum$_EstimationMode_$2709",
                    "typeString": "enum Math.EstimationMode"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 672,
                    "name": "Math.EstimationMode",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 2709,
                    "src": "6622:19:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_enum$_EstimationMode_$2709",
                      "typeString": "enum Math.EstimationMode"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6549:108:1"
            },
            "payable": false,
            "returnParameters": {
              "id": 681,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 676,
                  "name": "sum",
                  "nodeType": "VariableDeclaration",
                  "scope": 772,
                  "src": "6708:8:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 675,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "6708:4:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 678,
                  "name": "offset",
                  "nodeType": "VariableDeclaration",
                  "scope": 772,
                  "src": "6718:10:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_int256",
                    "typeString": "int256"
                  },
                  "typeName": {
                    "id": 677,
                    "name": "int",
                    "nodeType": "ElementaryTypeName",
                    "src": "6718:3:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 680,
                  "name": "outcomeExpTerm",
                  "nodeType": "VariableDeclaration",
                  "scope": 772,
                  "src": "6730:19:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 679,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "6730:4:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6707:43:1"
            },
            "scope": 815,
            "src": "6528:1576:1",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "private"
          },
          {
            "body": {
              "id": 813,
              "nodeType": "Block",
              "src": "8704:195:1",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 790,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 780,
                      "name": "quantities",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 778,
                      "src": "8714:10:1",
                      "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": 784,
                                  "name": "market",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 774,
                                  "src": "8737:6:1",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_Market_$885",
                                    "typeString": "contract Market"
                                  }
                                },
                                "id": 785,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "eventContract",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 869,
                                "src": "8737:20:1",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_function_external_view$__$returns$_t_contract$_ScalarEvent_$2415_$",
                                  "typeString": "function () view external returns (contract ScalarEvent)"
                                }
                              },
                              "id": 786,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "functionCall",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "8737:22:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_ScalarEvent_$2415",
                                "typeString": "contract ScalarEvent"
                              }
                            },
                            "id": 787,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "getOutcomeCount",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 2364,
                            "src": "8737:38:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_view$__$returns$_t_uint8_$",
                              "typeString": "function () view external returns (uint8)"
                            }
                          },
                          "id": 788,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "8737:40:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        ],
                        "id": 783,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "nodeType": "NewExpression",
                        "src": "8727:9:1",
                        "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": 781,
                            "name": "int",
                            "nodeType": "ElementaryTypeName",
                            "src": "8731:3:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "id": 782,
                          "length": null,
                          "nodeType": "ArrayTypeName",
                          "src": "8731:5:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                            "typeString": "int256[]"
                          }
                        }
                      },
                      "id": 789,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "8727:51:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_array$_t_int256_$dyn_memory",
                        "typeString": "int256[] memory"
                      }
                    },
                    "src": "8714:64:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                      "typeString": "int256[] memory"
                    }
                  },
                  "id": 791,
                  "nodeType": "ExpressionStatement",
                  "src": "8714:64:1"
                },
                {
                  "body": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 810,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "baseExpression": {
                          "argumentTypes": null,
                          "id": 803,
                          "name": "quantities",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 778,
                          "src": "8846:10:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                            "typeString": "int256[] memory"
                          }
                        },
                        "id": 805,
                        "indexExpression": {
                          "argumentTypes": null,
                          "id": 804,
                          "name": "i",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 793,
                          "src": "8857:1:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "isConstant": false,
                        "isLValue": true,
                        "isPure": false,
                        "lValueRequested": true,
                        "nodeType": "IndexAccess",
                        "src": "8846:13:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 808,
                            "name": "i",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 793,
                            "src": "8890:1:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          ],
                          "expression": {
                            "argumentTypes": null,
                            "id": 806,
                            "name": "market",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 774,
                            "src": "8862:6:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_contract$_Market_$885",
                              "typeString": "contract Market"
                            }
                          },
                          "id": 807,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "netOutcomeTokensSold",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 878,
                          "src": "8862:27:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_external_view$_t_uint256_$returns$_t_int256_$",
                            "typeString": "function (uint256) view external returns (int256)"
                          }
                        },
                        "id": 809,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "8862:30:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "src": "8846:46:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 811,
                    "nodeType": "ExpressionStatement",
                    "src": "8846:46:1"
                  },
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 799,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 796,
                      "name": "i",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 793,
                      "src": "8806:1:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint8",
                        "typeString": "uint8"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 797,
                        "name": "quantities",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 778,
                        "src": "8810:10:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      "id": 798,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "length",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": null,
                      "src": "8810:17:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "8806:21:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "id": 812,
                  "initializationExpression": {
                    "assignments": [
                      793
                    ],
                    "declarations": [
                      {
                        "constant": false,
                        "id": 793,
                        "name": "i",
                        "nodeType": "VariableDeclaration",
                        "scope": 814,
                        "src": "8793:7:1",
                        "stateVariable": false,
                        "storageLocation": "default",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "typeName": {
                          "id": 792,
                          "name": "uint8",
                          "nodeType": "ElementaryTypeName",
                          "src": "8793:5:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "value": null,
                        "visibility": "internal"
                      }
                    ],
                    "id": 795,
                    "initialValue": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 794,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "8803:1:1",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "nodeType": "VariableDeclarationStatement",
                    "src": "8793:11:1"
                  },
                  "loopExpression": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 801,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "nodeType": "UnaryOperation",
                      "operator": "++",
                      "prefix": false,
                      "src": "8829:3:1",
                      "subExpression": {
                        "argumentTypes": null,
                        "id": 800,
                        "name": "i",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 793,
                        "src": "8829:1:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      },
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint8",
                        "typeString": "uint8"
                      }
                    },
                    "id": 802,
                    "nodeType": "ExpressionStatement",
                    "src": "8829:3:1"
                  },
                  "nodeType": "ForStatement",
                  "src": "8788:104:1"
                }
              ]
            },
            "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": 814,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": true,
            "modifiers": [],
            "name": "getNetOutcomeTokensSold",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 775,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 774,
                  "name": "market",
                  "nodeType": "VariableDeclaration",
                  "scope": 814,
                  "src": "8617:13:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_contract$_Market_$885",
                    "typeString": "contract Market"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 773,
                    "name": "Market",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 885,
                    "src": "8617:6:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_Market_$885",
                      "typeString": "contract Market"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8616:15:1"
            },
            "payable": false,
            "returnParameters": {
              "id": 779,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 778,
                  "name": "quantities",
                  "nodeType": "VariableDeclaration",
                  "scope": 814,
                  "src": "8682:16:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                    "typeString": "int256[]"
                  },
                  "typeName": {
                    "baseType": {
                      "id": 776,
                      "name": "int",
                      "nodeType": "ElementaryTypeName",
                      "src": "8682:3:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 777,
                    "length": null,
                    "nodeType": "ArrayTypeName",
                    "src": "8682:5:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                      "typeString": "int256[]"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8681:18:1"
            },
            "scope": 815,
            "src": "8584:315:1",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "private"
          }
        ],
        "scope": 816,
        "src": "268:8633:1"
      }
    ],
    "src": "0:8902:1"
  },
  "legacyAST": {
    "absolutePath": "/home/josojo/reality/tokenized-events/contracts/Market/LMSRMarketMaker.sol",
    "exportedSymbols": {
      "LMSRMarketMaker": [
        815
      ]
    },
    "id": 816,
    "nodeType": "SourceUnit",
    "nodes": [
      {
        "id": 281,
        "literals": [
          "solidity",
          "^",
          "0.4",
          ".15"
        ],
        "nodeType": "PragmaDirective",
        "src": "0:24:1"
      },
      {
        "absolutePath": "@gnosis.pm/pm-contracts/contracts/Utils/Math.sol",
        "file": "@gnosis.pm/pm-contracts/contracts/Utils/Math.sol",
        "id": 282,
        "nodeType": "ImportDirective",
        "scope": 816,
        "sourceUnit": 3955,
        "src": "25:58:1",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "absolutePath": "/home/josojo/reality/tokenized-events/contracts/Market/MarketMaker.sol",
        "file": "./MarketMaker.sol",
        "id": 283,
        "nodeType": "ImportDirective",
        "scope": 816,
        "sourceUnit": 921,
        "src": "84:27:1",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "baseContracts": [
          {
            "arguments": null,
            "baseName": {
              "contractScope": null,
              "id": 284,
              "name": "MarketMaker",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 920,
              "src": "296:11:1",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_MarketMaker_$920",
                "typeString": "contract MarketMaker"
              }
            },
            "id": 285,
            "nodeType": "InheritanceSpecifier",
            "src": "296:11:1"
          }
        ],
        "contractDependencies": [
          920
        ],
        "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": 815,
        "linearizedBaseContracts": [
          815,
          920
        ],
        "name": "LMSRMarketMaker",
        "nodeType": "ContractDefinition",
        "nodes": [
          {
            "id": 287,
            "libraryName": {
              "contractScope": null,
              "id": 286,
              "name": "Math",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 3954,
              "src": "320:4:1",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_Math_$3954",
                "typeString": "library Math"
              }
            },
            "nodeType": "UsingForDirective",
            "src": "314:17:1",
            "typeName": null
          },
          {
            "constant": true,
            "id": 290,
            "name": "ONE",
            "nodeType": "VariableDeclaration",
            "scope": 815,
            "src": "370:39:1",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_uint256",
              "typeString": "uint256"
            },
            "typeName": {
              "id": 288,
              "name": "uint",
              "nodeType": "ElementaryTypeName",
              "src": "370:4:1",
              "typeDescriptions": {
                "typeIdentifier": "t_uint256",
                "typeString": "uint256"
              }
            },
            "value": {
              "argumentTypes": null,
              "hexValue": "30783130303030303030303030303030303030",
              "id": 289,
              "isConstant": false,
              "isLValue": false,
              "isPure": true,
              "kind": "number",
              "lValueRequested": false,
              "nodeType": "Literal",
              "src": "390:19:1",
              "subdenomination": null,
              "typeDescriptions": {
                "typeIdentifier": "t_rational_18446744073709551616_by_1",
                "typeString": "int_const 18446744073709551616"
              },
              "value": "0x10000000000000000"
            },
            "visibility": "internal"
          },
          {
            "constant": true,
            "id": 293,
            "name": "EXP_LIMIT",
            "nodeType": "VariableDeclaration",
            "scope": 815,
            "src": "415:47:1",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_int256",
              "typeString": "int256"
            },
            "typeName": {
              "id": 291,
              "name": "int",
              "nodeType": "ElementaryTypeName",
              "src": "415:3:1",
              "typeDescriptions": {
                "typeIdentifier": "t_int256",
                "typeString": "int256"
              }
            },
            "value": {
              "argumentTypes": null,
              "hexValue": "33333934323030393039353632353537343937333434",
              "id": 292,
              "isConstant": false,
              "isLValue": false,
              "isPure": true,
              "kind": "number",
              "lValueRequested": false,
              "nodeType": "Literal",
              "src": "440:22:1",
              "subdenomination": null,
              "typeDescriptions": {
                "typeIdentifier": "t_rational_3394200909562557497344_by_1",
                "typeString": "int_const 3394200909562557497344"
              },
              "value": "3394200909562557497344"
            },
            "visibility": "internal"
          },
          {
            "body": {
              "id": 428,
              "nodeType": "Block",
              "src": "900:1433:1",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "id": 311,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [],
                          "expression": {
                            "argumentTypes": [],
                            "expression": {
                              "argumentTypes": null,
                              "arguments": [],
                              "expression": {
                                "argumentTypes": [],
                                "expression": {
                                  "argumentTypes": null,
                                  "id": 305,
                                  "name": "market",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 295,
                                  "src": "918:6:1",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_Market_$885",
                                    "typeString": "contract Market"
                                  }
                                },
                                "id": 306,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "eventContract",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 869,
                                "src": "918:20:1",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_function_external_view$__$returns$_t_contract$_ScalarEvent_$2415_$",
                                  "typeString": "function () view external returns (contract ScalarEvent)"
                                }
                              },
                              "id": 307,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "functionCall",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "918:22:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_ScalarEvent_$2415",
                                "typeString": "contract ScalarEvent"
                              }
                            },
                            "id": 308,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "getOutcomeCount",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 2364,
                            "src": "918:38:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_view$__$returns$_t_uint8_$",
                              "typeString": "function () view external returns (uint8)"
                            }
                          },
                          "id": 309,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "918:40:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "31",
                          "id": 310,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "961:1:1",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_1_by_1",
                            "typeString": "int_const 1"
                          },
                          "value": "1"
                        },
                        "src": "918:44:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 304,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        8526,
                        8527
                      ],
                      "referencedDeclaration": 8526,
                      "src": "910:7:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 312,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "910:53:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 313,
                  "nodeType": "ExpressionStatement",
                  "src": "910:53:1"
                },
                {
                  "assignments": [
                    317
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 317,
                      "name": "netOutcomeTokensSold",
                      "nodeType": "VariableDeclaration",
                      "scope": 429,
                      "src": "973:33:1",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                        "typeString": "int256[]"
                      },
                      "typeName": {
                        "baseType": {
                          "id": 315,
                          "name": "int",
                          "nodeType": "ElementaryTypeName",
                          "src": "973:3:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 316,
                        "length": null,
                        "nodeType": "ArrayTypeName",
                        "src": "973:5:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                          "typeString": "int256[]"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 321,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 319,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 295,
                        "src": "1033:6:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$885",
                          "typeString": "contract Market"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_contract$_Market_$885",
                          "typeString": "contract Market"
                        }
                      ],
                      "id": 318,
                      "name": "getNetOutcomeTokensSold",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 814,
                      "src": "1009:23:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_contract$_Market_$885_$returns$_t_array$_t_int256_$dyn_memory_ptr_$",
                        "typeString": "function (contract Market) view returns (int256[] memory)"
                      }
                    },
                    "id": 320,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1009:31:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                      "typeString": "int256[] memory"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "973:67:1"
                },
                {
                  "assignments": [
                    323
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 323,
                      "name": "log2N",
                      "nodeType": "VariableDeclaration",
                      "scope": 429,
                      "src": "1118:9:1",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 322,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "1118:3:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 334,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 329,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 326,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 317,
                            "src": "1140:20:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 327,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "length",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": null,
                          "src": "1140:27:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "*",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 328,
                          "name": "ONE",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 290,
                          "src": "1170:3:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "1140:33:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 330,
                            "name": "Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 3954,
                            "src": "1175:4:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Math_$3954_$",
                              "typeString": "type(library Math)"
                            }
                          },
                          "id": 331,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 2709,
                          "src": "1175:19:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$2709_$",
                            "typeString": "type(enum Math.EstimationMode)"
                          }
                        },
                        "id": 332,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "UpperBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "1175:30:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$2709",
                          "typeString": "enum Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$2709",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 324,
                        "name": "Math",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 3954,
                        "src": "1130:4:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_contract$_Math_$3954_$",
                          "typeString": "type(library Math)"
                        }
                      },
                      "id": 325,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "log2",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 3461,
                      "src": "1130:9:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_delegatecall_view$_t_uint256_$_t_enum$_EstimationMode_$2709_$returns$_t_int256_$",
                        "typeString": "function (uint256,enum Math.EstimationMode) view returns (int256)"
                      }
                    },
                    "id": 333,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1130:76:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1118:88:1"
                },
                {
                  "assignments": [
                    336
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 336,
                      "name": "funding",
                      "nodeType": "VariableDeclaration",
                      "scope": 429,
                      "src": "1216:12:1",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 335,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "1216:4:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 340,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 337,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 295,
                        "src": "1231:6:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$885",
                          "typeString": "contract Market"
                        }
                      },
                      "id": 338,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "funding",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 875,
                      "src": "1231:14:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                        "typeString": "function () view external returns (uint256)"
                      }
                    },
                    "id": 339,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1231:16:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1216:31:1"
                },
                {
                  "assignments": [
                    342
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 342,
                      "name": "costLevelBefore",
                      "nodeType": "VariableDeclaration",
                      "scope": 429,
                      "src": "1257:19:1",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 341,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "1257:3:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 351,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 344,
                        "name": "log2N",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 323,
                        "src": "1293:5:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 345,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 317,
                        "src": "1300:20:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 346,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 336,
                        "src": "1322:7:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 347,
                            "name": "Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 3954,
                            "src": "1331:4:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Math_$3954_$",
                              "typeString": "type(library Math)"
                            }
                          },
                          "id": 348,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 2709,
                          "src": "1331:19:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$2709_$",
                            "typeString": "type(enum Math.EstimationMode)"
                          }
                        },
                        "id": 349,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "LowerBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "1331:30:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$2709",
                          "typeString": "enum Math.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_$2709",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "id": 343,
                      "name": "calcCostLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 662,
                      "src": "1279:13:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_enum$_EstimationMode_$2709_$returns$_t_int256_$",
                        "typeString": "function (int256,int256[] memory,uint256,enum Math.EstimationMode) view returns (int256)"
                      }
                    },
                    "id": 350,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1279:83:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1257:105:1"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        },
                        "id": 357,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 354,
                              "name": "outcomeTokenCount",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 299,
                              "src": "1448:17:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 353,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "1444:3:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_int256_$",
                              "typeString": "type(int256)"
                            },
                            "typeName": "int"
                          },
                          "id": 355,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "1444:22:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">=",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "30",
                          "id": 356,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "1470:1:1",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_0_by_1",
                            "typeString": "int_const 0"
                          },
                          "value": "0"
                        },
                        "src": "1444:27:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 352,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        8526,
                        8527
                      ],
                      "referencedDeclaration": 8526,
                      "src": "1436:7:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 358,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1436:36:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 359,
                  "nodeType": "ExpressionStatement",
                  "src": "1436:36:1"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 371,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "baseExpression": {
                        "argumentTypes": null,
                        "id": 360,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 317,
                        "src": "1482:20:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      "id": 362,
                      "indexExpression": {
                        "argumentTypes": null,
                        "id": 361,
                        "name": "outcomeTokenIndex",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 297,
                        "src": "1503:17:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      },
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "nodeType": "IndexAccess",
                      "src": "1482:39:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 368,
                              "name": "outcomeTokenCount",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 299,
                              "src": "1572:17:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 367,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "1568:3:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_int256_$",
                              "typeString": "type(int256)"
                            },
                            "typeName": "int"
                          },
                          "id": 369,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "1568:22:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "baseExpression": {
                            "argumentTypes": null,
                            "id": 363,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 317,
                            "src": "1524:20:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 365,
                          "indexExpression": {
                            "argumentTypes": null,
                            "id": 364,
                            "name": "outcomeTokenIndex",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 297,
                            "src": "1545:17:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          },
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "nodeType": "IndexAccess",
                          "src": "1524:39:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 366,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "add",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 3911,
                        "src": "1524:43:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_delegatecall_view$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                          "typeString": "function (int256,int256) view returns (int256)"
                        }
                      },
                      "id": 370,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "1524:67:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "1482:109:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 372,
                  "nodeType": "ExpressionStatement",
                  "src": "1482:109:1"
                },
                {
                  "assignments": [
                    374
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 374,
                      "name": "costLevelAfter",
                      "nodeType": "VariableDeclaration",
                      "scope": 429,
                      "src": "1659:18:1",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 373,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "1659:3:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 383,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 376,
                        "name": "log2N",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 323,
                        "src": "1694:5:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 377,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 317,
                        "src": "1701:20:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 378,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 336,
                        "src": "1723:7:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 379,
                            "name": "Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 3954,
                            "src": "1732:4:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Math_$3954_$",
                              "typeString": "type(library Math)"
                            }
                          },
                          "id": 380,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 2709,
                          "src": "1732:19:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$2709_$",
                            "typeString": "type(enum Math.EstimationMode)"
                          }
                        },
                        "id": 381,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "UpperBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "1732:30:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$2709",
                          "typeString": "enum Math.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_$2709",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "id": 375,
                      "name": "calcCostLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 662,
                      "src": "1680:13:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_enum$_EstimationMode_$2709_$returns$_t_int256_$",
                        "typeString": "function (int256,int256[] memory,uint256,enum Math.EstimationMode) view returns (int256)"
                      }
                    },
                    "id": 382,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1680:83:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1659:104:1"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    },
                    "id": 386,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 384,
                      "name": "costLevelAfter",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 374,
                      "src": "1827:14:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 385,
                      "name": "costLevelBefore",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 342,
                      "src": "1844:15:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "1827:32:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 391,
                  "nodeType": "IfStatement",
                  "src": "1824:81:1",
                  "trueBody": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 389,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 387,
                        "name": "costLevelAfter",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 374,
                        "src": "1873:14:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "id": 388,
                        "name": "costLevelBefore",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 342,
                        "src": "1890:15:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "src": "1873:32:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 390,
                    "nodeType": "ExpressionStatement",
                    "src": "1873:32:1"
                  }
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 398,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 392,
                      "name": "cost",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 302,
                      "src": "1915:4:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          },
                          "id": 396,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 394,
                            "name": "costLevelAfter",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 374,
                            "src": "1927:14:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "-",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 395,
                            "name": "costLevelBefore",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 342,
                            "src": "1944:15:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "src": "1927:32:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "id": 393,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "nodeType": "ElementaryTypeNameExpression",
                        "src": "1922:4:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_uint256_$",
                          "typeString": "type(uint256)"
                        },
                        "typeName": "uint"
                      },
                      "id": 397,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "typeConversion",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "1922:38:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "1915:45:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 399,
                  "nodeType": "ExpressionStatement",
                  "src": "1915:45:1"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 406,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 404,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 402,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 400,
                          "name": "cost",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 302,
                          "src": "2026:4:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "/",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 401,
                          "name": "ONE",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 290,
                          "src": "2033:3:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "2026:10:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "*",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 403,
                        "name": "ONE",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 290,
                        "src": "2039:3:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "2026:16:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "==",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 405,
                      "name": "cost",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 302,
                      "src": "2046:4:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "2026:24:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 417,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 411,
                        "name": "cost",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 302,
                        "src": "2172:4:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 416,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          "id": 414,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 412,
                            "name": "cost",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 302,
                            "src": "2179:4:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "/",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 413,
                            "name": "ONE",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 290,
                            "src": "2186:3:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "2179:10:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "+",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "31",
                          "id": 415,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "2192:1:1",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_1_by_1",
                            "typeString": "int_const 1"
                          },
                          "value": "1"
                        },
                        "src": "2179:14:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "2172:21:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "id": 418,
                    "nodeType": "ExpressionStatement",
                    "src": "2172:21:1"
                  },
                  "id": 419,
                  "nodeType": "IfStatement",
                  "src": "2022:171:1",
                  "trueBody": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 409,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 407,
                        "name": "cost",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 302,
                        "src": "2064:4:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "/=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "id": 408,
                        "name": "ONE",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 290,
                        "src": "2072:3:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "2064:11:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "id": 410,
                    "nodeType": "ExpressionStatement",
                    "src": "2064:11:1"
                  }
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 422,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 420,
                      "name": "cost",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 302,
                      "src": "2264:4:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 421,
                      "name": "outcomeTokenCount",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 299,
                      "src": "2271:17:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "2264:24:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 427,
                  "nodeType": "IfStatement",
                  "src": "2260:66:1",
                  "trueBody": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 425,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 423,
                        "name": "cost",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 302,
                        "src": "2302:4:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "id": 424,
                        "name": "outcomeTokenCount",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 299,
                        "src": "2309:17:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "2302:24:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "id": 426,
                    "nodeType": "ExpressionStatement",
                    "src": "2302:24:1"
                  }
                }
              ]
            },
            "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": 429,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": true,
            "modifiers": [],
            "name": "calcCost",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 300,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 295,
                  "name": "market",
                  "nodeType": "VariableDeclaration",
                  "scope": 429,
                  "src": "772:13:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_contract$_Market_$885",
                    "typeString": "contract Market"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 294,
                    "name": "Market",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 885,
                    "src": "772:6:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_Market_$885",
                      "typeString": "contract Market"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 297,
                  "name": "outcomeTokenIndex",
                  "nodeType": "VariableDeclaration",
                  "scope": 429,
                  "src": "787:23:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint8",
                    "typeString": "uint8"
                  },
                  "typeName": {
                    "id": 296,
                    "name": "uint8",
                    "nodeType": "ElementaryTypeName",
                    "src": "787:5:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint8",
                      "typeString": "uint8"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 299,
                  "name": "outcomeTokenCount",
                  "nodeType": "VariableDeclaration",
                  "scope": 429,
                  "src": "812:22:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 298,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "812:4:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "771:64:1"
            },
            "payable": false,
            "returnParameters": {
              "id": 303,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 302,
                  "name": "cost",
                  "nodeType": "VariableDeclaration",
                  "scope": 429,
                  "src": "885:9:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 301,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "885:4:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "884:11:1"
            },
            "scope": 815,
            "src": "754:1579:1",
            "stateMutability": "view",
            "superFunction": 899,
            "visibility": "public"
          },
          {
            "body": {
              "id": 538,
              "nodeType": "Block",
              "src": "2745:1115:1",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "id": 447,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [],
                          "expression": {
                            "argumentTypes": [],
                            "expression": {
                              "argumentTypes": null,
                              "arguments": [],
                              "expression": {
                                "argumentTypes": [],
                                "expression": {
                                  "argumentTypes": null,
                                  "id": 441,
                                  "name": "market",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 431,
                                  "src": "2763:6:1",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_Market_$885",
                                    "typeString": "contract Market"
                                  }
                                },
                                "id": 442,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "eventContract",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 869,
                                "src": "2763:20:1",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_function_external_view$__$returns$_t_contract$_ScalarEvent_$2415_$",
                                  "typeString": "function () view external returns (contract ScalarEvent)"
                                }
                              },
                              "id": 443,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "functionCall",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "2763:22:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_ScalarEvent_$2415",
                                "typeString": "contract ScalarEvent"
                              }
                            },
                            "id": 444,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "getOutcomeCount",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 2364,
                            "src": "2763:38:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_view$__$returns$_t_uint8_$",
                              "typeString": "function () view external returns (uint8)"
                            }
                          },
                          "id": 445,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "2763:40:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "31",
                          "id": 446,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "2806:1:1",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_1_by_1",
                            "typeString": "int_const 1"
                          },
                          "value": "1"
                        },
                        "src": "2763:44:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 440,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        8526,
                        8527
                      ],
                      "referencedDeclaration": 8526,
                      "src": "2755:7:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 448,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "2755:53:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 449,
                  "nodeType": "ExpressionStatement",
                  "src": "2755:53:1"
                },
                {
                  "assignments": [
                    453
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 453,
                      "name": "netOutcomeTokensSold",
                      "nodeType": "VariableDeclaration",
                      "scope": 539,
                      "src": "2818:33:1",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                        "typeString": "int256[]"
                      },
                      "typeName": {
                        "baseType": {
                          "id": 451,
                          "name": "int",
                          "nodeType": "ElementaryTypeName",
                          "src": "2818:3:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 452,
                        "length": null,
                        "nodeType": "ArrayTypeName",
                        "src": "2818:5:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                          "typeString": "int256[]"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 457,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 455,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 431,
                        "src": "2878:6:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$885",
                          "typeString": "contract Market"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_contract$_Market_$885",
                          "typeString": "contract Market"
                        }
                      ],
                      "id": 454,
                      "name": "getNetOutcomeTokensSold",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 814,
                      "src": "2854:23:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_contract$_Market_$885_$returns$_t_array$_t_int256_$dyn_memory_ptr_$",
                        "typeString": "function (contract Market) view returns (int256[] memory)"
                      }
                    },
                    "id": 456,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "2854:31:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                      "typeString": "int256[] memory"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "2818:67:1"
                },
                {
                  "assignments": [
                    459
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 459,
                      "name": "log2N",
                      "nodeType": "VariableDeclaration",
                      "scope": 539,
                      "src": "2963:9:1",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 458,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "2963:3:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 470,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 465,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 462,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 453,
                            "src": "2985:20:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 463,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "length",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": null,
                          "src": "2985:27:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "*",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 464,
                          "name": "ONE",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 290,
                          "src": "3015:3:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "2985:33:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 466,
                            "name": "Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 3954,
                            "src": "3020:4:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Math_$3954_$",
                              "typeString": "type(library Math)"
                            }
                          },
                          "id": 467,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 2709,
                          "src": "3020:19:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$2709_$",
                            "typeString": "type(enum Math.EstimationMode)"
                          }
                        },
                        "id": 468,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "UpperBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "3020:30:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$2709",
                          "typeString": "enum Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$2709",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 460,
                        "name": "Math",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 3954,
                        "src": "2975:4:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_contract$_Math_$3954_$",
                          "typeString": "type(library Math)"
                        }
                      },
                      "id": 461,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "log2",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 3461,
                      "src": "2975:9:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_delegatecall_view$_t_uint256_$_t_enum$_EstimationMode_$2709_$returns$_t_int256_$",
                        "typeString": "function (uint256,enum Math.EstimationMode) view returns (int256)"
                      }
                    },
                    "id": 469,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "2975:76:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "2963:88:1"
                },
                {
                  "assignments": [
                    472
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 472,
                      "name": "funding",
                      "nodeType": "VariableDeclaration",
                      "scope": 539,
                      "src": "3061:12:1",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 471,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "3061:4:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 476,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 473,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 431,
                        "src": "3076:6:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$885",
                          "typeString": "contract Market"
                        }
                      },
                      "id": 474,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "funding",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 875,
                      "src": "3076:14:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                        "typeString": "function () view external returns (uint256)"
                      }
                    },
                    "id": 475,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3076:16:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3061:31:1"
                },
                {
                  "assignments": [
                    478
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 478,
                      "name": "costLevelBefore",
                      "nodeType": "VariableDeclaration",
                      "scope": 539,
                      "src": "3102:19:1",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 477,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "3102:3:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 487,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 480,
                        "name": "log2N",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 459,
                        "src": "3138:5:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 481,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 453,
                        "src": "3145:20:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 482,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 472,
                        "src": "3167:7:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 483,
                            "name": "Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 3954,
                            "src": "3176:4:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Math_$3954_$",
                              "typeString": "type(library Math)"
                            }
                          },
                          "id": 484,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 2709,
                          "src": "3176:19:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$2709_$",
                            "typeString": "type(enum Math.EstimationMode)"
                          }
                        },
                        "id": 485,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "LowerBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "3176:30:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$2709",
                          "typeString": "enum Math.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_$2709",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "id": 479,
                      "name": "calcCostLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 662,
                      "src": "3124:13:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_enum$_EstimationMode_$2709_$returns$_t_int256_$",
                        "typeString": "function (int256,int256[] memory,uint256,enum Math.EstimationMode) view returns (int256)"
                      }
                    },
                    "id": 486,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3124:83:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3102:105:1"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        },
                        "id": 493,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 490,
                              "name": "outcomeTokenCount",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 435,
                              "src": "3304:17:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 489,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "3300:3:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_int256_$",
                              "typeString": "type(int256)"
                            },
                            "typeName": "int"
                          },
                          "id": 491,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "3300:22:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">=",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "30",
                          "id": 492,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "3326:1:1",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_0_by_1",
                            "typeString": "int_const 0"
                          },
                          "value": "0"
                        },
                        "src": "3300:27:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 488,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        8526,
                        8527
                      ],
                      "referencedDeclaration": 8526,
                      "src": "3292:7:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 494,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3292:36:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 495,
                  "nodeType": "ExpressionStatement",
                  "src": "3292:36:1"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 507,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "baseExpression": {
                        "argumentTypes": null,
                        "id": 496,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 453,
                        "src": "3338:20:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      "id": 498,
                      "indexExpression": {
                        "argumentTypes": null,
                        "id": 497,
                        "name": "outcomeTokenIndex",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 433,
                        "src": "3359:17:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      },
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "nodeType": "IndexAccess",
                      "src": "3338:39:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 504,
                              "name": "outcomeTokenCount",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 435,
                              "src": "3428:17:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 503,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "3424:3:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_int256_$",
                              "typeString": "type(int256)"
                            },
                            "typeName": "int"
                          },
                          "id": 505,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "3424:22:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "baseExpression": {
                            "argumentTypes": null,
                            "id": 499,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 453,
                            "src": "3380:20:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 501,
                          "indexExpression": {
                            "argumentTypes": null,
                            "id": 500,
                            "name": "outcomeTokenIndex",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 433,
                            "src": "3401:17:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          },
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "nodeType": "IndexAccess",
                          "src": "3380:39:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 502,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sub",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 3932,
                        "src": "3380:43:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_delegatecall_view$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                          "typeString": "function (int256,int256) view returns (int256)"
                        }
                      },
                      "id": 506,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "3380:67:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "3338:109:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 508,
                  "nodeType": "ExpressionStatement",
                  "src": "3338:109:1"
                },
                {
                  "assignments": [
                    510
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 510,
                      "name": "costLevelAfter",
                      "nodeType": "VariableDeclaration",
                      "scope": 539,
                      "src": "3515:18:1",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 509,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "3515:3:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 519,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 512,
                        "name": "log2N",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 459,
                        "src": "3550:5:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 513,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 453,
                        "src": "3557:20:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 514,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 472,
                        "src": "3579:7:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 515,
                            "name": "Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 3954,
                            "src": "3588:4:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Math_$3954_$",
                              "typeString": "type(library Math)"
                            }
                          },
                          "id": 516,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 2709,
                          "src": "3588:19:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$2709_$",
                            "typeString": "type(enum Math.EstimationMode)"
                          }
                        },
                        "id": 517,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "UpperBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "3588:30:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$2709",
                          "typeString": "enum Math.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_$2709",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "id": 511,
                      "name": "calcCostLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 662,
                      "src": "3536:13:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_enum$_EstimationMode_$2709_$returns$_t_int256_$",
                        "typeString": "function (int256,int256[] memory,uint256,enum Math.EstimationMode) view returns (int256)"
                      }
                    },
                    "id": 518,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3536:83:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3515:104:1"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    },
                    "id": 522,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 520,
                      "name": "costLevelBefore",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 478,
                      "src": "3685:15:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<=",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 521,
                      "name": "costLevelAfter",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 510,
                      "src": "3704:14:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "3685:33:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 527,
                  "nodeType": "IfStatement",
                  "src": "3682:82:1",
                  "trueBody": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 525,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 523,
                        "name": "costLevelBefore",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 478,
                        "src": "3732:15:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "id": 524,
                        "name": "costLevelAfter",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 510,
                        "src": "3750:14:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "src": "3732:32:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 526,
                    "nodeType": "ExpressionStatement",
                    "src": "3732:32:1"
                  }
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 536,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 528,
                      "name": "profit",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 438,
                      "src": "3800:6:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 535,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "commonType": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            },
                            "id": 532,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftExpression": {
                              "argumentTypes": null,
                              "id": 530,
                              "name": "costLevelBefore",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 478,
                              "src": "3814:15:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_int256",
                                "typeString": "int256"
                              }
                            },
                            "nodeType": "BinaryOperation",
                            "operator": "-",
                            "rightExpression": {
                              "argumentTypes": null,
                              "id": 531,
                              "name": "costLevelAfter",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 510,
                              "src": "3832:14:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_int256",
                                "typeString": "int256"
                              }
                            },
                            "src": "3814:32:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          ],
                          "id": 529,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "lValueRequested": false,
                          "nodeType": "ElementaryTypeNameExpression",
                          "src": "3809:4:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_uint256_$",
                            "typeString": "type(uint256)"
                          },
                          "typeName": "uint"
                        },
                        "id": 533,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "typeConversion",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "3809:38:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "/",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 534,
                        "name": "ONE",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 290,
                        "src": "3850:3:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "3809:44:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "3800:53:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 537,
                  "nodeType": "ExpressionStatement",
                  "src": "3800:53:1"
                }
              ]
            },
            "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": 539,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": true,
            "modifiers": [],
            "name": "calcProfit",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 436,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 431,
                  "name": "market",
                  "nodeType": "VariableDeclaration",
                  "scope": 539,
                  "src": "2615:13:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_contract$_Market_$885",
                    "typeString": "contract Market"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 430,
                    "name": "Market",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 885,
                    "src": "2615:6:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_Market_$885",
                      "typeString": "contract Market"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 433,
                  "name": "outcomeTokenIndex",
                  "nodeType": "VariableDeclaration",
                  "scope": 539,
                  "src": "2630:23:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint8",
                    "typeString": "uint8"
                  },
                  "typeName": {
                    "id": 432,
                    "name": "uint8",
                    "nodeType": "ElementaryTypeName",
                    "src": "2630:5:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint8",
                      "typeString": "uint8"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 435,
                  "name": "outcomeTokenCount",
                  "nodeType": "VariableDeclaration",
                  "scope": 539,
                  "src": "2655:22:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 434,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2655:4:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2614:64:1"
            },
            "payable": false,
            "returnParameters": {
              "id": 439,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 438,
                  "name": "profit",
                  "nodeType": "VariableDeclaration",
                  "scope": 539,
                  "src": "2728:11:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 437,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2728:4:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2727:13:1"
            },
            "scope": 815,
            "src": "2595:1265:1",
            "stateMutability": "view",
            "superFunction": 910,
            "visibility": "public"
          },
          {
            "body": {
              "id": 604,
              "nodeType": "Block",
              "src": "4236:687:1",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "id": 555,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [],
                          "expression": {
                            "argumentTypes": [],
                            "expression": {
                              "argumentTypes": null,
                              "arguments": [],
                              "expression": {
                                "argumentTypes": [],
                                "expression": {
                                  "argumentTypes": null,
                                  "id": 549,
                                  "name": "market",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 541,
                                  "src": "4254:6:1",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_Market_$885",
                                    "typeString": "contract Market"
                                  }
                                },
                                "id": 550,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "eventContract",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 869,
                                "src": "4254:20:1",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_function_external_view$__$returns$_t_contract$_ScalarEvent_$2415_$",
                                  "typeString": "function () view external returns (contract ScalarEvent)"
                                }
                              },
                              "id": 551,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "functionCall",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "4254:22:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_ScalarEvent_$2415",
                                "typeString": "contract ScalarEvent"
                              }
                            },
                            "id": 552,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "getOutcomeCount",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 2364,
                            "src": "4254:38:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_view$__$returns$_t_uint8_$",
                              "typeString": "function () view external returns (uint8)"
                            }
                          },
                          "id": 553,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "4254:40:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "31",
                          "id": 554,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "4297:1:1",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_1_by_1",
                            "typeString": "int_const 1"
                          },
                          "value": "1"
                        },
                        "src": "4254:44:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 548,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        8526,
                        8527
                      ],
                      "referencedDeclaration": 8526,
                      "src": "4246:7:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 556,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4246:53:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 557,
                  "nodeType": "ExpressionStatement",
                  "src": "4246:53:1"
                },
                {
                  "assignments": [
                    561
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 561,
                      "name": "netOutcomeTokensSold",
                      "nodeType": "VariableDeclaration",
                      "scope": 605,
                      "src": "4309:33:1",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                        "typeString": "int256[]"
                      },
                      "typeName": {
                        "baseType": {
                          "id": 559,
                          "name": "int",
                          "nodeType": "ElementaryTypeName",
                          "src": "4309:3:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 560,
                        "length": null,
                        "nodeType": "ArrayTypeName",
                        "src": "4309:5:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                          "typeString": "int256[]"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 565,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 563,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 541,
                        "src": "4369:6:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$885",
                          "typeString": "contract Market"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_contract$_Market_$885",
                          "typeString": "contract Market"
                        }
                      ],
                      "id": 562,
                      "name": "getNetOutcomeTokensSold",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 814,
                      "src": "4345:23:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_contract$_Market_$885_$returns$_t_array$_t_int256_$dyn_memory_ptr_$",
                        "typeString": "function (contract Market) view returns (int256[] memory)"
                      }
                    },
                    "id": 564,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4345:31:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                      "typeString": "int256[] memory"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4309:67:1"
                },
                {
                  "assignments": [
                    567
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 567,
                      "name": "logN",
                      "nodeType": "VariableDeclaration",
                      "scope": 605,
                      "src": "4386:8:1",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 566,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "4386:3:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 578,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 573,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 570,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 561,
                            "src": "4407:20:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 571,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "length",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": null,
                          "src": "4407:27:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "*",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 572,
                          "name": "ONE",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 290,
                          "src": "4437:3:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "4407:33:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 574,
                            "name": "Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 3954,
                            "src": "4442:4:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Math_$3954_$",
                              "typeString": "type(library Math)"
                            }
                          },
                          "id": 575,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 2709,
                          "src": "4442:19:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$2709_$",
                            "typeString": "type(enum Math.EstimationMode)"
                          }
                        },
                        "id": 576,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "Midpoint",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "4442:28:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$2709",
                          "typeString": "enum Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$2709",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 568,
                        "name": "Math",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 3954,
                        "src": "4397:4:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_contract$_Math_$3954_$",
                          "typeString": "type(library Math)"
                        }
                      },
                      "id": 569,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "log2",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 3461,
                      "src": "4397:9:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_delegatecall_view$_t_uint256_$_t_enum$_EstimationMode_$2709_$returns$_t_int256_$",
                        "typeString": "function (uint256,enum Math.EstimationMode) view returns (int256)"
                      }
                    },
                    "id": 577,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4397:74:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4386:85:1"
                },
                {
                  "assignments": [
                    580
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 580,
                      "name": "funding",
                      "nodeType": "VariableDeclaration",
                      "scope": 605,
                      "src": "4481:12:1",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 579,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "4481:4:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 584,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 581,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 541,
                        "src": "4496:6:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$885",
                          "typeString": "contract Market"
                        }
                      },
                      "id": 582,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "funding",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 875,
                      "src": "4496:14:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                        "typeString": "function () view external returns (uint256)"
                      }
                    },
                    "id": 583,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4496:16:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4481:31:1"
                },
                {
                  "assignments": [
                    585,
                    null,
                    586
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 585,
                      "name": "sum",
                      "nodeType": "VariableDeclaration",
                      "scope": 605,
                      "src": "4748:3:1",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": null,
                      "value": null,
                      "visibility": "internal"
                    },
                    null,
                    {
                      "constant": false,
                      "id": 586,
                      "name": "outcomeExpTerm",
                      "nodeType": "VariableDeclaration",
                      "scope": 605,
                      "src": "4755:14:1",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": null,
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 596,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 588,
                        "name": "logN",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 567,
                        "src": "4786:4:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 589,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 561,
                        "src": "4792:20:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 590,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 580,
                        "src": "4814:7:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 591,
                        "name": "outcomeTokenIndex",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 543,
                        "src": "4823:17:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 592,
                            "name": "Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 3954,
                            "src": "4842:4:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Math_$3954_$",
                              "typeString": "type(library Math)"
                            }
                          },
                          "id": 593,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 2709,
                          "src": "4842:19:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$2709_$",
                            "typeString": "type(enum Math.EstimationMode)"
                          }
                        },
                        "id": 594,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "Midpoint",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "4842:28:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$2709",
                          "typeString": "enum Math.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_$2709",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "id": 587,
                      "name": "sumExpOffset",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 772,
                      "src": "4773:12:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_uint8_$_t_enum$_EstimationMode_$2709_$returns$_t_uint256_$_t_int256_$_t_uint256_$",
                        "typeString": "function (int256,int256[] memory,uint256,uint8,enum Math.EstimationMode) view returns (uint256,int256,uint256)"
                      }
                    },
                    "id": 595,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4773:98:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$_t_uint256_$_t_int256_$_t_uint256_$",
                      "typeString": "tuple(uint256,int256,uint256)"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4743:128:1"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 602,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 597,
                      "name": "outcomeExpTerm",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 586,
                      "src": "4888:14:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "/",
                    "rightExpression": {
                      "argumentTypes": null,
                      "components": [
                        {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          "id": 600,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 598,
                            "name": "sum",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 585,
                            "src": "4906:3:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "/",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 599,
                            "name": "ONE",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 290,
                            "src": "4912:3:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "4906:9:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        }
                      ],
                      "id": 601,
                      "isConstant": false,
                      "isInlineArray": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "nodeType": "TupleExpression",
                      "src": "4905:11:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "4888:28:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "functionReturnParameters": 547,
                  "id": 603,
                  "nodeType": "Return",
                  "src": "4881:35:1"
                }
              ]
            },
            "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": 605,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": true,
            "modifiers": [],
            "name": "calcMarginalPrice",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 544,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 541,
                  "name": "market",
                  "nodeType": "VariableDeclaration",
                  "scope": 605,
                  "src": "4131:13:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_contract$_Market_$885",
                    "typeString": "contract Market"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 540,
                    "name": "Market",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 885,
                    "src": "4131:6:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_Market_$885",
                      "typeString": "contract Market"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 543,
                  "name": "outcomeTokenIndex",
                  "nodeType": "VariableDeclaration",
                  "scope": 605,
                  "src": "4146:23:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint8",
                    "typeString": "uint8"
                  },
                  "typeName": {
                    "id": 542,
                    "name": "uint8",
                    "nodeType": "ElementaryTypeName",
                    "src": "4146:5:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint8",
                      "typeString": "uint8"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "4130:40:1"
            },
            "payable": false,
            "returnParameters": {
              "id": 547,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 546,
                  "name": "price",
                  "nodeType": "VariableDeclaration",
                  "scope": 605,
                  "src": "4220:10:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 545,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "4220:4:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "4219:12:1"
            },
            "scope": 815,
            "src": "4104:819:1",
            "stateMutability": "view",
            "superFunction": 919,
            "visibility": "public"
          },
          {
            "body": {
              "id": 661,
              "nodeType": "Block",
              "src": "5479:503:1",
              "statements": [
                {
                  "assignments": [
                    619,
                    620,
                    null
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 619,
                      "name": "sum",
                      "nodeType": "VariableDeclaration",
                      "scope": 662,
                      "src": "5723:3:1",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": null,
                      "value": null,
                      "visibility": "internal"
                    },
                    {
                      "constant": false,
                      "id": 620,
                      "name": "offset",
                      "nodeType": "VariableDeclaration",
                      "scope": 662,
                      "src": "5728:6:1",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": null,
                      "value": null,
                      "visibility": "internal"
                    },
                    null
                  ],
                  "id": 628,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 622,
                        "name": "logN",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 607,
                        "src": "5753:4:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 623,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 610,
                        "src": "5759:20:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 624,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 612,
                        "src": "5781:7:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "30",
                        "id": 625,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "5790:1:1",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_0_by_1",
                          "typeString": "int_const 0"
                        },
                        "value": "0"
                      },
                      {
                        "argumentTypes": null,
                        "id": 626,
                        "name": "estimationMode",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 614,
                        "src": "5793:14:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$2709",
                          "typeString": "enum Math.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_$2709",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "id": 621,
                      "name": "sumExpOffset",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 772,
                      "src": "5740:12:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_uint8_$_t_enum$_EstimationMode_$2709_$returns$_t_uint256_$_t_int256_$_t_uint256_$",
                        "typeString": "function (int256,int256[] memory,uint256,uint8,enum Math.EstimationMode) view returns (uint256,int256,uint256)"
                      }
                    },
                    "id": 627,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "5740:68:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$_t_uint256_$_t_int256_$_t_uint256_$",
                      "typeString": "tuple(uint256,int256,uint256)"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "5718:90:1"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 635,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 629,
                      "name": "costLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 617,
                      "src": "5818:9:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "id": 632,
                          "name": "sum",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 619,
                          "src": "5840:3:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        {
                          "argumentTypes": null,
                          "id": 633,
                          "name": "estimationMode",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 614,
                          "src": "5845:14:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_enum$_EstimationMode_$2709",
                            "typeString": "enum Math.EstimationMode"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          {
                            "typeIdentifier": "t_enum$_EstimationMode_$2709",
                            "typeString": "enum Math.EstimationMode"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "id": 630,
                          "name": "Math",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 3954,
                          "src": "5830:4:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_contract$_Math_$3954_$",
                            "typeString": "type(library Math)"
                          }
                        },
                        "id": 631,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "log2",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 3461,
                        "src": "5830:9:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_delegatecall_view$_t_uint256_$_t_enum$_EstimationMode_$2709_$returns$_t_int256_$",
                          "typeString": "function (uint256,enum Math.EstimationMode) view returns (int256)"
                        }
                      },
                      "id": 634,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "5830:30:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "5818:42:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 636,
                  "nodeType": "ExpressionStatement",
                  "src": "5818:42:1"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 642,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 637,
                      "name": "costLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 617,
                      "src": "5870:9:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "id": 640,
                          "name": "offset",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 620,
                          "src": "5896:6:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "id": 638,
                          "name": "costLevel",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 617,
                          "src": "5882:9:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 639,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "add",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 3911,
                        "src": "5882:13:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_delegatecall_view$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                          "typeString": "function (int256,int256) view returns (int256)"
                        }
                      },
                      "id": 641,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "5882:21:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "5870:33:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 643,
                  "nodeType": "ExpressionStatement",
                  "src": "5870:33:1"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 659,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 644,
                      "name": "costLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 617,
                      "src": "5913:9:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 656,
                              "name": "funding",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 612,
                              "src": "5966:7:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 655,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "5962:3:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_int256_$",
                              "typeString": "type(int256)"
                            },
                            "typeName": "int"
                          },
                          "id": 657,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "5962:12:1",
                          "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": 652,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "leftExpression": {
                                "argumentTypes": null,
                                "arguments": [
                                  {
                                    "argumentTypes": null,
                                    "arguments": [
                                      {
                                        "argumentTypes": null,
                                        "id": 648,
                                        "name": "ONE",
                                        "nodeType": "Identifier",
                                        "overloadedDeclarations": [],
                                        "referencedDeclaration": 290,
                                        "src": "5944:3:1",
                                        "typeDescriptions": {
                                          "typeIdentifier": "t_uint256",
                                          "typeString": "uint256"
                                        }
                                      }
                                    ],
                                    "expression": {
                                      "argumentTypes": [
                                        {
                                          "typeIdentifier": "t_uint256",
                                          "typeString": "uint256"
                                        }
                                      ],
                                      "id": 647,
                                      "isConstant": false,
                                      "isLValue": false,
                                      "isPure": true,
                                      "lValueRequested": false,
                                      "nodeType": "ElementaryTypeNameExpression",
                                      "src": "5940:3:1",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_type$_t_int256_$",
                                        "typeString": "type(int256)"
                                      },
                                      "typeName": "int"
                                    },
                                    "id": 649,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": true,
                                    "kind": "typeConversion",
                                    "lValueRequested": false,
                                    "names": [],
                                    "nodeType": "FunctionCall",
                                    "src": "5940:8:1",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_int256",
                                      "typeString": "int256"
                                    }
                                  }
                                ],
                                "expression": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_int256",
                                      "typeString": "int256"
                                    }
                                  ],
                                  "expression": {
                                    "argumentTypes": null,
                                    "id": 645,
                                    "name": "costLevel",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 617,
                                    "src": "5926:9:1",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_int256",
                                      "typeString": "int256"
                                    }
                                  },
                                  "id": 646,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "mul",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 3953,
                                  "src": "5926:13:1",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_delegatecall_view$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                                    "typeString": "function (int256,int256) view returns (int256)"
                                  }
                                },
                                "id": 650,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "5926:23:1",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                }
                              },
                              "nodeType": "BinaryOperation",
                              "operator": "/",
                              "rightExpression": {
                                "argumentTypes": null,
                                "id": 651,
                                "name": "logN",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 607,
                                "src": "5952:4:1",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                }
                              },
                              "src": "5926:30:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_int256",
                                "typeString": "int256"
                              }
                            }
                          ],
                          "id": 653,
                          "isConstant": false,
                          "isInlineArray": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "nodeType": "TupleExpression",
                          "src": "5925:32:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 654,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "mul",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 3953,
                        "src": "5925:36:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_delegatecall_view$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                          "typeString": "function (int256,int256) view returns (int256)"
                        }
                      },
                      "id": 658,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "5925:50:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "5913:62:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 660,
                  "nodeType": "ExpressionStatement",
                  "src": "5913:62:1"
                }
              ]
            },
            "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": 662,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": true,
            "modifiers": [],
            "name": "calcCostLevel",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 615,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 607,
                  "name": "logN",
                  "nodeType": "VariableDeclaration",
                  "scope": 662,
                  "src": "5323:8:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_int256",
                    "typeString": "int256"
                  },
                  "typeName": {
                    "id": 606,
                    "name": "int",
                    "nodeType": "ElementaryTypeName",
                    "src": "5323:3:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 610,
                  "name": "netOutcomeTokensSold",
                  "nodeType": "VariableDeclaration",
                  "scope": 662,
                  "src": "5333:26:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                    "typeString": "int256[]"
                  },
                  "typeName": {
                    "baseType": {
                      "id": 608,
                      "name": "int",
                      "nodeType": "ElementaryTypeName",
                      "src": "5333:3:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 609,
                    "length": null,
                    "nodeType": "ArrayTypeName",
                    "src": "5333:5:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                      "typeString": "int256[]"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 612,
                  "name": "funding",
                  "nodeType": "VariableDeclaration",
                  "scope": 662,
                  "src": "5361:12:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 611,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "5361:4:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 614,
                  "name": "estimationMode",
                  "nodeType": "VariableDeclaration",
                  "scope": 662,
                  "src": "5375:34:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_enum$_EstimationMode_$2709",
                    "typeString": "enum Math.EstimationMode"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 613,
                    "name": "Math.EstimationMode",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 2709,
                    "src": "5375:19:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_enum$_EstimationMode_$2709",
                      "typeString": "enum Math.EstimationMode"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "5322:88:1"
            },
            "payable": false,
            "returnParameters": {
              "id": 618,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 617,
                  "name": "costLevel",
                  "nodeType": "VariableDeclaration",
                  "scope": 662,
                  "src": "5460:13:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_int256",
                    "typeString": "int256"
                  },
                  "typeName": {
                    "id": 616,
                    "name": "int",
                    "nodeType": "ElementaryTypeName",
                    "src": "5460:3:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "5459:15:1"
            },
            "scope": 815,
            "src": "5300:682:1",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "private"
          },
          {
            "body": {
              "id": 771,
              "nodeType": "Block",
              "src": "6755:1349:1",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        "id": 691,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          },
                          "id": 685,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 683,
                            "name": "logN",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 664,
                            "src": "7615:4:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": ">=",
                          "rightExpression": {
                            "argumentTypes": null,
                            "hexValue": "30",
                            "id": 684,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "7623:1:1",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_0_by_1",
                              "typeString": "int_const 0"
                            },
                            "value": "0"
                          },
                          "src": "7615:9:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "&&",
                        "rightExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          },
                          "id": 690,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "id": 687,
                                "name": "funding",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 669,
                                "src": "7632:7:1",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              ],
                              "id": 686,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "lValueRequested": false,
                              "nodeType": "ElementaryTypeNameExpression",
                              "src": "7628:3:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_type$_t_int256_$",
                                "typeString": "type(int256)"
                              },
                              "typeName": "int"
                            },
                            "id": 688,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "typeConversion",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "7628:12:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": ">=",
                          "rightExpression": {
                            "argumentTypes": null,
                            "hexValue": "30",
                            "id": 689,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "7644:1:1",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_0_by_1",
                              "typeString": "int_const 0"
                            },
                            "value": "0"
                          },
                          "src": "7628:17:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "src": "7615:30:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 682,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        8526,
                        8527
                      ],
                      "referencedDeclaration": 8526,
                      "src": "7607:7:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 692,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "7607:39:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 693,
                  "nodeType": "ExpressionStatement",
                  "src": "7607:39:1"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 699,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 694,
                      "name": "offset",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 678,
                      "src": "7656:6:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "id": 697,
                          "name": "netOutcomeTokensSold",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 667,
                          "src": "7674:20:1",
                          "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": 695,
                          "name": "Math",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 3954,
                          "src": "7665:4:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_contract$_Math_$3954_$",
                            "typeString": "type(library Math)"
                          }
                        },
                        "id": 696,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "max",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 3687,
                        "src": "7665:8:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_delegatecall_view$_t_array$_t_int256_$dyn_memory_ptr_$returns$_t_int256_$",
                          "typeString": "function (int256[] memory) view returns (int256)"
                        }
                      },
                      "id": 698,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "7665:30:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "7656:39:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 700,
                  "nodeType": "ExpressionStatement",
                  "src": "7656:39:1"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 710,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 701,
                      "name": "offset",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 678,
                      "src": "7705:6:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "id": 709,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 704,
                            "name": "logN",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 664,
                            "src": "7725:4:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          ],
                          "expression": {
                            "argumentTypes": null,
                            "id": 702,
                            "name": "offset",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 678,
                            "src": "7714:6:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "id": 703,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "mul",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 3953,
                          "src": "7714:10:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_delegatecall_view$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                            "typeString": "function (int256,int256) view returns (int256)"
                          }
                        },
                        "id": 705,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "7714:16:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "/",
                      "rightExpression": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 707,
                            "name": "funding",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 669,
                            "src": "7737:7:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          ],
                          "id": 706,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "lValueRequested": false,
                          "nodeType": "ElementaryTypeNameExpression",
                          "src": "7733:3:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_int256_$",
                            "typeString": "type(int256)"
                          },
                          "typeName": "int"
                        },
                        "id": 708,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "typeConversion",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "7733:12:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "src": "7714:31:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "7705:40:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 711,
                  "nodeType": "ExpressionStatement",
                  "src": "7705:40:1"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 717,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 712,
                      "name": "offset",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 678,
                      "src": "7755:6:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "id": 715,
                          "name": "EXP_LIMIT",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 293,
                          "src": "7775:9:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "id": 713,
                          "name": "offset",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 678,
                          "src": "7764:6:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 714,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sub",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 3932,
                        "src": "7764:10:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_delegatecall_view$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                          "typeString": "function (int256,int256) view returns (int256)"
                        }
                      },
                      "id": 716,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "7764:21:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "7755:30:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 718,
                  "nodeType": "ExpressionStatement",
                  "src": "7755:30:1"
                },
                {
                  "assignments": [],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 720,
                      "name": "term",
                      "nodeType": "VariableDeclaration",
                      "scope": 772,
                      "src": "7795:9:1",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 719,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "7795:4:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 721,
                  "initialValue": null,
                  "nodeType": "VariableDeclarationStatement",
                  "src": "7795:9:1"
                },
                {
                  "body": {
                    "id": 769,
                    "nodeType": "Block",
                    "src": "7870:228:1",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 752,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 733,
                            "name": "term",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 720,
                            "src": "7884:4:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "arguments": [
                                  {
                                    "argumentTypes": null,
                                    "id": 748,
                                    "name": "offset",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 678,
                                    "src": "7956:6:1",
                                    "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": 745,
                                        "isConstant": false,
                                        "isLValue": false,
                                        "isPure": false,
                                        "lValueRequested": false,
                                        "leftExpression": {
                                          "argumentTypes": null,
                                          "arguments": [
                                            {
                                              "argumentTypes": null,
                                              "id": 740,
                                              "name": "logN",
                                              "nodeType": "Identifier",
                                              "overloadedDeclarations": [],
                                              "referencedDeclaration": 664,
                                              "src": "7930:4:1",
                                              "typeDescriptions": {
                                                "typeIdentifier": "t_int256",
                                                "typeString": "int256"
                                              }
                                            }
                                          ],
                                          "expression": {
                                            "argumentTypes": [
                                              {
                                                "typeIdentifier": "t_int256",
                                                "typeString": "int256"
                                              }
                                            ],
                                            "expression": {
                                              "argumentTypes": null,
                                              "baseExpression": {
                                                "argumentTypes": null,
                                                "id": 736,
                                                "name": "netOutcomeTokensSold",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 667,
                                                "src": "7902:20:1",
                                                "typeDescriptions": {
                                                  "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                                                  "typeString": "int256[] memory"
                                                }
                                              },
                                              "id": 738,
                                              "indexExpression": {
                                                "argumentTypes": null,
                                                "id": 737,
                                                "name": "i",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 723,
                                                "src": "7923:1:1",
                                                "typeDescriptions": {
                                                  "typeIdentifier": "t_uint8",
                                                  "typeString": "uint8"
                                                }
                                              },
                                              "isConstant": false,
                                              "isLValue": true,
                                              "isPure": false,
                                              "lValueRequested": false,
                                              "nodeType": "IndexAccess",
                                              "src": "7902:23:1",
                                              "typeDescriptions": {
                                                "typeIdentifier": "t_int256",
                                                "typeString": "int256"
                                              }
                                            },
                                            "id": 739,
                                            "isConstant": false,
                                            "isLValue": false,
                                            "isPure": false,
                                            "lValueRequested": false,
                                            "memberName": "mul",
                                            "nodeType": "MemberAccess",
                                            "referencedDeclaration": 3953,
                                            "src": "7902:27:1",
                                            "typeDescriptions": {
                                              "typeIdentifier": "t_function_delegatecall_view$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                                              "typeString": "function (int256,int256) view returns (int256)"
                                            }
                                          },
                                          "id": 741,
                                          "isConstant": false,
                                          "isLValue": false,
                                          "isPure": false,
                                          "kind": "functionCall",
                                          "lValueRequested": false,
                                          "names": [],
                                          "nodeType": "FunctionCall",
                                          "src": "7902:33:1",
                                          "typeDescriptions": {
                                            "typeIdentifier": "t_int256",
                                            "typeString": "int256"
                                          }
                                        },
                                        "nodeType": "BinaryOperation",
                                        "operator": "/",
                                        "rightExpression": {
                                          "argumentTypes": null,
                                          "arguments": [
                                            {
                                              "argumentTypes": null,
                                              "id": 743,
                                              "name": "funding",
                                              "nodeType": "Identifier",
                                              "overloadedDeclarations": [],
                                              "referencedDeclaration": 669,
                                              "src": "7942:7:1",
                                              "typeDescriptions": {
                                                "typeIdentifier": "t_uint256",
                                                "typeString": "uint256"
                                              }
                                            }
                                          ],
                                          "expression": {
                                            "argumentTypes": [
                                              {
                                                "typeIdentifier": "t_uint256",
                                                "typeString": "uint256"
                                              }
                                            ],
                                            "id": 742,
                                            "isConstant": false,
                                            "isLValue": false,
                                            "isPure": true,
                                            "lValueRequested": false,
                                            "nodeType": "ElementaryTypeNameExpression",
                                            "src": "7938:3:1",
                                            "typeDescriptions": {
                                              "typeIdentifier": "t_type$_t_int256_$",
                                              "typeString": "type(int256)"
                                            },
                                            "typeName": "int"
                                          },
                                          "id": 744,
                                          "isConstant": false,
                                          "isLValue": false,
                                          "isPure": false,
                                          "kind": "typeConversion",
                                          "lValueRequested": false,
                                          "names": [],
                                          "nodeType": "FunctionCall",
                                          "src": "7938:12:1",
                                          "typeDescriptions": {
                                            "typeIdentifier": "t_int256",
                                            "typeString": "int256"
                                          }
                                        },
                                        "src": "7902:48:1",
                                        "typeDescriptions": {
                                          "typeIdentifier": "t_int256",
                                          "typeString": "int256"
                                        }
                                      }
                                    ],
                                    "id": 746,
                                    "isConstant": false,
                                    "isInlineArray": false,
                                    "isLValue": false,
                                    "isPure": false,
                                    "lValueRequested": false,
                                    "nodeType": "TupleExpression",
                                    "src": "7901:50:1",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_int256",
                                      "typeString": "int256"
                                    }
                                  },
                                  "id": 747,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "sub",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 3932,
                                  "src": "7901:54:1",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_delegatecall_view$_t_int256_$_t_int256_$returns$_t_int256_$bound_to$_t_int256_$",
                                    "typeString": "function (int256,int256) view returns (int256)"
                                  }
                                },
                                "id": 749,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "7901:62:1",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                }
                              },
                              {
                                "argumentTypes": null,
                                "id": 750,
                                "name": "estimationMode",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 673,
                                "src": "7965:14:1",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_enum$_EstimationMode_$2709",
                                  "typeString": "enum Math.EstimationMode"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                },
                                {
                                  "typeIdentifier": "t_enum$_EstimationMode_$2709",
                                  "typeString": "enum Math.EstimationMode"
                                }
                              ],
                              "expression": {
                                "argumentTypes": null,
                                "id": 734,
                                "name": "Math",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 3954,
                                "src": "7891:4:1",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_type$_t_contract$_Math_$3954_$",
                                  "typeString": "type(library Math)"
                                }
                              },
                              "id": 735,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "pow2",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 2812,
                              "src": "7891:9:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_delegatecall_view$_t_int256_$_t_enum$_EstimationMode_$2709_$returns$_t_uint256_$",
                                "typeString": "function (int256,enum Math.EstimationMode) view returns (uint256)"
                              }
                            },
                            "id": 751,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "7891:89:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "7884:96:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 753,
                        "nodeType": "ExpressionStatement",
                        "src": "7884:96:1"
                      },
                      {
                        "condition": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          },
                          "id": 756,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 754,
                            "name": "i",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 723,
                            "src": "7998:1:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "==",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 755,
                            "name": "outcomeIndex",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 671,
                            "src": "8003:12:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          },
                          "src": "7998:17:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "falseBody": null,
                        "id": 761,
                        "nodeType": "IfStatement",
                        "src": "7994:60:1",
                        "trueBody": {
                          "expression": {
                            "argumentTypes": null,
                            "id": 759,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftHandSide": {
                              "argumentTypes": null,
                              "id": 757,
                              "name": "outcomeExpTerm",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 680,
                              "src": "8033:14:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "nodeType": "Assignment",
                            "operator": "=",
                            "rightHandSide": {
                              "argumentTypes": null,
                              "id": 758,
                              "name": "term",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 720,
                              "src": "8050:4:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "src": "8033:21:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "id": 760,
                          "nodeType": "ExpressionStatement",
                          "src": "8033:21:1"
                        }
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 767,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 762,
                            "name": "sum",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 676,
                            "src": "8068:3:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "id": 765,
                                "name": "term",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 720,
                                "src": "8082:4:1",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              ],
                              "expression": {
                                "argumentTypes": null,
                                "id": 763,
                                "name": "sum",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 676,
                                "src": "8074:3:1",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "id": 764,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "add",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 3760,
                              "src": "8074:7:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_delegatecall_view$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                                "typeString": "function (uint256,uint256) view returns (uint256)"
                              }
                            },
                            "id": 766,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "8074:13:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "8068:19:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 768,
                        "nodeType": "ExpressionStatement",
                        "src": "8068:19:1"
                      }
                    ]
                  },
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 729,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 726,
                      "name": "i",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 723,
                      "src": "7832:1:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint8",
                        "typeString": "uint8"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 727,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 667,
                        "src": "7836:20:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      "id": 728,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "length",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": null,
                      "src": "7836:27:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "7832:31:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "id": 770,
                  "initializationExpression": {
                    "assignments": [
                      723
                    ],
                    "declarations": [
                      {
                        "constant": false,
                        "id": 723,
                        "name": "i",
                        "nodeType": "VariableDeclaration",
                        "scope": 772,
                        "src": "7819:7:1",
                        "stateVariable": false,
                        "storageLocation": "default",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "typeName": {
                          "id": 722,
                          "name": "uint8",
                          "nodeType": "ElementaryTypeName",
                          "src": "7819:5:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "value": null,
                        "visibility": "internal"
                      }
                    ],
                    "id": 725,
                    "initialValue": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 724,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "7829:1:1",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "nodeType": "VariableDeclarationStatement",
                    "src": "7819:11:1"
                  },
                  "loopExpression": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 731,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "nodeType": "UnaryOperation",
                      "operator": "++",
                      "prefix": false,
                      "src": "7865:3:1",
                      "subExpression": {
                        "argumentTypes": null,
                        "id": 730,
                        "name": "i",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 723,
                        "src": "7865:1:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      },
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint8",
                        "typeString": "uint8"
                      }
                    },
                    "id": 732,
                    "nodeType": "ExpressionStatement",
                    "src": "7865:3:1"
                  },
                  "nodeType": "ForStatement",
                  "src": "7814:284:1"
                }
              ]
            },
            "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": 772,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": true,
            "modifiers": [],
            "name": "sumExpOffset",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 674,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 664,
                  "name": "logN",
                  "nodeType": "VariableDeclaration",
                  "scope": 772,
                  "src": "6550:8:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_int256",
                    "typeString": "int256"
                  },
                  "typeName": {
                    "id": 663,
                    "name": "int",
                    "nodeType": "ElementaryTypeName",
                    "src": "6550:3:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 667,
                  "name": "netOutcomeTokensSold",
                  "nodeType": "VariableDeclaration",
                  "scope": 772,
                  "src": "6560:26:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                    "typeString": "int256[]"
                  },
                  "typeName": {
                    "baseType": {
                      "id": 665,
                      "name": "int",
                      "nodeType": "ElementaryTypeName",
                      "src": "6560:3:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 666,
                    "length": null,
                    "nodeType": "ArrayTypeName",
                    "src": "6560:5:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                      "typeString": "int256[]"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 669,
                  "name": "funding",
                  "nodeType": "VariableDeclaration",
                  "scope": 772,
                  "src": "6588:12:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 668,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "6588:4:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 671,
                  "name": "outcomeIndex",
                  "nodeType": "VariableDeclaration",
                  "scope": 772,
                  "src": "6602:18:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint8",
                    "typeString": "uint8"
                  },
                  "typeName": {
                    "id": 670,
                    "name": "uint8",
                    "nodeType": "ElementaryTypeName",
                    "src": "6602:5:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint8",
                      "typeString": "uint8"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 673,
                  "name": "estimationMode",
                  "nodeType": "VariableDeclaration",
                  "scope": 772,
                  "src": "6622:34:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_enum$_EstimationMode_$2709",
                    "typeString": "enum Math.EstimationMode"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 672,
                    "name": "Math.EstimationMode",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 2709,
                    "src": "6622:19:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_enum$_EstimationMode_$2709",
                      "typeString": "enum Math.EstimationMode"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6549:108:1"
            },
            "payable": false,
            "returnParameters": {
              "id": 681,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 676,
                  "name": "sum",
                  "nodeType": "VariableDeclaration",
                  "scope": 772,
                  "src": "6708:8:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 675,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "6708:4:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 678,
                  "name": "offset",
                  "nodeType": "VariableDeclaration",
                  "scope": 772,
                  "src": "6718:10:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_int256",
                    "typeString": "int256"
                  },
                  "typeName": {
                    "id": 677,
                    "name": "int",
                    "nodeType": "ElementaryTypeName",
                    "src": "6718:3:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 680,
                  "name": "outcomeExpTerm",
                  "nodeType": "VariableDeclaration",
                  "scope": 772,
                  "src": "6730:19:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 679,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "6730:4:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6707:43:1"
            },
            "scope": 815,
            "src": "6528:1576:1",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "private"
          },
          {
            "body": {
              "id": 813,
              "nodeType": "Block",
              "src": "8704:195:1",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 790,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 780,
                      "name": "quantities",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 778,
                      "src": "8714:10:1",
                      "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": 784,
                                  "name": "market",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 774,
                                  "src": "8737:6:1",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_Market_$885",
                                    "typeString": "contract Market"
                                  }
                                },
                                "id": 785,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "eventContract",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 869,
                                "src": "8737:20:1",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_function_external_view$__$returns$_t_contract$_ScalarEvent_$2415_$",
                                  "typeString": "function () view external returns (contract ScalarEvent)"
                                }
                              },
                              "id": 786,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "functionCall",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "8737:22:1",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_ScalarEvent_$2415",
                                "typeString": "contract ScalarEvent"
                              }
                            },
                            "id": 787,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "getOutcomeCount",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 2364,
                            "src": "8737:38:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_view$__$returns$_t_uint8_$",
                              "typeString": "function () view external returns (uint8)"
                            }
                          },
                          "id": 788,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "8737:40:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        ],
                        "id": 783,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "nodeType": "NewExpression",
                        "src": "8727:9:1",
                        "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": 781,
                            "name": "int",
                            "nodeType": "ElementaryTypeName",
                            "src": "8731:3:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "id": 782,
                          "length": null,
                          "nodeType": "ArrayTypeName",
                          "src": "8731:5:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                            "typeString": "int256[]"
                          }
                        }
                      },
                      "id": 789,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "8727:51:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_array$_t_int256_$dyn_memory",
                        "typeString": "int256[] memory"
                      }
                    },
                    "src": "8714:64:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                      "typeString": "int256[] memory"
                    }
                  },
                  "id": 791,
                  "nodeType": "ExpressionStatement",
                  "src": "8714:64:1"
                },
                {
                  "body": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 810,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "baseExpression": {
                          "argumentTypes": null,
                          "id": 803,
                          "name": "quantities",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 778,
                          "src": "8846:10:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                            "typeString": "int256[] memory"
                          }
                        },
                        "id": 805,
                        "indexExpression": {
                          "argumentTypes": null,
                          "id": 804,
                          "name": "i",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 793,
                          "src": "8857:1:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "isConstant": false,
                        "isLValue": true,
                        "isPure": false,
                        "lValueRequested": true,
                        "nodeType": "IndexAccess",
                        "src": "8846:13:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 808,
                            "name": "i",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 793,
                            "src": "8890:1:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          ],
                          "expression": {
                            "argumentTypes": null,
                            "id": 806,
                            "name": "market",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 774,
                            "src": "8862:6:1",
                            "typeDescriptions": {
                              "typeIdentifier": "t_contract$_Market_$885",
                              "typeString": "contract Market"
                            }
                          },
                          "id": 807,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "netOutcomeTokensSold",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 878,
                          "src": "8862:27:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_external_view$_t_uint256_$returns$_t_int256_$",
                            "typeString": "function (uint256) view external returns (int256)"
                          }
                        },
                        "id": 809,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "8862:30:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "src": "8846:46:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 811,
                    "nodeType": "ExpressionStatement",
                    "src": "8846:46:1"
                  },
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 799,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 796,
                      "name": "i",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 793,
                      "src": "8806:1:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint8",
                        "typeString": "uint8"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 797,
                        "name": "quantities",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 778,
                        "src": "8810:10:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      "id": 798,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "length",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": null,
                      "src": "8810:17:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "8806:21:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "id": 812,
                  "initializationExpression": {
                    "assignments": [
                      793
                    ],
                    "declarations": [
                      {
                        "constant": false,
                        "id": 793,
                        "name": "i",
                        "nodeType": "VariableDeclaration",
                        "scope": 814,
                        "src": "8793:7:1",
                        "stateVariable": false,
                        "storageLocation": "default",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "typeName": {
                          "id": 792,
                          "name": "uint8",
                          "nodeType": "ElementaryTypeName",
                          "src": "8793:5:1",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "value": null,
                        "visibility": "internal"
                      }
                    ],
                    "id": 795,
                    "initialValue": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 794,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "8803:1:1",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "nodeType": "VariableDeclarationStatement",
                    "src": "8793:11:1"
                  },
                  "loopExpression": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 801,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "nodeType": "UnaryOperation",
                      "operator": "++",
                      "prefix": false,
                      "src": "8829:3:1",
                      "subExpression": {
                        "argumentTypes": null,
                        "id": 800,
                        "name": "i",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 793,
                        "src": "8829:1:1",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      },
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint8",
                        "typeString": "uint8"
                      }
                    },
                    "id": 802,
                    "nodeType": "ExpressionStatement",
                    "src": "8829:3:1"
                  },
                  "nodeType": "ForStatement",
                  "src": "8788:104:1"
                }
              ]
            },
            "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": 814,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": true,
            "modifiers": [],
            "name": "getNetOutcomeTokensSold",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 775,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 774,
                  "name": "market",
                  "nodeType": "VariableDeclaration",
                  "scope": 814,
                  "src": "8617:13:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_contract$_Market_$885",
                    "typeString": "contract Market"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 773,
                    "name": "Market",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 885,
                    "src": "8617:6:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_Market_$885",
                      "typeString": "contract Market"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8616:15:1"
            },
            "payable": false,
            "returnParameters": {
              "id": 779,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 778,
                  "name": "quantities",
                  "nodeType": "VariableDeclaration",
                  "scope": 814,
                  "src": "8682:16:1",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                    "typeString": "int256[]"
                  },
                  "typeName": {
                    "baseType": {
                      "id": 776,
                      "name": "int",
                      "nodeType": "ElementaryTypeName",
                      "src": "8682:3:1",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 777,
                    "length": null,
                    "nodeType": "ArrayTypeName",
                    "src": "8682:5:1",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                      "typeString": "int256[]"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8681:18:1"
            },
            "scope": 815,
            "src": "8584:315:1",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "private"
          }
        ],
        "scope": 816,
        "src": "268:8633:1"
      }
    ],
    "src": "0:8902:1"
  },
  "compiler": {
    "name": "solc",
    "version": "0.4.25+commit.59dbf8f1.Emscripten.clang"
  },
  "networks": {
    "1541950306998": {
      "events": {},
      "links": {
        "Math": "0x07A01280043D8794199890B92827167842D7F8D2"
      },
      "address": "0x9e858E454CfDEA7A3386f2Bb91bcB73F2788E8aC",
      "transactionHash": "0xa0af1e02c2b1bcd2c525ee12a80f6bac31d21157cf28bb18a774c65a2cbbb031"
    }
  },
  "schemaVersion": "3.0.0-beta.1",
  "updatedAt": "2018-11-11T16:31:32.561Z"
}