{
  "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"
    },
    {
      "constant": true,
      "inputs": [
        {
          "name": "market",
          "type": "address"
        },
        {
          "name": "outcomeTokenIndex",
          "type": "uint8"
        },
        {
          "name": "outcomeTokenCount",
          "type": "uint256"
        }
      ],
      "name": "calcProfit",
      "outputs": [
        {
          "name": "profit",
          "type": "uint256"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [
        {
          "name": "market",
          "type": "address"
        },
        {
          "name": "outcomeTokenIndex",
          "type": "uint8"
        }
      ],
      "name": "calcMarginalPrice",
      "outputs": [
        {
          "name": "price",
          "type": "uint256"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    }
  ],
  "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__________________________________9163771602f7916044808301926020929190829003018186803b15801561130657600080fd5b505af415801561131a573d6000803e3d6000fd5b505050506040513d602081101561133057600080fd5b505194506001016110ac565b50509550955095925050505600a165627a7a72305820c0b316a21c996accbd4eceaa504292142fcd597f88767f5f0895b080a5dc04260029",
  "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__________________________________9163771602f7916044808301926020929190829003018186803b15801561130657600080fd5b505af415801561131a573d6000803e3d6000fd5b505050506040513d602081101561133057600080fd5b505194506001016110ac565b50509550955095925050505600a165627a7a72305820c0b316a21c996accbd4eceaa504292142fcd597f88767f5f0895b080a5dc04260029",
  "sourceMap": "251:8633:7:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;251:8633:7;;;;;;;",
  "deployedSourceMap": "251:8633:7:-;;;;;;;;;-1:-1:-1;;;251:8633:7;;;;;;;;;;;;;;;;;;;;;;;2578:1265;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2578:1265:7;-1:-1:-1;;;;;2578:1265:7;;;;;;;;;;;;;;;;;;;;;;;;;;;737:1579;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;737:1579:7;-1:-1:-1;;;;;737:1579:7;;;;;;;;;;;4087:819;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4087:819:7;-1:-1:-1;;;;;4087:819:7;;;;;;;;;2578:1265;2711:11;2801:33;2946:9;3044:12;3085:19;3498:18;2789:1;2746:6;-1:-1:-1;;;;;2746:20:7;;:22;;;;;-1:-1:-1;;;2746:22:7;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2746:22:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2746:22:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2746:22:7;:40;;;-1:-1:-1;;;;;2746:40:7;;;;-1:-1:-1;;;;;2746:38:7;;;;;;:40;;;;;:22;;:40;;;;;;;;;:38;:40;;;5:2:-1;;;;30:1;27;20:12;5:2;2746:40:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2746:40:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2746:40:7;:44;;;2738:53;;;;;;2837:31;2861:6;2837:23;:31::i;:::-;2801:67;;2958:4;:9;373:19;2968:20;:27;:33;3003:30;2958:76;;;;;-1:-1:-1;;;2958:76:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2958:76:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2958:76:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2958:76:7;3059:16;;;;;;;;2958:76;;-1:-1:-1;;;;;;3059:14:7;;;;;:16;;;;;2958:76;;3059:16;;;;;;;;;:14;:16;;;5:2:-1;;;;30:1;27;20:12;5:2;3059:16:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3059:16:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3059:16:7;;-1:-1:-1;3107:83:7;3121:5;3128:20;3059:16;3159:30;3107:13;:83::i;:::-;3085:105;-1:-1:-1;3309:1:7;3283:27;;;3275:36;;;;;;3363:20;3384:17;3363:39;;;;;;;;;;;;;;;;;;;;;;:67;;;;;;;;;;;;;;;;;;;;:43;;;;:67;;;;;;;;;;;:43;:67;;;5:2:-1;;;;30:1;27;20:12;5:2;3363:67:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3363:67:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3363:67:7;3321:39;;:20;;:39;;;;;;;;;;;;;;;;;;:109;3519:83;3533:5;3540:20;3562:7;3571:30;3519:13;:83::i;:::-;3498:104;-1:-1:-1;3668:33:7;;;3665:82;;3733:14;3715:32;;3665:82;373:19;3797:32;;3792:44;;;-1:-1:-1;;;;;;;2578:1265:7:o;737:1579::-;868:9;956:33;1101:9;1199:12;1240:19;1642:18;944:1;901:6;-1:-1:-1;;;;;901:20:7;;:22;;;;;-1:-1:-1;;;901:22:7;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;901:22:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;901:22:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;901:22:7;:40;;;-1:-1:-1;;;;;901:40:7;;;;-1:-1:-1;;;;;901:38:7;;;;;;:40;;;;;:22;;:40;;;;;;;;;:38;:40;;;5:2:-1;;;;30:1;27;20:12;5:2;901:40:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;901:40:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;901:40:7;:44;;;893:53;;;;;;992:31;1016:6;992:23;:31::i;:::-;956:67;;1113:4;:9;373:19;1123:20;:27;:33;1158:30;1113:76;;;;;-1:-1:-1;;;1113:76:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1113:76:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1113:76:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1113:76:7;1214:16;;;;;;;;1113:76;;-1:-1:-1;;;;;;1214:14:7;;;;;:16;;;;;1113:76;;1214:16;;;;;;;;;:14;:16;;;5:2:-1;;;;30:1;27;20:12;5:2;1214:16:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1214:16:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1214:16:7;;-1:-1:-1;1262:83:7;1276:5;1283:20;1214:16;1314:30;1262:13;:83::i;:::-;1240:105;-1:-1:-1;1453:1:7;1427:27;;;1419:36;;;;;;1507:20;1528:17;1507:39;;;;;;;;;;;;;;;;;;;;;;:67;;;;;;;;;;;;;;;;;;;;:43;;;;:67;;;;;;;;;;;:43;:67;;;5:2:-1;;;;30:1;27;20:12;5:2;1507:67:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1507:67:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1507:67:7;1465:39;;:20;;:39;;;;;;;;;;;;;;;;;;:109;1663:83;1677:5;1684:20;1706:7;1715:30;1663:13;:83::i;:::-;1642:104;;1827:15;1810:14;:32;1807:81;;;-1:-1:-1;1873:15:7;1807:81;1910:32;;;;-1:-1:-1;1910:32:7;373:19;;1910:32;2009:10;:16;:24;2005:171;;;373:19;2047:11;;;;2005:171;;;373:19;2162:4;:10;2175:1;2162:14;2155:21;;2005:171;2254:17;2247:4;:24;2243:66;;;2292:17;2285:24;;2243:66;737:1579;;;;;;;;;;:::o;4087:819::-;4203:10;4292:33;4369:8;4464:12;4731:3;4738:14;4280:1;4237:6;-1:-1:-1;;;;;4237:20:7;;:22;;;;;-1:-1:-1;;;4237:22:7;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4237:22:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4237:22:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4237:22:7;:40;;;-1:-1:-1;;;;;4237:40:7;;;;-1:-1:-1;;;;;4237:38:7;;;;;;:40;;;;;:22;;:40;;;;;;;;;:38;:40;;;5:2:-1;;;;30:1;27;20:12;5:2;4237:40:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4237:40:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4237:40:7;:44;;;4229:53;;;;;;4328:31;4352:6;4328:23;:31::i;:::-;4292:67;;4380:4;:9;373:19;4390:20;:27;:33;4425:28;4380:74;;;;;-1:-1:-1;;;4380:74:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4380:74:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4380:74:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4380:74:7;4479:16;;;;;;;;4380:74;;-1:-1:-1;;;;;;4479:14:7;;;;;:16;;;;;4380:74;;4479:16;;;;;;;;;:14;:16;;;5:2:-1;;;;30:1;27;20:12;5:2;4479:16:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4479:16:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4479:16:7;;-1:-1:-1;4756:98:7;4769:4;4775:20;4479:16;4806:17;4825:28;4756:12;:98::i;:::-;4726:128;;;;;373:19;4889:3;:9;;;;;;;;4871:14;:28;;;;;;;;;4087:819;-1:-1:-1;;;;;;;;4087:819:7:o;8567:315::-;8665:16;8776:7;8720:6;-1:-1:-1;;;;;8720:20:7;;:22;;;;;-1:-1:-1;;;8720:22:7;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;8720:22:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;8720:22:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;8720:22:7;:40;;;-1:-1:-1;;;;;8720:40:7;;;;-1:-1:-1;;;;;8720:38:7;;;;;;:40;;;;;:22;;:40;;;;;;;;;:38;:40;;;5:2:-1;;;;30:1;27;20:12;5:2;8720:40:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;8720:40:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;8720:40:7;8710:51;;;;;;;;;;8720:40;8710:51;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;136:17;;-1:-1;8710:51:7;;8697:64;;8786:1;8776:11;;8771:104;8793:10;:17;8789:1;:21;;;8771:104;;;8845:6;-1:-1:-1;;;;;8845:27:7;;8873:1;8845:30;;;;;-1:-1:-1;;;8845:30:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;8845:30:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;8845:30:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;8845:30:7;8829:13;;:10;;:13;;;;;;;;;;;;;;;;;;:46;8812:3;;8771:104;;;8567:315;;;;:::o;5283:682::-;5443:13;5706:3;5711:6;5723:68;5736:4;5742:20;5764:7;5773:1;5776:14;5723:12;:68::i;:::-;5701:90;;;;;5813:4;:9;5823:3;5828:14;5813:30;;;;;-1:-1:-1;;;5813:30:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5813:30:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5813:30:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5813:30:7;5865:21;;;;;;;;;;;;;;;;;;;;5813:30;;-1:-1:-1;5865:13:7;;;;:21;;;;;5813:30;;5865:21;;;;;;;;:13;:21;;;5:2:-1;;;;30:1;27;20:12;5:2;5865:21:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5865:21:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5865:21:7;5909:23;;;;;;;;;;;;373:19;5909:23;;;;;;5865:21;;-1:-1:-1;5935:4:7;;5909:13;;;;:23;;;;;5865:21;;5909:23;;;;;;;:13;:23;;;5:2:-1;;;;30:1;27;20:12;5:2;5909:23:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5909:23:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5909:23:7;:30;;;;;;;;5908:36;;;;5949:7;5908:50;;;;;-1:-1:-1;;;5908:50:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5908:50:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5908:50:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5908:50:7;;5283:682;-1:-1:-1;;;;;;;5283:682:7:o;6511:1576::-;6691:8;6701:10;6713:19;7778:9;7802:7;7606:1;7598:4;:9;;:30;;;;;7627:1;7615:7;7611:17;;7598:30;7590:39;;;;;;;;7648:30;;;;;;;;;;;;;;;;;;;;:4;;:8;;7657:20;;7648: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;7648:30:7;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;7648:30:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;7648:30:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;7648:30:7;7697:16;;;;;;;;;;;;;;;;;;;;7648:30;;-1:-1:-1;7720:7:7;;7697:10;;;;:16;;;;;7648:30;;7697:16;;;;;;;:10;:16;;;5:2:-1;;;;30:1;27;20:12;5:2;7697:16:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;7697:16:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;7697:16:7;:31;;;;;;;;7688:40;;7747:6;:10;;;;423:22;7747:21;;;;;-1:-1:-1;;;7747:21:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;7747:21:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;7747:21:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;7747:21:7;;-1:-1:-1;7812:1:7;;-1:-1:-1;7797:284:7;7819:20;:27;7815:1;:31;;;7797:284;;;7874:4;:9;7925:7;7885:20;7906:1;7885:23;;;;;;;;;;;;;;;;;;;;:27;;;;7913:4;7885:33;;;;;-1:-1:-1;;;7885:33:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;7885:33:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;7885:33:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;7885:33:7;:48;;;;;;;;7884:54;;;;7939:6;7884:62;;;;;-1:-1:-1;;;7884:62:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;7884:62:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;7884:62:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;7884:62:7;7874:89;;-1:-1:-1;;;7874:89:7;;;;;;;;;;;;7948:14;;7874:89;;7948:14;7874:89;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;7874:89:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;7874:89:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;7874:89:7;;-1:-1:-1;7981:17:7;;;;;;;;7977:60;;;8033:4;8016:21;;7977:60;8057:13;;;;;;;;;;;;;;;;;;;;:7;;;;:13;;;;;;;;;;;;;;:7;:13;;;5:2:-1;;;;30:1;27;20:12;5:2;8057:13:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;8057:13:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;8057:13:7;;-1:-1:-1;7848:3:7;;7797:284;;;6511:1576;;;;;;;;;;;:::o",
  "source": "pragma solidity ^0.4.15;\nimport \"../Utils/Math.sol\";\nimport \"../MarketMakers/MarketMaker.sol\";\n\n\n/// @title LMSR market maker contract - Calculates share prices based on share distribution and initial funding\n/// @author Alan Lu - <alan.lu@gnosis.pm>\ncontract LMSRMarketMaker is MarketMaker {\n    using 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": "@gnosis.pm/pm-contracts/contracts/MarketMakers/LMSRMarketMaker.sol",
  "ast": {
    "absolutePath": "@gnosis.pm/pm-contracts/contracts/MarketMakers/LMSRMarketMaker.sol",
    "exportedSymbols": {
      "LMSRMarketMaker": [
        2216
      ]
    },
    "id": 2217,
    "nodeType": "SourceUnit",
    "nodes": [
      {
        "id": 1682,
        "literals": [
          "solidity",
          "^",
          "0.4",
          ".15"
        ],
        "nodeType": "PragmaDirective",
        "src": "0:24:7"
      },
      {
        "absolutePath": "@gnosis.pm/pm-contracts/contracts/Utils/Math.sol",
        "file": "../Utils/Math.sol",
        "id": 1683,
        "nodeType": "ImportDirective",
        "scope": 2217,
        "sourceUnit": 4612,
        "src": "25:27:7",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "absolutePath": "@gnosis.pm/pm-contracts/contracts/MarketMakers/MarketMaker.sol",
        "file": "../MarketMakers/MarketMaker.sol",
        "id": 1684,
        "nodeType": "ImportDirective",
        "scope": 2217,
        "sourceUnit": 2252,
        "src": "53:41:7",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "baseContracts": [
          {
            "arguments": null,
            "baseName": {
              "contractScope": null,
              "id": 1685,
              "name": "MarketMaker",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 2251,
              "src": "279:11:7",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_MarketMaker_$2251",
                "typeString": "contract MarketMaker"
              }
            },
            "id": 1686,
            "nodeType": "InheritanceSpecifier",
            "src": "279:11:7"
          }
        ],
        "contractDependencies": [
          2251
        ],
        "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": 2216,
        "linearizedBaseContracts": [
          2216,
          2251
        ],
        "name": "LMSRMarketMaker",
        "nodeType": "ContractDefinition",
        "nodes": [
          {
            "id": 1688,
            "libraryName": {
              "contractScope": null,
              "id": 1687,
              "name": "Math",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 4611,
              "src": "303:4:7",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_Math_$4611",
                "typeString": "library Math"
              }
            },
            "nodeType": "UsingForDirective",
            "src": "297:17:7",
            "typeName": null
          },
          {
            "constant": true,
            "id": 1691,
            "name": "ONE",
            "nodeType": "VariableDeclaration",
            "scope": 2216,
            "src": "353:39:7",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_uint256",
              "typeString": "uint256"
            },
            "typeName": {
              "id": 1689,
              "name": "uint",
              "nodeType": "ElementaryTypeName",
              "src": "353:4:7",
              "typeDescriptions": {
                "typeIdentifier": "t_uint256",
                "typeString": "uint256"
              }
            },
            "value": {
              "argumentTypes": null,
              "hexValue": "30783130303030303030303030303030303030",
              "id": 1690,
              "isConstant": false,
              "isLValue": false,
              "isPure": true,
              "kind": "number",
              "lValueRequested": false,
              "nodeType": "Literal",
              "src": "373:19:7",
              "subdenomination": null,
              "typeDescriptions": {
                "typeIdentifier": "t_rational_18446744073709551616_by_1",
                "typeString": "int_const 18446744073709551616"
              },
              "value": "0x10000000000000000"
            },
            "visibility": "internal"
          },
          {
            "constant": true,
            "id": 1694,
            "name": "EXP_LIMIT",
            "nodeType": "VariableDeclaration",
            "scope": 2216,
            "src": "398:47:7",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_int256",
              "typeString": "int256"
            },
            "typeName": {
              "id": 1692,
              "name": "int",
              "nodeType": "ElementaryTypeName",
              "src": "398:3:7",
              "typeDescriptions": {
                "typeIdentifier": "t_int256",
                "typeString": "int256"
              }
            },
            "value": {
              "argumentTypes": null,
              "hexValue": "33333934323030393039353632353537343937333434",
              "id": 1693,
              "isConstant": false,
              "isLValue": false,
              "isPure": true,
              "kind": "number",
              "lValueRequested": false,
              "nodeType": "Literal",
              "src": "423:22:7",
              "subdenomination": null,
              "typeDescriptions": {
                "typeIdentifier": "t_rational_3394200909562557497344_by_1",
                "typeString": "int_const 3394200909562557497344"
              },
              "value": "3394200909562557497344"
            },
            "visibility": "internal"
          },
          {
            "body": {
              "id": 1829,
              "nodeType": "Block",
              "src": "883:1433:7",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "id": 1712,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [],
                          "expression": {
                            "argumentTypes": [],
                            "expression": {
                              "argumentTypes": null,
                              "arguments": [],
                              "expression": {
                                "argumentTypes": [],
                                "expression": {
                                  "argumentTypes": null,
                                  "id": 1706,
                                  "name": "market",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1696,
                                  "src": "901:6:7",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_Market_$2374",
                                    "typeString": "contract Market"
                                  }
                                },
                                "id": 1707,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "eventContract",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 2305,
                                "src": "901:20:7",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_function_external_view$__$returns$_t_contract$_Event_$1680_$",
                                  "typeString": "function () view external returns (contract Event)"
                                }
                              },
                              "id": 1708,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "functionCall",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "901:22:7",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_Event_$1680",
                                "typeString": "contract Event"
                              }
                            },
                            "id": 1709,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "getOutcomeCount",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 1619,
                            "src": "901:38:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_view$__$returns$_t_uint8_$",
                              "typeString": "function () view external returns (uint8)"
                            }
                          },
                          "id": 1710,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "901:40:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "31",
                          "id": 1711,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "944:1:7",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_1_by_1",
                            "typeString": "int_const 1"
                          },
                          "value": "1"
                        },
                        "src": "901:44:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 1705,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        9183,
                        9184
                      ],
                      "referencedDeclaration": 9183,
                      "src": "893:7:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 1713,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "893:53:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1714,
                  "nodeType": "ExpressionStatement",
                  "src": "893:53:7"
                },
                {
                  "assignments": [
                    1718
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1718,
                      "name": "netOutcomeTokensSold",
                      "nodeType": "VariableDeclaration",
                      "scope": 1830,
                      "src": "956:33:7",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                        "typeString": "int256[]"
                      },
                      "typeName": {
                        "baseType": {
                          "id": 1716,
                          "name": "int",
                          "nodeType": "ElementaryTypeName",
                          "src": "956:3:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 1717,
                        "length": null,
                        "nodeType": "ArrayTypeName",
                        "src": "956:5:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                          "typeString": "int256[]"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1722,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1720,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1696,
                        "src": "1016:6:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$2374",
                          "typeString": "contract Market"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_contract$_Market_$2374",
                          "typeString": "contract Market"
                        }
                      ],
                      "id": 1719,
                      "name": "getNetOutcomeTokensSold",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2215,
                      "src": "992:23:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_contract$_Market_$2374_$returns$_t_array$_t_int256_$dyn_memory_ptr_$",
                        "typeString": "function (contract Market) view returns (int256[] memory)"
                      }
                    },
                    "id": 1721,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "992:31:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                      "typeString": "int256[] memory"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "956:67:7"
                },
                {
                  "assignments": [
                    1724
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1724,
                      "name": "log2N",
                      "nodeType": "VariableDeclaration",
                      "scope": 1830,
                      "src": "1101:9:7",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 1723,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "1101:3:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1735,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 1730,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1727,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1718,
                            "src": "1123:20:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 1728,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "length",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": null,
                          "src": "1123:27:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "*",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 1729,
                          "name": "ONE",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1691,
                          "src": "1153:3:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "1123:33:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1731,
                            "name": "Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4611,
                            "src": "1158:4:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Math_$4611_$",
                              "typeString": "type(library Math)"
                            }
                          },
                          "id": 1732,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 3366,
                          "src": "1158:19:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$3366_$",
                            "typeString": "type(enum Math.EstimationMode)"
                          }
                        },
                        "id": 1733,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "UpperBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "1158:30:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$3366",
                          "typeString": "enum Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$3366",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1725,
                        "name": "Math",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4611,
                        "src": "1113:4:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_contract$_Math_$4611_$",
                          "typeString": "type(library Math)"
                        }
                      },
                      "id": 1726,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "log2",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 4118,
                      "src": "1113:9:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_delegatecall_view$_t_uint256_$_t_enum$_EstimationMode_$3366_$returns$_t_int256_$",
                        "typeString": "function (uint256,enum Math.EstimationMode) view returns (int256)"
                      }
                    },
                    "id": 1734,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1113:76:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1101:88:7"
                },
                {
                  "assignments": [
                    1737
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1737,
                      "name": "funding",
                      "nodeType": "VariableDeclaration",
                      "scope": 1830,
                      "src": "1199:12:7",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1736,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "1199:4:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1741,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1738,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1696,
                        "src": "1214:6:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$2374",
                          "typeString": "contract Market"
                        }
                      },
                      "id": 1739,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "funding",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 2311,
                      "src": "1214:14:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                        "typeString": "function () view external returns (uint256)"
                      }
                    },
                    "id": 1740,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1214:16:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1199:31:7"
                },
                {
                  "assignments": [
                    1743
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1743,
                      "name": "costLevelBefore",
                      "nodeType": "VariableDeclaration",
                      "scope": 1830,
                      "src": "1240:19:7",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 1742,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "1240:3:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1752,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1745,
                        "name": "log2N",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1724,
                        "src": "1276:5:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1746,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1718,
                        "src": "1283:20:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1747,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1737,
                        "src": "1305:7:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1748,
                            "name": "Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4611,
                            "src": "1314:4:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Math_$4611_$",
                              "typeString": "type(library Math)"
                            }
                          },
                          "id": 1749,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 3366,
                          "src": "1314:19:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$3366_$",
                            "typeString": "type(enum Math.EstimationMode)"
                          }
                        },
                        "id": 1750,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "LowerBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "1314:30:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$3366",
                          "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_$3366",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "id": 1744,
                      "name": "calcCostLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2063,
                      "src": "1262:13:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_enum$_EstimationMode_$3366_$returns$_t_int256_$",
                        "typeString": "function (int256,int256[] memory,uint256,enum Math.EstimationMode) view returns (int256)"
                      }
                    },
                    "id": 1751,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1262:83:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1240:105:7"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        },
                        "id": 1758,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 1755,
                              "name": "outcomeTokenCount",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1700,
                              "src": "1431:17:7",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 1754,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "1427:3:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_int256_$",
                              "typeString": "type(int256)"
                            },
                            "typeName": "int"
                          },
                          "id": 1756,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "1427:22:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">=",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "30",
                          "id": 1757,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "1453:1:7",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_0_by_1",
                            "typeString": "int_const 0"
                          },
                          "value": "0"
                        },
                        "src": "1427:27:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 1753,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        9183,
                        9184
                      ],
                      "referencedDeclaration": 9183,
                      "src": "1419:7:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 1759,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1419:36:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1760,
                  "nodeType": "ExpressionStatement",
                  "src": "1419:36:7"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1772,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "baseExpression": {
                        "argumentTypes": null,
                        "id": 1761,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1718,
                        "src": "1465:20:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      "id": 1763,
                      "indexExpression": {
                        "argumentTypes": null,
                        "id": 1762,
                        "name": "outcomeTokenIndex",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1698,
                        "src": "1486:17:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      },
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "nodeType": "IndexAccess",
                      "src": "1465:39:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 1769,
                              "name": "outcomeTokenCount",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1700,
                              "src": "1555:17:7",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 1768,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "1551:3:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_int256_$",
                              "typeString": "type(int256)"
                            },
                            "typeName": "int"
                          },
                          "id": 1770,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "1551:22:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "baseExpression": {
                            "argumentTypes": null,
                            "id": 1764,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1718,
                            "src": "1507:20:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 1766,
                          "indexExpression": {
                            "argumentTypes": null,
                            "id": 1765,
                            "name": "outcomeTokenIndex",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1698,
                            "src": "1528:17:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          },
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "nodeType": "IndexAccess",
                          "src": "1507:39:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 1767,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "add",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 4568,
                        "src": "1507:43:7",
                        "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": 1771,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "1507:67:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "1465:109:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 1773,
                  "nodeType": "ExpressionStatement",
                  "src": "1465:109:7"
                },
                {
                  "assignments": [
                    1775
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1775,
                      "name": "costLevelAfter",
                      "nodeType": "VariableDeclaration",
                      "scope": 1830,
                      "src": "1642:18:7",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 1774,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "1642:3:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1784,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1777,
                        "name": "log2N",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1724,
                        "src": "1677:5:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1778,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1718,
                        "src": "1684:20:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1779,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1737,
                        "src": "1706:7:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1780,
                            "name": "Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4611,
                            "src": "1715:4:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Math_$4611_$",
                              "typeString": "type(library Math)"
                            }
                          },
                          "id": 1781,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 3366,
                          "src": "1715:19:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$3366_$",
                            "typeString": "type(enum Math.EstimationMode)"
                          }
                        },
                        "id": 1782,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "UpperBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "1715:30:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$3366",
                          "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_$3366",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "id": 1776,
                      "name": "calcCostLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2063,
                      "src": "1663:13:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_enum$_EstimationMode_$3366_$returns$_t_int256_$",
                        "typeString": "function (int256,int256[] memory,uint256,enum Math.EstimationMode) view returns (int256)"
                      }
                    },
                    "id": 1783,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1663:83:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1642:104:7"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    },
                    "id": 1787,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 1785,
                      "name": "costLevelAfter",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1775,
                      "src": "1810:14:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 1786,
                      "name": "costLevelBefore",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1743,
                      "src": "1827:15:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "1810:32:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 1792,
                  "nodeType": "IfStatement",
                  "src": "1807:81:7",
                  "trueBody": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1790,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 1788,
                        "name": "costLevelAfter",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1775,
                        "src": "1856:14:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "id": 1789,
                        "name": "costLevelBefore",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1743,
                        "src": "1873:15:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "src": "1856:32:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 1791,
                    "nodeType": "ExpressionStatement",
                    "src": "1856:32:7"
                  }
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1799,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1793,
                      "name": "cost",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1703,
                      "src": "1898:4:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          },
                          "id": 1797,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 1795,
                            "name": "costLevelAfter",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1775,
                            "src": "1910:14:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "-",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 1796,
                            "name": "costLevelBefore",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1743,
                            "src": "1927:15:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "src": "1910:32:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "id": 1794,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "nodeType": "ElementaryTypeNameExpression",
                        "src": "1905:4:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_uint256_$",
                          "typeString": "type(uint256)"
                        },
                        "typeName": "uint"
                      },
                      "id": 1798,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "typeConversion",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "1905:38:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "1898:45:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 1800,
                  "nodeType": "ExpressionStatement",
                  "src": "1898:45:7"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 1807,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 1805,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 1803,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 1801,
                          "name": "cost",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1703,
                          "src": "2009:4:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "/",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 1802,
                          "name": "ONE",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1691,
                          "src": "2016:3:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "2009:10:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "*",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 1804,
                        "name": "ONE",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1691,
                        "src": "2022:3:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "2009:16:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "==",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 1806,
                      "name": "cost",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1703,
                      "src": "2029:4:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "2009:24:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1818,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 1812,
                        "name": "cost",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1703,
                        "src": "2155:4:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 1817,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          "id": 1815,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 1813,
                            "name": "cost",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1703,
                            "src": "2162:4:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "/",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 1814,
                            "name": "ONE",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1691,
                            "src": "2169:3:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "2162:10:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "+",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "31",
                          "id": 1816,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "2175:1:7",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_1_by_1",
                            "typeString": "int_const 1"
                          },
                          "value": "1"
                        },
                        "src": "2162:14:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "2155:21:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "id": 1819,
                    "nodeType": "ExpressionStatement",
                    "src": "2155:21:7"
                  },
                  "id": 1820,
                  "nodeType": "IfStatement",
                  "src": "2005:171:7",
                  "trueBody": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1810,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 1808,
                        "name": "cost",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1703,
                        "src": "2047:4:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "/=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "id": 1809,
                        "name": "ONE",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1691,
                        "src": "2055:3:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "2047:11:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "id": 1811,
                    "nodeType": "ExpressionStatement",
                    "src": "2047:11:7"
                  }
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 1823,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 1821,
                      "name": "cost",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1703,
                      "src": "2247:4:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 1822,
                      "name": "outcomeTokenCount",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1700,
                      "src": "2254:17:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "2247:24:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 1828,
                  "nodeType": "IfStatement",
                  "src": "2243:66:7",
                  "trueBody": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1826,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 1824,
                        "name": "cost",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1703,
                        "src": "2285:4:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "id": 1825,
                        "name": "outcomeTokenCount",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1700,
                        "src": "2292:17:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "2285:24:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "id": 1827,
                    "nodeType": "ExpressionStatement",
                    "src": "2285:24:7"
                  }
                }
              ]
            },
            "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": 1830,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": true,
            "modifiers": [],
            "name": "calcCost",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1701,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1696,
                  "name": "market",
                  "nodeType": "VariableDeclaration",
                  "scope": 1830,
                  "src": "755:13:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_contract$_Market_$2374",
                    "typeString": "contract Market"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 1695,
                    "name": "Market",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 2374,
                    "src": "755:6:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_Market_$2374",
                      "typeString": "contract Market"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1698,
                  "name": "outcomeTokenIndex",
                  "nodeType": "VariableDeclaration",
                  "scope": 1830,
                  "src": "770:23:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint8",
                    "typeString": "uint8"
                  },
                  "typeName": {
                    "id": 1697,
                    "name": "uint8",
                    "nodeType": "ElementaryTypeName",
                    "src": "770:5:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint8",
                      "typeString": "uint8"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1700,
                  "name": "outcomeTokenCount",
                  "nodeType": "VariableDeclaration",
                  "scope": 1830,
                  "src": "795:22:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1699,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "795:4:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "754:64:7"
            },
            "payable": false,
            "returnParameters": {
              "id": 1704,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1703,
                  "name": "cost",
                  "nodeType": "VariableDeclaration",
                  "scope": 1830,
                  "src": "868:9:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1702,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "868:4:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "867:11:7"
            },
            "scope": 2216,
            "src": "737:1579:7",
            "stateMutability": "view",
            "superFunction": 2230,
            "visibility": "public"
          },
          {
            "body": {
              "id": 1939,
              "nodeType": "Block",
              "src": "2728:1115:7",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "id": 1848,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [],
                          "expression": {
                            "argumentTypes": [],
                            "expression": {
                              "argumentTypes": null,
                              "arguments": [],
                              "expression": {
                                "argumentTypes": [],
                                "expression": {
                                  "argumentTypes": null,
                                  "id": 1842,
                                  "name": "market",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1832,
                                  "src": "2746:6:7",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_Market_$2374",
                                    "typeString": "contract Market"
                                  }
                                },
                                "id": 1843,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "eventContract",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 2305,
                                "src": "2746:20:7",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_function_external_view$__$returns$_t_contract$_Event_$1680_$",
                                  "typeString": "function () view external returns (contract Event)"
                                }
                              },
                              "id": 1844,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "functionCall",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "2746:22:7",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_Event_$1680",
                                "typeString": "contract Event"
                              }
                            },
                            "id": 1845,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "getOutcomeCount",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 1619,
                            "src": "2746:38:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_view$__$returns$_t_uint8_$",
                              "typeString": "function () view external returns (uint8)"
                            }
                          },
                          "id": 1846,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "2746:40:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "31",
                          "id": 1847,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "2789:1:7",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_1_by_1",
                            "typeString": "int_const 1"
                          },
                          "value": "1"
                        },
                        "src": "2746:44:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 1841,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        9183,
                        9184
                      ],
                      "referencedDeclaration": 9183,
                      "src": "2738:7:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 1849,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "2738:53:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1850,
                  "nodeType": "ExpressionStatement",
                  "src": "2738:53:7"
                },
                {
                  "assignments": [
                    1854
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1854,
                      "name": "netOutcomeTokensSold",
                      "nodeType": "VariableDeclaration",
                      "scope": 1940,
                      "src": "2801:33:7",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                        "typeString": "int256[]"
                      },
                      "typeName": {
                        "baseType": {
                          "id": 1852,
                          "name": "int",
                          "nodeType": "ElementaryTypeName",
                          "src": "2801:3:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 1853,
                        "length": null,
                        "nodeType": "ArrayTypeName",
                        "src": "2801:5:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                          "typeString": "int256[]"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1858,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1856,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1832,
                        "src": "2861:6:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$2374",
                          "typeString": "contract Market"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_contract$_Market_$2374",
                          "typeString": "contract Market"
                        }
                      ],
                      "id": 1855,
                      "name": "getNetOutcomeTokensSold",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2215,
                      "src": "2837:23:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_contract$_Market_$2374_$returns$_t_array$_t_int256_$dyn_memory_ptr_$",
                        "typeString": "function (contract Market) view returns (int256[] memory)"
                      }
                    },
                    "id": 1857,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "2837:31:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                      "typeString": "int256[] memory"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "2801:67:7"
                },
                {
                  "assignments": [
                    1860
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1860,
                      "name": "log2N",
                      "nodeType": "VariableDeclaration",
                      "scope": 1940,
                      "src": "2946:9:7",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 1859,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "2946:3:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1871,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 1866,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1863,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1854,
                            "src": "2968:20:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 1864,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "length",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": null,
                          "src": "2968:27:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "*",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 1865,
                          "name": "ONE",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1691,
                          "src": "2998:3:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "2968:33:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1867,
                            "name": "Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4611,
                            "src": "3003:4:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Math_$4611_$",
                              "typeString": "type(library Math)"
                            }
                          },
                          "id": 1868,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 3366,
                          "src": "3003:19:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$3366_$",
                            "typeString": "type(enum Math.EstimationMode)"
                          }
                        },
                        "id": 1869,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "UpperBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "3003:30:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$3366",
                          "typeString": "enum Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$3366",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1861,
                        "name": "Math",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4611,
                        "src": "2958:4:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_contract$_Math_$4611_$",
                          "typeString": "type(library Math)"
                        }
                      },
                      "id": 1862,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "log2",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 4118,
                      "src": "2958:9:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_delegatecall_view$_t_uint256_$_t_enum$_EstimationMode_$3366_$returns$_t_int256_$",
                        "typeString": "function (uint256,enum Math.EstimationMode) view returns (int256)"
                      }
                    },
                    "id": 1870,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "2958:76:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "2946:88:7"
                },
                {
                  "assignments": [
                    1873
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1873,
                      "name": "funding",
                      "nodeType": "VariableDeclaration",
                      "scope": 1940,
                      "src": "3044:12:7",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1872,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "3044:4:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1877,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1874,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1832,
                        "src": "3059:6:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$2374",
                          "typeString": "contract Market"
                        }
                      },
                      "id": 1875,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "funding",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 2311,
                      "src": "3059:14:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                        "typeString": "function () view external returns (uint256)"
                      }
                    },
                    "id": 1876,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3059:16:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3044:31:7"
                },
                {
                  "assignments": [
                    1879
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1879,
                      "name": "costLevelBefore",
                      "nodeType": "VariableDeclaration",
                      "scope": 1940,
                      "src": "3085:19:7",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 1878,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "3085:3:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1888,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1881,
                        "name": "log2N",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1860,
                        "src": "3121:5:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1882,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1854,
                        "src": "3128:20:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1883,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1873,
                        "src": "3150:7:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1884,
                            "name": "Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4611,
                            "src": "3159:4:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Math_$4611_$",
                              "typeString": "type(library Math)"
                            }
                          },
                          "id": 1885,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 3366,
                          "src": "3159:19:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$3366_$",
                            "typeString": "type(enum Math.EstimationMode)"
                          }
                        },
                        "id": 1886,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "LowerBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "3159:30:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$3366",
                          "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_$3366",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "id": 1880,
                      "name": "calcCostLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2063,
                      "src": "3107:13:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_enum$_EstimationMode_$3366_$returns$_t_int256_$",
                        "typeString": "function (int256,int256[] memory,uint256,enum Math.EstimationMode) view returns (int256)"
                      }
                    },
                    "id": 1887,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3107:83:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3085:105:7"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        },
                        "id": 1894,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 1891,
                              "name": "outcomeTokenCount",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1836,
                              "src": "3287:17:7",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 1890,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "3283:3:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_int256_$",
                              "typeString": "type(int256)"
                            },
                            "typeName": "int"
                          },
                          "id": 1892,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "3283:22:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">=",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "30",
                          "id": 1893,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "3309:1:7",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_0_by_1",
                            "typeString": "int_const 0"
                          },
                          "value": "0"
                        },
                        "src": "3283:27:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 1889,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        9183,
                        9184
                      ],
                      "referencedDeclaration": 9183,
                      "src": "3275:7:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 1895,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3275:36:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1896,
                  "nodeType": "ExpressionStatement",
                  "src": "3275:36:7"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1908,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "baseExpression": {
                        "argumentTypes": null,
                        "id": 1897,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1854,
                        "src": "3321:20:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      "id": 1899,
                      "indexExpression": {
                        "argumentTypes": null,
                        "id": 1898,
                        "name": "outcomeTokenIndex",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1834,
                        "src": "3342:17:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      },
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "nodeType": "IndexAccess",
                      "src": "3321:39:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 1905,
                              "name": "outcomeTokenCount",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1836,
                              "src": "3411:17:7",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 1904,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "3407:3:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_int256_$",
                              "typeString": "type(int256)"
                            },
                            "typeName": "int"
                          },
                          "id": 1906,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "3407:22:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "baseExpression": {
                            "argumentTypes": null,
                            "id": 1900,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1854,
                            "src": "3363:20:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 1902,
                          "indexExpression": {
                            "argumentTypes": null,
                            "id": 1901,
                            "name": "outcomeTokenIndex",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1834,
                            "src": "3384:17:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          },
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "nodeType": "IndexAccess",
                          "src": "3363:39:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 1903,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sub",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 4589,
                        "src": "3363:43:7",
                        "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": 1907,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "3363:67:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "3321:109:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 1909,
                  "nodeType": "ExpressionStatement",
                  "src": "3321:109:7"
                },
                {
                  "assignments": [
                    1911
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1911,
                      "name": "costLevelAfter",
                      "nodeType": "VariableDeclaration",
                      "scope": 1940,
                      "src": "3498:18:7",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 1910,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "3498:3:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1920,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1913,
                        "name": "log2N",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1860,
                        "src": "3533:5:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1914,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1854,
                        "src": "3540:20:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1915,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1873,
                        "src": "3562:7:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1916,
                            "name": "Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4611,
                            "src": "3571:4:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Math_$4611_$",
                              "typeString": "type(library Math)"
                            }
                          },
                          "id": 1917,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 3366,
                          "src": "3571:19:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$3366_$",
                            "typeString": "type(enum Math.EstimationMode)"
                          }
                        },
                        "id": 1918,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "UpperBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "3571:30:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$3366",
                          "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_$3366",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "id": 1912,
                      "name": "calcCostLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2063,
                      "src": "3519:13:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_enum$_EstimationMode_$3366_$returns$_t_int256_$",
                        "typeString": "function (int256,int256[] memory,uint256,enum Math.EstimationMode) view returns (int256)"
                      }
                    },
                    "id": 1919,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3519:83:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3498:104:7"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    },
                    "id": 1923,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 1921,
                      "name": "costLevelBefore",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1879,
                      "src": "3668:15:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<=",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 1922,
                      "name": "costLevelAfter",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1911,
                      "src": "3687:14:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "3668:33:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 1928,
                  "nodeType": "IfStatement",
                  "src": "3665:82:7",
                  "trueBody": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1926,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 1924,
                        "name": "costLevelBefore",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1879,
                        "src": "3715:15:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "id": 1925,
                        "name": "costLevelAfter",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1911,
                        "src": "3733:14:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "src": "3715:32:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 1927,
                    "nodeType": "ExpressionStatement",
                    "src": "3715:32:7"
                  }
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1937,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1929,
                      "name": "profit",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1839,
                      "src": "3783:6:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 1936,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "commonType": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            },
                            "id": 1933,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftExpression": {
                              "argumentTypes": null,
                              "id": 1931,
                              "name": "costLevelBefore",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1879,
                              "src": "3797:15:7",
                              "typeDescriptions": {
                                "typeIdentifier": "t_int256",
                                "typeString": "int256"
                              }
                            },
                            "nodeType": "BinaryOperation",
                            "operator": "-",
                            "rightExpression": {
                              "argumentTypes": null,
                              "id": 1932,
                              "name": "costLevelAfter",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1911,
                              "src": "3815:14:7",
                              "typeDescriptions": {
                                "typeIdentifier": "t_int256",
                                "typeString": "int256"
                              }
                            },
                            "src": "3797:32:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          ],
                          "id": 1930,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "lValueRequested": false,
                          "nodeType": "ElementaryTypeNameExpression",
                          "src": "3792:4:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_uint256_$",
                            "typeString": "type(uint256)"
                          },
                          "typeName": "uint"
                        },
                        "id": 1934,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "typeConversion",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "3792:38:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "/",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 1935,
                        "name": "ONE",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1691,
                        "src": "3833:3:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "3792:44:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "3783:53:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 1938,
                  "nodeType": "ExpressionStatement",
                  "src": "3783:53:7"
                }
              ]
            },
            "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": 1940,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": true,
            "modifiers": [],
            "name": "calcProfit",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1837,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1832,
                  "name": "market",
                  "nodeType": "VariableDeclaration",
                  "scope": 1940,
                  "src": "2598:13:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_contract$_Market_$2374",
                    "typeString": "contract Market"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 1831,
                    "name": "Market",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 2374,
                    "src": "2598:6:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_Market_$2374",
                      "typeString": "contract Market"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1834,
                  "name": "outcomeTokenIndex",
                  "nodeType": "VariableDeclaration",
                  "scope": 1940,
                  "src": "2613:23:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint8",
                    "typeString": "uint8"
                  },
                  "typeName": {
                    "id": 1833,
                    "name": "uint8",
                    "nodeType": "ElementaryTypeName",
                    "src": "2613:5:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint8",
                      "typeString": "uint8"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1836,
                  "name": "outcomeTokenCount",
                  "nodeType": "VariableDeclaration",
                  "scope": 1940,
                  "src": "2638:22:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1835,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2638:4:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2597:64:7"
            },
            "payable": false,
            "returnParameters": {
              "id": 1840,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1839,
                  "name": "profit",
                  "nodeType": "VariableDeclaration",
                  "scope": 1940,
                  "src": "2711:11:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1838,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2711:4:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2710:13:7"
            },
            "scope": 2216,
            "src": "2578:1265:7",
            "stateMutability": "view",
            "superFunction": 2241,
            "visibility": "public"
          },
          {
            "body": {
              "id": 2005,
              "nodeType": "Block",
              "src": "4219:687:7",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "id": 1956,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [],
                          "expression": {
                            "argumentTypes": [],
                            "expression": {
                              "argumentTypes": null,
                              "arguments": [],
                              "expression": {
                                "argumentTypes": [],
                                "expression": {
                                  "argumentTypes": null,
                                  "id": 1950,
                                  "name": "market",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1942,
                                  "src": "4237:6:7",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_Market_$2374",
                                    "typeString": "contract Market"
                                  }
                                },
                                "id": 1951,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "eventContract",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 2305,
                                "src": "4237:20:7",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_function_external_view$__$returns$_t_contract$_Event_$1680_$",
                                  "typeString": "function () view external returns (contract Event)"
                                }
                              },
                              "id": 1952,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "functionCall",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "4237:22:7",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_Event_$1680",
                                "typeString": "contract Event"
                              }
                            },
                            "id": 1953,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "getOutcomeCount",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 1619,
                            "src": "4237:38:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_view$__$returns$_t_uint8_$",
                              "typeString": "function () view external returns (uint8)"
                            }
                          },
                          "id": 1954,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "4237:40:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "31",
                          "id": 1955,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "4280:1:7",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_1_by_1",
                            "typeString": "int_const 1"
                          },
                          "value": "1"
                        },
                        "src": "4237:44:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 1949,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        9183,
                        9184
                      ],
                      "referencedDeclaration": 9183,
                      "src": "4229:7:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 1957,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4229:53:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1958,
                  "nodeType": "ExpressionStatement",
                  "src": "4229:53:7"
                },
                {
                  "assignments": [
                    1962
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1962,
                      "name": "netOutcomeTokensSold",
                      "nodeType": "VariableDeclaration",
                      "scope": 2006,
                      "src": "4292:33:7",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                        "typeString": "int256[]"
                      },
                      "typeName": {
                        "baseType": {
                          "id": 1960,
                          "name": "int",
                          "nodeType": "ElementaryTypeName",
                          "src": "4292:3:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 1961,
                        "length": null,
                        "nodeType": "ArrayTypeName",
                        "src": "4292:5:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                          "typeString": "int256[]"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1966,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1964,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1942,
                        "src": "4352:6:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$2374",
                          "typeString": "contract Market"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_contract$_Market_$2374",
                          "typeString": "contract Market"
                        }
                      ],
                      "id": 1963,
                      "name": "getNetOutcomeTokensSold",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2215,
                      "src": "4328:23:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_contract$_Market_$2374_$returns$_t_array$_t_int256_$dyn_memory_ptr_$",
                        "typeString": "function (contract Market) view returns (int256[] memory)"
                      }
                    },
                    "id": 1965,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4328:31:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                      "typeString": "int256[] memory"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4292:67:7"
                },
                {
                  "assignments": [
                    1968
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1968,
                      "name": "logN",
                      "nodeType": "VariableDeclaration",
                      "scope": 2006,
                      "src": "4369:8:7",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 1967,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "4369:3:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1979,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 1974,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1971,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1962,
                            "src": "4390:20:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 1972,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "length",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": null,
                          "src": "4390:27:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "*",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 1973,
                          "name": "ONE",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1691,
                          "src": "4420:3:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "4390:33:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1975,
                            "name": "Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4611,
                            "src": "4425:4:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Math_$4611_$",
                              "typeString": "type(library Math)"
                            }
                          },
                          "id": 1976,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 3366,
                          "src": "4425:19:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$3366_$",
                            "typeString": "type(enum Math.EstimationMode)"
                          }
                        },
                        "id": 1977,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "Midpoint",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "4425:28:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$3366",
                          "typeString": "enum Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$3366",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1969,
                        "name": "Math",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4611,
                        "src": "4380:4:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_contract$_Math_$4611_$",
                          "typeString": "type(library Math)"
                        }
                      },
                      "id": 1970,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "log2",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 4118,
                      "src": "4380:9:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_delegatecall_view$_t_uint256_$_t_enum$_EstimationMode_$3366_$returns$_t_int256_$",
                        "typeString": "function (uint256,enum Math.EstimationMode) view returns (int256)"
                      }
                    },
                    "id": 1978,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4380:74:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4369:85:7"
                },
                {
                  "assignments": [
                    1981
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1981,
                      "name": "funding",
                      "nodeType": "VariableDeclaration",
                      "scope": 2006,
                      "src": "4464:12:7",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1980,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "4464:4:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1985,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1982,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1942,
                        "src": "4479:6:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$2374",
                          "typeString": "contract Market"
                        }
                      },
                      "id": 1983,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "funding",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 2311,
                      "src": "4479:14:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                        "typeString": "function () view external returns (uint256)"
                      }
                    },
                    "id": 1984,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4479:16:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4464:31:7"
                },
                {
                  "assignments": [
                    1986,
                    null,
                    1987
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1986,
                      "name": "sum",
                      "nodeType": "VariableDeclaration",
                      "scope": 2006,
                      "src": "4731:3:7",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": null,
                      "value": null,
                      "visibility": "internal"
                    },
                    null,
                    {
                      "constant": false,
                      "id": 1987,
                      "name": "outcomeExpTerm",
                      "nodeType": "VariableDeclaration",
                      "scope": 2006,
                      "src": "4738:14:7",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": null,
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1997,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1989,
                        "name": "logN",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1968,
                        "src": "4769:4:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1990,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1962,
                        "src": "4775:20:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1991,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1981,
                        "src": "4797:7:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1992,
                        "name": "outcomeTokenIndex",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1944,
                        "src": "4806:17:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1993,
                            "name": "Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4611,
                            "src": "4825:4:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Math_$4611_$",
                              "typeString": "type(library Math)"
                            }
                          },
                          "id": 1994,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 3366,
                          "src": "4825:19:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$3366_$",
                            "typeString": "type(enum Math.EstimationMode)"
                          }
                        },
                        "id": 1995,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "Midpoint",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "4825:28:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$3366",
                          "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_$3366",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "id": 1988,
                      "name": "sumExpOffset",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2173,
                      "src": "4756:12:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_uint8_$_t_enum$_EstimationMode_$3366_$returns$_t_uint256_$_t_int256_$_t_uint256_$",
                        "typeString": "function (int256,int256[] memory,uint256,uint8,enum Math.EstimationMode) view returns (uint256,int256,uint256)"
                      }
                    },
                    "id": 1996,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4756:98:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$_t_uint256_$_t_int256_$_t_uint256_$",
                      "typeString": "tuple(uint256,int256,uint256)"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4726:128:7"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 2003,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 1998,
                      "name": "outcomeExpTerm",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1987,
                      "src": "4871:14:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "/",
                    "rightExpression": {
                      "argumentTypes": null,
                      "components": [
                        {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          "id": 2001,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 1999,
                            "name": "sum",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1986,
                            "src": "4889:3:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "/",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 2000,
                            "name": "ONE",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1691,
                            "src": "4895:3:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "4889:9:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        }
                      ],
                      "id": 2002,
                      "isConstant": false,
                      "isInlineArray": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "nodeType": "TupleExpression",
                      "src": "4888:11:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "4871:28:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "functionReturnParameters": 1948,
                  "id": 2004,
                  "nodeType": "Return",
                  "src": "4864:35:7"
                }
              ]
            },
            "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": 2006,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": true,
            "modifiers": [],
            "name": "calcMarginalPrice",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1945,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1942,
                  "name": "market",
                  "nodeType": "VariableDeclaration",
                  "scope": 2006,
                  "src": "4114:13:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_contract$_Market_$2374",
                    "typeString": "contract Market"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 1941,
                    "name": "Market",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 2374,
                    "src": "4114:6:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_Market_$2374",
                      "typeString": "contract Market"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1944,
                  "name": "outcomeTokenIndex",
                  "nodeType": "VariableDeclaration",
                  "scope": 2006,
                  "src": "4129:23:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint8",
                    "typeString": "uint8"
                  },
                  "typeName": {
                    "id": 1943,
                    "name": "uint8",
                    "nodeType": "ElementaryTypeName",
                    "src": "4129:5:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint8",
                      "typeString": "uint8"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "4113:40:7"
            },
            "payable": false,
            "returnParameters": {
              "id": 1948,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1947,
                  "name": "price",
                  "nodeType": "VariableDeclaration",
                  "scope": 2006,
                  "src": "4203:10:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1946,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "4203:4:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "4202:12:7"
            },
            "scope": 2216,
            "src": "4087:819:7",
            "stateMutability": "view",
            "superFunction": 2250,
            "visibility": "public"
          },
          {
            "body": {
              "id": 2062,
              "nodeType": "Block",
              "src": "5462:503:7",
              "statements": [
                {
                  "assignments": [
                    2020,
                    2021,
                    null
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 2020,
                      "name": "sum",
                      "nodeType": "VariableDeclaration",
                      "scope": 2063,
                      "src": "5706:3:7",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": null,
                      "value": null,
                      "visibility": "internal"
                    },
                    {
                      "constant": false,
                      "id": 2021,
                      "name": "offset",
                      "nodeType": "VariableDeclaration",
                      "scope": 2063,
                      "src": "5711:6:7",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": null,
                      "value": null,
                      "visibility": "internal"
                    },
                    null
                  ],
                  "id": 2029,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 2023,
                        "name": "logN",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2008,
                        "src": "5736:4:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 2024,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2011,
                        "src": "5742:20:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 2025,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2013,
                        "src": "5764:7:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "30",
                        "id": 2026,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "5773:1:7",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_0_by_1",
                          "typeString": "int_const 0"
                        },
                        "value": "0"
                      },
                      {
                        "argumentTypes": null,
                        "id": 2027,
                        "name": "estimationMode",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2015,
                        "src": "5776:14:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$3366",
                          "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_$3366",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "id": 2022,
                      "name": "sumExpOffset",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2173,
                      "src": "5723:12:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_uint8_$_t_enum$_EstimationMode_$3366_$returns$_t_uint256_$_t_int256_$_t_uint256_$",
                        "typeString": "function (int256,int256[] memory,uint256,uint8,enum Math.EstimationMode) view returns (uint256,int256,uint256)"
                      }
                    },
                    "id": 2028,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "5723:68:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$_t_uint256_$_t_int256_$_t_uint256_$",
                      "typeString": "tuple(uint256,int256,uint256)"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "5701:90:7"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 2036,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 2030,
                      "name": "costLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2018,
                      "src": "5801:9:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "id": 2033,
                          "name": "sum",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 2020,
                          "src": "5823:3:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        {
                          "argumentTypes": null,
                          "id": 2034,
                          "name": "estimationMode",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 2015,
                          "src": "5828:14:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_enum$_EstimationMode_$3366",
                            "typeString": "enum Math.EstimationMode"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          {
                            "typeIdentifier": "t_enum$_EstimationMode_$3366",
                            "typeString": "enum Math.EstimationMode"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "id": 2031,
                          "name": "Math",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 4611,
                          "src": "5813:4:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_contract$_Math_$4611_$",
                            "typeString": "type(library Math)"
                          }
                        },
                        "id": 2032,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "log2",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 4118,
                        "src": "5813:9:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_delegatecall_view$_t_uint256_$_t_enum$_EstimationMode_$3366_$returns$_t_int256_$",
                          "typeString": "function (uint256,enum Math.EstimationMode) view returns (int256)"
                        }
                      },
                      "id": 2035,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "5813:30:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "5801:42:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 2037,
                  "nodeType": "ExpressionStatement",
                  "src": "5801:42:7"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 2043,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 2038,
                      "name": "costLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2018,
                      "src": "5853:9:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "id": 2041,
                          "name": "offset",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 2021,
                          "src": "5879:6:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "id": 2039,
                          "name": "costLevel",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 2018,
                          "src": "5865:9:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 2040,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "add",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 4568,
                        "src": "5865:13:7",
                        "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": 2042,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "5865:21:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "5853:33:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 2044,
                  "nodeType": "ExpressionStatement",
                  "src": "5853:33:7"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 2060,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 2045,
                      "name": "costLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2018,
                      "src": "5896:9:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 2057,
                              "name": "funding",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 2013,
                              "src": "5949:7:7",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 2056,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "5945:3:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_int256_$",
                              "typeString": "type(int256)"
                            },
                            "typeName": "int"
                          },
                          "id": 2058,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "5945:12:7",
                          "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": 2053,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "leftExpression": {
                                "argumentTypes": null,
                                "arguments": [
                                  {
                                    "argumentTypes": null,
                                    "arguments": [
                                      {
                                        "argumentTypes": null,
                                        "id": 2049,
                                        "name": "ONE",
                                        "nodeType": "Identifier",
                                        "overloadedDeclarations": [],
                                        "referencedDeclaration": 1691,
                                        "src": "5927:3:7",
                                        "typeDescriptions": {
                                          "typeIdentifier": "t_uint256",
                                          "typeString": "uint256"
                                        }
                                      }
                                    ],
                                    "expression": {
                                      "argumentTypes": [
                                        {
                                          "typeIdentifier": "t_uint256",
                                          "typeString": "uint256"
                                        }
                                      ],
                                      "id": 2048,
                                      "isConstant": false,
                                      "isLValue": false,
                                      "isPure": true,
                                      "lValueRequested": false,
                                      "nodeType": "ElementaryTypeNameExpression",
                                      "src": "5923:3:7",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_type$_t_int256_$",
                                        "typeString": "type(int256)"
                                      },
                                      "typeName": "int"
                                    },
                                    "id": 2050,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": true,
                                    "kind": "typeConversion",
                                    "lValueRequested": false,
                                    "names": [],
                                    "nodeType": "FunctionCall",
                                    "src": "5923:8:7",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_int256",
                                      "typeString": "int256"
                                    }
                                  }
                                ],
                                "expression": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_int256",
                                      "typeString": "int256"
                                    }
                                  ],
                                  "expression": {
                                    "argumentTypes": null,
                                    "id": 2046,
                                    "name": "costLevel",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 2018,
                                    "src": "5909:9:7",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_int256",
                                      "typeString": "int256"
                                    }
                                  },
                                  "id": 2047,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "mul",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 4610,
                                  "src": "5909:13:7",
                                  "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": 2051,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "5909:23:7",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                }
                              },
                              "nodeType": "BinaryOperation",
                              "operator": "/",
                              "rightExpression": {
                                "argumentTypes": null,
                                "id": 2052,
                                "name": "logN",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 2008,
                                "src": "5935:4:7",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                }
                              },
                              "src": "5909:30:7",
                              "typeDescriptions": {
                                "typeIdentifier": "t_int256",
                                "typeString": "int256"
                              }
                            }
                          ],
                          "id": 2054,
                          "isConstant": false,
                          "isInlineArray": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "nodeType": "TupleExpression",
                          "src": "5908:32:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 2055,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "mul",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 4610,
                        "src": "5908:36:7",
                        "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": 2059,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "5908:50:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "5896:62:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 2061,
                  "nodeType": "ExpressionStatement",
                  "src": "5896:62:7"
                }
              ]
            },
            "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": 2063,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": true,
            "modifiers": [],
            "name": "calcCostLevel",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 2016,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2008,
                  "name": "logN",
                  "nodeType": "VariableDeclaration",
                  "scope": 2063,
                  "src": "5306:8:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_int256",
                    "typeString": "int256"
                  },
                  "typeName": {
                    "id": 2007,
                    "name": "int",
                    "nodeType": "ElementaryTypeName",
                    "src": "5306:3:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 2011,
                  "name": "netOutcomeTokensSold",
                  "nodeType": "VariableDeclaration",
                  "scope": 2063,
                  "src": "5316:26:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                    "typeString": "int256[]"
                  },
                  "typeName": {
                    "baseType": {
                      "id": 2009,
                      "name": "int",
                      "nodeType": "ElementaryTypeName",
                      "src": "5316:3:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 2010,
                    "length": null,
                    "nodeType": "ArrayTypeName",
                    "src": "5316:5:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                      "typeString": "int256[]"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 2013,
                  "name": "funding",
                  "nodeType": "VariableDeclaration",
                  "scope": 2063,
                  "src": "5344:12:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 2012,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "5344:4:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 2015,
                  "name": "estimationMode",
                  "nodeType": "VariableDeclaration",
                  "scope": 2063,
                  "src": "5358:34:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_enum$_EstimationMode_$3366",
                    "typeString": "enum Math.EstimationMode"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 2014,
                    "name": "Math.EstimationMode",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 3366,
                    "src": "5358:19:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_enum$_EstimationMode_$3366",
                      "typeString": "enum Math.EstimationMode"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "5305:88:7"
            },
            "payable": false,
            "returnParameters": {
              "id": 2019,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2018,
                  "name": "costLevel",
                  "nodeType": "VariableDeclaration",
                  "scope": 2063,
                  "src": "5443:13:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_int256",
                    "typeString": "int256"
                  },
                  "typeName": {
                    "id": 2017,
                    "name": "int",
                    "nodeType": "ElementaryTypeName",
                    "src": "5443:3:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "5442:15:7"
            },
            "scope": 2216,
            "src": "5283:682:7",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "private"
          },
          {
            "body": {
              "id": 2172,
              "nodeType": "Block",
              "src": "6738:1349:7",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        "id": 2092,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          },
                          "id": 2086,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 2084,
                            "name": "logN",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2065,
                            "src": "7598:4:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": ">=",
                          "rightExpression": {
                            "argumentTypes": null,
                            "hexValue": "30",
                            "id": 2085,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "7606:1:7",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_0_by_1",
                              "typeString": "int_const 0"
                            },
                            "value": "0"
                          },
                          "src": "7598:9:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "&&",
                        "rightExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          },
                          "id": 2091,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "id": 2088,
                                "name": "funding",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 2070,
                                "src": "7615:7:7",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              ],
                              "id": 2087,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "lValueRequested": false,
                              "nodeType": "ElementaryTypeNameExpression",
                              "src": "7611:3:7",
                              "typeDescriptions": {
                                "typeIdentifier": "t_type$_t_int256_$",
                                "typeString": "type(int256)"
                              },
                              "typeName": "int"
                            },
                            "id": 2089,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "typeConversion",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "7611:12:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": ">=",
                          "rightExpression": {
                            "argumentTypes": null,
                            "hexValue": "30",
                            "id": 2090,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "7627:1:7",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_0_by_1",
                              "typeString": "int_const 0"
                            },
                            "value": "0"
                          },
                          "src": "7611:17:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "src": "7598:30:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 2083,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        9183,
                        9184
                      ],
                      "referencedDeclaration": 9183,
                      "src": "7590:7:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 2093,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "7590:39:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 2094,
                  "nodeType": "ExpressionStatement",
                  "src": "7590:39:7"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 2100,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 2095,
                      "name": "offset",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2079,
                      "src": "7639:6:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "id": 2098,
                          "name": "netOutcomeTokensSold",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 2068,
                          "src": "7657:20:7",
                          "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": 2096,
                          "name": "Math",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 4611,
                          "src": "7648:4:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_contract$_Math_$4611_$",
                            "typeString": "type(library Math)"
                          }
                        },
                        "id": 2097,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "max",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 4344,
                        "src": "7648:8:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_delegatecall_view$_t_array$_t_int256_$dyn_memory_ptr_$returns$_t_int256_$",
                          "typeString": "function (int256[] memory) view returns (int256)"
                        }
                      },
                      "id": 2099,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "7648:30:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "7639:39:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 2101,
                  "nodeType": "ExpressionStatement",
                  "src": "7639:39:7"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 2111,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 2102,
                      "name": "offset",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2079,
                      "src": "7688:6:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "id": 2110,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 2105,
                            "name": "logN",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2065,
                            "src": "7708:4:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          ],
                          "expression": {
                            "argumentTypes": null,
                            "id": 2103,
                            "name": "offset",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2079,
                            "src": "7697:6:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "id": 2104,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "mul",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 4610,
                          "src": "7697:10:7",
                          "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": 2106,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "7697:16:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "/",
                      "rightExpression": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 2108,
                            "name": "funding",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2070,
                            "src": "7720:7:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          ],
                          "id": 2107,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "lValueRequested": false,
                          "nodeType": "ElementaryTypeNameExpression",
                          "src": "7716:3:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_int256_$",
                            "typeString": "type(int256)"
                          },
                          "typeName": "int"
                        },
                        "id": 2109,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "typeConversion",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "7716:12:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "src": "7697:31:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "7688:40:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 2112,
                  "nodeType": "ExpressionStatement",
                  "src": "7688:40:7"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 2118,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 2113,
                      "name": "offset",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2079,
                      "src": "7738:6:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "id": 2116,
                          "name": "EXP_LIMIT",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1694,
                          "src": "7758:9:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "id": 2114,
                          "name": "offset",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 2079,
                          "src": "7747:6:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 2115,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sub",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 4589,
                        "src": "7747:10:7",
                        "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": 2117,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "7747:21:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "7738:30:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 2119,
                  "nodeType": "ExpressionStatement",
                  "src": "7738:30:7"
                },
                {
                  "assignments": [],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 2121,
                      "name": "term",
                      "nodeType": "VariableDeclaration",
                      "scope": 2173,
                      "src": "7778:9:7",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 2120,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "7778:4:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 2122,
                  "initialValue": null,
                  "nodeType": "VariableDeclarationStatement",
                  "src": "7778:9:7"
                },
                {
                  "body": {
                    "id": 2170,
                    "nodeType": "Block",
                    "src": "7853:228:7",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 2153,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 2134,
                            "name": "term",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2121,
                            "src": "7867:4:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "arguments": [
                                  {
                                    "argumentTypes": null,
                                    "id": 2149,
                                    "name": "offset",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 2079,
                                    "src": "7939:6:7",
                                    "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": 2146,
                                        "isConstant": false,
                                        "isLValue": false,
                                        "isPure": false,
                                        "lValueRequested": false,
                                        "leftExpression": {
                                          "argumentTypes": null,
                                          "arguments": [
                                            {
                                              "argumentTypes": null,
                                              "id": 2141,
                                              "name": "logN",
                                              "nodeType": "Identifier",
                                              "overloadedDeclarations": [],
                                              "referencedDeclaration": 2065,
                                              "src": "7913:4:7",
                                              "typeDescriptions": {
                                                "typeIdentifier": "t_int256",
                                                "typeString": "int256"
                                              }
                                            }
                                          ],
                                          "expression": {
                                            "argumentTypes": [
                                              {
                                                "typeIdentifier": "t_int256",
                                                "typeString": "int256"
                                              }
                                            ],
                                            "expression": {
                                              "argumentTypes": null,
                                              "baseExpression": {
                                                "argumentTypes": null,
                                                "id": 2137,
                                                "name": "netOutcomeTokensSold",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 2068,
                                                "src": "7885:20:7",
                                                "typeDescriptions": {
                                                  "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                                                  "typeString": "int256[] memory"
                                                }
                                              },
                                              "id": 2139,
                                              "indexExpression": {
                                                "argumentTypes": null,
                                                "id": 2138,
                                                "name": "i",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 2124,
                                                "src": "7906:1:7",
                                                "typeDescriptions": {
                                                  "typeIdentifier": "t_uint8",
                                                  "typeString": "uint8"
                                                }
                                              },
                                              "isConstant": false,
                                              "isLValue": true,
                                              "isPure": false,
                                              "lValueRequested": false,
                                              "nodeType": "IndexAccess",
                                              "src": "7885:23:7",
                                              "typeDescriptions": {
                                                "typeIdentifier": "t_int256",
                                                "typeString": "int256"
                                              }
                                            },
                                            "id": 2140,
                                            "isConstant": false,
                                            "isLValue": false,
                                            "isPure": false,
                                            "lValueRequested": false,
                                            "memberName": "mul",
                                            "nodeType": "MemberAccess",
                                            "referencedDeclaration": 4610,
                                            "src": "7885:27:7",
                                            "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": 2142,
                                          "isConstant": false,
                                          "isLValue": false,
                                          "isPure": false,
                                          "kind": "functionCall",
                                          "lValueRequested": false,
                                          "names": [],
                                          "nodeType": "FunctionCall",
                                          "src": "7885:33:7",
                                          "typeDescriptions": {
                                            "typeIdentifier": "t_int256",
                                            "typeString": "int256"
                                          }
                                        },
                                        "nodeType": "BinaryOperation",
                                        "operator": "/",
                                        "rightExpression": {
                                          "argumentTypes": null,
                                          "arguments": [
                                            {
                                              "argumentTypes": null,
                                              "id": 2144,
                                              "name": "funding",
                                              "nodeType": "Identifier",
                                              "overloadedDeclarations": [],
                                              "referencedDeclaration": 2070,
                                              "src": "7925:7:7",
                                              "typeDescriptions": {
                                                "typeIdentifier": "t_uint256",
                                                "typeString": "uint256"
                                              }
                                            }
                                          ],
                                          "expression": {
                                            "argumentTypes": [
                                              {
                                                "typeIdentifier": "t_uint256",
                                                "typeString": "uint256"
                                              }
                                            ],
                                            "id": 2143,
                                            "isConstant": false,
                                            "isLValue": false,
                                            "isPure": true,
                                            "lValueRequested": false,
                                            "nodeType": "ElementaryTypeNameExpression",
                                            "src": "7921:3:7",
                                            "typeDescriptions": {
                                              "typeIdentifier": "t_type$_t_int256_$",
                                              "typeString": "type(int256)"
                                            },
                                            "typeName": "int"
                                          },
                                          "id": 2145,
                                          "isConstant": false,
                                          "isLValue": false,
                                          "isPure": false,
                                          "kind": "typeConversion",
                                          "lValueRequested": false,
                                          "names": [],
                                          "nodeType": "FunctionCall",
                                          "src": "7921:12:7",
                                          "typeDescriptions": {
                                            "typeIdentifier": "t_int256",
                                            "typeString": "int256"
                                          }
                                        },
                                        "src": "7885:48:7",
                                        "typeDescriptions": {
                                          "typeIdentifier": "t_int256",
                                          "typeString": "int256"
                                        }
                                      }
                                    ],
                                    "id": 2147,
                                    "isConstant": false,
                                    "isInlineArray": false,
                                    "isLValue": false,
                                    "isPure": false,
                                    "lValueRequested": false,
                                    "nodeType": "TupleExpression",
                                    "src": "7884:50:7",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_int256",
                                      "typeString": "int256"
                                    }
                                  },
                                  "id": 2148,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "sub",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 4589,
                                  "src": "7884:54:7",
                                  "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": 2150,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "7884:62:7",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                }
                              },
                              {
                                "argumentTypes": null,
                                "id": 2151,
                                "name": "estimationMode",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 2074,
                                "src": "7948:14:7",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_enum$_EstimationMode_$3366",
                                  "typeString": "enum Math.EstimationMode"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                },
                                {
                                  "typeIdentifier": "t_enum$_EstimationMode_$3366",
                                  "typeString": "enum Math.EstimationMode"
                                }
                              ],
                              "expression": {
                                "argumentTypes": null,
                                "id": 2135,
                                "name": "Math",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 4611,
                                "src": "7874:4:7",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_type$_t_contract$_Math_$4611_$",
                                  "typeString": "type(library Math)"
                                }
                              },
                              "id": 2136,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "pow2",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 3469,
                              "src": "7874:9:7",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_delegatecall_view$_t_int256_$_t_enum$_EstimationMode_$3366_$returns$_t_uint256_$",
                                "typeString": "function (int256,enum Math.EstimationMode) view returns (uint256)"
                              }
                            },
                            "id": 2152,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "7874:89:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "7867:96:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 2154,
                        "nodeType": "ExpressionStatement",
                        "src": "7867:96:7"
                      },
                      {
                        "condition": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          },
                          "id": 2157,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 2155,
                            "name": "i",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2124,
                            "src": "7981:1:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "==",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 2156,
                            "name": "outcomeIndex",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2072,
                            "src": "7986:12:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          },
                          "src": "7981:17:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "falseBody": null,
                        "id": 2162,
                        "nodeType": "IfStatement",
                        "src": "7977:60:7",
                        "trueBody": {
                          "expression": {
                            "argumentTypes": null,
                            "id": 2160,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftHandSide": {
                              "argumentTypes": null,
                              "id": 2158,
                              "name": "outcomeExpTerm",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 2081,
                              "src": "8016:14:7",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "nodeType": "Assignment",
                            "operator": "=",
                            "rightHandSide": {
                              "argumentTypes": null,
                              "id": 2159,
                              "name": "term",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 2121,
                              "src": "8033:4:7",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "src": "8016:21:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "id": 2161,
                          "nodeType": "ExpressionStatement",
                          "src": "8016:21:7"
                        }
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 2168,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 2163,
                            "name": "sum",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2077,
                            "src": "8051:3:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "id": 2166,
                                "name": "term",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 2121,
                                "src": "8065:4:7",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              ],
                              "expression": {
                                "argumentTypes": null,
                                "id": 2164,
                                "name": "sum",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 2077,
                                "src": "8057:3:7",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "id": 2165,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "add",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 4417,
                              "src": "8057:7:7",
                              "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": 2167,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "8057:13:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "8051:19:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 2169,
                        "nodeType": "ExpressionStatement",
                        "src": "8051:19:7"
                      }
                    ]
                  },
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 2130,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 2127,
                      "name": "i",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2124,
                      "src": "7815:1:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint8",
                        "typeString": "uint8"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 2128,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2068,
                        "src": "7819:20:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      "id": 2129,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "length",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": null,
                      "src": "7819:27:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "7815:31:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "id": 2171,
                  "initializationExpression": {
                    "assignments": [
                      2124
                    ],
                    "declarations": [
                      {
                        "constant": false,
                        "id": 2124,
                        "name": "i",
                        "nodeType": "VariableDeclaration",
                        "scope": 2173,
                        "src": "7802:7:7",
                        "stateVariable": false,
                        "storageLocation": "default",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "typeName": {
                          "id": 2123,
                          "name": "uint8",
                          "nodeType": "ElementaryTypeName",
                          "src": "7802:5:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "value": null,
                        "visibility": "internal"
                      }
                    ],
                    "id": 2126,
                    "initialValue": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 2125,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "7812:1:7",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "nodeType": "VariableDeclarationStatement",
                    "src": "7802:11:7"
                  },
                  "loopExpression": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 2132,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "nodeType": "UnaryOperation",
                      "operator": "++",
                      "prefix": false,
                      "src": "7848:3:7",
                      "subExpression": {
                        "argumentTypes": null,
                        "id": 2131,
                        "name": "i",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2124,
                        "src": "7848:1:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      },
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint8",
                        "typeString": "uint8"
                      }
                    },
                    "id": 2133,
                    "nodeType": "ExpressionStatement",
                    "src": "7848:3:7"
                  },
                  "nodeType": "ForStatement",
                  "src": "7797:284:7"
                }
              ]
            },
            "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": 2173,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": true,
            "modifiers": [],
            "name": "sumExpOffset",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 2075,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2065,
                  "name": "logN",
                  "nodeType": "VariableDeclaration",
                  "scope": 2173,
                  "src": "6533:8:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_int256",
                    "typeString": "int256"
                  },
                  "typeName": {
                    "id": 2064,
                    "name": "int",
                    "nodeType": "ElementaryTypeName",
                    "src": "6533:3:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 2068,
                  "name": "netOutcomeTokensSold",
                  "nodeType": "VariableDeclaration",
                  "scope": 2173,
                  "src": "6543:26:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                    "typeString": "int256[]"
                  },
                  "typeName": {
                    "baseType": {
                      "id": 2066,
                      "name": "int",
                      "nodeType": "ElementaryTypeName",
                      "src": "6543:3:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 2067,
                    "length": null,
                    "nodeType": "ArrayTypeName",
                    "src": "6543:5:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                      "typeString": "int256[]"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 2070,
                  "name": "funding",
                  "nodeType": "VariableDeclaration",
                  "scope": 2173,
                  "src": "6571:12:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 2069,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "6571:4:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 2072,
                  "name": "outcomeIndex",
                  "nodeType": "VariableDeclaration",
                  "scope": 2173,
                  "src": "6585:18:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint8",
                    "typeString": "uint8"
                  },
                  "typeName": {
                    "id": 2071,
                    "name": "uint8",
                    "nodeType": "ElementaryTypeName",
                    "src": "6585:5:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint8",
                      "typeString": "uint8"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 2074,
                  "name": "estimationMode",
                  "nodeType": "VariableDeclaration",
                  "scope": 2173,
                  "src": "6605:34:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_enum$_EstimationMode_$3366",
                    "typeString": "enum Math.EstimationMode"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 2073,
                    "name": "Math.EstimationMode",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 3366,
                    "src": "6605:19:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_enum$_EstimationMode_$3366",
                      "typeString": "enum Math.EstimationMode"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6532:108:7"
            },
            "payable": false,
            "returnParameters": {
              "id": 2082,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2077,
                  "name": "sum",
                  "nodeType": "VariableDeclaration",
                  "scope": 2173,
                  "src": "6691:8:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 2076,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "6691:4:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 2079,
                  "name": "offset",
                  "nodeType": "VariableDeclaration",
                  "scope": 2173,
                  "src": "6701:10:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_int256",
                    "typeString": "int256"
                  },
                  "typeName": {
                    "id": 2078,
                    "name": "int",
                    "nodeType": "ElementaryTypeName",
                    "src": "6701:3:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 2081,
                  "name": "outcomeExpTerm",
                  "nodeType": "VariableDeclaration",
                  "scope": 2173,
                  "src": "6713:19:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 2080,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "6713:4:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6690:43:7"
            },
            "scope": 2216,
            "src": "6511:1576:7",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "private"
          },
          {
            "body": {
              "id": 2214,
              "nodeType": "Block",
              "src": "8687:195:7",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 2191,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 2181,
                      "name": "quantities",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2179,
                      "src": "8697:10:7",
                      "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": 2185,
                                  "name": "market",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 2175,
                                  "src": "8720:6:7",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_Market_$2374",
                                    "typeString": "contract Market"
                                  }
                                },
                                "id": 2186,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "eventContract",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 2305,
                                "src": "8720:20:7",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_function_external_view$__$returns$_t_contract$_Event_$1680_$",
                                  "typeString": "function () view external returns (contract Event)"
                                }
                              },
                              "id": 2187,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "functionCall",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "8720:22:7",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_Event_$1680",
                                "typeString": "contract Event"
                              }
                            },
                            "id": 2188,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "getOutcomeCount",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 1619,
                            "src": "8720:38:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_view$__$returns$_t_uint8_$",
                              "typeString": "function () view external returns (uint8)"
                            }
                          },
                          "id": 2189,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "8720:40:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        ],
                        "id": 2184,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "nodeType": "NewExpression",
                        "src": "8710:9:7",
                        "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": 2182,
                            "name": "int",
                            "nodeType": "ElementaryTypeName",
                            "src": "8714:3:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "id": 2183,
                          "length": null,
                          "nodeType": "ArrayTypeName",
                          "src": "8714:5:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                            "typeString": "int256[]"
                          }
                        }
                      },
                      "id": 2190,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "8710:51:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_array$_t_int256_$dyn_memory",
                        "typeString": "int256[] memory"
                      }
                    },
                    "src": "8697:64:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                      "typeString": "int256[] memory"
                    }
                  },
                  "id": 2192,
                  "nodeType": "ExpressionStatement",
                  "src": "8697:64:7"
                },
                {
                  "body": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 2211,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "baseExpression": {
                          "argumentTypes": null,
                          "id": 2204,
                          "name": "quantities",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 2179,
                          "src": "8829:10:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                            "typeString": "int256[] memory"
                          }
                        },
                        "id": 2206,
                        "indexExpression": {
                          "argumentTypes": null,
                          "id": 2205,
                          "name": "i",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 2194,
                          "src": "8840:1:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "isConstant": false,
                        "isLValue": true,
                        "isPure": false,
                        "lValueRequested": true,
                        "nodeType": "IndexAccess",
                        "src": "8829:13:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 2209,
                            "name": "i",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2194,
                            "src": "8873:1:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          ],
                          "expression": {
                            "argumentTypes": null,
                            "id": 2207,
                            "name": "market",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2175,
                            "src": "8845:6:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_contract$_Market_$2374",
                              "typeString": "contract Market"
                            }
                          },
                          "id": 2208,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "netOutcomeTokensSold",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 2314,
                          "src": "8845:27:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_external_view$_t_uint256_$returns$_t_int256_$",
                            "typeString": "function (uint256) view external returns (int256)"
                          }
                        },
                        "id": 2210,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "8845:30:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "src": "8829:46:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 2212,
                    "nodeType": "ExpressionStatement",
                    "src": "8829:46:7"
                  },
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 2200,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 2197,
                      "name": "i",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2194,
                      "src": "8789:1:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint8",
                        "typeString": "uint8"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 2198,
                        "name": "quantities",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2179,
                        "src": "8793:10:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      "id": 2199,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "length",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": null,
                      "src": "8793:17:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "8789:21:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "id": 2213,
                  "initializationExpression": {
                    "assignments": [
                      2194
                    ],
                    "declarations": [
                      {
                        "constant": false,
                        "id": 2194,
                        "name": "i",
                        "nodeType": "VariableDeclaration",
                        "scope": 2215,
                        "src": "8776:7:7",
                        "stateVariable": false,
                        "storageLocation": "default",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "typeName": {
                          "id": 2193,
                          "name": "uint8",
                          "nodeType": "ElementaryTypeName",
                          "src": "8776:5:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "value": null,
                        "visibility": "internal"
                      }
                    ],
                    "id": 2196,
                    "initialValue": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 2195,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "8786:1:7",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "nodeType": "VariableDeclarationStatement",
                    "src": "8776:11:7"
                  },
                  "loopExpression": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 2202,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "nodeType": "UnaryOperation",
                      "operator": "++",
                      "prefix": false,
                      "src": "8812:3:7",
                      "subExpression": {
                        "argumentTypes": null,
                        "id": 2201,
                        "name": "i",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2194,
                        "src": "8812:1:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      },
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint8",
                        "typeString": "uint8"
                      }
                    },
                    "id": 2203,
                    "nodeType": "ExpressionStatement",
                    "src": "8812:3:7"
                  },
                  "nodeType": "ForStatement",
                  "src": "8771:104:7"
                }
              ]
            },
            "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": 2215,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": true,
            "modifiers": [],
            "name": "getNetOutcomeTokensSold",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 2176,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2175,
                  "name": "market",
                  "nodeType": "VariableDeclaration",
                  "scope": 2215,
                  "src": "8600:13:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_contract$_Market_$2374",
                    "typeString": "contract Market"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 2174,
                    "name": "Market",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 2374,
                    "src": "8600:6:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_Market_$2374",
                      "typeString": "contract Market"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8599:15:7"
            },
            "payable": false,
            "returnParameters": {
              "id": 2180,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2179,
                  "name": "quantities",
                  "nodeType": "VariableDeclaration",
                  "scope": 2215,
                  "src": "8665:16:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                    "typeString": "int256[]"
                  },
                  "typeName": {
                    "baseType": {
                      "id": 2177,
                      "name": "int",
                      "nodeType": "ElementaryTypeName",
                      "src": "8665:3:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 2178,
                    "length": null,
                    "nodeType": "ArrayTypeName",
                    "src": "8665:5:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                      "typeString": "int256[]"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8664:18:7"
            },
            "scope": 2216,
            "src": "8567:315:7",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "private"
          }
        ],
        "scope": 2217,
        "src": "251:8633:7"
      }
    ],
    "src": "0:8885:7"
  },
  "legacyAST": {
    "absolutePath": "@gnosis.pm/pm-contracts/contracts/MarketMakers/LMSRMarketMaker.sol",
    "exportedSymbols": {
      "LMSRMarketMaker": [
        2216
      ]
    },
    "id": 2217,
    "nodeType": "SourceUnit",
    "nodes": [
      {
        "id": 1682,
        "literals": [
          "solidity",
          "^",
          "0.4",
          ".15"
        ],
        "nodeType": "PragmaDirective",
        "src": "0:24:7"
      },
      {
        "absolutePath": "@gnosis.pm/pm-contracts/contracts/Utils/Math.sol",
        "file": "../Utils/Math.sol",
        "id": 1683,
        "nodeType": "ImportDirective",
        "scope": 2217,
        "sourceUnit": 4612,
        "src": "25:27:7",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "absolutePath": "@gnosis.pm/pm-contracts/contracts/MarketMakers/MarketMaker.sol",
        "file": "../MarketMakers/MarketMaker.sol",
        "id": 1684,
        "nodeType": "ImportDirective",
        "scope": 2217,
        "sourceUnit": 2252,
        "src": "53:41:7",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "baseContracts": [
          {
            "arguments": null,
            "baseName": {
              "contractScope": null,
              "id": 1685,
              "name": "MarketMaker",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 2251,
              "src": "279:11:7",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_MarketMaker_$2251",
                "typeString": "contract MarketMaker"
              }
            },
            "id": 1686,
            "nodeType": "InheritanceSpecifier",
            "src": "279:11:7"
          }
        ],
        "contractDependencies": [
          2251
        ],
        "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": 2216,
        "linearizedBaseContracts": [
          2216,
          2251
        ],
        "name": "LMSRMarketMaker",
        "nodeType": "ContractDefinition",
        "nodes": [
          {
            "id": 1688,
            "libraryName": {
              "contractScope": null,
              "id": 1687,
              "name": "Math",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 4611,
              "src": "303:4:7",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_Math_$4611",
                "typeString": "library Math"
              }
            },
            "nodeType": "UsingForDirective",
            "src": "297:17:7",
            "typeName": null
          },
          {
            "constant": true,
            "id": 1691,
            "name": "ONE",
            "nodeType": "VariableDeclaration",
            "scope": 2216,
            "src": "353:39:7",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_uint256",
              "typeString": "uint256"
            },
            "typeName": {
              "id": 1689,
              "name": "uint",
              "nodeType": "ElementaryTypeName",
              "src": "353:4:7",
              "typeDescriptions": {
                "typeIdentifier": "t_uint256",
                "typeString": "uint256"
              }
            },
            "value": {
              "argumentTypes": null,
              "hexValue": "30783130303030303030303030303030303030",
              "id": 1690,
              "isConstant": false,
              "isLValue": false,
              "isPure": true,
              "kind": "number",
              "lValueRequested": false,
              "nodeType": "Literal",
              "src": "373:19:7",
              "subdenomination": null,
              "typeDescriptions": {
                "typeIdentifier": "t_rational_18446744073709551616_by_1",
                "typeString": "int_const 18446744073709551616"
              },
              "value": "0x10000000000000000"
            },
            "visibility": "internal"
          },
          {
            "constant": true,
            "id": 1694,
            "name": "EXP_LIMIT",
            "nodeType": "VariableDeclaration",
            "scope": 2216,
            "src": "398:47:7",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_int256",
              "typeString": "int256"
            },
            "typeName": {
              "id": 1692,
              "name": "int",
              "nodeType": "ElementaryTypeName",
              "src": "398:3:7",
              "typeDescriptions": {
                "typeIdentifier": "t_int256",
                "typeString": "int256"
              }
            },
            "value": {
              "argumentTypes": null,
              "hexValue": "33333934323030393039353632353537343937333434",
              "id": 1693,
              "isConstant": false,
              "isLValue": false,
              "isPure": true,
              "kind": "number",
              "lValueRequested": false,
              "nodeType": "Literal",
              "src": "423:22:7",
              "subdenomination": null,
              "typeDescriptions": {
                "typeIdentifier": "t_rational_3394200909562557497344_by_1",
                "typeString": "int_const 3394200909562557497344"
              },
              "value": "3394200909562557497344"
            },
            "visibility": "internal"
          },
          {
            "body": {
              "id": 1829,
              "nodeType": "Block",
              "src": "883:1433:7",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "id": 1712,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [],
                          "expression": {
                            "argumentTypes": [],
                            "expression": {
                              "argumentTypes": null,
                              "arguments": [],
                              "expression": {
                                "argumentTypes": [],
                                "expression": {
                                  "argumentTypes": null,
                                  "id": 1706,
                                  "name": "market",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1696,
                                  "src": "901:6:7",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_Market_$2374",
                                    "typeString": "contract Market"
                                  }
                                },
                                "id": 1707,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "eventContract",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 2305,
                                "src": "901:20:7",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_function_external_view$__$returns$_t_contract$_Event_$1680_$",
                                  "typeString": "function () view external returns (contract Event)"
                                }
                              },
                              "id": 1708,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "functionCall",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "901:22:7",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_Event_$1680",
                                "typeString": "contract Event"
                              }
                            },
                            "id": 1709,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "getOutcomeCount",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 1619,
                            "src": "901:38:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_view$__$returns$_t_uint8_$",
                              "typeString": "function () view external returns (uint8)"
                            }
                          },
                          "id": 1710,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "901:40:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "31",
                          "id": 1711,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "944:1:7",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_1_by_1",
                            "typeString": "int_const 1"
                          },
                          "value": "1"
                        },
                        "src": "901:44:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 1705,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        9183,
                        9184
                      ],
                      "referencedDeclaration": 9183,
                      "src": "893:7:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 1713,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "893:53:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1714,
                  "nodeType": "ExpressionStatement",
                  "src": "893:53:7"
                },
                {
                  "assignments": [
                    1718
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1718,
                      "name": "netOutcomeTokensSold",
                      "nodeType": "VariableDeclaration",
                      "scope": 1830,
                      "src": "956:33:7",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                        "typeString": "int256[]"
                      },
                      "typeName": {
                        "baseType": {
                          "id": 1716,
                          "name": "int",
                          "nodeType": "ElementaryTypeName",
                          "src": "956:3:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 1717,
                        "length": null,
                        "nodeType": "ArrayTypeName",
                        "src": "956:5:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                          "typeString": "int256[]"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1722,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1720,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1696,
                        "src": "1016:6:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$2374",
                          "typeString": "contract Market"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_contract$_Market_$2374",
                          "typeString": "contract Market"
                        }
                      ],
                      "id": 1719,
                      "name": "getNetOutcomeTokensSold",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2215,
                      "src": "992:23:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_contract$_Market_$2374_$returns$_t_array$_t_int256_$dyn_memory_ptr_$",
                        "typeString": "function (contract Market) view returns (int256[] memory)"
                      }
                    },
                    "id": 1721,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "992:31:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                      "typeString": "int256[] memory"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "956:67:7"
                },
                {
                  "assignments": [
                    1724
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1724,
                      "name": "log2N",
                      "nodeType": "VariableDeclaration",
                      "scope": 1830,
                      "src": "1101:9:7",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 1723,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "1101:3:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1735,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 1730,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1727,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1718,
                            "src": "1123:20:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 1728,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "length",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": null,
                          "src": "1123:27:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "*",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 1729,
                          "name": "ONE",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1691,
                          "src": "1153:3:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "1123:33:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1731,
                            "name": "Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4611,
                            "src": "1158:4:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Math_$4611_$",
                              "typeString": "type(library Math)"
                            }
                          },
                          "id": 1732,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 3366,
                          "src": "1158:19:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$3366_$",
                            "typeString": "type(enum Math.EstimationMode)"
                          }
                        },
                        "id": 1733,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "UpperBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "1158:30:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$3366",
                          "typeString": "enum Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$3366",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1725,
                        "name": "Math",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4611,
                        "src": "1113:4:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_contract$_Math_$4611_$",
                          "typeString": "type(library Math)"
                        }
                      },
                      "id": 1726,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "log2",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 4118,
                      "src": "1113:9:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_delegatecall_view$_t_uint256_$_t_enum$_EstimationMode_$3366_$returns$_t_int256_$",
                        "typeString": "function (uint256,enum Math.EstimationMode) view returns (int256)"
                      }
                    },
                    "id": 1734,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1113:76:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1101:88:7"
                },
                {
                  "assignments": [
                    1737
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1737,
                      "name": "funding",
                      "nodeType": "VariableDeclaration",
                      "scope": 1830,
                      "src": "1199:12:7",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1736,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "1199:4:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1741,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1738,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1696,
                        "src": "1214:6:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$2374",
                          "typeString": "contract Market"
                        }
                      },
                      "id": 1739,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "funding",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 2311,
                      "src": "1214:14:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                        "typeString": "function () view external returns (uint256)"
                      }
                    },
                    "id": 1740,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1214:16:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1199:31:7"
                },
                {
                  "assignments": [
                    1743
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1743,
                      "name": "costLevelBefore",
                      "nodeType": "VariableDeclaration",
                      "scope": 1830,
                      "src": "1240:19:7",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 1742,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "1240:3:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1752,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1745,
                        "name": "log2N",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1724,
                        "src": "1276:5:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1746,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1718,
                        "src": "1283:20:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1747,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1737,
                        "src": "1305:7:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1748,
                            "name": "Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4611,
                            "src": "1314:4:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Math_$4611_$",
                              "typeString": "type(library Math)"
                            }
                          },
                          "id": 1749,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 3366,
                          "src": "1314:19:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$3366_$",
                            "typeString": "type(enum Math.EstimationMode)"
                          }
                        },
                        "id": 1750,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "LowerBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "1314:30:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$3366",
                          "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_$3366",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "id": 1744,
                      "name": "calcCostLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2063,
                      "src": "1262:13:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_enum$_EstimationMode_$3366_$returns$_t_int256_$",
                        "typeString": "function (int256,int256[] memory,uint256,enum Math.EstimationMode) view returns (int256)"
                      }
                    },
                    "id": 1751,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1262:83:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1240:105:7"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        },
                        "id": 1758,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 1755,
                              "name": "outcomeTokenCount",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1700,
                              "src": "1431:17:7",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 1754,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "1427:3:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_int256_$",
                              "typeString": "type(int256)"
                            },
                            "typeName": "int"
                          },
                          "id": 1756,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "1427:22:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">=",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "30",
                          "id": 1757,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "1453:1:7",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_0_by_1",
                            "typeString": "int_const 0"
                          },
                          "value": "0"
                        },
                        "src": "1427:27:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 1753,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        9183,
                        9184
                      ],
                      "referencedDeclaration": 9183,
                      "src": "1419:7:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 1759,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1419:36:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1760,
                  "nodeType": "ExpressionStatement",
                  "src": "1419:36:7"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1772,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "baseExpression": {
                        "argumentTypes": null,
                        "id": 1761,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1718,
                        "src": "1465:20:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      "id": 1763,
                      "indexExpression": {
                        "argumentTypes": null,
                        "id": 1762,
                        "name": "outcomeTokenIndex",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1698,
                        "src": "1486:17:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      },
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "nodeType": "IndexAccess",
                      "src": "1465:39:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 1769,
                              "name": "outcomeTokenCount",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1700,
                              "src": "1555:17:7",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 1768,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "1551:3:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_int256_$",
                              "typeString": "type(int256)"
                            },
                            "typeName": "int"
                          },
                          "id": 1770,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "1551:22:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "baseExpression": {
                            "argumentTypes": null,
                            "id": 1764,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1718,
                            "src": "1507:20:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 1766,
                          "indexExpression": {
                            "argumentTypes": null,
                            "id": 1765,
                            "name": "outcomeTokenIndex",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1698,
                            "src": "1528:17:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          },
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "nodeType": "IndexAccess",
                          "src": "1507:39:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 1767,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "add",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 4568,
                        "src": "1507:43:7",
                        "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": 1771,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "1507:67:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "1465:109:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 1773,
                  "nodeType": "ExpressionStatement",
                  "src": "1465:109:7"
                },
                {
                  "assignments": [
                    1775
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1775,
                      "name": "costLevelAfter",
                      "nodeType": "VariableDeclaration",
                      "scope": 1830,
                      "src": "1642:18:7",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 1774,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "1642:3:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1784,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1777,
                        "name": "log2N",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1724,
                        "src": "1677:5:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1778,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1718,
                        "src": "1684:20:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1779,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1737,
                        "src": "1706:7:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1780,
                            "name": "Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4611,
                            "src": "1715:4:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Math_$4611_$",
                              "typeString": "type(library Math)"
                            }
                          },
                          "id": 1781,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 3366,
                          "src": "1715:19:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$3366_$",
                            "typeString": "type(enum Math.EstimationMode)"
                          }
                        },
                        "id": 1782,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "UpperBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "1715:30:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$3366",
                          "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_$3366",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "id": 1776,
                      "name": "calcCostLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2063,
                      "src": "1663:13:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_enum$_EstimationMode_$3366_$returns$_t_int256_$",
                        "typeString": "function (int256,int256[] memory,uint256,enum Math.EstimationMode) view returns (int256)"
                      }
                    },
                    "id": 1783,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1663:83:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1642:104:7"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    },
                    "id": 1787,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 1785,
                      "name": "costLevelAfter",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1775,
                      "src": "1810:14:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 1786,
                      "name": "costLevelBefore",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1743,
                      "src": "1827:15:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "1810:32:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 1792,
                  "nodeType": "IfStatement",
                  "src": "1807:81:7",
                  "trueBody": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1790,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 1788,
                        "name": "costLevelAfter",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1775,
                        "src": "1856:14:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "id": 1789,
                        "name": "costLevelBefore",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1743,
                        "src": "1873:15:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "src": "1856:32:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 1791,
                    "nodeType": "ExpressionStatement",
                    "src": "1856:32:7"
                  }
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1799,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1793,
                      "name": "cost",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1703,
                      "src": "1898:4:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          },
                          "id": 1797,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 1795,
                            "name": "costLevelAfter",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1775,
                            "src": "1910:14:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "-",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 1796,
                            "name": "costLevelBefore",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1743,
                            "src": "1927:15:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "src": "1910:32:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "id": 1794,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "nodeType": "ElementaryTypeNameExpression",
                        "src": "1905:4:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_uint256_$",
                          "typeString": "type(uint256)"
                        },
                        "typeName": "uint"
                      },
                      "id": 1798,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "typeConversion",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "1905:38:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "1898:45:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 1800,
                  "nodeType": "ExpressionStatement",
                  "src": "1898:45:7"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 1807,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 1805,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 1803,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 1801,
                          "name": "cost",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1703,
                          "src": "2009:4:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "/",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 1802,
                          "name": "ONE",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1691,
                          "src": "2016:3:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "2009:10:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "*",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 1804,
                        "name": "ONE",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1691,
                        "src": "2022:3:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "2009:16:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "==",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 1806,
                      "name": "cost",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1703,
                      "src": "2029:4:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "2009:24:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1818,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 1812,
                        "name": "cost",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1703,
                        "src": "2155:4:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 1817,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          "id": 1815,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 1813,
                            "name": "cost",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1703,
                            "src": "2162:4:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "/",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 1814,
                            "name": "ONE",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1691,
                            "src": "2169:3:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "2162:10:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "+",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "31",
                          "id": 1816,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "2175:1:7",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_1_by_1",
                            "typeString": "int_const 1"
                          },
                          "value": "1"
                        },
                        "src": "2162:14:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "2155:21:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "id": 1819,
                    "nodeType": "ExpressionStatement",
                    "src": "2155:21:7"
                  },
                  "id": 1820,
                  "nodeType": "IfStatement",
                  "src": "2005:171:7",
                  "trueBody": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1810,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 1808,
                        "name": "cost",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1703,
                        "src": "2047:4:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "/=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "id": 1809,
                        "name": "ONE",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1691,
                        "src": "2055:3:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "2047:11:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "id": 1811,
                    "nodeType": "ExpressionStatement",
                    "src": "2047:11:7"
                  }
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 1823,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 1821,
                      "name": "cost",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1703,
                      "src": "2247:4:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 1822,
                      "name": "outcomeTokenCount",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1700,
                      "src": "2254:17:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "2247:24:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 1828,
                  "nodeType": "IfStatement",
                  "src": "2243:66:7",
                  "trueBody": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1826,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 1824,
                        "name": "cost",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1703,
                        "src": "2285:4:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "id": 1825,
                        "name": "outcomeTokenCount",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1700,
                        "src": "2292:17:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "2285:24:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "id": 1827,
                    "nodeType": "ExpressionStatement",
                    "src": "2285:24:7"
                  }
                }
              ]
            },
            "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": 1830,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": true,
            "modifiers": [],
            "name": "calcCost",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1701,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1696,
                  "name": "market",
                  "nodeType": "VariableDeclaration",
                  "scope": 1830,
                  "src": "755:13:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_contract$_Market_$2374",
                    "typeString": "contract Market"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 1695,
                    "name": "Market",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 2374,
                    "src": "755:6:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_Market_$2374",
                      "typeString": "contract Market"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1698,
                  "name": "outcomeTokenIndex",
                  "nodeType": "VariableDeclaration",
                  "scope": 1830,
                  "src": "770:23:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint8",
                    "typeString": "uint8"
                  },
                  "typeName": {
                    "id": 1697,
                    "name": "uint8",
                    "nodeType": "ElementaryTypeName",
                    "src": "770:5:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint8",
                      "typeString": "uint8"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1700,
                  "name": "outcomeTokenCount",
                  "nodeType": "VariableDeclaration",
                  "scope": 1830,
                  "src": "795:22:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1699,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "795:4:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "754:64:7"
            },
            "payable": false,
            "returnParameters": {
              "id": 1704,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1703,
                  "name": "cost",
                  "nodeType": "VariableDeclaration",
                  "scope": 1830,
                  "src": "868:9:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1702,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "868:4:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "867:11:7"
            },
            "scope": 2216,
            "src": "737:1579:7",
            "stateMutability": "view",
            "superFunction": 2230,
            "visibility": "public"
          },
          {
            "body": {
              "id": 1939,
              "nodeType": "Block",
              "src": "2728:1115:7",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "id": 1848,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [],
                          "expression": {
                            "argumentTypes": [],
                            "expression": {
                              "argumentTypes": null,
                              "arguments": [],
                              "expression": {
                                "argumentTypes": [],
                                "expression": {
                                  "argumentTypes": null,
                                  "id": 1842,
                                  "name": "market",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1832,
                                  "src": "2746:6:7",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_Market_$2374",
                                    "typeString": "contract Market"
                                  }
                                },
                                "id": 1843,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "eventContract",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 2305,
                                "src": "2746:20:7",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_function_external_view$__$returns$_t_contract$_Event_$1680_$",
                                  "typeString": "function () view external returns (contract Event)"
                                }
                              },
                              "id": 1844,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "functionCall",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "2746:22:7",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_Event_$1680",
                                "typeString": "contract Event"
                              }
                            },
                            "id": 1845,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "getOutcomeCount",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 1619,
                            "src": "2746:38:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_view$__$returns$_t_uint8_$",
                              "typeString": "function () view external returns (uint8)"
                            }
                          },
                          "id": 1846,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "2746:40:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "31",
                          "id": 1847,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "2789:1:7",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_1_by_1",
                            "typeString": "int_const 1"
                          },
                          "value": "1"
                        },
                        "src": "2746:44:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 1841,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        9183,
                        9184
                      ],
                      "referencedDeclaration": 9183,
                      "src": "2738:7:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 1849,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "2738:53:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1850,
                  "nodeType": "ExpressionStatement",
                  "src": "2738:53:7"
                },
                {
                  "assignments": [
                    1854
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1854,
                      "name": "netOutcomeTokensSold",
                      "nodeType": "VariableDeclaration",
                      "scope": 1940,
                      "src": "2801:33:7",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                        "typeString": "int256[]"
                      },
                      "typeName": {
                        "baseType": {
                          "id": 1852,
                          "name": "int",
                          "nodeType": "ElementaryTypeName",
                          "src": "2801:3:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 1853,
                        "length": null,
                        "nodeType": "ArrayTypeName",
                        "src": "2801:5:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                          "typeString": "int256[]"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1858,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1856,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1832,
                        "src": "2861:6:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$2374",
                          "typeString": "contract Market"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_contract$_Market_$2374",
                          "typeString": "contract Market"
                        }
                      ],
                      "id": 1855,
                      "name": "getNetOutcomeTokensSold",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2215,
                      "src": "2837:23:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_contract$_Market_$2374_$returns$_t_array$_t_int256_$dyn_memory_ptr_$",
                        "typeString": "function (contract Market) view returns (int256[] memory)"
                      }
                    },
                    "id": 1857,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "2837:31:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                      "typeString": "int256[] memory"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "2801:67:7"
                },
                {
                  "assignments": [
                    1860
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1860,
                      "name": "log2N",
                      "nodeType": "VariableDeclaration",
                      "scope": 1940,
                      "src": "2946:9:7",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 1859,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "2946:3:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1871,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 1866,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1863,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1854,
                            "src": "2968:20:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 1864,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "length",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": null,
                          "src": "2968:27:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "*",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 1865,
                          "name": "ONE",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1691,
                          "src": "2998:3:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "2968:33:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1867,
                            "name": "Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4611,
                            "src": "3003:4:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Math_$4611_$",
                              "typeString": "type(library Math)"
                            }
                          },
                          "id": 1868,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 3366,
                          "src": "3003:19:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$3366_$",
                            "typeString": "type(enum Math.EstimationMode)"
                          }
                        },
                        "id": 1869,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "UpperBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "3003:30:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$3366",
                          "typeString": "enum Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$3366",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1861,
                        "name": "Math",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4611,
                        "src": "2958:4:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_contract$_Math_$4611_$",
                          "typeString": "type(library Math)"
                        }
                      },
                      "id": 1862,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "log2",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 4118,
                      "src": "2958:9:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_delegatecall_view$_t_uint256_$_t_enum$_EstimationMode_$3366_$returns$_t_int256_$",
                        "typeString": "function (uint256,enum Math.EstimationMode) view returns (int256)"
                      }
                    },
                    "id": 1870,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "2958:76:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "2946:88:7"
                },
                {
                  "assignments": [
                    1873
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1873,
                      "name": "funding",
                      "nodeType": "VariableDeclaration",
                      "scope": 1940,
                      "src": "3044:12:7",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1872,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "3044:4:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1877,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1874,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1832,
                        "src": "3059:6:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$2374",
                          "typeString": "contract Market"
                        }
                      },
                      "id": 1875,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "funding",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 2311,
                      "src": "3059:14:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                        "typeString": "function () view external returns (uint256)"
                      }
                    },
                    "id": 1876,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3059:16:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3044:31:7"
                },
                {
                  "assignments": [
                    1879
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1879,
                      "name": "costLevelBefore",
                      "nodeType": "VariableDeclaration",
                      "scope": 1940,
                      "src": "3085:19:7",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 1878,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "3085:3:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1888,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1881,
                        "name": "log2N",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1860,
                        "src": "3121:5:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1882,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1854,
                        "src": "3128:20:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1883,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1873,
                        "src": "3150:7:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1884,
                            "name": "Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4611,
                            "src": "3159:4:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Math_$4611_$",
                              "typeString": "type(library Math)"
                            }
                          },
                          "id": 1885,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 3366,
                          "src": "3159:19:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$3366_$",
                            "typeString": "type(enum Math.EstimationMode)"
                          }
                        },
                        "id": 1886,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "LowerBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "3159:30:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$3366",
                          "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_$3366",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "id": 1880,
                      "name": "calcCostLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2063,
                      "src": "3107:13:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_enum$_EstimationMode_$3366_$returns$_t_int256_$",
                        "typeString": "function (int256,int256[] memory,uint256,enum Math.EstimationMode) view returns (int256)"
                      }
                    },
                    "id": 1887,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3107:83:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3085:105:7"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        },
                        "id": 1894,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 1891,
                              "name": "outcomeTokenCount",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1836,
                              "src": "3287:17:7",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 1890,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "3283:3:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_int256_$",
                              "typeString": "type(int256)"
                            },
                            "typeName": "int"
                          },
                          "id": 1892,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "3283:22:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">=",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "30",
                          "id": 1893,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "3309:1:7",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_0_by_1",
                            "typeString": "int_const 0"
                          },
                          "value": "0"
                        },
                        "src": "3283:27:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 1889,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        9183,
                        9184
                      ],
                      "referencedDeclaration": 9183,
                      "src": "3275:7:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 1895,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3275:36:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1896,
                  "nodeType": "ExpressionStatement",
                  "src": "3275:36:7"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1908,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "baseExpression": {
                        "argumentTypes": null,
                        "id": 1897,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1854,
                        "src": "3321:20:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      "id": 1899,
                      "indexExpression": {
                        "argumentTypes": null,
                        "id": 1898,
                        "name": "outcomeTokenIndex",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1834,
                        "src": "3342:17:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      },
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "nodeType": "IndexAccess",
                      "src": "3321:39:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 1905,
                              "name": "outcomeTokenCount",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1836,
                              "src": "3411:17:7",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 1904,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "3407:3:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_int256_$",
                              "typeString": "type(int256)"
                            },
                            "typeName": "int"
                          },
                          "id": 1906,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "3407:22:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "baseExpression": {
                            "argumentTypes": null,
                            "id": 1900,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1854,
                            "src": "3363:20:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 1902,
                          "indexExpression": {
                            "argumentTypes": null,
                            "id": 1901,
                            "name": "outcomeTokenIndex",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1834,
                            "src": "3384:17:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          },
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "nodeType": "IndexAccess",
                          "src": "3363:39:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 1903,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sub",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 4589,
                        "src": "3363:43:7",
                        "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": 1907,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "3363:67:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "3321:109:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 1909,
                  "nodeType": "ExpressionStatement",
                  "src": "3321:109:7"
                },
                {
                  "assignments": [
                    1911
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1911,
                      "name": "costLevelAfter",
                      "nodeType": "VariableDeclaration",
                      "scope": 1940,
                      "src": "3498:18:7",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 1910,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "3498:3:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1920,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1913,
                        "name": "log2N",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1860,
                        "src": "3533:5:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1914,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1854,
                        "src": "3540:20:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1915,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1873,
                        "src": "3562:7:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1916,
                            "name": "Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4611,
                            "src": "3571:4:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Math_$4611_$",
                              "typeString": "type(library Math)"
                            }
                          },
                          "id": 1917,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 3366,
                          "src": "3571:19:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$3366_$",
                            "typeString": "type(enum Math.EstimationMode)"
                          }
                        },
                        "id": 1918,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "UpperBound",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "3571:30:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$3366",
                          "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_$3366",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "id": 1912,
                      "name": "calcCostLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2063,
                      "src": "3519:13:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_enum$_EstimationMode_$3366_$returns$_t_int256_$",
                        "typeString": "function (int256,int256[] memory,uint256,enum Math.EstimationMode) view returns (int256)"
                      }
                    },
                    "id": 1919,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3519:83:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3498:104:7"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    },
                    "id": 1923,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 1921,
                      "name": "costLevelBefore",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1879,
                      "src": "3668:15:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<=",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 1922,
                      "name": "costLevelAfter",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1911,
                      "src": "3687:14:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "3668:33:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 1928,
                  "nodeType": "IfStatement",
                  "src": "3665:82:7",
                  "trueBody": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1926,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 1924,
                        "name": "costLevelBefore",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1879,
                        "src": "3715:15:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "id": 1925,
                        "name": "costLevelAfter",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1911,
                        "src": "3733:14:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "src": "3715:32:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 1927,
                    "nodeType": "ExpressionStatement",
                    "src": "3715:32:7"
                  }
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1937,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1929,
                      "name": "profit",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1839,
                      "src": "3783:6:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 1936,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "commonType": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            },
                            "id": 1933,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftExpression": {
                              "argumentTypes": null,
                              "id": 1931,
                              "name": "costLevelBefore",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1879,
                              "src": "3797:15:7",
                              "typeDescriptions": {
                                "typeIdentifier": "t_int256",
                                "typeString": "int256"
                              }
                            },
                            "nodeType": "BinaryOperation",
                            "operator": "-",
                            "rightExpression": {
                              "argumentTypes": null,
                              "id": 1932,
                              "name": "costLevelAfter",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1911,
                              "src": "3815:14:7",
                              "typeDescriptions": {
                                "typeIdentifier": "t_int256",
                                "typeString": "int256"
                              }
                            },
                            "src": "3797:32:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          ],
                          "id": 1930,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "lValueRequested": false,
                          "nodeType": "ElementaryTypeNameExpression",
                          "src": "3792:4:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_uint256_$",
                            "typeString": "type(uint256)"
                          },
                          "typeName": "uint"
                        },
                        "id": 1934,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "typeConversion",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "3792:38:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "/",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 1935,
                        "name": "ONE",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1691,
                        "src": "3833:3:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "3792:44:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "3783:53:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 1938,
                  "nodeType": "ExpressionStatement",
                  "src": "3783:53:7"
                }
              ]
            },
            "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": 1940,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": true,
            "modifiers": [],
            "name": "calcProfit",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1837,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1832,
                  "name": "market",
                  "nodeType": "VariableDeclaration",
                  "scope": 1940,
                  "src": "2598:13:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_contract$_Market_$2374",
                    "typeString": "contract Market"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 1831,
                    "name": "Market",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 2374,
                    "src": "2598:6:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_Market_$2374",
                      "typeString": "contract Market"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1834,
                  "name": "outcomeTokenIndex",
                  "nodeType": "VariableDeclaration",
                  "scope": 1940,
                  "src": "2613:23:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint8",
                    "typeString": "uint8"
                  },
                  "typeName": {
                    "id": 1833,
                    "name": "uint8",
                    "nodeType": "ElementaryTypeName",
                    "src": "2613:5:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint8",
                      "typeString": "uint8"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1836,
                  "name": "outcomeTokenCount",
                  "nodeType": "VariableDeclaration",
                  "scope": 1940,
                  "src": "2638:22:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1835,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2638:4:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2597:64:7"
            },
            "payable": false,
            "returnParameters": {
              "id": 1840,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1839,
                  "name": "profit",
                  "nodeType": "VariableDeclaration",
                  "scope": 1940,
                  "src": "2711:11:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1838,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2711:4:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2710:13:7"
            },
            "scope": 2216,
            "src": "2578:1265:7",
            "stateMutability": "view",
            "superFunction": 2241,
            "visibility": "public"
          },
          {
            "body": {
              "id": 2005,
              "nodeType": "Block",
              "src": "4219:687:7",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "id": 1956,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [],
                          "expression": {
                            "argumentTypes": [],
                            "expression": {
                              "argumentTypes": null,
                              "arguments": [],
                              "expression": {
                                "argumentTypes": [],
                                "expression": {
                                  "argumentTypes": null,
                                  "id": 1950,
                                  "name": "market",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1942,
                                  "src": "4237:6:7",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_Market_$2374",
                                    "typeString": "contract Market"
                                  }
                                },
                                "id": 1951,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "eventContract",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 2305,
                                "src": "4237:20:7",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_function_external_view$__$returns$_t_contract$_Event_$1680_$",
                                  "typeString": "function () view external returns (contract Event)"
                                }
                              },
                              "id": 1952,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "functionCall",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "4237:22:7",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_Event_$1680",
                                "typeString": "contract Event"
                              }
                            },
                            "id": 1953,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "getOutcomeCount",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 1619,
                            "src": "4237:38:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_view$__$returns$_t_uint8_$",
                              "typeString": "function () view external returns (uint8)"
                            }
                          },
                          "id": 1954,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "4237:40:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "31",
                          "id": 1955,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "4280:1:7",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_1_by_1",
                            "typeString": "int_const 1"
                          },
                          "value": "1"
                        },
                        "src": "4237:44:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 1949,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        9183,
                        9184
                      ],
                      "referencedDeclaration": 9183,
                      "src": "4229:7:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 1957,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4229:53:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1958,
                  "nodeType": "ExpressionStatement",
                  "src": "4229:53:7"
                },
                {
                  "assignments": [
                    1962
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1962,
                      "name": "netOutcomeTokensSold",
                      "nodeType": "VariableDeclaration",
                      "scope": 2006,
                      "src": "4292:33:7",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                        "typeString": "int256[]"
                      },
                      "typeName": {
                        "baseType": {
                          "id": 1960,
                          "name": "int",
                          "nodeType": "ElementaryTypeName",
                          "src": "4292:3:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 1961,
                        "length": null,
                        "nodeType": "ArrayTypeName",
                        "src": "4292:5:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                          "typeString": "int256[]"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1966,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1964,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1942,
                        "src": "4352:6:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$2374",
                          "typeString": "contract Market"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_contract$_Market_$2374",
                          "typeString": "contract Market"
                        }
                      ],
                      "id": 1963,
                      "name": "getNetOutcomeTokensSold",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2215,
                      "src": "4328:23:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_contract$_Market_$2374_$returns$_t_array$_t_int256_$dyn_memory_ptr_$",
                        "typeString": "function (contract Market) view returns (int256[] memory)"
                      }
                    },
                    "id": 1965,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4328:31:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                      "typeString": "int256[] memory"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4292:67:7"
                },
                {
                  "assignments": [
                    1968
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1968,
                      "name": "logN",
                      "nodeType": "VariableDeclaration",
                      "scope": 2006,
                      "src": "4369:8:7",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": {
                        "id": 1967,
                        "name": "int",
                        "nodeType": "ElementaryTypeName",
                        "src": "4369:3:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1979,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 1974,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1971,
                            "name": "netOutcomeTokensSold",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1962,
                            "src": "4390:20:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                              "typeString": "int256[] memory"
                            }
                          },
                          "id": 1972,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "length",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": null,
                          "src": "4390:27:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "*",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 1973,
                          "name": "ONE",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1691,
                          "src": "4420:3:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "4390:33:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1975,
                            "name": "Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4611,
                            "src": "4425:4:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Math_$4611_$",
                              "typeString": "type(library Math)"
                            }
                          },
                          "id": 1976,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 3366,
                          "src": "4425:19:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$3366_$",
                            "typeString": "type(enum Math.EstimationMode)"
                          }
                        },
                        "id": 1977,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "Midpoint",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "4425:28:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$3366",
                          "typeString": "enum Math.EstimationMode"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_enum$_EstimationMode_$3366",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1969,
                        "name": "Math",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4611,
                        "src": "4380:4:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_contract$_Math_$4611_$",
                          "typeString": "type(library Math)"
                        }
                      },
                      "id": 1970,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "log2",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 4118,
                      "src": "4380:9:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_delegatecall_view$_t_uint256_$_t_enum$_EstimationMode_$3366_$returns$_t_int256_$",
                        "typeString": "function (uint256,enum Math.EstimationMode) view returns (int256)"
                      }
                    },
                    "id": 1978,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4380:74:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4369:85:7"
                },
                {
                  "assignments": [
                    1981
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1981,
                      "name": "funding",
                      "nodeType": "VariableDeclaration",
                      "scope": 2006,
                      "src": "4464:12:7",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1980,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "4464:4:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1985,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1982,
                        "name": "market",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1942,
                        "src": "4479:6:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_Market_$2374",
                          "typeString": "contract Market"
                        }
                      },
                      "id": 1983,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "funding",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 2311,
                      "src": "4479:14:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                        "typeString": "function () view external returns (uint256)"
                      }
                    },
                    "id": 1984,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4479:16:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4464:31:7"
                },
                {
                  "assignments": [
                    1986,
                    null,
                    1987
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1986,
                      "name": "sum",
                      "nodeType": "VariableDeclaration",
                      "scope": 2006,
                      "src": "4731:3:7",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": null,
                      "value": null,
                      "visibility": "internal"
                    },
                    null,
                    {
                      "constant": false,
                      "id": 1987,
                      "name": "outcomeExpTerm",
                      "nodeType": "VariableDeclaration",
                      "scope": 2006,
                      "src": "4738:14:7",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": null,
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1997,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1989,
                        "name": "logN",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1968,
                        "src": "4769:4:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1990,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1962,
                        "src": "4775:20:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1991,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1981,
                        "src": "4797:7:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1992,
                        "name": "outcomeTokenIndex",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1944,
                        "src": "4806:17:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1993,
                            "name": "Math",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4611,
                            "src": "4825:4:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_Math_$4611_$",
                              "typeString": "type(library Math)"
                            }
                          },
                          "id": 1994,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "EstimationMode",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 3366,
                          "src": "4825:19:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_enum$_EstimationMode_$3366_$",
                            "typeString": "type(enum Math.EstimationMode)"
                          }
                        },
                        "id": 1995,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "memberName": "Midpoint",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "4825:28:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$3366",
                          "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_$3366",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "id": 1988,
                      "name": "sumExpOffset",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2173,
                      "src": "4756:12:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_uint8_$_t_enum$_EstimationMode_$3366_$returns$_t_uint256_$_t_int256_$_t_uint256_$",
                        "typeString": "function (int256,int256[] memory,uint256,uint8,enum Math.EstimationMode) view returns (uint256,int256,uint256)"
                      }
                    },
                    "id": 1996,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4756:98:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$_t_uint256_$_t_int256_$_t_uint256_$",
                      "typeString": "tuple(uint256,int256,uint256)"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4726:128:7"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 2003,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 1998,
                      "name": "outcomeExpTerm",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1987,
                      "src": "4871:14:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "/",
                    "rightExpression": {
                      "argumentTypes": null,
                      "components": [
                        {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          "id": 2001,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 1999,
                            "name": "sum",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1986,
                            "src": "4889:3:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "/",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 2000,
                            "name": "ONE",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1691,
                            "src": "4895:3:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "4889:9:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        }
                      ],
                      "id": 2002,
                      "isConstant": false,
                      "isInlineArray": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "nodeType": "TupleExpression",
                      "src": "4888:11:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "4871:28:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "functionReturnParameters": 1948,
                  "id": 2004,
                  "nodeType": "Return",
                  "src": "4864:35:7"
                }
              ]
            },
            "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": 2006,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": true,
            "modifiers": [],
            "name": "calcMarginalPrice",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1945,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1942,
                  "name": "market",
                  "nodeType": "VariableDeclaration",
                  "scope": 2006,
                  "src": "4114:13:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_contract$_Market_$2374",
                    "typeString": "contract Market"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 1941,
                    "name": "Market",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 2374,
                    "src": "4114:6:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_Market_$2374",
                      "typeString": "contract Market"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1944,
                  "name": "outcomeTokenIndex",
                  "nodeType": "VariableDeclaration",
                  "scope": 2006,
                  "src": "4129:23:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint8",
                    "typeString": "uint8"
                  },
                  "typeName": {
                    "id": 1943,
                    "name": "uint8",
                    "nodeType": "ElementaryTypeName",
                    "src": "4129:5:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint8",
                      "typeString": "uint8"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "4113:40:7"
            },
            "payable": false,
            "returnParameters": {
              "id": 1948,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1947,
                  "name": "price",
                  "nodeType": "VariableDeclaration",
                  "scope": 2006,
                  "src": "4203:10:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1946,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "4203:4:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "4202:12:7"
            },
            "scope": 2216,
            "src": "4087:819:7",
            "stateMutability": "view",
            "superFunction": 2250,
            "visibility": "public"
          },
          {
            "body": {
              "id": 2062,
              "nodeType": "Block",
              "src": "5462:503:7",
              "statements": [
                {
                  "assignments": [
                    2020,
                    2021,
                    null
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 2020,
                      "name": "sum",
                      "nodeType": "VariableDeclaration",
                      "scope": 2063,
                      "src": "5706:3:7",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": null,
                      "value": null,
                      "visibility": "internal"
                    },
                    {
                      "constant": false,
                      "id": 2021,
                      "name": "offset",
                      "nodeType": "VariableDeclaration",
                      "scope": 2063,
                      "src": "5711:6:7",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "typeName": null,
                      "value": null,
                      "visibility": "internal"
                    },
                    null
                  ],
                  "id": 2029,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 2023,
                        "name": "logN",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2008,
                        "src": "5736:4:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 2024,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2011,
                        "src": "5742:20:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 2025,
                        "name": "funding",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2013,
                        "src": "5764:7:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "30",
                        "id": 2026,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "5773:1:7",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_0_by_1",
                          "typeString": "int_const 0"
                        },
                        "value": "0"
                      },
                      {
                        "argumentTypes": null,
                        "id": 2027,
                        "name": "estimationMode",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2015,
                        "src": "5776:14:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_enum$_EstimationMode_$3366",
                          "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_$3366",
                          "typeString": "enum Math.EstimationMode"
                        }
                      ],
                      "id": 2022,
                      "name": "sumExpOffset",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2173,
                      "src": "5723:12:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_int256_$_t_array$_t_int256_$dyn_memory_ptr_$_t_uint256_$_t_uint8_$_t_enum$_EstimationMode_$3366_$returns$_t_uint256_$_t_int256_$_t_uint256_$",
                        "typeString": "function (int256,int256[] memory,uint256,uint8,enum Math.EstimationMode) view returns (uint256,int256,uint256)"
                      }
                    },
                    "id": 2028,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "5723:68:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$_t_uint256_$_t_int256_$_t_uint256_$",
                      "typeString": "tuple(uint256,int256,uint256)"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "5701:90:7"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 2036,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 2030,
                      "name": "costLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2018,
                      "src": "5801:9:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "id": 2033,
                          "name": "sum",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 2020,
                          "src": "5823:3:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        {
                          "argumentTypes": null,
                          "id": 2034,
                          "name": "estimationMode",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 2015,
                          "src": "5828:14:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_enum$_EstimationMode_$3366",
                            "typeString": "enum Math.EstimationMode"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          {
                            "typeIdentifier": "t_enum$_EstimationMode_$3366",
                            "typeString": "enum Math.EstimationMode"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "id": 2031,
                          "name": "Math",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 4611,
                          "src": "5813:4:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_contract$_Math_$4611_$",
                            "typeString": "type(library Math)"
                          }
                        },
                        "id": 2032,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "log2",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 4118,
                        "src": "5813:9:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_delegatecall_view$_t_uint256_$_t_enum$_EstimationMode_$3366_$returns$_t_int256_$",
                          "typeString": "function (uint256,enum Math.EstimationMode) view returns (int256)"
                        }
                      },
                      "id": 2035,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "5813:30:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "5801:42:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 2037,
                  "nodeType": "ExpressionStatement",
                  "src": "5801:42:7"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 2043,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 2038,
                      "name": "costLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2018,
                      "src": "5853:9:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "id": 2041,
                          "name": "offset",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 2021,
                          "src": "5879:6:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "id": 2039,
                          "name": "costLevel",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 2018,
                          "src": "5865:9:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 2040,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "add",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 4568,
                        "src": "5865:13:7",
                        "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": 2042,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "5865:21:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "5853:33:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 2044,
                  "nodeType": "ExpressionStatement",
                  "src": "5853:33:7"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 2060,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 2045,
                      "name": "costLevel",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2018,
                      "src": "5896:9:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 2057,
                              "name": "funding",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 2013,
                              "src": "5949:7:7",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 2056,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "5945:3:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_int256_$",
                              "typeString": "type(int256)"
                            },
                            "typeName": "int"
                          },
                          "id": 2058,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "5945:12:7",
                          "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": 2053,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "leftExpression": {
                                "argumentTypes": null,
                                "arguments": [
                                  {
                                    "argumentTypes": null,
                                    "arguments": [
                                      {
                                        "argumentTypes": null,
                                        "id": 2049,
                                        "name": "ONE",
                                        "nodeType": "Identifier",
                                        "overloadedDeclarations": [],
                                        "referencedDeclaration": 1691,
                                        "src": "5927:3:7",
                                        "typeDescriptions": {
                                          "typeIdentifier": "t_uint256",
                                          "typeString": "uint256"
                                        }
                                      }
                                    ],
                                    "expression": {
                                      "argumentTypes": [
                                        {
                                          "typeIdentifier": "t_uint256",
                                          "typeString": "uint256"
                                        }
                                      ],
                                      "id": 2048,
                                      "isConstant": false,
                                      "isLValue": false,
                                      "isPure": true,
                                      "lValueRequested": false,
                                      "nodeType": "ElementaryTypeNameExpression",
                                      "src": "5923:3:7",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_type$_t_int256_$",
                                        "typeString": "type(int256)"
                                      },
                                      "typeName": "int"
                                    },
                                    "id": 2050,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": true,
                                    "kind": "typeConversion",
                                    "lValueRequested": false,
                                    "names": [],
                                    "nodeType": "FunctionCall",
                                    "src": "5923:8:7",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_int256",
                                      "typeString": "int256"
                                    }
                                  }
                                ],
                                "expression": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_int256",
                                      "typeString": "int256"
                                    }
                                  ],
                                  "expression": {
                                    "argumentTypes": null,
                                    "id": 2046,
                                    "name": "costLevel",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 2018,
                                    "src": "5909:9:7",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_int256",
                                      "typeString": "int256"
                                    }
                                  },
                                  "id": 2047,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "mul",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 4610,
                                  "src": "5909:13:7",
                                  "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": 2051,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "5909:23:7",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                }
                              },
                              "nodeType": "BinaryOperation",
                              "operator": "/",
                              "rightExpression": {
                                "argumentTypes": null,
                                "id": 2052,
                                "name": "logN",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 2008,
                                "src": "5935:4:7",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                }
                              },
                              "src": "5909:30:7",
                              "typeDescriptions": {
                                "typeIdentifier": "t_int256",
                                "typeString": "int256"
                              }
                            }
                          ],
                          "id": 2054,
                          "isConstant": false,
                          "isInlineArray": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "nodeType": "TupleExpression",
                          "src": "5908:32:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 2055,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "mul",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 4610,
                        "src": "5908:36:7",
                        "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": 2059,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "5908:50:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "5896:62:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 2061,
                  "nodeType": "ExpressionStatement",
                  "src": "5896:62:7"
                }
              ]
            },
            "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": 2063,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": true,
            "modifiers": [],
            "name": "calcCostLevel",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 2016,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2008,
                  "name": "logN",
                  "nodeType": "VariableDeclaration",
                  "scope": 2063,
                  "src": "5306:8:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_int256",
                    "typeString": "int256"
                  },
                  "typeName": {
                    "id": 2007,
                    "name": "int",
                    "nodeType": "ElementaryTypeName",
                    "src": "5306:3:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 2011,
                  "name": "netOutcomeTokensSold",
                  "nodeType": "VariableDeclaration",
                  "scope": 2063,
                  "src": "5316:26:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                    "typeString": "int256[]"
                  },
                  "typeName": {
                    "baseType": {
                      "id": 2009,
                      "name": "int",
                      "nodeType": "ElementaryTypeName",
                      "src": "5316:3:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 2010,
                    "length": null,
                    "nodeType": "ArrayTypeName",
                    "src": "5316:5:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                      "typeString": "int256[]"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 2013,
                  "name": "funding",
                  "nodeType": "VariableDeclaration",
                  "scope": 2063,
                  "src": "5344:12:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 2012,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "5344:4:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 2015,
                  "name": "estimationMode",
                  "nodeType": "VariableDeclaration",
                  "scope": 2063,
                  "src": "5358:34:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_enum$_EstimationMode_$3366",
                    "typeString": "enum Math.EstimationMode"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 2014,
                    "name": "Math.EstimationMode",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 3366,
                    "src": "5358:19:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_enum$_EstimationMode_$3366",
                      "typeString": "enum Math.EstimationMode"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "5305:88:7"
            },
            "payable": false,
            "returnParameters": {
              "id": 2019,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2018,
                  "name": "costLevel",
                  "nodeType": "VariableDeclaration",
                  "scope": 2063,
                  "src": "5443:13:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_int256",
                    "typeString": "int256"
                  },
                  "typeName": {
                    "id": 2017,
                    "name": "int",
                    "nodeType": "ElementaryTypeName",
                    "src": "5443:3:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "5442:15:7"
            },
            "scope": 2216,
            "src": "5283:682:7",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "private"
          },
          {
            "body": {
              "id": 2172,
              "nodeType": "Block",
              "src": "6738:1349:7",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        "id": 2092,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          },
                          "id": 2086,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 2084,
                            "name": "logN",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2065,
                            "src": "7598:4:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": ">=",
                          "rightExpression": {
                            "argumentTypes": null,
                            "hexValue": "30",
                            "id": 2085,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "7606:1:7",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_0_by_1",
                              "typeString": "int_const 0"
                            },
                            "value": "0"
                          },
                          "src": "7598:9:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "&&",
                        "rightExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          },
                          "id": 2091,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "id": 2088,
                                "name": "funding",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 2070,
                                "src": "7615:7:7",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              ],
                              "id": 2087,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "lValueRequested": false,
                              "nodeType": "ElementaryTypeNameExpression",
                              "src": "7611:3:7",
                              "typeDescriptions": {
                                "typeIdentifier": "t_type$_t_int256_$",
                                "typeString": "type(int256)"
                              },
                              "typeName": "int"
                            },
                            "id": 2089,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "typeConversion",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "7611:12:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": ">=",
                          "rightExpression": {
                            "argumentTypes": null,
                            "hexValue": "30",
                            "id": 2090,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "7627:1:7",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_0_by_1",
                              "typeString": "int_const 0"
                            },
                            "value": "0"
                          },
                          "src": "7611:17:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "src": "7598:30:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 2083,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        9183,
                        9184
                      ],
                      "referencedDeclaration": 9183,
                      "src": "7590:7:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 2093,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "7590:39:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 2094,
                  "nodeType": "ExpressionStatement",
                  "src": "7590:39:7"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 2100,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 2095,
                      "name": "offset",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2079,
                      "src": "7639:6:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "id": 2098,
                          "name": "netOutcomeTokensSold",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 2068,
                          "src": "7657:20:7",
                          "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": 2096,
                          "name": "Math",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 4611,
                          "src": "7648:4:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_contract$_Math_$4611_$",
                            "typeString": "type(library Math)"
                          }
                        },
                        "id": 2097,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "max",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 4344,
                        "src": "7648:8:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_delegatecall_view$_t_array$_t_int256_$dyn_memory_ptr_$returns$_t_int256_$",
                          "typeString": "function (int256[] memory) view returns (int256)"
                        }
                      },
                      "id": 2099,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "7648:30:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "7639:39:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 2101,
                  "nodeType": "ExpressionStatement",
                  "src": "7639:39:7"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 2111,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 2102,
                      "name": "offset",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2079,
                      "src": "7688:6:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      },
                      "id": 2110,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 2105,
                            "name": "logN",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2065,
                            "src": "7708:4:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          ],
                          "expression": {
                            "argumentTypes": null,
                            "id": 2103,
                            "name": "offset",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2079,
                            "src": "7697:6:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "id": 2104,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "mul",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 4610,
                          "src": "7697:10:7",
                          "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": 2106,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "7697:16:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "/",
                      "rightExpression": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 2108,
                            "name": "funding",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2070,
                            "src": "7720:7:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          ],
                          "id": 2107,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "lValueRequested": false,
                          "nodeType": "ElementaryTypeNameExpression",
                          "src": "7716:3:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_int256_$",
                            "typeString": "type(int256)"
                          },
                          "typeName": "int"
                        },
                        "id": 2109,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "typeConversion",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "7716:12:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "src": "7697:31:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "7688:40:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 2112,
                  "nodeType": "ExpressionStatement",
                  "src": "7688:40:7"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 2118,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 2113,
                      "name": "offset",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2079,
                      "src": "7738:6:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "id": 2116,
                          "name": "EXP_LIMIT",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1694,
                          "src": "7758:9:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "id": 2114,
                          "name": "offset",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 2079,
                          "src": "7747:6:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_int256",
                            "typeString": "int256"
                          }
                        },
                        "id": 2115,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sub",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 4589,
                        "src": "7747:10:7",
                        "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": 2117,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "7747:21:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "src": "7738:30:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "id": 2119,
                  "nodeType": "ExpressionStatement",
                  "src": "7738:30:7"
                },
                {
                  "assignments": [],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 2121,
                      "name": "term",
                      "nodeType": "VariableDeclaration",
                      "scope": 2173,
                      "src": "7778:9:7",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 2120,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "7778:4:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 2122,
                  "initialValue": null,
                  "nodeType": "VariableDeclarationStatement",
                  "src": "7778:9:7"
                },
                {
                  "body": {
                    "id": 2170,
                    "nodeType": "Block",
                    "src": "7853:228:7",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 2153,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 2134,
                            "name": "term",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2121,
                            "src": "7867:4:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "arguments": [
                                  {
                                    "argumentTypes": null,
                                    "id": 2149,
                                    "name": "offset",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 2079,
                                    "src": "7939:6:7",
                                    "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": 2146,
                                        "isConstant": false,
                                        "isLValue": false,
                                        "isPure": false,
                                        "lValueRequested": false,
                                        "leftExpression": {
                                          "argumentTypes": null,
                                          "arguments": [
                                            {
                                              "argumentTypes": null,
                                              "id": 2141,
                                              "name": "logN",
                                              "nodeType": "Identifier",
                                              "overloadedDeclarations": [],
                                              "referencedDeclaration": 2065,
                                              "src": "7913:4:7",
                                              "typeDescriptions": {
                                                "typeIdentifier": "t_int256",
                                                "typeString": "int256"
                                              }
                                            }
                                          ],
                                          "expression": {
                                            "argumentTypes": [
                                              {
                                                "typeIdentifier": "t_int256",
                                                "typeString": "int256"
                                              }
                                            ],
                                            "expression": {
                                              "argumentTypes": null,
                                              "baseExpression": {
                                                "argumentTypes": null,
                                                "id": 2137,
                                                "name": "netOutcomeTokensSold",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 2068,
                                                "src": "7885:20:7",
                                                "typeDescriptions": {
                                                  "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                                                  "typeString": "int256[] memory"
                                                }
                                              },
                                              "id": 2139,
                                              "indexExpression": {
                                                "argumentTypes": null,
                                                "id": 2138,
                                                "name": "i",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 2124,
                                                "src": "7906:1:7",
                                                "typeDescriptions": {
                                                  "typeIdentifier": "t_uint8",
                                                  "typeString": "uint8"
                                                }
                                              },
                                              "isConstant": false,
                                              "isLValue": true,
                                              "isPure": false,
                                              "lValueRequested": false,
                                              "nodeType": "IndexAccess",
                                              "src": "7885:23:7",
                                              "typeDescriptions": {
                                                "typeIdentifier": "t_int256",
                                                "typeString": "int256"
                                              }
                                            },
                                            "id": 2140,
                                            "isConstant": false,
                                            "isLValue": false,
                                            "isPure": false,
                                            "lValueRequested": false,
                                            "memberName": "mul",
                                            "nodeType": "MemberAccess",
                                            "referencedDeclaration": 4610,
                                            "src": "7885:27:7",
                                            "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": 2142,
                                          "isConstant": false,
                                          "isLValue": false,
                                          "isPure": false,
                                          "kind": "functionCall",
                                          "lValueRequested": false,
                                          "names": [],
                                          "nodeType": "FunctionCall",
                                          "src": "7885:33:7",
                                          "typeDescriptions": {
                                            "typeIdentifier": "t_int256",
                                            "typeString": "int256"
                                          }
                                        },
                                        "nodeType": "BinaryOperation",
                                        "operator": "/",
                                        "rightExpression": {
                                          "argumentTypes": null,
                                          "arguments": [
                                            {
                                              "argumentTypes": null,
                                              "id": 2144,
                                              "name": "funding",
                                              "nodeType": "Identifier",
                                              "overloadedDeclarations": [],
                                              "referencedDeclaration": 2070,
                                              "src": "7925:7:7",
                                              "typeDescriptions": {
                                                "typeIdentifier": "t_uint256",
                                                "typeString": "uint256"
                                              }
                                            }
                                          ],
                                          "expression": {
                                            "argumentTypes": [
                                              {
                                                "typeIdentifier": "t_uint256",
                                                "typeString": "uint256"
                                              }
                                            ],
                                            "id": 2143,
                                            "isConstant": false,
                                            "isLValue": false,
                                            "isPure": true,
                                            "lValueRequested": false,
                                            "nodeType": "ElementaryTypeNameExpression",
                                            "src": "7921:3:7",
                                            "typeDescriptions": {
                                              "typeIdentifier": "t_type$_t_int256_$",
                                              "typeString": "type(int256)"
                                            },
                                            "typeName": "int"
                                          },
                                          "id": 2145,
                                          "isConstant": false,
                                          "isLValue": false,
                                          "isPure": false,
                                          "kind": "typeConversion",
                                          "lValueRequested": false,
                                          "names": [],
                                          "nodeType": "FunctionCall",
                                          "src": "7921:12:7",
                                          "typeDescriptions": {
                                            "typeIdentifier": "t_int256",
                                            "typeString": "int256"
                                          }
                                        },
                                        "src": "7885:48:7",
                                        "typeDescriptions": {
                                          "typeIdentifier": "t_int256",
                                          "typeString": "int256"
                                        }
                                      }
                                    ],
                                    "id": 2147,
                                    "isConstant": false,
                                    "isInlineArray": false,
                                    "isLValue": false,
                                    "isPure": false,
                                    "lValueRequested": false,
                                    "nodeType": "TupleExpression",
                                    "src": "7884:50:7",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_int256",
                                      "typeString": "int256"
                                    }
                                  },
                                  "id": 2148,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "sub",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 4589,
                                  "src": "7884:54:7",
                                  "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": 2150,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "7884:62:7",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                }
                              },
                              {
                                "argumentTypes": null,
                                "id": 2151,
                                "name": "estimationMode",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 2074,
                                "src": "7948:14:7",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_enum$_EstimationMode_$3366",
                                  "typeString": "enum Math.EstimationMode"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_int256",
                                  "typeString": "int256"
                                },
                                {
                                  "typeIdentifier": "t_enum$_EstimationMode_$3366",
                                  "typeString": "enum Math.EstimationMode"
                                }
                              ],
                              "expression": {
                                "argumentTypes": null,
                                "id": 2135,
                                "name": "Math",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 4611,
                                "src": "7874:4:7",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_type$_t_contract$_Math_$4611_$",
                                  "typeString": "type(library Math)"
                                }
                              },
                              "id": 2136,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "pow2",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 3469,
                              "src": "7874:9:7",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_delegatecall_view$_t_int256_$_t_enum$_EstimationMode_$3366_$returns$_t_uint256_$",
                                "typeString": "function (int256,enum Math.EstimationMode) view returns (uint256)"
                              }
                            },
                            "id": 2152,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "7874:89:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "7867:96:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 2154,
                        "nodeType": "ExpressionStatement",
                        "src": "7867:96:7"
                      },
                      {
                        "condition": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          },
                          "id": 2157,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 2155,
                            "name": "i",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2124,
                            "src": "7981:1:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "==",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 2156,
                            "name": "outcomeIndex",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2072,
                            "src": "7986:12:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          },
                          "src": "7981:17:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "falseBody": null,
                        "id": 2162,
                        "nodeType": "IfStatement",
                        "src": "7977:60:7",
                        "trueBody": {
                          "expression": {
                            "argumentTypes": null,
                            "id": 2160,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftHandSide": {
                              "argumentTypes": null,
                              "id": 2158,
                              "name": "outcomeExpTerm",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 2081,
                              "src": "8016:14:7",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "nodeType": "Assignment",
                            "operator": "=",
                            "rightHandSide": {
                              "argumentTypes": null,
                              "id": 2159,
                              "name": "term",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 2121,
                              "src": "8033:4:7",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "src": "8016:21:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "id": 2161,
                          "nodeType": "ExpressionStatement",
                          "src": "8016:21:7"
                        }
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 2168,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 2163,
                            "name": "sum",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2077,
                            "src": "8051:3:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "id": 2166,
                                "name": "term",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 2121,
                                "src": "8065:4:7",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              ],
                              "expression": {
                                "argumentTypes": null,
                                "id": 2164,
                                "name": "sum",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 2077,
                                "src": "8057:3:7",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "id": 2165,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "add",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 4417,
                              "src": "8057:7:7",
                              "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": 2167,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "8057:13:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "8051:19:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 2169,
                        "nodeType": "ExpressionStatement",
                        "src": "8051:19:7"
                      }
                    ]
                  },
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 2130,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 2127,
                      "name": "i",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2124,
                      "src": "7815:1:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint8",
                        "typeString": "uint8"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 2128,
                        "name": "netOutcomeTokensSold",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2068,
                        "src": "7819:20:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      "id": 2129,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "length",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": null,
                      "src": "7819:27:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "7815:31:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "id": 2171,
                  "initializationExpression": {
                    "assignments": [
                      2124
                    ],
                    "declarations": [
                      {
                        "constant": false,
                        "id": 2124,
                        "name": "i",
                        "nodeType": "VariableDeclaration",
                        "scope": 2173,
                        "src": "7802:7:7",
                        "stateVariable": false,
                        "storageLocation": "default",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "typeName": {
                          "id": 2123,
                          "name": "uint8",
                          "nodeType": "ElementaryTypeName",
                          "src": "7802:5:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "value": null,
                        "visibility": "internal"
                      }
                    ],
                    "id": 2126,
                    "initialValue": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 2125,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "7812:1:7",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "nodeType": "VariableDeclarationStatement",
                    "src": "7802:11:7"
                  },
                  "loopExpression": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 2132,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "nodeType": "UnaryOperation",
                      "operator": "++",
                      "prefix": false,
                      "src": "7848:3:7",
                      "subExpression": {
                        "argumentTypes": null,
                        "id": 2131,
                        "name": "i",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2124,
                        "src": "7848:1:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      },
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint8",
                        "typeString": "uint8"
                      }
                    },
                    "id": 2133,
                    "nodeType": "ExpressionStatement",
                    "src": "7848:3:7"
                  },
                  "nodeType": "ForStatement",
                  "src": "7797:284:7"
                }
              ]
            },
            "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": 2173,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": true,
            "modifiers": [],
            "name": "sumExpOffset",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 2075,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2065,
                  "name": "logN",
                  "nodeType": "VariableDeclaration",
                  "scope": 2173,
                  "src": "6533:8:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_int256",
                    "typeString": "int256"
                  },
                  "typeName": {
                    "id": 2064,
                    "name": "int",
                    "nodeType": "ElementaryTypeName",
                    "src": "6533:3:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 2068,
                  "name": "netOutcomeTokensSold",
                  "nodeType": "VariableDeclaration",
                  "scope": 2173,
                  "src": "6543:26:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                    "typeString": "int256[]"
                  },
                  "typeName": {
                    "baseType": {
                      "id": 2066,
                      "name": "int",
                      "nodeType": "ElementaryTypeName",
                      "src": "6543:3:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 2067,
                    "length": null,
                    "nodeType": "ArrayTypeName",
                    "src": "6543:5:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                      "typeString": "int256[]"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 2070,
                  "name": "funding",
                  "nodeType": "VariableDeclaration",
                  "scope": 2173,
                  "src": "6571:12:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 2069,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "6571:4:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 2072,
                  "name": "outcomeIndex",
                  "nodeType": "VariableDeclaration",
                  "scope": 2173,
                  "src": "6585:18:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint8",
                    "typeString": "uint8"
                  },
                  "typeName": {
                    "id": 2071,
                    "name": "uint8",
                    "nodeType": "ElementaryTypeName",
                    "src": "6585:5:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint8",
                      "typeString": "uint8"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 2074,
                  "name": "estimationMode",
                  "nodeType": "VariableDeclaration",
                  "scope": 2173,
                  "src": "6605:34:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_enum$_EstimationMode_$3366",
                    "typeString": "enum Math.EstimationMode"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 2073,
                    "name": "Math.EstimationMode",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 3366,
                    "src": "6605:19:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_enum$_EstimationMode_$3366",
                      "typeString": "enum Math.EstimationMode"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6532:108:7"
            },
            "payable": false,
            "returnParameters": {
              "id": 2082,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2077,
                  "name": "sum",
                  "nodeType": "VariableDeclaration",
                  "scope": 2173,
                  "src": "6691:8:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 2076,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "6691:4:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 2079,
                  "name": "offset",
                  "nodeType": "VariableDeclaration",
                  "scope": 2173,
                  "src": "6701:10:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_int256",
                    "typeString": "int256"
                  },
                  "typeName": {
                    "id": 2078,
                    "name": "int",
                    "nodeType": "ElementaryTypeName",
                    "src": "6701:3:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_int256",
                      "typeString": "int256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 2081,
                  "name": "outcomeExpTerm",
                  "nodeType": "VariableDeclaration",
                  "scope": 2173,
                  "src": "6713:19:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 2080,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "6713:4:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6690:43:7"
            },
            "scope": 2216,
            "src": "6511:1576:7",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "private"
          },
          {
            "body": {
              "id": 2214,
              "nodeType": "Block",
              "src": "8687:195:7",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 2191,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 2181,
                      "name": "quantities",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2179,
                      "src": "8697:10:7",
                      "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": 2185,
                                  "name": "market",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 2175,
                                  "src": "8720:6:7",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_Market_$2374",
                                    "typeString": "contract Market"
                                  }
                                },
                                "id": 2186,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "eventContract",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 2305,
                                "src": "8720:20:7",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_function_external_view$__$returns$_t_contract$_Event_$1680_$",
                                  "typeString": "function () view external returns (contract Event)"
                                }
                              },
                              "id": 2187,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "functionCall",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "8720:22:7",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_Event_$1680",
                                "typeString": "contract Event"
                              }
                            },
                            "id": 2188,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "getOutcomeCount",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 1619,
                            "src": "8720:38:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_view$__$returns$_t_uint8_$",
                              "typeString": "function () view external returns (uint8)"
                            }
                          },
                          "id": 2189,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "8720:40:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        ],
                        "id": 2184,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "lValueRequested": false,
                        "nodeType": "NewExpression",
                        "src": "8710:9:7",
                        "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": 2182,
                            "name": "int",
                            "nodeType": "ElementaryTypeName",
                            "src": "8714:3:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_int256",
                              "typeString": "int256"
                            }
                          },
                          "id": 2183,
                          "length": null,
                          "nodeType": "ArrayTypeName",
                          "src": "8714:5:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                            "typeString": "int256[]"
                          }
                        }
                      },
                      "id": 2190,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "8710:51:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_array$_t_int256_$dyn_memory",
                        "typeString": "int256[] memory"
                      }
                    },
                    "src": "8697:64:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                      "typeString": "int256[] memory"
                    }
                  },
                  "id": 2192,
                  "nodeType": "ExpressionStatement",
                  "src": "8697:64:7"
                },
                {
                  "body": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 2211,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "baseExpression": {
                          "argumentTypes": null,
                          "id": 2204,
                          "name": "quantities",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 2179,
                          "src": "8829:10:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                            "typeString": "int256[] memory"
                          }
                        },
                        "id": 2206,
                        "indexExpression": {
                          "argumentTypes": null,
                          "id": 2205,
                          "name": "i",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 2194,
                          "src": "8840:1:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "isConstant": false,
                        "isLValue": true,
                        "isPure": false,
                        "lValueRequested": true,
                        "nodeType": "IndexAccess",
                        "src": "8829:13:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 2209,
                            "name": "i",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2194,
                            "src": "8873:1:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_uint8",
                              "typeString": "uint8"
                            }
                          ],
                          "expression": {
                            "argumentTypes": null,
                            "id": 2207,
                            "name": "market",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2175,
                            "src": "8845:6:7",
                            "typeDescriptions": {
                              "typeIdentifier": "t_contract$_Market_$2374",
                              "typeString": "contract Market"
                            }
                          },
                          "id": 2208,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "netOutcomeTokensSold",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 2314,
                          "src": "8845:27:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_external_view$_t_uint256_$returns$_t_int256_$",
                            "typeString": "function (uint256) view external returns (int256)"
                          }
                        },
                        "id": 2210,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "8845:30:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_int256",
                          "typeString": "int256"
                        }
                      },
                      "src": "8829:46:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 2212,
                    "nodeType": "ExpressionStatement",
                    "src": "8829:46:7"
                  },
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 2200,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 2197,
                      "name": "i",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2194,
                      "src": "8789:1:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint8",
                        "typeString": "uint8"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 2198,
                        "name": "quantities",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2179,
                        "src": "8793:10:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                          "typeString": "int256[] memory"
                        }
                      },
                      "id": 2199,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "length",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": null,
                      "src": "8793:17:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "8789:21:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "id": 2213,
                  "initializationExpression": {
                    "assignments": [
                      2194
                    ],
                    "declarations": [
                      {
                        "constant": false,
                        "id": 2194,
                        "name": "i",
                        "nodeType": "VariableDeclaration",
                        "scope": 2215,
                        "src": "8776:7:7",
                        "stateVariable": false,
                        "storageLocation": "default",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        },
                        "typeName": {
                          "id": 2193,
                          "name": "uint8",
                          "nodeType": "ElementaryTypeName",
                          "src": "8776:5:7",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint8",
                            "typeString": "uint8"
                          }
                        },
                        "value": null,
                        "visibility": "internal"
                      }
                    ],
                    "id": 2196,
                    "initialValue": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 2195,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "8786:1:7",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "nodeType": "VariableDeclarationStatement",
                    "src": "8776:11:7"
                  },
                  "loopExpression": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 2202,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "nodeType": "UnaryOperation",
                      "operator": "++",
                      "prefix": false,
                      "src": "8812:3:7",
                      "subExpression": {
                        "argumentTypes": null,
                        "id": 2201,
                        "name": "i",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2194,
                        "src": "8812:1:7",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      },
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint8",
                        "typeString": "uint8"
                      }
                    },
                    "id": 2203,
                    "nodeType": "ExpressionStatement",
                    "src": "8812:3:7"
                  },
                  "nodeType": "ForStatement",
                  "src": "8771:104:7"
                }
              ]
            },
            "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": 2215,
            "implemented": true,
            "isConstructor": false,
            "isDeclaredConst": true,
            "modifiers": [],
            "name": "getNetOutcomeTokensSold",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 2176,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2175,
                  "name": "market",
                  "nodeType": "VariableDeclaration",
                  "scope": 2215,
                  "src": "8600:13:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_contract$_Market_$2374",
                    "typeString": "contract Market"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 2174,
                    "name": "Market",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 2374,
                    "src": "8600:6:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_Market_$2374",
                      "typeString": "contract Market"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8599:15:7"
            },
            "payable": false,
            "returnParameters": {
              "id": 2180,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2179,
                  "name": "quantities",
                  "nodeType": "VariableDeclaration",
                  "scope": 2215,
                  "src": "8665:16:7",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_array$_t_int256_$dyn_memory_ptr",
                    "typeString": "int256[]"
                  },
                  "typeName": {
                    "baseType": {
                      "id": 2177,
                      "name": "int",
                      "nodeType": "ElementaryTypeName",
                      "src": "8665:3:7",
                      "typeDescriptions": {
                        "typeIdentifier": "t_int256",
                        "typeString": "int256"
                      }
                    },
                    "id": 2178,
                    "length": null,
                    "nodeType": "ArrayTypeName",
                    "src": "8665:5:7",
                    "typeDescriptions": {
                      "typeIdentifier": "t_array$_t_int256_$dyn_storage_ptr",
                      "typeString": "int256[]"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8664:18:7"
            },
            "scope": 2216,
            "src": "8567:315:7",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "private"
          }
        ],
        "scope": 2217,
        "src": "251:8633:7"
      }
    ],
    "src": "0:8885:7"
  },
  "compiler": {
    "name": "solc",
    "version": "0.4.25+commit.59dbf8f1.Emscripten.clang"
  },
  "networks": {},
  "schemaVersion": "3.0.0-beta.1",
  "updatedAt": "2018-10-27T21:23:29.094Z"
}