{
  "contractName": "MarketCollateralPool",
  "abi": [
    {
      "constant": true,
      "inputs": [
        {
          "name": "",
          "type": "address"
        }
      ],
      "name": "feesCollectedByTokenAddress",
      "outputs": [
        {
          "name": "",
          "type": "uint256"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [],
      "name": "mktToken",
      "outputs": [
        {
          "name": "",
          "type": "address"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": false,
      "inputs": [],
      "name": "renounceOwnership",
      "outputs": [],
      "payable": false,
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [],
      "name": "owner",
      "outputs": [
        {
          "name": "",
          "type": "address"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [],
      "name": "isOwner",
      "outputs": [
        {
          "name": "",
          "type": "bool"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [
        {
          "name": "",
          "type": "address"
        }
      ],
      "name": "contractAddressToCollateralPoolBalance",
      "outputs": [
        {
          "name": "",
          "type": "uint256"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [],
      "name": "marketContractRegistry",
      "outputs": [
        {
          "name": "",
          "type": "address"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": false,
      "inputs": [
        {
          "name": "newOwner",
          "type": "address"
        }
      ],
      "name": "transferOwnership",
      "outputs": [],
      "payable": false,
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "name": "marketContractRegistryAddress",
          "type": "address"
        },
        {
          "name": "mktTokenAddress",
          "type": "address"
        }
      ],
      "payable": false,
      "stateMutability": "nonpayable",
      "type": "constructor"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "name": "marketContract",
          "type": "address"
        },
        {
          "indexed": true,
          "name": "user",
          "type": "address"
        },
        {
          "indexed": true,
          "name": "feeToken",
          "type": "address"
        },
        {
          "indexed": false,
          "name": "qtyMinted",
          "type": "uint256"
        },
        {
          "indexed": false,
          "name": "collateralLocked",
          "type": "uint256"
        },
        {
          "indexed": false,
          "name": "feesPaid",
          "type": "uint256"
        }
      ],
      "name": "TokensMinted",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "name": "marketContract",
          "type": "address"
        },
        {
          "indexed": true,
          "name": "user",
          "type": "address"
        },
        {
          "indexed": false,
          "name": "longQtyRedeemed",
          "type": "uint256"
        },
        {
          "indexed": false,
          "name": "shortQtyRedeemed",
          "type": "uint256"
        },
        {
          "indexed": false,
          "name": "collateralUnlocked",
          "type": "uint256"
        }
      ],
      "name": "TokensRedeemed",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "name": "previousOwner",
          "type": "address"
        },
        {
          "indexed": true,
          "name": "newOwner",
          "type": "address"
        }
      ],
      "name": "OwnershipTransferred",
      "type": "event"
    },
    {
      "constant": false,
      "inputs": [
        {
          "name": "marketContractAddress",
          "type": "address"
        },
        {
          "name": "qtyToMint",
          "type": "uint256"
        },
        {
          "name": "isAttemptToPayInMKT",
          "type": "bool"
        }
      ],
      "name": "mintPositionTokens",
      "outputs": [],
      "payable": false,
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "constant": false,
      "inputs": [
        {
          "name": "marketContractAddress",
          "type": "address"
        },
        {
          "name": "qtyToRedeem",
          "type": "uint256"
        }
      ],
      "name": "redeemPositionTokens",
      "outputs": [],
      "payable": false,
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "constant": false,
      "inputs": [
        {
          "name": "marketContractAddress",
          "type": "address"
        },
        {
          "name": "longQtyToRedeem",
          "type": "uint256"
        },
        {
          "name": "shortQtyToRedeem",
          "type": "uint256"
        }
      ],
      "name": "settleAndClose",
      "outputs": [],
      "payable": false,
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "constant": false,
      "inputs": [
        {
          "name": "feeTokenAddress",
          "type": "address"
        },
        {
          "name": "feeRecipient",
          "type": "address"
        }
      ],
      "name": "withdrawFees",
      "outputs": [],
      "payable": false,
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "constant": false,
      "inputs": [
        {
          "name": "mktTokenAddress",
          "type": "address"
        }
      ],
      "name": "setMKTTokenAddress",
      "outputs": [],
      "payable": false,
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "constant": false,
      "inputs": [
        {
          "name": "marketContractRegistryAddress",
          "type": "address"
        }
      ],
      "name": "setMarketContractRegistryAddress",
      "outputs": [],
      "payable": false,
      "stateMutability": "nonpayable",
      "type": "function"
    }
  ],
  "metadata": "{\"compiler\":{\"version\":\"0.5.2+commit.1df8f40c\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":false,\"inputs\":[{\"name\":\"marketContractAddress\",\"type\":\"address\"},{\"name\":\"longQtyToRedeem\",\"type\":\"uint256\"},{\"name\":\"shortQtyToRedeem\",\"type\":\"uint256\"}],\"name\":\"settleAndClose\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"marketContractAddress\",\"type\":\"address\"},{\"name\":\"qtyToMint\",\"type\":\"uint256\"},{\"name\":\"isAttemptToPayInMKT\",\"type\":\"bool\"}],\"name\":\"mintPositionTokens\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"}],\"name\":\"feesCollectedByTokenAddress\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"mktTokenAddress\",\"type\":\"address\"}],\"name\":\"setMKTTokenAddress\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"mktToken\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"isOwner\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"marketContractAddress\",\"type\":\"address\"},{\"name\":\"qtyToRedeem\",\"type\":\"uint256\"}],\"name\":\"redeemPositionTokens\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"}],\"name\":\"contractAddressToCollateralPoolBalance\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"marketContractRegistry\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"marketContractRegistryAddress\",\"type\":\"address\"}],\"name\":\"setMarketContractRegistryAddress\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"feeTokenAddress\",\"type\":\"address\"},{\"name\":\"feeRecipient\",\"type\":\"address\"}],\"name\":\"withdrawFees\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"marketContractRegistryAddress\",\"type\":\"address\"},{\"name\":\"mktTokenAddress\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"marketContract\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"user\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"feeToken\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"qtyMinted\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"collateralLocked\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"feesPaid\",\"type\":\"uint256\"}],\"name\":\"TokensMinted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"marketContract\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"longQtyRedeemed\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"shortQtyRedeemed\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"collateralUnlocked\",\"type\":\"uint256\"}],\"name\":\"TokensRedeemed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"}],\"devdoc\":{\"author\":\"Phil Elsasser <phil@marketprotocol.io>\",\"methods\":{\"isOwner()\":{\"return\":\"true if `msg.sender` is the owner of the contract.\"},\"mintPositionTokens(address,uint256,bool)\":{\"params\":{\"isAttemptToPayInMKT\":\"if possible, attempt to pay fee's in MKT rather than collateral tokens\",\"marketContractAddress\":\"address of the market contract to redeem tokens for\",\"qtyToMint\":\"quantity of long / short tokens to mint.\"}},\"owner()\":{\"return\":\"the address of the owner.\"},\"redeemPositionTokens(address,uint256)\":{\"params\":{\"marketContractAddress\":\"address of the market contract to redeem tokens for\",\"qtyToRedeem\":\"quantity of long / short tokens to redeem.\"}},\"renounceOwnership()\":{\"details\":\"Allows the current owner to relinquish control of the contract. It will not be possible to call the functions with the `onlyOwner` modifier anymore.\"},\"setMKTTokenAddress(address)\":{\"details\":\"allows the owner to update the mkt token address in use for fees\",\"params\":{\"mktTokenAddress\":\"address of new MKT token\"}},\"setMarketContractRegistryAddress(address)\":{\"details\":\"allows the owner to update the mkt token address in use for fees\",\"params\":{\"marketContractRegistryAddress\":\"address of new contract registry\"}},\"settleAndClose(address,uint256,uint256)\":{\"params\":{\"longQtyToRedeem\":\"qty to redeem of long tokens\",\"marketContractAddress\":\"address of the MARKET Contract being traded.\",\"shortQtyToRedeem\":\"qty to redeem of short tokens\"}},\"transferOwnership(address)\":{\"details\":\"Allows the current owner to transfer control of the contract to a newOwner.\",\"params\":{\"newOwner\":\"The address to transfer ownership to.\"}},\"withdrawFees(address,address)\":{\"details\":\"allows the owner to remove the fees paid into this contract for minting\",\"params\":{\"feeRecipient\":\"- Recipient address of fees\",\"feeTokenAddress\":\"- address of the erc20 token fees have been paid in\"}}},\"title\":\"MarketCollateralPool\"},\"userdoc\":{\"methods\":{\"mintPositionTokens(address,uint256,bool)\":{\"notice\":\"Called by a user that would like to mint a new set of long and short token for a specified market contract.  This will transfer and lock the correct amount of collateral into the pool and issue them the requested qty of long and short tokens\"},\"redeemPositionTokens(address,uint256)\":{\"notice\":\"Called by a user that currently holds both short and long position tokens and would like to redeem them for their collateral.\"},\"renounceOwnership()\":{\"notice\":\"Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"}},\"notice\":\"This collateral pool houses all of the collateral for all market contracts currently in circulation. This pool facilitates locking of collateral and minting / redemption of position tokens for that collateral.\"}},\"settings\":{\"compilationTarget\":{\"/home/travis/build/MARKETProtocol/MARKETProtocol/contracts/MarketCollateralPool.sol\":\"MarketCollateralPool\"},\"evmVersion\":\"byzantium\",\"libraries\":{},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/home/travis/build/MARKETProtocol/MARKETProtocol/contracts/MarketCollateralPool.sol\":{\"keccak256\":\"0x0b6355543b299eada55a3faab81952dd24a4e95c07e1e6c1c1c7b97d574dce97\",\"urls\":[\"bzzr://cff209086041171eedb7d8f8f84220f1e5301538c472b52d46b549fb9aff43e9\"]},\"/home/travis/build/MARKETProtocol/MARKETProtocol/contracts/MarketContract.sol\":{\"keccak256\":\"0xb1e837f17c189abdf5e9f699be068f07d45618df3a6adece0d4a2f78879428be\",\"urls\":[\"bzzr://51deacf4c6dfbabc62017f9c407ce55002c3906e16b810ad9033eb8df6633f3f\"]},\"/home/travis/build/MARKETProtocol/MARKETProtocol/contracts/MarketContractRegistryInterface.sol\":{\"keccak256\":\"0x08e535462791c92fa3d508921433678237c3cc6b6e64c856c5edfb6653ce09e2\",\"urls\":[\"bzzr://790793564fa36ee77a10986b601db861f80b7ab82c51b8a4d7a41b97523eea45\"]},\"/home/travis/build/MARKETProtocol/MARKETProtocol/contracts/libraries/MathLib.sol\":{\"keccak256\":\"0x28e7ed8ea6e300e4d0dbf0e63b2414ba71bc1596b7142690c1bf4016e313abee\",\"urls\":[\"bzzr://6bb2953cfd96de25e614d77e8a4793a8bc11f9eae0d2d0fb9614488bca7e1754\"]},\"/home/travis/build/MARKETProtocol/MARKETProtocol/contracts/libraries/StringLib.sol\":{\"keccak256\":\"0xa1d7d76809600493055bdb04692a775fde71142a921f994568beb1fdb42a92c7\",\"urls\":[\"bzzr://dcc475bb3f21803b7d5fba4157f07c5fc642ea9a976eb118bac74a1cb0b91f4f\"]},\"/home/travis/build/MARKETProtocol/MARKETProtocol/contracts/tokens/PositionToken.sol\":{\"keccak256\":\"0xa1b6986878eedeb5014268a4257b0918473c348f6f39c1558bced6dcf0268f01\",\"urls\":[\"bzzr://9af5870494a1ac62401d92713525808c132a34e11f4dc6aa73f4174ada0201e8\"]},\"openzeppelin-solidity/contracts/math/SafeMath.sol\":{\"keccak256\":\"0xc2a200a877c4a9b2475c246c54ffecc69ffde3e11af83319c63c2dc5458bac80\",\"urls\":[\"bzzr://c8876e2c39b60f155d748d71d715c8f3903fae5a405ac599adcb6ad2f9a583f9\"]},\"openzeppelin-solidity/contracts/ownership/Ownable.sol\":{\"keccak256\":\"0xcb16adc00dcf0d75e0bdf94379f4d5a6d74dca7c74e4183b94e15721159f8a30\",\"urls\":[\"bzzr://b81e03f7203cd628cfed19255911a04a05e8670d248afb48a7b067dd03b4ff55\"]},\"openzeppelin-solidity/contracts/token/ERC20/ERC20.sol\":{\"keccak256\":\"0x3dceb7e4aa237a56111c13f77d7efadeceda7271d62bfac94ac79afab7c1f411\",\"urls\":[\"bzzr://2f34152a5bec385352002c31bc89f5e9935f628f1923ccea45c2281e0084a4db\"]},\"openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x59e7df16169a498cb8837963b2f5461d88e63bd1eb6c7d58b814d76b84ccbe61\",\"urls\":[\"bzzr://e572c9c4e02e37349702451bf3b5dcbbc86a19da5a51695b5b3e1bfe1e7825dc\"]},\"openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol\":{\"keccak256\":\"0x7230c14d692aff375e4931d60ef73ac8a79c28b9e54c200a377b7dc613c81a78\",\"urls\":[\"bzzr://3538d7da02640c67ac909e84d90e799439f3b3195cf0de39fd173dacd5a98311\"]},\"openzeppelin-solidity/contracts/utils/Address.sol\":{\"keccak256\":\"0xea16b9933153c647242ba50b3e494fb133063d49f1fa81823f35a8c28754142e\",\"urls\":[\"bzzr://aa2b2eb534149525e194341c01cadf666668a1b7d679a268d10e23570a7e26b1\"]}},\"version\":1}",
  "bytecode": "0x608060405234801561001057600080fd5b50604051604080612c388339810180604052604081101561003057600080fd5b810190808051906020019092919080519060200190929190505050336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a381600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050612a9e8061019a6000396000f3fe608060405234801561001057600080fd5b5060043610610107576000357c0100000000000000000000000000000000000000000000000000000000900480638f32d59b116100a9578063ceaaa91511610083578063ceaaa915146103c0578063e5ac125f1461040a578063f25552781461044e578063f2fde38b146104b257610107565b80638f32d59b146102f8578063c1b214111461031a578063ca7b1b4d1461036857610107565b806354de298e116100e557806354de298e146102165780636b4a8ae01461025a578063715018a6146102a45780638da5cb5b146102ae57610107565b806310198cb71461010c578063125bb6a9146101645780631f2af365146101be575b600080fd5b6101626004803603606081101561012257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291905050506104f6565b005b6101bc6004803603606081101561017a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803515159060200190929190505050610d3f565b005b610200600480360360208110156101d457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611856565b6040518082815260200191505060405180910390f35b6102586004803603602081101561022c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061186e565b005b61026261194d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102ac611973565b005b6102b6611a45565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610300611a6e565b604051808215151515815260200191505060405180910390f35b6103666004803603604081101561033057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611ac5565b005b6103aa6004803603602081101561037e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061202d565b6040518082815260200191505060405180910390f35b6103c8612045565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61044c6004803603602081101561042057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061206b565b005b6104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061214a565b005b6104f4600480360360208110156104c857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612334565b005b82600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad23de63826040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156105b257600080fd5b505afa1580156105c6573d6000803e3d6000fd5b505050506040513d60208110156105dc57600080fd5b81019080805190602001909291905050501515610661576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f436f6e7472616374206973206e6f742077686974656c6973746564000000000081525060200191505060405180910390fd5b60008490508073ffffffffffffffffffffffffffffffffffffffff1663bd220dae6040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b1580156106c857600080fd5b505afa1580156106dc573d6000803e3d6000fd5b505050506040513d60208110156106f257600080fd5b8101908080519060200190929190505050151561075a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612a1b6025913960400191505060405180910390fd5b600084111561081f578073ffffffffffffffffffffffffffffffffffffffff1663c25c444485336040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050600060405180830381600087803b15801561080657600080fd5b505af115801561081a573d6000803e3d6000fd5b505050505b60008311156108e4578073ffffffffffffffffffffffffffffffffffffffff16636d35946784336040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050600060405180830381600087803b1580156108cb57600080fd5b505af11580156108df573d6000803e3d6000fd5b505050505b6000610b648273ffffffffffffffffffffffffffffffffffffffff1663c32b1dfa6040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b15801561094b57600080fd5b505afa15801561095f573d6000803e3d6000fd5b505050506040513d602081101561097557600080fd5b81019080805190602001909291905050508373ffffffffffffffffffffffffffffffffffffffff1663b5471dee6040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b1580156109e857600080fd5b505afa1580156109fc573d6000803e3d6000fd5b505050506040513d6020811015610a1257600080fd5b81019080805190602001909291905050508473ffffffffffffffffffffffffffffffffffffffff1663ca361d676040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b158015610a8557600080fd5b505afa158015610a99573d6000803e3d6000fd5b505050506040513d6020811015610aaf57600080fd5b810190808051906020019092919050505088888773ffffffffffffffffffffffffffffffffffffffff1663f348e8b26040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b158015610b2457600080fd5b505afa158015610b38573d6000803e3d6000fd5b505050506040513d6020811015610b4e57600080fd5b8101908080519060200190929190505050612353565b9050610bb881600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123ef90919063ffffffff16565b600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610cc233828473ffffffffffffffffffffffffffffffffffffffff1663323bb7756040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b158015610c6257600080fd5b505afa158015610c76573d6000803e3d6000fd5b505050506040513d6020811015610c8c57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff166124749092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167f75b6073dcb0773119aa05ecb4a5866ef9323b20a5b4e795d5a436532deeae4f787878560405180848152602001838152602001828152602001935050505060405180910390a3505050505050565b82600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad23de63826040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610dfb57600080fd5b505afa158015610e0f573d6000803e3d6000fd5b505050506040513d6020811015610e2557600080fd5b81019080805190602001909291905050501515610eaa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f436f6e7472616374206973206e6f742077686974656c6973746564000000000081525060200191505060405180910390fd5b60008490508073ffffffffffffffffffffffffffffffffffffffff16633270bb5b6040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b158015610f1157600080fd5b505afa158015610f25573d6000803e3d6000fd5b505050506040513d6020811015610f3b57600080fd5b8101908080519060200190929190505050151515610fc1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f436f6e747261637420697320616c726561647920736574746c6564000000000081525060200191505060405180910390fd5b60008173ffffffffffffffffffffffffffffffffffffffff1663323bb7756040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b15801561102557600080fd5b505afa158015611039573d6000803e3d6000fd5b505050506040513d602081101561104f57600080fd5b81019080805190602001909291905050509050600061110a868473ffffffffffffffffffffffffffffffffffffffff1663e158e02d6040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b1580156110ca57600080fd5b505afa1580156110de573d6000803e3d6000fd5b505050506040513d60208110156110f457600080fd5b8101908080519060200190929190505050612561565b905060008580156111b8575060008473ffffffffffffffffffffffffffffffffffffffff1663db3fa7716040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b15801561117a57600080fd5b505afa15801561118e573d6000803e3d6000fd5b505050506040513d60208110156111a457600080fd5b810190808051906020019092919050505014155b80611312575085158015611269575060008473ffffffffffffffffffffffffffffffffffffffff1663db3fa7716040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b15801561122b57600080fd5b505afa15801561123f573d6000803e3d6000fd5b505050506040513d602081101561125557600080fd5b810190808051906020019092919050505014155b8015611311575060008473ffffffffffffffffffffffffffffffffffffffff16635c7c70596040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b1580156112d457600080fd5b505afa1580156112e8573d6000803e3d6000fd5b505050506040513d60208110156112fe57600080fd5b8101908080519060200190929190505050145b5b905060008060008315611443576113c58a8873ffffffffffffffffffffffffffffffffffffffff1663db3fa7716040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b15801561138557600080fd5b505afa158015611399573d6000803e3d6000fd5b505050506040513d60208110156113af57600080fd5b8101908080519060200190929190505050612561565b9250849150600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905061143e333085600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612608909392919063ffffffff16565b611504565b6114e98a8873ffffffffffffffffffffffffffffffffffffffff16635c7c70596040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b1580156114a957600080fd5b505afa1580156114bd573d6000803e3d6000fd5b505050506040513d60208110156114d357600080fd5b8101908080519060200190929190505050612561565b92506114fe838661272a90919063ffffffff16565b91508590505b6115cd3330848a73ffffffffffffffffffffffffffffffffffffffff1663323bb7756040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b15801561156c57600080fd5b505afa158015611580573d6000803e3d6000fd5b505050506040513d602081101561159657600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff16612608909392919063ffffffff16565b60008314151561166d5761162983600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461272a90919063ffffffff16565b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6116bf85600360008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461272a90919063ffffffff16565b600360008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508673ffffffffffffffffffffffffffffffffffffffff1663cabd58348b336040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050600060405180830381600087803b1580156117a557600080fd5b505af11580156117b9573d6000803e3d6000fd5b505050508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff168c73ffffffffffffffffffffffffffffffffffffffff167f1e551210cd64464d2a2d2b08a00acc53863e5e3c0b7c943a9a8fe11d71a71ae28d898860405180848152602001838152602001828152602001935050505060405180910390a45050505050505050505050565b60046020528060005260406000206000915090505481565b611876611a6e565b151561188157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611909576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806129f76024913960400191505060405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61197b611a6e565b151561198657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b81600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad23de63826040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611b8157600080fd5b505afa158015611b95573d6000803e3d6000fd5b505050506040513d6020811015611bab57600080fd5b81019080805190602001909291905050501515611c30576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f436f6e7472616374206973206e6f742077686974656c6973746564000000000081525060200191505060405180910390fd5b60008390508073ffffffffffffffffffffffffffffffffffffffff1663c25c444484336040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050600060405180830381600087803b158015611cd857600080fd5b505af1158015611cec573d6000803e3d6000fd5b505050508073ffffffffffffffffffffffffffffffffffffffff16636d35946784336040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050600060405180830381600087803b158015611d9357600080fd5b505af1158015611da7573d6000803e3d6000fd5b505050506000611e53848373ffffffffffffffffffffffffffffffffffffffff1663e158e02d6040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b158015611e1357600080fd5b505afa158015611e27573d6000803e3d6000fd5b505050506040513d6020811015611e3d57600080fd5b8101908080519060200190929190505050612561565b9050611ea781600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123ef90919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611fb133828473ffffffffffffffffffffffffffffffffffffffff1663323bb7756040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b158015611f5157600080fd5b505afa158015611f65573d6000803e3d6000fd5b505050506040513d6020811015611f7b57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff166124749092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f75b6073dcb0773119aa05ecb4a5866ef9323b20a5b4e795d5a436532deeae4f786878560405180848152602001838152602001828152602001935050505060405180910390a35050505050565b60036020528060005260406000206000915090505481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b612073611a6e565b151561207e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515612106576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526033815260200180612a406033913960400191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b612152611a6e565b151561215d57600080fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000811415151561221a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4e6f206665657320617661696c61626c6520666f72207769746864726177616c81525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156122bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f43616e6e6f742073656e64206665657320746f206e756c6c206164647265737381525060200191505060405180910390fd5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232f82828573ffffffffffffffffffffffffffffffffffffffff166124749092919063ffffffff16565b505050565b61233c611a6e565b151561234757600080fd5b612350816127b4565b50565b600080600090506000808611156123995788841115156123765760009050612383565b612380848a6123ef565b90505b6123966123908288612561565b88612561565b91505b60008511156123e05787841015156123b457600090506123c1565b6123be88856123ef565b90505b6123dd826123d86123d28489612561565b8a612561565b61272a565b91505b81925050509695505050505050565b6000828211151515612469576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4d6174684c69623a207375627472616374696f6e206f766572666c6f7700000081525060200191505060405180910390fd5b818303905092915050565b61255c838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb90507c0100000000000000000000000000000000000000000000000000000000028484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506128ae565b505050565b6000808314156125745760009050612602565b6000828402905082848281151561258757fe5b041415156125fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4d6174684c69623a206d756c7469706c69636174696f6e206f766572666c6f7781525060200191505060405180910390fd5b809150505b92915050565b612724848573ffffffffffffffffffffffffffffffffffffffff166323b872dd90507c010000000000000000000000000000000000000000000000000000000002858585604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506128ae565b50505050565b60008082840190508381101515156127aa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4d6174684c69623a206164646974696f6e206f766572666c6f7700000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156127f057600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6128cd8273ffffffffffffffffffffffffffffffffffffffff166129e3565b15156128d857600080fd5b600060608373ffffffffffffffffffffffffffffffffffffffff16836040518082805190602001908083835b6020831015156129295780518252602082019150602081019050602083039250612904565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461298b576040519150601f19603f3d011682016040523d82523d6000602084013e612990565b606091505b50915091508115156129a157600080fd5b6000815111156129dd578080602001905160208110156129c057600080fd5b810190808051906020019092919050505015156129dc57600080fd5b5b50505050565b600080823b90506000811191505091905056fe43616e6e6f7420736574204d4b5420546f6b656e204164647265737320546f204e756c6c436f6e7472616374206973206e6f74207061737420736574746c656d656e742064656c617943616e6e6f7420736574204d61726b657420436f6e7472616374205265676973747279204164647265737320546f204e756c6ca165627a7a72305820ae41a3d9f5676f4fd3607763d723cb29e1d2f155fc88ab36f87976ff74b86c7c0029",
  "deployedBytecode": "0x608060405234801561001057600080fd5b5060043610610107576000357c0100000000000000000000000000000000000000000000000000000000900480638f32d59b116100a9578063ceaaa91511610083578063ceaaa915146103c0578063e5ac125f1461040a578063f25552781461044e578063f2fde38b146104b257610107565b80638f32d59b146102f8578063c1b214111461031a578063ca7b1b4d1461036857610107565b806354de298e116100e557806354de298e146102165780636b4a8ae01461025a578063715018a6146102a45780638da5cb5b146102ae57610107565b806310198cb71461010c578063125bb6a9146101645780631f2af365146101be575b600080fd5b6101626004803603606081101561012257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291905050506104f6565b005b6101bc6004803603606081101561017a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803515159060200190929190505050610d3f565b005b610200600480360360208110156101d457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611856565b6040518082815260200191505060405180910390f35b6102586004803603602081101561022c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061186e565b005b61026261194d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102ac611973565b005b6102b6611a45565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610300611a6e565b604051808215151515815260200191505060405180910390f35b6103666004803603604081101561033057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611ac5565b005b6103aa6004803603602081101561037e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061202d565b6040518082815260200191505060405180910390f35b6103c8612045565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61044c6004803603602081101561042057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061206b565b005b6104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061214a565b005b6104f4600480360360208110156104c857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612334565b005b82600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad23de63826040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156105b257600080fd5b505afa1580156105c6573d6000803e3d6000fd5b505050506040513d60208110156105dc57600080fd5b81019080805190602001909291905050501515610661576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f436f6e7472616374206973206e6f742077686974656c6973746564000000000081525060200191505060405180910390fd5b60008490508073ffffffffffffffffffffffffffffffffffffffff1663bd220dae6040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b1580156106c857600080fd5b505afa1580156106dc573d6000803e3d6000fd5b505050506040513d60208110156106f257600080fd5b8101908080519060200190929190505050151561075a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612a1b6025913960400191505060405180910390fd5b600084111561081f578073ffffffffffffffffffffffffffffffffffffffff1663c25c444485336040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050600060405180830381600087803b15801561080657600080fd5b505af115801561081a573d6000803e3d6000fd5b505050505b60008311156108e4578073ffffffffffffffffffffffffffffffffffffffff16636d35946784336040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050600060405180830381600087803b1580156108cb57600080fd5b505af11580156108df573d6000803e3d6000fd5b505050505b6000610b648273ffffffffffffffffffffffffffffffffffffffff1663c32b1dfa6040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b15801561094b57600080fd5b505afa15801561095f573d6000803e3d6000fd5b505050506040513d602081101561097557600080fd5b81019080805190602001909291905050508373ffffffffffffffffffffffffffffffffffffffff1663b5471dee6040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b1580156109e857600080fd5b505afa1580156109fc573d6000803e3d6000fd5b505050506040513d6020811015610a1257600080fd5b81019080805190602001909291905050508473ffffffffffffffffffffffffffffffffffffffff1663ca361d676040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b158015610a8557600080fd5b505afa158015610a99573d6000803e3d6000fd5b505050506040513d6020811015610aaf57600080fd5b810190808051906020019092919050505088888773ffffffffffffffffffffffffffffffffffffffff1663f348e8b26040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b158015610b2457600080fd5b505afa158015610b38573d6000803e3d6000fd5b505050506040513d6020811015610b4e57600080fd5b8101908080519060200190929190505050612353565b9050610bb881600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123ef90919063ffffffff16565b600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610cc233828473ffffffffffffffffffffffffffffffffffffffff1663323bb7756040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b158015610c6257600080fd5b505afa158015610c76573d6000803e3d6000fd5b505050506040513d6020811015610c8c57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff166124749092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167f75b6073dcb0773119aa05ecb4a5866ef9323b20a5b4e795d5a436532deeae4f787878560405180848152602001838152602001828152602001935050505060405180910390a3505050505050565b82600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad23de63826040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610dfb57600080fd5b505afa158015610e0f573d6000803e3d6000fd5b505050506040513d6020811015610e2557600080fd5b81019080805190602001909291905050501515610eaa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f436f6e7472616374206973206e6f742077686974656c6973746564000000000081525060200191505060405180910390fd5b60008490508073ffffffffffffffffffffffffffffffffffffffff16633270bb5b6040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b158015610f1157600080fd5b505afa158015610f25573d6000803e3d6000fd5b505050506040513d6020811015610f3b57600080fd5b8101908080519060200190929190505050151515610fc1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f436f6e747261637420697320616c726561647920736574746c6564000000000081525060200191505060405180910390fd5b60008173ffffffffffffffffffffffffffffffffffffffff1663323bb7756040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b15801561102557600080fd5b505afa158015611039573d6000803e3d6000fd5b505050506040513d602081101561104f57600080fd5b81019080805190602001909291905050509050600061110a868473ffffffffffffffffffffffffffffffffffffffff1663e158e02d6040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b1580156110ca57600080fd5b505afa1580156110de573d6000803e3d6000fd5b505050506040513d60208110156110f457600080fd5b8101908080519060200190929190505050612561565b905060008580156111b8575060008473ffffffffffffffffffffffffffffffffffffffff1663db3fa7716040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b15801561117a57600080fd5b505afa15801561118e573d6000803e3d6000fd5b505050506040513d60208110156111a457600080fd5b810190808051906020019092919050505014155b80611312575085158015611269575060008473ffffffffffffffffffffffffffffffffffffffff1663db3fa7716040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b15801561122b57600080fd5b505afa15801561123f573d6000803e3d6000fd5b505050506040513d602081101561125557600080fd5b810190808051906020019092919050505014155b8015611311575060008473ffffffffffffffffffffffffffffffffffffffff16635c7c70596040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b1580156112d457600080fd5b505afa1580156112e8573d6000803e3d6000fd5b505050506040513d60208110156112fe57600080fd5b8101908080519060200190929190505050145b5b905060008060008315611443576113c58a8873ffffffffffffffffffffffffffffffffffffffff1663db3fa7716040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b15801561138557600080fd5b505afa158015611399573d6000803e3d6000fd5b505050506040513d60208110156113af57600080fd5b8101908080519060200190929190505050612561565b9250849150600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905061143e333085600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612608909392919063ffffffff16565b611504565b6114e98a8873ffffffffffffffffffffffffffffffffffffffff16635c7c70596040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b1580156114a957600080fd5b505afa1580156114bd573d6000803e3d6000fd5b505050506040513d60208110156114d357600080fd5b8101908080519060200190929190505050612561565b92506114fe838661272a90919063ffffffff16565b91508590505b6115cd3330848a73ffffffffffffffffffffffffffffffffffffffff1663323bb7756040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b15801561156c57600080fd5b505afa158015611580573d6000803e3d6000fd5b505050506040513d602081101561159657600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff16612608909392919063ffffffff16565b60008314151561166d5761162983600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461272a90919063ffffffff16565b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6116bf85600360008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461272a90919063ffffffff16565b600360008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508673ffffffffffffffffffffffffffffffffffffffff1663cabd58348b336040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050600060405180830381600087803b1580156117a557600080fd5b505af11580156117b9573d6000803e3d6000fd5b505050508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff168c73ffffffffffffffffffffffffffffffffffffffff167f1e551210cd64464d2a2d2b08a00acc53863e5e3c0b7c943a9a8fe11d71a71ae28d898860405180848152602001838152602001828152602001935050505060405180910390a45050505050505050505050565b60046020528060005260406000206000915090505481565b611876611a6e565b151561188157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611909576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806129f76024913960400191505060405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61197b611a6e565b151561198657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b81600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad23de63826040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611b8157600080fd5b505afa158015611b95573d6000803e3d6000fd5b505050506040513d6020811015611bab57600080fd5b81019080805190602001909291905050501515611c30576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f436f6e7472616374206973206e6f742077686974656c6973746564000000000081525060200191505060405180910390fd5b60008390508073ffffffffffffffffffffffffffffffffffffffff1663c25c444484336040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050600060405180830381600087803b158015611cd857600080fd5b505af1158015611cec573d6000803e3d6000fd5b505050508073ffffffffffffffffffffffffffffffffffffffff16636d35946784336040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050600060405180830381600087803b158015611d9357600080fd5b505af1158015611da7573d6000803e3d6000fd5b505050506000611e53848373ffffffffffffffffffffffffffffffffffffffff1663e158e02d6040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b158015611e1357600080fd5b505afa158015611e27573d6000803e3d6000fd5b505050506040513d6020811015611e3d57600080fd5b8101908080519060200190929190505050612561565b9050611ea781600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123ef90919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611fb133828473ffffffffffffffffffffffffffffffffffffffff1663323bb7756040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b158015611f5157600080fd5b505afa158015611f65573d6000803e3d6000fd5b505050506040513d6020811015611f7b57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff166124749092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f75b6073dcb0773119aa05ecb4a5866ef9323b20a5b4e795d5a436532deeae4f786878560405180848152602001838152602001828152602001935050505060405180910390a35050505050565b60036020528060005260406000206000915090505481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b612073611a6e565b151561207e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515612106576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526033815260200180612a406033913960400191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b612152611a6e565b151561215d57600080fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000811415151561221a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4e6f206665657320617661696c61626c6520666f72207769746864726177616c81525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156122bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f43616e6e6f742073656e64206665657320746f206e756c6c206164647265737381525060200191505060405180910390fd5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232f82828573ffffffffffffffffffffffffffffffffffffffff166124749092919063ffffffff16565b505050565b61233c611a6e565b151561234757600080fd5b612350816127b4565b50565b600080600090506000808611156123995788841115156123765760009050612383565b612380848a6123ef565b90505b6123966123908288612561565b88612561565b91505b60008511156123e05787841015156123b457600090506123c1565b6123be88856123ef565b90505b6123dd826123d86123d28489612561565b8a612561565b61272a565b91505b81925050509695505050505050565b6000828211151515612469576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4d6174684c69623a207375627472616374696f6e206f766572666c6f7700000081525060200191505060405180910390fd5b818303905092915050565b61255c838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb90507c0100000000000000000000000000000000000000000000000000000000028484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506128ae565b505050565b6000808314156125745760009050612602565b6000828402905082848281151561258757fe5b041415156125fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4d6174684c69623a206d756c7469706c69636174696f6e206f766572666c6f7781525060200191505060405180910390fd5b809150505b92915050565b612724848573ffffffffffffffffffffffffffffffffffffffff166323b872dd90507c010000000000000000000000000000000000000000000000000000000002858585604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506128ae565b50505050565b60008082840190508381101515156127aa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4d6174684c69623a206164646974696f6e206f766572666c6f7700000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156127f057600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6128cd8273ffffffffffffffffffffffffffffffffffffffff166129e3565b15156128d857600080fd5b600060608373ffffffffffffffffffffffffffffffffffffffff16836040518082805190602001908083835b6020831015156129295780518252602082019150602081019050602083039250612904565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461298b576040519150601f19603f3d011682016040523d82523d6000602084013e612990565b606091505b50915091508115156129a157600080fd5b6000815111156129dd578080602001905160208110156129c057600080fd5b810190808051906020019092919050505015156129dc57600080fd5b5b50505050565b600080823b90506000811191505091905056fe43616e6e6f7420736574204d4b5420546f6b656e204164647265737320546f204e756c6c436f6e7472616374206973206e6f74207061737420736574746c656d656e742064656c617943616e6e6f7420736574204d61726b657420436f6e7472616374205265676973747279204164647265737320546f204e756c6ca165627a7a72305820ae41a3d9f5676f4fd3607763d723cb29e1d2f155fc88ab36f87976ff74b86c7c0029",
  "sourceMap": "1290:10520:0:-;;;2113:190;8:9:-1;5:2;;;30:1;27;20:12;5:2;2113:190:0;;;;;;;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;2113:190:0;;;;;;;;;;;;;;;;;;;;;;;;;524:10:17;515:6;;:19;;;;;;;;;;;;;;;;;;582:6;;;;;;;;;;;549:40;;578:1;549:40;;;;;;;;;;;;2231:29:0;2206:22;;:54;;;;;;;;;;;;;;;;;;2281:15;2270:8;;:26;;;;;;;;;;;;;;;;;;2113:190;;1290:10520;;;;;;",
  "deployedSourceMap": "1290:10520:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1290:10520:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8016:1562;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;8016:1562:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;2926:3182;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;2926:3182:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;1636:59;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1636:59:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;10466:201;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;10466:201:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;1467:23;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;1423:137:17;;;:::i;:::-;;659:77;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;979:90;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;6455:1088:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;6455:1088:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;1497:70;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1497:70:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1424:37;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;10829:286;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;10829:286:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;9808:518;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;9808:518:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;1731:107:17;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1731:107:17;;;;;;;;;;;;;;;;;;;:::i;:::-;;8016:1562:0;8178:21;11670:22;;;;;;;;;;;11638:76;;;11715:21;11638:99;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;11638:99:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;11638:99:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;11638:99:0;;;;;;;;;;;;;;;;11617:173;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8215:29;8262:21;8215:69;;8302:14;:36;;;:38;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;8302:38:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;8302:38:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;8302:38:0;;;;;;;;;;;;;;;;8294:88;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8454:1;8436:15;:19;8432:109;;;8471:14;:30;;;8502:15;8519:10;8471:59;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;8471:59:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;8471:59:0;;;;8432:109;8574:1;8555:16;:20;8551:112;;;8591:14;:31;;;8623:16;8641:10;8591:61;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;8591:61:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;8591:61:0;;;;8551:112;8751:23;8777:277;8826:14;:26;;;:28;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;8826:28:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;8826:28:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;8826:28:0;;;;;;;;;;;;;;;;8868:14;:24;;;:26;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;8868:26:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;8868:26:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;8868:26:0;;;;;;;;;;;;;;;;8908:14;:29;;;:31;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;8908:31:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;8908:31:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;8908:31:0;;;;;;;;;;;;;;;;8953:15;8982:16;9012:14;:30;;;:32;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;9012:32:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;9012:32:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;9012:32:0;;;;;;;;;;;;;;;;8777:35;:277::i;:::-;8751:303;;9129:112;9222:18;9129:38;:83;9181:21;9129:83;;;;;;;;;;;;;;;;:92;;:112;;;;:::i;:::-;9065:38;:61;9104:21;9065:61;;;;;;;;;;;;;;;:176;;;;9288:93;9350:10;9362:18;9294:14;:39;;;:41;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;9294:41:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;9294:41:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;9294:41:0;;;;;;;;;;;;;;;;9288:61;;;;:93;;;;;:::i;:::-;9460:10;9397:174;;9425:21;9397:174;;;9484:15;9513:16;9543:18;9397:174;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11800:1;;8016:1562;;;;:::o;2926:3182::-;3089:21;11670:22;;;;;;;;;;;11638:76;;;11715:21;11638:99;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;11638:99:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;11638:99:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;11638:99:0;;;;;;;;;;;;;;;;11617:173;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3127:29;3174:21;3127:69;;3215:14;:24;;;:26;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3215:26:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3215:26:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3215:26:0;;;;;;;;;;;;;;;;3214:27;3206:67;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3284:30;3317:14;:39;;;:41;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3317:41:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3317:41:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3317:41:0;;;;;;;;;;;;;;;;3284:74;;3368:21;3392:65;3409:9;3420:14;:34;;;:36;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3420:36:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3420:36:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3420:36:0;;;;;;;;;;;;;;;;3392:16;:65::i;:::-;3368:89;;3751:19;3774;:79;;;;;3852:1;3809:14;:37;;;:39;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3809:39:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3809:39:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3809:39:0;;;;;;;;;;;;;;;;:44;;3774:79;3773:246;;;;3872:19;3871:20;:80;;;;;3950:1;3907:14;:37;;;:39;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3907:39:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3907:39:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3907:39:0;;;;;;;;;;;;;;;;:44;;3871:80;:147;;;;;4017:1;3967:14;:44;;;:46;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3967:46:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3967:46:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3967:46:0;;;;;;;;;;;;;;;;:51;3871:147;3773:246;3751:268;;4030:14;4054:39;4103:16;4133:14;4129:899;;;4210:68;4227:9;4238:14;:37;;;:39;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4238:39:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4238:39:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;4238:39:0;;;;;;;;;;;;;;;;4210:16;:68::i;:::-;4198:80;;4329:16;4292:53;;4370:8;;;;;;;;;;;4359:19;;4567:70;4600:10;4620:4;4627:9;4573:8;;;;;;;;;;;4567:32;;;;:70;;;;;;:::i;:::-;4129:899;;;4742:75;4759:9;4770:14;:44;;;:46;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4770:46:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4770:46:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;4770:46:0;;;;;;;;;;;;;;;;4742:16;:75::i;:::-;4730:87;;4868:31;4889:9;4868:16;:20;;:31;;;;:::i;:::-;4831:68;;4924:22;4913:33;;4129:899;5204:128;5270:10;5290:4;5297:34;5210:14;:39;;;:41;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5210:41:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5210:41:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;5210:41:0;;;;;;;;;;;;;;;;5204:65;;;;:128;;;;;;:::i;:::-;5360:1;5347:9;:14;;5343:187;;;5467:52;5509:9;5467:27;:37;5495:8;5467:37;;;;;;;;;;;;;;;;:41;;:52;;;;:::i;:::-;5427:27;:37;5455:8;5427:37;;;;;;;;;;;;;;;:92;;;;5343:187;5658:105;5746:16;5658:38;:83;5710:21;5658:83;;;;;;;;;;;;;;;;:87;;:105;;;;:::i;:::-;5594:38;:61;5633:21;5594:61;;;;;;;;;;;;;;;:169;;;;5850:14;:33;;;5884:9;5895:10;5850:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5850:56:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5850:56:0;;;;6007:8;5922:179;;5983:10;5922:179;;5948:21;5922:179;;;6029:9;6052:16;6082:9;5922:179;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11800:1;;;;;;;2926:3182;;;;:::o;1636:59::-;;;;;;;;;;;;;;;;;:::o;10466:201::-;863:9:17;:7;:9::i;:::-;855:18;;;;;;;;10581:1:0;10554:29;;:15;:29;;;;10546:78;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10645:15;10634:8;;:26;;;;;;;;;;;;;;;;;;10466:201;:::o;1467:23::-;;;;;;;;;;;;;:::o;1423:137:17:-;863:9;:7;:9::i;:::-;855:18;;;;;;;;1521:1;1484:40;;1505:6;;;;;;;;;;;1484:40;;;;;;;;;;;;1551:1;1534:6;;:19;;;;;;;;;;;;;;;;;;1423:137::o;659:77::-;697:7;723:6;;;;;;;;;;;716:13;;659:77;:::o;979:90::-;1019:4;1056:6;;;;;;;;;;;1042:20;;:10;:20;;;1035:27;;979:90;:::o;6455:1088:0:-;6588:21;11670:22;;;;;;;;;;;11638:76;;;11715:21;11638:99;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;11638:99:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;11638:99:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;11638:99:0;;;;;;;;;;;;;;;;11617:173;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6625:29;6672:21;6625:69;;6705:14;:30;;;6736:11;6749:10;6705:55;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;6705:55:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;6705:55:0;;;;6770:14;:31;;;6802:11;6815:10;6770:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;6770:56:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;6770:56:0;;;;6903:23;6929:67;6946:11;6959:14;:34;;;:36;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;6959:36:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;6959:36:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;6959:36:0;;;;;;;;;;;;;;;;6929:16;:67::i;:::-;6903:93;;7070:112;7163:18;7070:38;:83;7122:21;7070:83;;;;;;;;;;;;;;;;:92;;:112;;;;:::i;:::-;7006:38;:61;7045:21;7006:61;;;;;;;;;;;;;;;:176;;;;7262:93;7324:10;7336:18;7268:14;:39;;;:41;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;7268:41:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;7268:41:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;7268:41:0;;;;;;;;;;;;;;;;7262:61;;;;:93;;;;;:::i;:::-;7434:10;7371:165;;7399:21;7371:165;;;7458:11;7483;7508:18;7371:165;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11800:1;;6455:1088;;;:::o;1497:70::-;;;;;;;;;;;;;;;;;:::o;1424:37::-;;;;;;;;;;;;;:::o;10829:286::-;863:9:17;:7;:9::i;:::-;855:18;;;;;;;;10986:1:0;10945:43;;:29;:43;;;;10937:107;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11079:29;11054:22;;:54;;;;;;;;;;;;;;;;;;10829:286;:::o;9808:518::-;863:9:17;:7;:9::i;:::-;855:18;;;;;;;;9904:31:0;9938:27;:44;9966:15;9938:44;;;;;;;;;;;;;;;;9904:78;;10030:1;10000:26;:31;;9992:76;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10110:1;10086:26;;:12;:26;;;;10078:71;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10206:1;10159:27;:44;10187:15;10159:44;;;;;;;;;;;;;;;:48;;;;10242:77;10278:12;10292:26;10248:15;10242:35;;;;:77;;;;;:::i;:::-;883:1:17;9808:518:0;;:::o;1731:107:17:-;863:9;:7;:9::i;:::-;855:18;;;;;;;;1803:28;1822:8;1803:18;:28::i;:::-;1731:107;:::o;2121:998:5:-;2328:4;2348:21;2372:1;2348:25;;2383:12;2419:1;2409:7;:11;2405:321;;;2499:10;2490:5;:19;;2486:145;;;2539:1;2529:11;;2486:145;;;2589:27;2598:5;2605:10;2589:8;:27::i;:::-;2579:37;;2486:145;2663:52;2672:26;2681:7;2690;2672:8;:26::i;:::-;2701:13;2663:8;:52::i;:::-;2644:71;;2405:321;2751:1;2740:8;:12;2736:344;;;2833:8;2824:5;:17;;2820:141;;;2871:1;2861:11;;2820:141;;;2921:25;2930:8;2940:5;2921:8;:25::i;:::-;2911:35;;2820:141;2993:76;2997:16;3015:53;3024:27;3033:7;3042:8;3024;:27::i;:::-;3054:13;3015:8;:53::i;:::-;2993:3;:76::i;:::-;2974:95;;2736:344;3096:16;3089:23;;;;2121:998;;;;;;;;:::o;1328:159::-;1391:7;1423:1;1418;:6;;1410:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1479:1;1475;:5;1468:12;;1328:159;;;;:::o;662:174:21:-;744:85;763:5;793;:14;;;:23;;;;818:2;822:5;770:58;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;770:58:21;;;;;;;38:4:-1;29:7;25:18;67:10;61:17;96:58;199:8;192:4;186;182:15;179:29;167:10;160:49;0:215;;;770:58:21;744:18;:85::i;:::-;662:174;;;:::o;867:246:5:-;930:7;958:1;953;:6;949:45;;;982:1;975:8;;;;949:45;1004:9;1020:1;1016;:5;1004:17;;1048:1;1043;1039;:5;;;;;;;;:10;1031:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1105:1;1098:8;;;867:246;;;;;:::o;842:202:21:-;942:95;961:5;991;:18;;;:27;;;;1020:4;1026:2;1030:5;968:68;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;968:68:21;;;;;;;38:4:-1;29:7;25:18;67:10;61:17;96:58;199:8;192:4;186;182:15;179:29;167:10;160:49;0:215;;;968:68:21;942:18;:95::i;:::-;842:202;;;;:::o;1493:174:5:-;1551:7;1570:9;1586:1;1582;:5;1570:17;;1610:1;1605;:6;;1597:45;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1659:1;1652:8;;;1493:174;;;;:::o;1982:183:17:-;2075:1;2055:22;;:8;:22;;;;2047:31;;;;;;;;2122:8;2093:38;;2114:6;;;;;;;;;;;2093:38;;;;;;;;;;;;2150:8;2141:6;;:17;;;;;;;;;;;;;;;;;;1982:183;:::o;2487:869:21:-;3030:27;3038:5;3030:25;;;:27::i;:::-;3022:36;;;;;;;;3129:12;3143:23;3178:5;3170:19;;3190:4;3170:25;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;3170:25:21;;;;;;;;;;;;;;;;;;;;;;;;14:1:-1;21;16:31;;;;75:4;69:11;64:16;;144:4;140:9;133:4;115:16;111:27;107:43;104:1;100:51;94:4;87:65;169:16;166:1;159:27;225:16;222:1;215:4;212:1;208:12;193:49;7:242;;16:31;36:4;31:9;;7:242;;3128:67:21;;;;3213:7;3205:16;;;;;;;;3256:1;3236:10;:17;:21;3232:118;;;3319:10;3308:30;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3308:30:21;;;;;;;;;;;;;;;;3300:39;;;;;;;;3232:118;2487:869;;;;:::o;463:616:22:-;523:4;539:12;1038:7;1026:20;1018:28;;1071:1;1064:4;:8;1057:15;;;463:616;;;:::o",
  "source": "/*\n    Copyright 2017-2019 Phillip A. Elsasser\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n*/\n\npragma solidity 0.5.2;\n\nimport \"./libraries/MathLib.sol\";\nimport \"./MarketContract.sol\";\nimport \"./tokens/PositionToken.sol\";\nimport \"./MarketContractRegistryInterface.sol\";\n\nimport \"openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol\";\nimport \"openzeppelin-solidity/contracts/token/ERC20/ERC20.sol\";\nimport \"openzeppelin-solidity/contracts/ownership/Ownable.sol\";\n\n\n/// @title MarketCollateralPool\n/// @notice This collateral pool houses all of the collateral for all market contracts currently in circulation.\n/// This pool facilitates locking of collateral and minting / redemption of position tokens for that collateral.\n/// @author Phil Elsasser <phil@marketprotocol.io>\ncontract MarketCollateralPool is Ownable {\n    using MathLib for uint;\n    using MathLib for int;\n    using SafeERC20 for ERC20;\n\n    address public marketContractRegistry;\n    address public mktToken;\n\n    mapping(address => uint) public contractAddressToCollateralPoolBalance;                 // current balance of all collateral committed\n    mapping(address => uint) public feesCollectedByTokenAddress;\n\n    event TokensMinted(\n        address indexed marketContract,\n        address indexed user,\n        address indexed feeToken,\n        uint qtyMinted,\n        uint collateralLocked,\n        uint feesPaid\n    );\n\n    event TokensRedeemed (\n        address indexed marketContract,\n        address indexed user,\n        uint longQtyRedeemed,\n        uint shortQtyRedeemed,\n        uint collateralUnlocked\n    );\n\n    constructor(address marketContractRegistryAddress, address mktTokenAddress) public {\n        marketContractRegistry = marketContractRegistryAddress;\n        mktToken = mktTokenAddress;\n    }\n\n    /*\n    // EXTERNAL METHODS\n    */\n\n    /// @notice Called by a user that would like to mint a new set of long and short token for a specified\n    /// market contract.  This will transfer and lock the correct amount of collateral into the pool\n    /// and issue them the requested qty of long and short tokens\n    /// @param marketContractAddress            address of the market contract to redeem tokens for\n    /// @param qtyToMint                      quantity of long / short tokens to mint.\n    /// @param isAttemptToPayInMKT            if possible, attempt to pay fee's in MKT rather than collateral tokens\n    function mintPositionTokens(\n        address marketContractAddress,\n        uint qtyToMint,\n        bool isAttemptToPayInMKT\n    ) external onlyWhiteListedAddress(marketContractAddress)\n    {\n\n        MarketContract marketContract = MarketContract(marketContractAddress);\n        require(!marketContract.isSettled(), \"Contract is already settled\");\n\n        address collateralTokenAddress = marketContract.COLLATERAL_TOKEN_ADDRESS();\n        uint neededCollateral = MathLib.multiply(qtyToMint, marketContract.COLLATERAL_PER_UNIT());\n        // the user has selected to pay fees in MKT and those fees are non zero (allowed) OR\n        // the user has selected not to pay fees in MKT, BUT the collateral token fees are disabled (0) AND the\n        // MKT fees are enabled (non zero).  (If both are zero, no fee exists)\n        bool isPayFeesInMKT = (isAttemptToPayInMKT &&\n            marketContract.MKT_TOKEN_FEE_PER_UNIT() != 0) ||\n            (!isAttemptToPayInMKT &&\n            marketContract.MKT_TOKEN_FEE_PER_UNIT() != 0 &&\n            marketContract.COLLATERAL_TOKEN_FEE_PER_UNIT() == 0);\n\n        uint feeAmount;\n        uint totalCollateralTokenTransferAmount;\n        address feeToken;\n        if (isPayFeesInMKT) { // fees are able to be paid in MKT\n            feeAmount = MathLib.multiply(qtyToMint, marketContract.MKT_TOKEN_FEE_PER_UNIT());\n            totalCollateralTokenTransferAmount = neededCollateral;\n            feeToken = mktToken;\n\n            // EXTERNAL CALL - transferring ERC20 tokens from sender to this contract.  User must have called\n            // ERC20.approve in order for this call to succeed.\n            ERC20(mktToken).safeTransferFrom(msg.sender, address(this), feeAmount);\n        } else { // fee are either zero, or being paid in the collateral token\n            feeAmount = MathLib.multiply(qtyToMint, marketContract.COLLATERAL_TOKEN_FEE_PER_UNIT());\n            totalCollateralTokenTransferAmount = neededCollateral.add(feeAmount);\n            feeToken = collateralTokenAddress;\n            // we will transfer collateral and fees all at once below.\n        }\n\n        // EXTERNAL CALL - transferring ERC20 tokens from sender to this contract.  User must have called\n        // ERC20.approve in order for this call to succeed.\n        ERC20(marketContract.COLLATERAL_TOKEN_ADDRESS()).safeTransferFrom(msg.sender, address(this), totalCollateralTokenTransferAmount);\n\n        if (feeAmount != 0) {\n            // update the fee's collected balance\n            feesCollectedByTokenAddress[feeToken] = feesCollectedByTokenAddress[feeToken].add(feeAmount);\n        }\n\n        // Update the collateral pool locked balance.\n        contractAddressToCollateralPoolBalance[marketContractAddress] = contractAddressToCollateralPoolBalance[\n            marketContractAddress\n        ].add(neededCollateral);\n\n        // mint and distribute short and long position tokens to our caller\n        marketContract.mintPositionTokens(qtyToMint, msg.sender);\n\n        emit TokensMinted(\n            marketContractAddress,\n            msg.sender,\n            feeToken,\n            qtyToMint,\n            neededCollateral,\n            feeAmount\n        );\n    }\n\n    /// @notice Called by a user that currently holds both short and long position tokens and would like to redeem them\n    /// for their collateral.\n    /// @param marketContractAddress            address of the market contract to redeem tokens for\n    /// @param qtyToRedeem                      quantity of long / short tokens to redeem.\n    function redeemPositionTokens(\n        address marketContractAddress,\n        uint qtyToRedeem\n    ) external onlyWhiteListedAddress(marketContractAddress)\n    {\n        MarketContract marketContract = MarketContract(marketContractAddress);\n\n        marketContract.redeemLongToken(qtyToRedeem, msg.sender);\n        marketContract.redeemShortToken(qtyToRedeem, msg.sender);\n\n        // calculate collateral to return and update pool balance\n        uint collateralToReturn = MathLib.multiply(qtyToRedeem, marketContract.COLLATERAL_PER_UNIT());\n        contractAddressToCollateralPoolBalance[marketContractAddress] = contractAddressToCollateralPoolBalance[\n            marketContractAddress\n        ].subtract(collateralToReturn);\n\n        // EXTERNAL CALL\n        // transfer collateral back to user\n        ERC20(marketContract.COLLATERAL_TOKEN_ADDRESS()).safeTransfer(msg.sender, collateralToReturn);\n\n        emit TokensRedeemed(\n            marketContractAddress,\n            msg.sender,\n            qtyToRedeem,\n            qtyToRedeem,\n            collateralToReturn\n        );\n    }\n\n    // @notice called by a user after settlement has occurred.  This function will finalize all accounting around any\n    // outstanding positions and return all remaining collateral to the caller. This should only be called after\n    // settlement has occurred.\n    /// @param marketContractAddress address of the MARKET Contract being traded.\n    /// @param longQtyToRedeem qty to redeem of long tokens\n    /// @param shortQtyToRedeem qty to redeem of short tokens\n    function settleAndClose(\n        address marketContractAddress,\n        uint longQtyToRedeem,\n        uint shortQtyToRedeem\n    ) external onlyWhiteListedAddress(marketContractAddress)\n    {\n        MarketContract marketContract = MarketContract(marketContractAddress);\n        require(marketContract.isPostSettlementDelay(), \"Contract is not past settlement delay\");\n\n        // burn tokens being redeemed.\n        if (longQtyToRedeem > 0) {\n            marketContract.redeemLongToken(longQtyToRedeem, msg.sender);\n        }\n\n        if (shortQtyToRedeem > 0) {\n            marketContract.redeemShortToken(shortQtyToRedeem, msg.sender);\n        }\n\n\n        // calculate amount of collateral to return and update pool balances\n        uint collateralToReturn = MathLib.calculateCollateralToReturn(\n            marketContract.PRICE_FLOOR(),\n            marketContract.PRICE_CAP(),\n            marketContract.QTY_MULTIPLIER(),\n            longQtyToRedeem,\n            shortQtyToRedeem,\n            marketContract.settlementPrice()\n        );\n\n        contractAddressToCollateralPoolBalance[marketContractAddress] = contractAddressToCollateralPoolBalance[\n            marketContractAddress\n        ].subtract(collateralToReturn);\n\n        // return collateral tokens\n        ERC20(marketContract.COLLATERAL_TOKEN_ADDRESS()).safeTransfer(msg.sender, collateralToReturn);\n\n        emit TokensRedeemed(\n            marketContractAddress,\n            msg.sender,\n            longQtyToRedeem,\n            shortQtyToRedeem,\n            collateralToReturn\n        );\n    }\n\n    /// @dev allows the owner to remove the fees paid into this contract for minting\n    /// @param feeTokenAddress - address of the erc20 token fees have been paid in\n    /// @param feeRecipient - Recipient address of fees\n    function withdrawFees(address feeTokenAddress, address feeRecipient) public onlyOwner {\n        uint feesAvailableForWithdrawal = feesCollectedByTokenAddress[feeTokenAddress];\n        require(feesAvailableForWithdrawal != 0, \"No fees available for withdrawal\");\n        require(feeRecipient != address(0), \"Cannot send fees to null address\");\n        feesCollectedByTokenAddress[feeTokenAddress] = 0;\n        // EXTERNAL CALL\n        ERC20(feeTokenAddress).safeTransfer(feeRecipient, feesAvailableForWithdrawal);\n    }\n\n    /// @dev allows the owner to update the mkt token address in use for fees\n    /// @param mktTokenAddress address of new MKT token\n    function setMKTTokenAddress(address mktTokenAddress) public onlyOwner {\n        require(mktTokenAddress != address(0), \"Cannot set MKT Token Address To Null\");\n        mktToken = mktTokenAddress;\n    }\n\n    /// @dev allows the owner to update the mkt token address in use for fees\n    /// @param marketContractRegistryAddress address of new contract registry\n    function setMarketContractRegistryAddress(address marketContractRegistryAddress) public onlyOwner {\n        require(marketContractRegistryAddress != address(0), \"Cannot set Market Contract Registry Address To Null\");\n        marketContractRegistry = marketContractRegistryAddress;\n    }\n\n    /*\n    // MODIFIERS\n    */\n\n    /// @notice only can be called with a market contract address that currently exists in our whitelist\n    /// this ensure's it is a market contract that has been created by us and therefore has a uniquely created\n    /// long and short token address.  If it didn't we could have spoofed contracts minting tokens with a\n    /// collateral token that wasn't the same as the intended token.\n    modifier onlyWhiteListedAddress(address marketContractAddress) {\n        require(\n            MarketContractRegistryInterface(marketContractRegistry).isAddressWhiteListed(marketContractAddress),\n            \"Contract is not whitelisted\"\n        );\n        _;\n    }\n}\n",
  "sourcePath": "/home/travis/build/MARKETProtocol/MARKETProtocol/contracts/MarketCollateralPool.sol",
  "ast": {
    "absolutePath": "/home/travis/build/MARKETProtocol/MARKETProtocol/contracts/MarketCollateralPool.sol",
    "exportedSymbols": {
      "MarketCollateralPool": [
        548
      ]
    },
    "id": 549,
    "nodeType": "SourceUnit",
    "nodes": [
      {
        "id": 1,
        "literals": [
          "solidity",
          "0.5",
          ".2"
        ],
        "nodeType": "PragmaDirective",
        "src": "608:22:0"
      },
      {
        "absolutePath": "/home/travis/build/MARKETProtocol/MARKETProtocol/contracts/libraries/MathLib.sol",
        "file": "./libraries/MathLib.sol",
        "id": 2,
        "nodeType": "ImportDirective",
        "scope": 549,
        "sourceUnit": 1490,
        "src": "632:33:0",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "absolutePath": "/home/travis/build/MARKETProtocol/MARKETProtocol/contracts/MarketContract.sol",
        "file": "./MarketContract.sol",
        "id": 3,
        "nodeType": "ImportDirective",
        "scope": 549,
        "sourceUnit": 945,
        "src": "666:30:0",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "absolutePath": "/home/travis/build/MARKETProtocol/MARKETProtocol/contracts/tokens/PositionToken.sol",
        "file": "./tokens/PositionToken.sol",
        "id": 4,
        "nodeType": "ImportDirective",
        "scope": 549,
        "sourceUnit": 2090,
        "src": "697:36:0",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "absolutePath": "/home/travis/build/MARKETProtocol/MARKETProtocol/contracts/MarketContractRegistryInterface.sol",
        "file": "./MarketContractRegistryInterface.sol",
        "id": 5,
        "nodeType": "ImportDirective",
        "scope": 549,
        "sourceUnit": 1162,
        "src": "734:47:0",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "absolutePath": "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol",
        "file": "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol",
        "id": 6,
        "nodeType": "ImportDirective",
        "scope": 549,
        "sourceUnit": 3153,
        "src": "783:67:0",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "absolutePath": "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol",
        "file": "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol",
        "id": 7,
        "nodeType": "ImportDirective",
        "scope": 549,
        "sourceUnit": 2838,
        "src": "851:63:0",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "absolutePath": "openzeppelin-solidity/contracts/ownership/Ownable.sol",
        "file": "openzeppelin-solidity/contracts/ownership/Ownable.sol",
        "id": 8,
        "nodeType": "ImportDirective",
        "scope": 549,
        "sourceUnit": 2455,
        "src": "915:63:0",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "baseContracts": [
          {
            "arguments": null,
            "baseName": {
              "contractScope": null,
              "id": 9,
              "name": "Ownable",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 2454,
              "src": "1323:7:0",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_Ownable_$2454",
                "typeString": "contract Ownable"
              }
            },
            "id": 10,
            "nodeType": "InheritanceSpecifier",
            "src": "1323:7:0"
          }
        ],
        "contractDependencies": [
          2454
        ],
        "contractKind": "contract",
        "documentation": "@title MarketCollateralPool\n @notice This collateral pool houses all of the collateral for all market contracts currently in circulation.\n This pool facilitates locking of collateral and minting / redemption of position tokens for that collateral.\n @author Phil Elsasser <phil@marketprotocol.io>",
        "fullyImplemented": true,
        "id": 548,
        "linearizedBaseContracts": [
          548,
          2454
        ],
        "name": "MarketCollateralPool",
        "nodeType": "ContractDefinition",
        "nodes": [
          {
            "id": 13,
            "libraryName": {
              "contractScope": null,
              "id": 11,
              "name": "MathLib",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 1489,
              "src": "1343:7:0",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_MathLib_$1489",
                "typeString": "library MathLib"
              }
            },
            "nodeType": "UsingForDirective",
            "src": "1337:23:0",
            "typeName": {
              "id": 12,
              "name": "uint",
              "nodeType": "ElementaryTypeName",
              "src": "1355:4:0",
              "typeDescriptions": {
                "typeIdentifier": "t_uint256",
                "typeString": "uint256"
              }
            }
          },
          {
            "id": 16,
            "libraryName": {
              "contractScope": null,
              "id": 14,
              "name": "MathLib",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 1489,
              "src": "1371:7:0",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_MathLib_$1489",
                "typeString": "library MathLib"
              }
            },
            "nodeType": "UsingForDirective",
            "src": "1365:22:0",
            "typeName": {
              "id": 15,
              "name": "int",
              "nodeType": "ElementaryTypeName",
              "src": "1383:3:0",
              "typeDescriptions": {
                "typeIdentifier": "t_int256",
                "typeString": "int256"
              }
            }
          },
          {
            "id": 19,
            "libraryName": {
              "contractScope": null,
              "id": 17,
              "name": "SafeERC20",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 3152,
              "src": "1398:9:0",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_SafeERC20_$3152",
                "typeString": "library SafeERC20"
              }
            },
            "nodeType": "UsingForDirective",
            "src": "1392:26:0",
            "typeName": {
              "contractScope": null,
              "id": 18,
              "name": "ERC20",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 2837,
              "src": "1412:5:0",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_ERC20_$2837",
                "typeString": "contract ERC20"
              }
            }
          },
          {
            "constant": false,
            "id": 21,
            "name": "marketContractRegistry",
            "nodeType": "VariableDeclaration",
            "scope": 548,
            "src": "1424:37:0",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_address",
              "typeString": "address"
            },
            "typeName": {
              "id": 20,
              "name": "address",
              "nodeType": "ElementaryTypeName",
              "src": "1424:7:0",
              "stateMutability": "nonpayable",
              "typeDescriptions": {
                "typeIdentifier": "t_address",
                "typeString": "address"
              }
            },
            "value": null,
            "visibility": "public"
          },
          {
            "constant": false,
            "id": 23,
            "name": "mktToken",
            "nodeType": "VariableDeclaration",
            "scope": 548,
            "src": "1467:23:0",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_address",
              "typeString": "address"
            },
            "typeName": {
              "id": 22,
              "name": "address",
              "nodeType": "ElementaryTypeName",
              "src": "1467:7:0",
              "stateMutability": "nonpayable",
              "typeDescriptions": {
                "typeIdentifier": "t_address",
                "typeString": "address"
              }
            },
            "value": null,
            "visibility": "public"
          },
          {
            "constant": false,
            "id": 27,
            "name": "contractAddressToCollateralPoolBalance",
            "nodeType": "VariableDeclaration",
            "scope": 548,
            "src": "1497:70:0",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
              "typeString": "mapping(address => uint256)"
            },
            "typeName": {
              "id": 26,
              "keyType": {
                "id": 24,
                "name": "address",
                "nodeType": "ElementaryTypeName",
                "src": "1505:7:0",
                "typeDescriptions": {
                  "typeIdentifier": "t_address",
                  "typeString": "address"
                }
              },
              "nodeType": "Mapping",
              "src": "1497:24:0",
              "typeDescriptions": {
                "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
                "typeString": "mapping(address => uint256)"
              },
              "valueType": {
                "id": 25,
                "name": "uint",
                "nodeType": "ElementaryTypeName",
                "src": "1516:4:0",
                "typeDescriptions": {
                  "typeIdentifier": "t_uint256",
                  "typeString": "uint256"
                }
              }
            },
            "value": null,
            "visibility": "public"
          },
          {
            "constant": false,
            "id": 31,
            "name": "feesCollectedByTokenAddress",
            "nodeType": "VariableDeclaration",
            "scope": 548,
            "src": "1636:59:0",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
              "typeString": "mapping(address => uint256)"
            },
            "typeName": {
              "id": 30,
              "keyType": {
                "id": 28,
                "name": "address",
                "nodeType": "ElementaryTypeName",
                "src": "1644:7:0",
                "typeDescriptions": {
                  "typeIdentifier": "t_address",
                  "typeString": "address"
                }
              },
              "nodeType": "Mapping",
              "src": "1636:24:0",
              "typeDescriptions": {
                "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
                "typeString": "mapping(address => uint256)"
              },
              "valueType": {
                "id": 29,
                "name": "uint",
                "nodeType": "ElementaryTypeName",
                "src": "1655:4:0",
                "typeDescriptions": {
                  "typeIdentifier": "t_uint256",
                  "typeString": "uint256"
                }
              }
            },
            "value": null,
            "visibility": "public"
          },
          {
            "anonymous": false,
            "documentation": null,
            "id": 45,
            "name": "TokensMinted",
            "nodeType": "EventDefinition",
            "parameters": {
              "id": 44,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 33,
                  "indexed": true,
                  "name": "marketContract",
                  "nodeType": "VariableDeclaration",
                  "scope": 45,
                  "src": "1730:30:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 32,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "1730:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 35,
                  "indexed": true,
                  "name": "user",
                  "nodeType": "VariableDeclaration",
                  "scope": 45,
                  "src": "1770:20:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 34,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "1770:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 37,
                  "indexed": true,
                  "name": "feeToken",
                  "nodeType": "VariableDeclaration",
                  "scope": 45,
                  "src": "1800:24:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 36,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "1800:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 39,
                  "indexed": false,
                  "name": "qtyMinted",
                  "nodeType": "VariableDeclaration",
                  "scope": 45,
                  "src": "1834:14:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 38,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "1834:4:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 41,
                  "indexed": false,
                  "name": "collateralLocked",
                  "nodeType": "VariableDeclaration",
                  "scope": 45,
                  "src": "1858:21:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 40,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "1858:4:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 43,
                  "indexed": false,
                  "name": "feesPaid",
                  "nodeType": "VariableDeclaration",
                  "scope": 45,
                  "src": "1889:13:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 42,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "1889:4:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1720:188:0"
            },
            "src": "1702:207:0"
          },
          {
            "anonymous": false,
            "documentation": null,
            "id": 57,
            "name": "TokensRedeemed",
            "nodeType": "EventDefinition",
            "parameters": {
              "id": 56,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 47,
                  "indexed": true,
                  "name": "marketContract",
                  "nodeType": "VariableDeclaration",
                  "scope": 57,
                  "src": "1946:30:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 46,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "1946:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 49,
                  "indexed": true,
                  "name": "user",
                  "nodeType": "VariableDeclaration",
                  "scope": 57,
                  "src": "1986:20:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 48,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "1986:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 51,
                  "indexed": false,
                  "name": "longQtyRedeemed",
                  "nodeType": "VariableDeclaration",
                  "scope": 57,
                  "src": "2016:20:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 50,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2016:4:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 53,
                  "indexed": false,
                  "name": "shortQtyRedeemed",
                  "nodeType": "VariableDeclaration",
                  "scope": 57,
                  "src": "2046:21:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 52,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2046:4:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 55,
                  "indexed": false,
                  "name": "collateralUnlocked",
                  "nodeType": "VariableDeclaration",
                  "scope": 57,
                  "src": "2077:23:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 54,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2077:4:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1936:170:0"
            },
            "src": "1915:192:0"
          },
          {
            "body": {
              "id": 72,
              "nodeType": "Block",
              "src": "2196:107:0",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 66,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 64,
                      "name": "marketContractRegistry",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 21,
                      "src": "2206:22:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_address",
                        "typeString": "address"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "id": 65,
                      "name": "marketContractRegistryAddress",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 59,
                      "src": "2231:29:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_address",
                        "typeString": "address"
                      }
                    },
                    "src": "2206:54:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "id": 67,
                  "nodeType": "ExpressionStatement",
                  "src": "2206:54:0"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 70,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 68,
                      "name": "mktToken",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 23,
                      "src": "2270:8:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_address",
                        "typeString": "address"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "id": 69,
                      "name": "mktTokenAddress",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 61,
                      "src": "2281:15:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_address",
                        "typeString": "address"
                      }
                    },
                    "src": "2270:26:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "id": 71,
                  "nodeType": "ExpressionStatement",
                  "src": "2270:26:0"
                }
              ]
            },
            "documentation": null,
            "id": 73,
            "implemented": true,
            "kind": "constructor",
            "modifiers": [],
            "name": "",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 62,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 59,
                  "name": "marketContractRegistryAddress",
                  "nodeType": "VariableDeclaration",
                  "scope": 73,
                  "src": "2125:37:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 58,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "2125:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 61,
                  "name": "mktTokenAddress",
                  "nodeType": "VariableDeclaration",
                  "scope": 73,
                  "src": "2164:23:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 60,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "2164:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2124:64:0"
            },
            "returnParameters": {
              "id": 63,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "2196:0:0"
            },
            "scope": 548,
            "src": "2113:190:0",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "public"
          },
          {
            "body": {
              "id": 265,
              "nodeType": "Block",
              "src": "3116:2992:0",
              "statements": [
                {
                  "assignments": [
                    86
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 86,
                      "name": "marketContract",
                      "nodeType": "VariableDeclaration",
                      "scope": 265,
                      "src": "3127:29:0",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_contract$_MarketContract_$944",
                        "typeString": "contract MarketContract"
                      },
                      "typeName": {
                        "contractScope": null,
                        "id": 85,
                        "name": "MarketContract",
                        "nodeType": "UserDefinedTypeName",
                        "referencedDeclaration": 944,
                        "src": "3127:14:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_MarketContract_$944",
                          "typeString": "contract MarketContract"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 90,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 88,
                        "name": "marketContractAddress",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 75,
                        "src": "3174:21:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      ],
                      "id": 87,
                      "name": "MarketContract",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 944,
                      "src": "3159:14:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_type$_t_contract$_MarketContract_$944_$",
                        "typeString": "type(contract MarketContract)"
                      }
                    },
                    "id": 89,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "typeConversion",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3159:37:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_MarketContract_$944",
                      "typeString": "contract MarketContract"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3127:69:0"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 95,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "nodeType": "UnaryOperation",
                        "operator": "!",
                        "prefix": true,
                        "src": "3214:27:0",
                        "subExpression": {
                          "argumentTypes": null,
                          "arguments": [],
                          "expression": {
                            "argumentTypes": [],
                            "expression": {
                              "argumentTypes": null,
                              "id": 92,
                              "name": "marketContract",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 86,
                              "src": "3215:14:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_MarketContract_$944",
                                "typeString": "contract MarketContract"
                              }
                            },
                            "id": 93,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "isSettled",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 596,
                            "src": "3215:24:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_view$__$returns$_t_bool_$",
                              "typeString": "function () view external returns (bool)"
                            }
                          },
                          "id": 94,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "3215:26:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "436f6e747261637420697320616c726561647920736574746c6564",
                        "id": 96,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "3243:29:0",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_ca173d03a4252dfa571f586cd2c07cbf7461ad4fb4aa3d483d41782466df287b",
                          "typeString": "literal_string \"Contract is already settled\""
                        },
                        "value": "Contract is already settled"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_ca173d03a4252dfa571f586cd2c07cbf7461ad4fb4aa3d483d41782466df287b",
                          "typeString": "literal_string \"Contract is already settled\""
                        }
                      ],
                      "id": 91,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        3189,
                        3190
                      ],
                      "referencedDeclaration": 3190,
                      "src": "3206:7:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 97,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3206:67:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 98,
                  "nodeType": "ExpressionStatement",
                  "src": "3206:67:0"
                },
                {
                  "assignments": [
                    100
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 100,
                      "name": "collateralTokenAddress",
                      "nodeType": "VariableDeclaration",
                      "scope": 265,
                      "src": "3284:30:0",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_address",
                        "typeString": "address"
                      },
                      "typeName": {
                        "id": 99,
                        "name": "address",
                        "nodeType": "ElementaryTypeName",
                        "src": "3284:7:0",
                        "stateMutability": "nonpayable",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 104,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 101,
                        "name": "marketContract",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 86,
                        "src": "3317:14:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_MarketContract_$944",
                          "typeString": "contract MarketContract"
                        }
                      },
                      "id": 102,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "COLLATERAL_TOKEN_ADDRESS",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 562,
                      "src": "3317:39:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_external_view$__$returns$_t_address_$",
                        "typeString": "function () view external returns (address)"
                      }
                    },
                    "id": 103,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3317:41:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3284:74:0"
                },
                {
                  "assignments": [
                    106
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 106,
                      "name": "neededCollateral",
                      "nodeType": "VariableDeclaration",
                      "scope": 265,
                      "src": "3368:21:0",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 105,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "3368:4:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 114,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 109,
                        "name": "qtyToMint",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 77,
                        "src": "3409:9:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "arguments": [],
                        "expression": {
                          "argumentTypes": [],
                          "expression": {
                            "argumentTypes": null,
                            "id": 110,
                            "name": "marketContract",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 86,
                            "src": "3420:14:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_contract$_MarketContract_$944",
                              "typeString": "contract MarketContract"
                            }
                          },
                          "id": 111,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "COLLATERAL_PER_UNIT",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 574,
                          "src": "3420:34:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                            "typeString": "function () view external returns (uint256)"
                          }
                        },
                        "id": 112,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "3420:36:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 107,
                        "name": "MathLib",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1489,
                        "src": "3392:7:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_contract$_MathLib_$1489_$",
                          "typeString": "type(library MathLib)"
                        }
                      },
                      "id": 108,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "multiply",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 1276,
                      "src": "3392:16:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
                        "typeString": "function (uint256,uint256) pure returns (uint256)"
                      }
                    },
                    "id": 113,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3392:65:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3368:89:0"
                },
                {
                  "assignments": [
                    116
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 116,
                      "name": "isPayFeesInMKT",
                      "nodeType": "VariableDeclaration",
                      "scope": 265,
                      "src": "3751:19:0",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      },
                      "typeName": {
                        "id": 115,
                        "name": "bool",
                        "nodeType": "ElementaryTypeName",
                        "src": "3751:4:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 141,
                  "initialValue": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    },
                    "id": 140,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "components": [
                        {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          },
                          "id": 123,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 117,
                            "name": "isAttemptToPayInMKT",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 79,
                            "src": "3774:19:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bool",
                              "typeString": "bool"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "&&",
                          "rightExpression": {
                            "argumentTypes": null,
                            "commonType": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            },
                            "id": 122,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftExpression": {
                              "argumentTypes": null,
                              "arguments": [],
                              "expression": {
                                "argumentTypes": [],
                                "expression": {
                                  "argumentTypes": null,
                                  "id": 118,
                                  "name": "marketContract",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 86,
                                  "src": "3809:14:0",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_MarketContract_$944",
                                    "typeString": "contract MarketContract"
                                  }
                                },
                                "id": 119,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "MKT_TOKEN_FEE_PER_UNIT",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 578,
                                "src": "3809:37:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                                  "typeString": "function () view external returns (uint256)"
                                }
                              },
                              "id": 120,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "functionCall",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "3809:39:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "nodeType": "BinaryOperation",
                            "operator": "!=",
                            "rightExpression": {
                              "argumentTypes": null,
                              "hexValue": "30",
                              "id": 121,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "number",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "3852:1:0",
                              "subdenomination": null,
                              "typeDescriptions": {
                                "typeIdentifier": "t_rational_0_by_1",
                                "typeString": "int_const 0"
                              },
                              "value": "0"
                            },
                            "src": "3809:44:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bool",
                              "typeString": "bool"
                            }
                          },
                          "src": "3774:79:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        }
                      ],
                      "id": 124,
                      "isConstant": false,
                      "isInlineArray": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "nodeType": "TupleExpression",
                      "src": "3773:81:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "||",
                    "rightExpression": {
                      "argumentTypes": null,
                      "components": [
                        {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          },
                          "id": 138,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "commonType": {
                              "typeIdentifier": "t_bool",
                              "typeString": "bool"
                            },
                            "id": 132,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftExpression": {
                              "argumentTypes": null,
                              "id": 126,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "nodeType": "UnaryOperation",
                              "operator": "!",
                              "prefix": true,
                              "src": "3871:20:0",
                              "subExpression": {
                                "argumentTypes": null,
                                "id": 125,
                                "name": "isAttemptToPayInMKT",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 79,
                                "src": "3872:19:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bool",
                                  "typeString": "bool"
                                }
                              },
                              "typeDescriptions": {
                                "typeIdentifier": "t_bool",
                                "typeString": "bool"
                              }
                            },
                            "nodeType": "BinaryOperation",
                            "operator": "&&",
                            "rightExpression": {
                              "argumentTypes": null,
                              "commonType": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              },
                              "id": 131,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "leftExpression": {
                                "argumentTypes": null,
                                "arguments": [],
                                "expression": {
                                  "argumentTypes": [],
                                  "expression": {
                                    "argumentTypes": null,
                                    "id": 127,
                                    "name": "marketContract",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 86,
                                    "src": "3907:14:0",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_contract$_MarketContract_$944",
                                      "typeString": "contract MarketContract"
                                    }
                                  },
                                  "id": 128,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "MKT_TOKEN_FEE_PER_UNIT",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 578,
                                  "src": "3907:37:0",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                                    "typeString": "function () view external returns (uint256)"
                                  }
                                },
                                "id": 129,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "3907:39:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "nodeType": "BinaryOperation",
                              "operator": "!=",
                              "rightExpression": {
                                "argumentTypes": null,
                                "hexValue": "30",
                                "id": 130,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": true,
                                "kind": "number",
                                "lValueRequested": false,
                                "nodeType": "Literal",
                                "src": "3950:1:0",
                                "subdenomination": null,
                                "typeDescriptions": {
                                  "typeIdentifier": "t_rational_0_by_1",
                                  "typeString": "int_const 0"
                                },
                                "value": "0"
                              },
                              "src": "3907:44:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_bool",
                                "typeString": "bool"
                              }
                            },
                            "src": "3871:80:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bool",
                              "typeString": "bool"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "&&",
                          "rightExpression": {
                            "argumentTypes": null,
                            "commonType": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            },
                            "id": 137,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftExpression": {
                              "argumentTypes": null,
                              "arguments": [],
                              "expression": {
                                "argumentTypes": [],
                                "expression": {
                                  "argumentTypes": null,
                                  "id": 133,
                                  "name": "marketContract",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 86,
                                  "src": "3967:14:0",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_MarketContract_$944",
                                    "typeString": "contract MarketContract"
                                  }
                                },
                                "id": 134,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "COLLATERAL_TOKEN_FEE_PER_UNIT",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 576,
                                "src": "3967:44:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                                  "typeString": "function () view external returns (uint256)"
                                }
                              },
                              "id": 135,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "functionCall",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "3967:46:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "nodeType": "BinaryOperation",
                            "operator": "==",
                            "rightExpression": {
                              "argumentTypes": null,
                              "hexValue": "30",
                              "id": 136,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "number",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "4017:1:0",
                              "subdenomination": null,
                              "typeDescriptions": {
                                "typeIdentifier": "t_rational_0_by_1",
                                "typeString": "int_const 0"
                              },
                              "value": "0"
                            },
                            "src": "3967:51:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bool",
                              "typeString": "bool"
                            }
                          },
                          "src": "3871:147:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        }
                      ],
                      "id": 139,
                      "isConstant": false,
                      "isInlineArray": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "nodeType": "TupleExpression",
                      "src": "3870:149:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      }
                    },
                    "src": "3773:246:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3751:268:0"
                },
                {
                  "assignments": [
                    143
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 143,
                      "name": "feeAmount",
                      "nodeType": "VariableDeclaration",
                      "scope": 265,
                      "src": "4030:14:0",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 142,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "4030:4:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 144,
                  "initialValue": null,
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4030:14:0"
                },
                {
                  "assignments": [
                    146
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 146,
                      "name": "totalCollateralTokenTransferAmount",
                      "nodeType": "VariableDeclaration",
                      "scope": 265,
                      "src": "4054:39:0",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 145,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "4054:4:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 147,
                  "initialValue": null,
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4054:39:0"
                },
                {
                  "assignments": [
                    149
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 149,
                      "name": "feeToken",
                      "nodeType": "VariableDeclaration",
                      "scope": 265,
                      "src": "4103:16:0",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_address",
                        "typeString": "address"
                      },
                      "typeName": {
                        "id": 148,
                        "name": "address",
                        "nodeType": "ElementaryTypeName",
                        "src": "4103:7:0",
                        "stateMutability": "nonpayable",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 150,
                  "initialValue": null,
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4103:16:0"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "id": 151,
                    "name": "isPayFeesInMKT",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 116,
                    "src": "4133:14:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": {
                    "id": 204,
                    "nodeType": "Block",
                    "src": "4654:374:0",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 191,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 183,
                            "name": "feeAmount",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 143,
                            "src": "4730:9:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "id": 186,
                                "name": "qtyToMint",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 77,
                                "src": "4759:9:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              {
                                "argumentTypes": null,
                                "arguments": [],
                                "expression": {
                                  "argumentTypes": [],
                                  "expression": {
                                    "argumentTypes": null,
                                    "id": 187,
                                    "name": "marketContract",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 86,
                                    "src": "4770:14:0",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_contract$_MarketContract_$944",
                                      "typeString": "contract MarketContract"
                                    }
                                  },
                                  "id": 188,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "COLLATERAL_TOKEN_FEE_PER_UNIT",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 576,
                                  "src": "4770:44:0",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                                    "typeString": "function () view external returns (uint256)"
                                  }
                                },
                                "id": 189,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "4770:46:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                },
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              ],
                              "expression": {
                                "argumentTypes": null,
                                "id": 184,
                                "name": "MathLib",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 1489,
                                "src": "4742:7:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_type$_t_contract$_MathLib_$1489_$",
                                  "typeString": "type(library MathLib)"
                                }
                              },
                              "id": 185,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "multiply",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 1276,
                              "src": "4742:16:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
                                "typeString": "function (uint256,uint256) pure returns (uint256)"
                              }
                            },
                            "id": 190,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "4742:75:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "4730:87:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 192,
                        "nodeType": "ExpressionStatement",
                        "src": "4730:87:0"
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 198,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 193,
                            "name": "totalCollateralTokenTransferAmount",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 146,
                            "src": "4831:34:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "id": 196,
                                "name": "feeAmount",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 143,
                                "src": "4889:9:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              ],
                              "expression": {
                                "argumentTypes": null,
                                "id": 194,
                                "name": "neededCollateral",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 106,
                                "src": "4868:16:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "id": 195,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "add",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 1341,
                              "src": "4868:20:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                                "typeString": "function (uint256,uint256) pure returns (uint256)"
                              }
                            },
                            "id": 197,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "4868:31:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "4831:68:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 199,
                        "nodeType": "ExpressionStatement",
                        "src": "4831:68:0"
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 202,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 200,
                            "name": "feeToken",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 149,
                            "src": "4913:8:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "id": 201,
                            "name": "collateralTokenAddress",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 100,
                            "src": "4924:22:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          },
                          "src": "4913:33:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_address",
                            "typeString": "address"
                          }
                        },
                        "id": 203,
                        "nodeType": "ExpressionStatement",
                        "src": "4913:33:0"
                      }
                    ]
                  },
                  "id": 205,
                  "nodeType": "IfStatement",
                  "src": "4129:899:0",
                  "trueBody": {
                    "id": 182,
                    "nodeType": "Block",
                    "src": "4149:499:0",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 160,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 152,
                            "name": "feeAmount",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 143,
                            "src": "4198:9:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "id": 155,
                                "name": "qtyToMint",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 77,
                                "src": "4227:9:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              {
                                "argumentTypes": null,
                                "arguments": [],
                                "expression": {
                                  "argumentTypes": [],
                                  "expression": {
                                    "argumentTypes": null,
                                    "id": 156,
                                    "name": "marketContract",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 86,
                                    "src": "4238:14:0",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_contract$_MarketContract_$944",
                                      "typeString": "contract MarketContract"
                                    }
                                  },
                                  "id": 157,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "MKT_TOKEN_FEE_PER_UNIT",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 578,
                                  "src": "4238:37:0",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                                    "typeString": "function () view external returns (uint256)"
                                  }
                                },
                                "id": 158,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "4238:39:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                },
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              ],
                              "expression": {
                                "argumentTypes": null,
                                "id": 153,
                                "name": "MathLib",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 1489,
                                "src": "4210:7:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_type$_t_contract$_MathLib_$1489_$",
                                  "typeString": "type(library MathLib)"
                                }
                              },
                              "id": 154,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "multiply",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 1276,
                              "src": "4210:16:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
                                "typeString": "function (uint256,uint256) pure returns (uint256)"
                              }
                            },
                            "id": 159,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "4210:68:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "4198:80:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 161,
                        "nodeType": "ExpressionStatement",
                        "src": "4198:80:0"
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 164,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 162,
                            "name": "totalCollateralTokenTransferAmount",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 146,
                            "src": "4292:34:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "id": 163,
                            "name": "neededCollateral",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 106,
                            "src": "4329:16:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "4292:53:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 165,
                        "nodeType": "ExpressionStatement",
                        "src": "4292:53:0"
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 168,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 166,
                            "name": "feeToken",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 149,
                            "src": "4359:8:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "id": 167,
                            "name": "mktToken",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 23,
                            "src": "4370:8:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          },
                          "src": "4359:19:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_address",
                            "typeString": "address"
                          }
                        },
                        "id": 169,
                        "nodeType": "ExpressionStatement",
                        "src": "4359:19:0"
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "expression": {
                                "argumentTypes": null,
                                "id": 174,
                                "name": "msg",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 3186,
                                "src": "4600:3:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_magic_message",
                                  "typeString": "msg"
                                }
                              },
                              "id": 175,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "sender",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": null,
                              "src": "4600:10:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_address_payable",
                                "typeString": "address payable"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "arguments": [
                                {
                                  "argumentTypes": null,
                                  "id": 177,
                                  "name": "this",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 3221,
                                  "src": "4620:4:0",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_MarketCollateralPool_$548",
                                    "typeString": "contract MarketCollateralPool"
                                  }
                                }
                              ],
                              "expression": {
                                "argumentTypes": [
                                  {
                                    "typeIdentifier": "t_contract$_MarketCollateralPool_$548",
                                    "typeString": "contract MarketCollateralPool"
                                  }
                                ],
                                "id": 176,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": true,
                                "lValueRequested": false,
                                "nodeType": "ElementaryTypeNameExpression",
                                "src": "4612:7:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_type$_t_address_$",
                                  "typeString": "type(address)"
                                },
                                "typeName": "address"
                              },
                              "id": 178,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "typeConversion",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "4612:13:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_address",
                                "typeString": "address"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "id": 179,
                              "name": "feeAmount",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 143,
                              "src": "4627:9:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_address_payable",
                                "typeString": "address payable"
                              },
                              {
                                "typeIdentifier": "t_address",
                                "typeString": "address"
                              },
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "expression": {
                              "argumentTypes": null,
                              "arguments": [
                                {
                                  "argumentTypes": null,
                                  "id": 171,
                                  "name": "mktToken",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 23,
                                  "src": "4573:8:0",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_address",
                                    "typeString": "address"
                                  }
                                }
                              ],
                              "expression": {
                                "argumentTypes": [
                                  {
                                    "typeIdentifier": "t_address",
                                    "typeString": "address"
                                  }
                                ],
                                "id": 170,
                                "name": "ERC20",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 2837,
                                "src": "4567:5:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_type$_t_contract$_ERC20_$2837_$",
                                  "typeString": "type(contract ERC20)"
                                }
                              },
                              "id": 172,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "typeConversion",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "4567:15:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_ERC20_$2837",
                                "typeString": "contract ERC20"
                              }
                            },
                            "id": 173,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "safeTransferFrom",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 2995,
                            "src": "4567:32:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20_$2937_$_t_address_$_t_address_$_t_uint256_$returns$__$bound_to$_t_contract$_IERC20_$2937_$",
                              "typeString": "function (contract IERC20,address,address,uint256)"
                            }
                          },
                          "id": 180,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "4567:70:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_tuple$__$",
                            "typeString": "tuple()"
                          }
                        },
                        "id": 181,
                        "nodeType": "ExpressionStatement",
                        "src": "4567:70:0"
                      }
                    ]
                  }
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "id": 212,
                          "name": "msg",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 3186,
                          "src": "5270:3:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_magic_message",
                            "typeString": "msg"
                          }
                        },
                        "id": 213,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sender",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "5270:10:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 215,
                            "name": "this",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 3221,
                            "src": "5290:4:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_contract$_MarketCollateralPool_$548",
                              "typeString": "contract MarketCollateralPool"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_contract$_MarketCollateralPool_$548",
                              "typeString": "contract MarketCollateralPool"
                            }
                          ],
                          "id": 214,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "lValueRequested": false,
                          "nodeType": "ElementaryTypeNameExpression",
                          "src": "5282:7:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_address_$",
                            "typeString": "type(address)"
                          },
                          "typeName": "address"
                        },
                        "id": 216,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "typeConversion",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "5282:13:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 217,
                        "name": "totalCollateralTokenTransferAmount",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 146,
                        "src": "5297:34:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        },
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "arguments": [],
                            "expression": {
                              "argumentTypes": [],
                              "expression": {
                                "argumentTypes": null,
                                "id": 207,
                                "name": "marketContract",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 86,
                                "src": "5210:14:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_contract$_MarketContract_$944",
                                  "typeString": "contract MarketContract"
                                }
                              },
                              "id": 208,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "COLLATERAL_TOKEN_ADDRESS",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 562,
                              "src": "5210:39:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_external_view$__$returns$_t_address_$",
                                "typeString": "function () view external returns (address)"
                              }
                            },
                            "id": 209,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "5210:41:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          ],
                          "id": 206,
                          "name": "ERC20",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 2837,
                          "src": "5204:5:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_contract$_ERC20_$2837_$",
                            "typeString": "type(contract ERC20)"
                          }
                        },
                        "id": 210,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "typeConversion",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "5204:48:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_ERC20_$2837",
                          "typeString": "contract ERC20"
                        }
                      },
                      "id": 211,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "safeTransferFrom",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 2995,
                      "src": "5204:65:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20_$2937_$_t_address_$_t_address_$_t_uint256_$returns$__$bound_to$_t_contract$_IERC20_$2937_$",
                        "typeString": "function (contract IERC20,address,address,uint256)"
                      }
                    },
                    "id": 218,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "5204:128:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 219,
                  "nodeType": "ExpressionStatement",
                  "src": "5204:128:0"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 222,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 220,
                      "name": "feeAmount",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 143,
                      "src": "5347:9:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "!=",
                    "rightExpression": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 221,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "5360:1:0",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "src": "5347:14:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 235,
                  "nodeType": "IfStatement",
                  "src": "5343:187:0",
                  "trueBody": {
                    "id": 234,
                    "nodeType": "Block",
                    "src": "5363:167:0",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 232,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "baseExpression": {
                              "argumentTypes": null,
                              "id": 223,
                              "name": "feesCollectedByTokenAddress",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 31,
                              "src": "5427:27:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
                                "typeString": "mapping(address => uint256)"
                              }
                            },
                            "id": 225,
                            "indexExpression": {
                              "argumentTypes": null,
                              "id": 224,
                              "name": "feeToken",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 149,
                              "src": "5455:8:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_address",
                                "typeString": "address"
                              }
                            },
                            "isConstant": false,
                            "isLValue": true,
                            "isPure": false,
                            "lValueRequested": true,
                            "nodeType": "IndexAccess",
                            "src": "5427:37:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "id": 230,
                                "name": "feeAmount",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 143,
                                "src": "5509:9:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              ],
                              "expression": {
                                "argumentTypes": null,
                                "baseExpression": {
                                  "argumentTypes": null,
                                  "id": 226,
                                  "name": "feesCollectedByTokenAddress",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 31,
                                  "src": "5467:27:0",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
                                    "typeString": "mapping(address => uint256)"
                                  }
                                },
                                "id": 228,
                                "indexExpression": {
                                  "argumentTypes": null,
                                  "id": 227,
                                  "name": "feeToken",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 149,
                                  "src": "5495:8:0",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_address",
                                    "typeString": "address"
                                  }
                                },
                                "isConstant": false,
                                "isLValue": true,
                                "isPure": false,
                                "lValueRequested": false,
                                "nodeType": "IndexAccess",
                                "src": "5467:37:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "id": 229,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "add",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 1341,
                              "src": "5467:41:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                                "typeString": "function (uint256,uint256) pure returns (uint256)"
                              }
                            },
                            "id": 231,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "5467:52:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "5427:92:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 233,
                        "nodeType": "ExpressionStatement",
                        "src": "5427:92:0"
                      }
                    ]
                  }
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 245,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "baseExpression": {
                        "argumentTypes": null,
                        "id": 236,
                        "name": "contractAddressToCollateralPoolBalance",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 27,
                        "src": "5594:38:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
                          "typeString": "mapping(address => uint256)"
                        }
                      },
                      "id": 238,
                      "indexExpression": {
                        "argumentTypes": null,
                        "id": 237,
                        "name": "marketContractAddress",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 75,
                        "src": "5633:21:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "nodeType": "IndexAccess",
                      "src": "5594:61:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "id": 243,
                          "name": "neededCollateral",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 106,
                          "src": "5746:16:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "baseExpression": {
                            "argumentTypes": null,
                            "id": 239,
                            "name": "contractAddressToCollateralPoolBalance",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 27,
                            "src": "5658:38:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
                              "typeString": "mapping(address => uint256)"
                            }
                          },
                          "id": 241,
                          "indexExpression": {
                            "argumentTypes": null,
                            "id": 240,
                            "name": "marketContractAddress",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 75,
                            "src": "5710:21:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          },
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "nodeType": "IndexAccess",
                          "src": "5658:83:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 242,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "add",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 1341,
                        "src": "5658:87:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                          "typeString": "function (uint256,uint256) pure returns (uint256)"
                        }
                      },
                      "id": 244,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "5658:105:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "5594:169:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 246,
                  "nodeType": "ExpressionStatement",
                  "src": "5594:169:0"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 250,
                        "name": "qtyToMint",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 77,
                        "src": "5884:9:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "id": 251,
                          "name": "msg",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 3186,
                          "src": "5895:3:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_magic_message",
                            "typeString": "msg"
                          }
                        },
                        "id": 252,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sender",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "5895:10:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 247,
                        "name": "marketContract",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 86,
                        "src": "5850:14:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_MarketContract_$944",
                          "typeString": "contract MarketContract"
                        }
                      },
                      "id": 249,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "mintPositionTokens",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 802,
                      "src": "5850:33:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_external_nonpayable$_t_uint256_$_t_address_$returns$__$",
                        "typeString": "function (uint256,address) external"
                      }
                    },
                    "id": 253,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "5850:56:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 254,
                  "nodeType": "ExpressionStatement",
                  "src": "5850:56:0"
                },
                {
                  "eventCall": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 256,
                        "name": "marketContractAddress",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 75,
                        "src": "5948:21:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "id": 257,
                          "name": "msg",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 3186,
                          "src": "5983:3:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_magic_message",
                            "typeString": "msg"
                          }
                        },
                        "id": 258,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sender",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "5983:10:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 259,
                        "name": "feeToken",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 149,
                        "src": "6007:8:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 260,
                        "name": "qtyToMint",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 77,
                        "src": "6029:9:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 261,
                        "name": "neededCollateral",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 106,
                        "src": "6052:16:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 262,
                        "name": "feeAmount",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 143,
                        "src": "6082:9:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        },
                        {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        },
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "id": 255,
                      "name": "TokensMinted",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 45,
                      "src": "5922:12:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$",
                        "typeString": "function (address,address,address,uint256,uint256,uint256)"
                      }
                    },
                    "id": 263,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "5922:179:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 264,
                  "nodeType": "EmitStatement",
                  "src": "5917:184:0"
                }
              ]
            },
            "documentation": "@notice Called by a user that would like to mint a new set of long and short token for a specified\n market contract.  This will transfer and lock the correct amount of collateral into the pool\n and issue them the requested qty of long and short tokens\n @param marketContractAddress            address of the market contract to redeem tokens for\n @param qtyToMint                      quantity of long / short tokens to mint.\n @param isAttemptToPayInMKT            if possible, attempt to pay fee's in MKT rather than collateral tokens",
            "id": 266,
            "implemented": true,
            "kind": "function",
            "modifiers": [
              {
                "arguments": [
                  {
                    "argumentTypes": null,
                    "id": 82,
                    "name": "marketContractAddress",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 75,
                    "src": "3089:21:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  }
                ],
                "id": 83,
                "modifierName": {
                  "argumentTypes": null,
                  "id": 81,
                  "name": "onlyWhiteListedAddress",
                  "nodeType": "Identifier",
                  "overloadedDeclarations": [],
                  "referencedDeclaration": 547,
                  "src": "3066:22:0",
                  "typeDescriptions": {
                    "typeIdentifier": "t_modifier$_t_address_$",
                    "typeString": "modifier (address)"
                  }
                },
                "nodeType": "ModifierInvocation",
                "src": "3066:45:0"
              }
            ],
            "name": "mintPositionTokens",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 80,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 75,
                  "name": "marketContractAddress",
                  "nodeType": "VariableDeclaration",
                  "scope": 266,
                  "src": "2963:29:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 74,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "2963:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 77,
                  "name": "qtyToMint",
                  "nodeType": "VariableDeclaration",
                  "scope": 266,
                  "src": "3002:14:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 76,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "3002:4:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 79,
                  "name": "isAttemptToPayInMKT",
                  "nodeType": "VariableDeclaration",
                  "scope": 266,
                  "src": "3026:24:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 78,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "3026:4:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2953:103:0"
            },
            "returnParameters": {
              "id": 84,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "3116:0:0"
            },
            "scope": 548,
            "src": "2926:3182:0",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "external"
          },
          {
            "body": {
              "id": 339,
              "nodeType": "Block",
              "src": "6615:928:0",
              "statements": [
                {
                  "assignments": [
                    277
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 277,
                      "name": "marketContract",
                      "nodeType": "VariableDeclaration",
                      "scope": 339,
                      "src": "6625:29:0",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_contract$_MarketContract_$944",
                        "typeString": "contract MarketContract"
                      },
                      "typeName": {
                        "contractScope": null,
                        "id": 276,
                        "name": "MarketContract",
                        "nodeType": "UserDefinedTypeName",
                        "referencedDeclaration": 944,
                        "src": "6625:14:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_MarketContract_$944",
                          "typeString": "contract MarketContract"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 281,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 279,
                        "name": "marketContractAddress",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 268,
                        "src": "6672:21:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      ],
                      "id": 278,
                      "name": "MarketContract",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 944,
                      "src": "6657:14:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_type$_t_contract$_MarketContract_$944_$",
                        "typeString": "type(contract MarketContract)"
                      }
                    },
                    "id": 280,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "typeConversion",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "6657:37:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_MarketContract_$944",
                      "typeString": "contract MarketContract"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "6625:69:0"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 285,
                        "name": "qtyToRedeem",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 270,
                        "src": "6736:11:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "id": 286,
                          "name": "msg",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 3186,
                          "src": "6749:3:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_magic_message",
                            "typeString": "msg"
                          }
                        },
                        "id": 287,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sender",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "6749:10:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 282,
                        "name": "marketContract",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 277,
                        "src": "6705:14:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_MarketContract_$944",
                          "typeString": "contract MarketContract"
                        }
                      },
                      "id": 284,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "redeemLongToken",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 820,
                      "src": "6705:30:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_external_nonpayable$_t_uint256_$_t_address_$returns$__$",
                        "typeString": "function (uint256,address) external"
                      }
                    },
                    "id": 288,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "6705:55:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 289,
                  "nodeType": "ExpressionStatement",
                  "src": "6705:55:0"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 293,
                        "name": "qtyToRedeem",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 270,
                        "src": "6802:11:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "id": 294,
                          "name": "msg",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 3186,
                          "src": "6815:3:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_magic_message",
                            "typeString": "msg"
                          }
                        },
                        "id": 295,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sender",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "6815:10:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 290,
                        "name": "marketContract",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 277,
                        "src": "6770:14:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_MarketContract_$944",
                          "typeString": "contract MarketContract"
                        }
                      },
                      "id": 292,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "redeemShortToken",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 838,
                      "src": "6770:31:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_external_nonpayable$_t_uint256_$_t_address_$returns$__$",
                        "typeString": "function (uint256,address) external"
                      }
                    },
                    "id": 296,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "6770:56:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 297,
                  "nodeType": "ExpressionStatement",
                  "src": "6770:56:0"
                },
                {
                  "assignments": [
                    299
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 299,
                      "name": "collateralToReturn",
                      "nodeType": "VariableDeclaration",
                      "scope": 339,
                      "src": "6903:23:0",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 298,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "6903:4:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 307,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 302,
                        "name": "qtyToRedeem",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 270,
                        "src": "6946:11:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "arguments": [],
                        "expression": {
                          "argumentTypes": [],
                          "expression": {
                            "argumentTypes": null,
                            "id": 303,
                            "name": "marketContract",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 277,
                            "src": "6959:14:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_contract$_MarketContract_$944",
                              "typeString": "contract MarketContract"
                            }
                          },
                          "id": 304,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "COLLATERAL_PER_UNIT",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 574,
                          "src": "6959:34:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                            "typeString": "function () view external returns (uint256)"
                          }
                        },
                        "id": 305,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "6959:36:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 300,
                        "name": "MathLib",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1489,
                        "src": "6929:7:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_contract$_MathLib_$1489_$",
                          "typeString": "type(library MathLib)"
                        }
                      },
                      "id": 301,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "multiply",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 1276,
                      "src": "6929:16:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
                        "typeString": "function (uint256,uint256) pure returns (uint256)"
                      }
                    },
                    "id": 306,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "6929:67:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "6903:93:0"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 317,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "baseExpression": {
                        "argumentTypes": null,
                        "id": 308,
                        "name": "contractAddressToCollateralPoolBalance",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 27,
                        "src": "7006:38:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
                          "typeString": "mapping(address => uint256)"
                        }
                      },
                      "id": 310,
                      "indexExpression": {
                        "argumentTypes": null,
                        "id": 309,
                        "name": "marketContractAddress",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 268,
                        "src": "7045:21:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "nodeType": "IndexAccess",
                      "src": "7006:61:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "id": 315,
                          "name": "collateralToReturn",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 299,
                          "src": "7163:18:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "baseExpression": {
                            "argumentTypes": null,
                            "id": 311,
                            "name": "contractAddressToCollateralPoolBalance",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 27,
                            "src": "7070:38:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
                              "typeString": "mapping(address => uint256)"
                            }
                          },
                          "id": 313,
                          "indexExpression": {
                            "argumentTypes": null,
                            "id": 312,
                            "name": "marketContractAddress",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 268,
                            "src": "7122:21:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          },
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "nodeType": "IndexAccess",
                          "src": "7070:83:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 314,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "subtract",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 1316,
                        "src": "7070:92:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                          "typeString": "function (uint256,uint256) pure returns (uint256)"
                        }
                      },
                      "id": 316,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "7070:112:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "7006:176:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 318,
                  "nodeType": "ExpressionStatement",
                  "src": "7006:176:0"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "id": 325,
                          "name": "msg",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 3186,
                          "src": "7324:3:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_magic_message",
                            "typeString": "msg"
                          }
                        },
                        "id": 326,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sender",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "7324:10:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 327,
                        "name": "collateralToReturn",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 299,
                        "src": "7336:18:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "arguments": [],
                            "expression": {
                              "argumentTypes": [],
                              "expression": {
                                "argumentTypes": null,
                                "id": 320,
                                "name": "marketContract",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 277,
                                "src": "7268:14:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_contract$_MarketContract_$944",
                                  "typeString": "contract MarketContract"
                                }
                              },
                              "id": 321,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "COLLATERAL_TOKEN_ADDRESS",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 562,
                              "src": "7268:39:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_external_view$__$returns$_t_address_$",
                                "typeString": "function () view external returns (address)"
                              }
                            },
                            "id": 322,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "7268:41:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          ],
                          "id": 319,
                          "name": "ERC20",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 2837,
                          "src": "7262:5:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_contract$_ERC20_$2837_$",
                            "typeString": "type(contract ERC20)"
                          }
                        },
                        "id": 323,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "typeConversion",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "7262:48:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_ERC20_$2837",
                          "typeString": "contract ERC20"
                        }
                      },
                      "id": 324,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "safeTransfer",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 2970,
                      "src": "7262:61:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20_$2937_$_t_address_$_t_uint256_$returns$__$bound_to$_t_contract$_IERC20_$2937_$",
                        "typeString": "function (contract IERC20,address,uint256)"
                      }
                    },
                    "id": 328,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "7262:93:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 329,
                  "nodeType": "ExpressionStatement",
                  "src": "7262:93:0"
                },
                {
                  "eventCall": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 331,
                        "name": "marketContractAddress",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 268,
                        "src": "7399:21:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "id": 332,
                          "name": "msg",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 3186,
                          "src": "7434:3:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_magic_message",
                            "typeString": "msg"
                          }
                        },
                        "id": 333,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sender",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "7434:10:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 334,
                        "name": "qtyToRedeem",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 270,
                        "src": "7458:11:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 335,
                        "name": "qtyToRedeem",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 270,
                        "src": "7483:11:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 336,
                        "name": "collateralToReturn",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 299,
                        "src": "7508:18:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        },
                        {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "id": 330,
                      "name": "TokensRedeemed",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 57,
                      "src": "7371:14:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$",
                        "typeString": "function (address,address,uint256,uint256,uint256)"
                      }
                    },
                    "id": 337,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "7371:165:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 338,
                  "nodeType": "EmitStatement",
                  "src": "7366:170:0"
                }
              ]
            },
            "documentation": "@notice Called by a user that currently holds both short and long position tokens and would like to redeem them\n for their collateral.\n @param marketContractAddress            address of the market contract to redeem tokens for\n @param qtyToRedeem                      quantity of long / short tokens to redeem.",
            "id": 340,
            "implemented": true,
            "kind": "function",
            "modifiers": [
              {
                "arguments": [
                  {
                    "argumentTypes": null,
                    "id": 273,
                    "name": "marketContractAddress",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 268,
                    "src": "6588:21:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  }
                ],
                "id": 274,
                "modifierName": {
                  "argumentTypes": null,
                  "id": 272,
                  "name": "onlyWhiteListedAddress",
                  "nodeType": "Identifier",
                  "overloadedDeclarations": [],
                  "referencedDeclaration": 547,
                  "src": "6565:22:0",
                  "typeDescriptions": {
                    "typeIdentifier": "t_modifier$_t_address_$",
                    "typeString": "modifier (address)"
                  }
                },
                "nodeType": "ModifierInvocation",
                "src": "6565:45:0"
              }
            ],
            "name": "redeemPositionTokens",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 271,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 268,
                  "name": "marketContractAddress",
                  "nodeType": "VariableDeclaration",
                  "scope": 340,
                  "src": "6494:29:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 267,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "6494:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 270,
                  "name": "qtyToRedeem",
                  "nodeType": "VariableDeclaration",
                  "scope": 340,
                  "src": "6533:16:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 269,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "6533:4:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6484:71:0"
            },
            "returnParameters": {
              "id": 275,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "6615:0:0"
            },
            "scope": 548,
            "src": "6455:1088:0",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "external"
          },
          {
            "body": {
              "id": 442,
              "nodeType": "Block",
              "src": "8205:1373:0",
              "statements": [
                {
                  "assignments": [
                    353
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 353,
                      "name": "marketContract",
                      "nodeType": "VariableDeclaration",
                      "scope": 442,
                      "src": "8215:29:0",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_contract$_MarketContract_$944",
                        "typeString": "contract MarketContract"
                      },
                      "typeName": {
                        "contractScope": null,
                        "id": 352,
                        "name": "MarketContract",
                        "nodeType": "UserDefinedTypeName",
                        "referencedDeclaration": 944,
                        "src": "8215:14:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_MarketContract_$944",
                          "typeString": "contract MarketContract"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 357,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 355,
                        "name": "marketContractAddress",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 342,
                        "src": "8262:21:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      ],
                      "id": 354,
                      "name": "MarketContract",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 944,
                      "src": "8247:14:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_type$_t_contract$_MarketContract_$944_$",
                        "typeString": "type(contract MarketContract)"
                      }
                    },
                    "id": 356,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "typeConversion",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "8247:37:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_MarketContract_$944",
                      "typeString": "contract MarketContract"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "8215:69:0"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "arguments": [],
                        "expression": {
                          "argumentTypes": [],
                          "expression": {
                            "argumentTypes": null,
                            "id": 359,
                            "name": "marketContract",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 353,
                            "src": "8302:14:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_contract$_MarketContract_$944",
                              "typeString": "contract MarketContract"
                            }
                          },
                          "id": 360,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "isPostSettlementDelay",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 854,
                          "src": "8302:36:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_external_view$__$returns$_t_bool_$",
                            "typeString": "function () view external returns (bool)"
                          }
                        },
                        "id": 361,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "8302:38:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "436f6e7472616374206973206e6f74207061737420736574746c656d656e742064656c6179",
                        "id": 362,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "8342:39:0",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_8b486410106c11bcd850323e93c47a2f7b1d84230ecebf1a4ff45a53ce0cc707",
                          "typeString": "literal_string \"Contract is not past settlement delay\""
                        },
                        "value": "Contract is not past settlement delay"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_8b486410106c11bcd850323e93c47a2f7b1d84230ecebf1a4ff45a53ce0cc707",
                          "typeString": "literal_string \"Contract is not past settlement delay\""
                        }
                      ],
                      "id": 358,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        3189,
                        3190
                      ],
                      "referencedDeclaration": 3190,
                      "src": "8294:7:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 363,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "8294:88:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 364,
                  "nodeType": "ExpressionStatement",
                  "src": "8294:88:0"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 367,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 365,
                      "name": "longQtyToRedeem",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 344,
                      "src": "8436:15:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">",
                    "rightExpression": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 366,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "8454:1:0",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "src": "8436:19:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 377,
                  "nodeType": "IfStatement",
                  "src": "8432:109:0",
                  "trueBody": {
                    "id": 376,
                    "nodeType": "Block",
                    "src": "8457:84:0",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 371,
                              "name": "longQtyToRedeem",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 344,
                              "src": "8502:15:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "expression": {
                                "argumentTypes": null,
                                "id": 372,
                                "name": "msg",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 3186,
                                "src": "8519:3:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_magic_message",
                                  "typeString": "msg"
                                }
                              },
                              "id": 373,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "sender",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": null,
                              "src": "8519:10:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_address_payable",
                                "typeString": "address payable"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              },
                              {
                                "typeIdentifier": "t_address_payable",
                                "typeString": "address payable"
                              }
                            ],
                            "expression": {
                              "argumentTypes": null,
                              "id": 368,
                              "name": "marketContract",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 353,
                              "src": "8471:14:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_MarketContract_$944",
                                "typeString": "contract MarketContract"
                              }
                            },
                            "id": 370,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "redeemLongToken",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 820,
                            "src": "8471:30:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_nonpayable$_t_uint256_$_t_address_$returns$__$",
                              "typeString": "function (uint256,address) external"
                            }
                          },
                          "id": 374,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "8471:59:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_tuple$__$",
                            "typeString": "tuple()"
                          }
                        },
                        "id": 375,
                        "nodeType": "ExpressionStatement",
                        "src": "8471:59:0"
                      }
                    ]
                  }
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 380,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 378,
                      "name": "shortQtyToRedeem",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 346,
                      "src": "8555:16:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">",
                    "rightExpression": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 379,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "8574:1:0",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "src": "8555:20:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 390,
                  "nodeType": "IfStatement",
                  "src": "8551:112:0",
                  "trueBody": {
                    "id": 389,
                    "nodeType": "Block",
                    "src": "8577:86:0",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 384,
                              "name": "shortQtyToRedeem",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 346,
                              "src": "8623:16:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "expression": {
                                "argumentTypes": null,
                                "id": 385,
                                "name": "msg",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 3186,
                                "src": "8641:3:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_magic_message",
                                  "typeString": "msg"
                                }
                              },
                              "id": 386,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "sender",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": null,
                              "src": "8641:10:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_address_payable",
                                "typeString": "address payable"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              },
                              {
                                "typeIdentifier": "t_address_payable",
                                "typeString": "address payable"
                              }
                            ],
                            "expression": {
                              "argumentTypes": null,
                              "id": 381,
                              "name": "marketContract",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 353,
                              "src": "8591:14:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_MarketContract_$944",
                                "typeString": "contract MarketContract"
                              }
                            },
                            "id": 383,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "redeemShortToken",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 838,
                            "src": "8591:31:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_nonpayable$_t_uint256_$_t_address_$returns$__$",
                              "typeString": "function (uint256,address) external"
                            }
                          },
                          "id": 387,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "8591:61:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_tuple$__$",
                            "typeString": "tuple()"
                          }
                        },
                        "id": 388,
                        "nodeType": "ExpressionStatement",
                        "src": "8591:61:0"
                      }
                    ]
                  }
                },
                {
                  "assignments": [
                    392
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 392,
                      "name": "collateralToReturn",
                      "nodeType": "VariableDeclaration",
                      "scope": 442,
                      "src": "8751:23:0",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 391,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "8751:4:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 410,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "arguments": [],
                        "expression": {
                          "argumentTypes": [],
                          "expression": {
                            "argumentTypes": null,
                            "id": 395,
                            "name": "marketContract",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 353,
                            "src": "8826:14:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_contract$_MarketContract_$944",
                              "typeString": "contract MarketContract"
                            }
                          },
                          "id": 396,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "PRICE_FLOOR",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 568,
                          "src": "8826:26:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                            "typeString": "function () view external returns (uint256)"
                          }
                        },
                        "id": 397,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "8826:28:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "arguments": [],
                        "expression": {
                          "argumentTypes": [],
                          "expression": {
                            "argumentTypes": null,
                            "id": 398,
                            "name": "marketContract",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 353,
                            "src": "8868:14:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_contract$_MarketContract_$944",
                              "typeString": "contract MarketContract"
                            }
                          },
                          "id": 399,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "PRICE_CAP",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 566,
                          "src": "8868:24:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                            "typeString": "function () view external returns (uint256)"
                          }
                        },
                        "id": 400,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "8868:26:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "arguments": [],
                        "expression": {
                          "argumentTypes": [],
                          "expression": {
                            "argumentTypes": null,
                            "id": 401,
                            "name": "marketContract",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 353,
                            "src": "8908:14:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_contract$_MarketContract_$944",
                              "typeString": "contract MarketContract"
                            }
                          },
                          "id": 402,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "QTY_MULTIPLIER",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 572,
                          "src": "8908:29:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                            "typeString": "function () view external returns (uint256)"
                          }
                        },
                        "id": 403,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "8908:31:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 404,
                        "name": "longQtyToRedeem",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 344,
                        "src": "8953:15:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 405,
                        "name": "shortQtyToRedeem",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 346,
                        "src": "8982:16:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "arguments": [],
                        "expression": {
                          "argumentTypes": [],
                          "expression": {
                            "argumentTypes": null,
                            "id": 406,
                            "name": "marketContract",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 353,
                            "src": "9012:14:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_contract$_MarketContract_$944",
                              "typeString": "contract MarketContract"
                            }
                          },
                          "id": 407,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "settlementPrice",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 591,
                          "src": "9012:30:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                            "typeString": "function () view external returns (uint256)"
                          }
                        },
                        "id": 408,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "9012:32:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 393,
                        "name": "MathLib",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1489,
                        "src": "8777:7:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_contract$_MathLib_$1489_$",
                          "typeString": "type(library MathLib)"
                        }
                      },
                      "id": 394,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "calculateCollateralToReturn",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 1435,
                      "src": "8777:35:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
                        "typeString": "function (uint256,uint256,uint256,uint256,uint256,uint256) pure returns (uint256)"
                      }
                    },
                    "id": 409,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "8777:277:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "8751:303:0"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 420,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "baseExpression": {
                        "argumentTypes": null,
                        "id": 411,
                        "name": "contractAddressToCollateralPoolBalance",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 27,
                        "src": "9065:38:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
                          "typeString": "mapping(address => uint256)"
                        }
                      },
                      "id": 413,
                      "indexExpression": {
                        "argumentTypes": null,
                        "id": 412,
                        "name": "marketContractAddress",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 342,
                        "src": "9104:21:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "nodeType": "IndexAccess",
                      "src": "9065:61:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "id": 418,
                          "name": "collateralToReturn",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 392,
                          "src": "9222:18:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "baseExpression": {
                            "argumentTypes": null,
                            "id": 414,
                            "name": "contractAddressToCollateralPoolBalance",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 27,
                            "src": "9129:38:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
                              "typeString": "mapping(address => uint256)"
                            }
                          },
                          "id": 416,
                          "indexExpression": {
                            "argumentTypes": null,
                            "id": 415,
                            "name": "marketContractAddress",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 342,
                            "src": "9181:21:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          },
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "nodeType": "IndexAccess",
                          "src": "9129:83:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 417,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "subtract",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 1316,
                        "src": "9129:92:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                          "typeString": "function (uint256,uint256) pure returns (uint256)"
                        }
                      },
                      "id": 419,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "9129:112:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "9065:176:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 421,
                  "nodeType": "ExpressionStatement",
                  "src": "9065:176:0"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "id": 428,
                          "name": "msg",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 3186,
                          "src": "9350:3:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_magic_message",
                            "typeString": "msg"
                          }
                        },
                        "id": 429,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sender",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "9350:10:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 430,
                        "name": "collateralToReturn",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 392,
                        "src": "9362:18:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "arguments": [],
                            "expression": {
                              "argumentTypes": [],
                              "expression": {
                                "argumentTypes": null,
                                "id": 423,
                                "name": "marketContract",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 353,
                                "src": "9294:14:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_contract$_MarketContract_$944",
                                  "typeString": "contract MarketContract"
                                }
                              },
                              "id": 424,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "COLLATERAL_TOKEN_ADDRESS",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 562,
                              "src": "9294:39:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_external_view$__$returns$_t_address_$",
                                "typeString": "function () view external returns (address)"
                              }
                            },
                            "id": 425,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "9294:41:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          ],
                          "id": 422,
                          "name": "ERC20",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 2837,
                          "src": "9288:5:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_contract$_ERC20_$2837_$",
                            "typeString": "type(contract ERC20)"
                          }
                        },
                        "id": 426,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "typeConversion",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "9288:48:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_ERC20_$2837",
                          "typeString": "contract ERC20"
                        }
                      },
                      "id": 427,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "safeTransfer",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 2970,
                      "src": "9288:61:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20_$2937_$_t_address_$_t_uint256_$returns$__$bound_to$_t_contract$_IERC20_$2937_$",
                        "typeString": "function (contract IERC20,address,uint256)"
                      }
                    },
                    "id": 431,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "9288:93:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 432,
                  "nodeType": "ExpressionStatement",
                  "src": "9288:93:0"
                },
                {
                  "eventCall": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 434,
                        "name": "marketContractAddress",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 342,
                        "src": "9425:21:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "id": 435,
                          "name": "msg",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 3186,
                          "src": "9460:3:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_magic_message",
                            "typeString": "msg"
                          }
                        },
                        "id": 436,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sender",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "9460:10:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 437,
                        "name": "longQtyToRedeem",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 344,
                        "src": "9484:15:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 438,
                        "name": "shortQtyToRedeem",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 346,
                        "src": "9513:16:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 439,
                        "name": "collateralToReturn",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 392,
                        "src": "9543:18:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        },
                        {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "id": 433,
                      "name": "TokensRedeemed",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 57,
                      "src": "9397:14:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$",
                        "typeString": "function (address,address,uint256,uint256,uint256)"
                      }
                    },
                    "id": 440,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "9397:174:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 441,
                  "nodeType": "EmitStatement",
                  "src": "9392:179:0"
                }
              ]
            },
            "documentation": "@param marketContractAddress address of the MARKET Contract being traded.\n @param longQtyToRedeem qty to redeem of long tokens\n @param shortQtyToRedeem qty to redeem of short tokens",
            "id": 443,
            "implemented": true,
            "kind": "function",
            "modifiers": [
              {
                "arguments": [
                  {
                    "argumentTypes": null,
                    "id": 349,
                    "name": "marketContractAddress",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 342,
                    "src": "8178:21:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  }
                ],
                "id": 350,
                "modifierName": {
                  "argumentTypes": null,
                  "id": 348,
                  "name": "onlyWhiteListedAddress",
                  "nodeType": "Identifier",
                  "overloadedDeclarations": [],
                  "referencedDeclaration": 547,
                  "src": "8155:22:0",
                  "typeDescriptions": {
                    "typeIdentifier": "t_modifier$_t_address_$",
                    "typeString": "modifier (address)"
                  }
                },
                "nodeType": "ModifierInvocation",
                "src": "8155:45:0"
              }
            ],
            "name": "settleAndClose",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 347,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 342,
                  "name": "marketContractAddress",
                  "nodeType": "VariableDeclaration",
                  "scope": 443,
                  "src": "8049:29:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 341,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "8049:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 344,
                  "name": "longQtyToRedeem",
                  "nodeType": "VariableDeclaration",
                  "scope": 443,
                  "src": "8088:20:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 343,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "8088:4:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 346,
                  "name": "shortQtyToRedeem",
                  "nodeType": "VariableDeclaration",
                  "scope": 443,
                  "src": "8118:21:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 345,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "8118:4:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8039:106:0"
            },
            "returnParameters": {
              "id": 351,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "8205:0:0"
            },
            "scope": 548,
            "src": "8016:1562:0",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "external"
          },
          {
            "body": {
              "id": 488,
              "nodeType": "Block",
              "src": "9894:432:0",
              "statements": [
                {
                  "assignments": [
                    453
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 453,
                      "name": "feesAvailableForWithdrawal",
                      "nodeType": "VariableDeclaration",
                      "scope": 488,
                      "src": "9904:31:0",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 452,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "9904:4:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 457,
                  "initialValue": {
                    "argumentTypes": null,
                    "baseExpression": {
                      "argumentTypes": null,
                      "id": 454,
                      "name": "feesCollectedByTokenAddress",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 31,
                      "src": "9938:27:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
                        "typeString": "mapping(address => uint256)"
                      }
                    },
                    "id": 456,
                    "indexExpression": {
                      "argumentTypes": null,
                      "id": 455,
                      "name": "feeTokenAddress",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 445,
                      "src": "9966:15:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_address",
                        "typeString": "address"
                      }
                    },
                    "isConstant": false,
                    "isLValue": true,
                    "isPure": false,
                    "lValueRequested": false,
                    "nodeType": "IndexAccess",
                    "src": "9938:44:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "9904:78:0"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 461,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 459,
                          "name": "feesAvailableForWithdrawal",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 453,
                          "src": "10000:26:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "!=",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "30",
                          "id": 460,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "10030:1:0",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_0_by_1",
                            "typeString": "int_const 0"
                          },
                          "value": "0"
                        },
                        "src": "10000:31:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "4e6f206665657320617661696c61626c6520666f72207769746864726177616c",
                        "id": 462,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "10033:34:0",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_54ec81e8f99a6c2d788b48bee377b616fca564eb699db703307200d2904e1ee4",
                          "typeString": "literal_string \"No fees available for withdrawal\""
                        },
                        "value": "No fees available for withdrawal"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_54ec81e8f99a6c2d788b48bee377b616fca564eb699db703307200d2904e1ee4",
                          "typeString": "literal_string \"No fees available for withdrawal\""
                        }
                      ],
                      "id": 458,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        3189,
                        3190
                      ],
                      "referencedDeclaration": 3190,
                      "src": "9992:7:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 463,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "9992:76:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 464,
                  "nodeType": "ExpressionStatement",
                  "src": "9992:76:0"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        },
                        "id": 470,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 466,
                          "name": "feeRecipient",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 447,
                          "src": "10086:12:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_address",
                            "typeString": "address"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "!=",
                        "rightExpression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "hexValue": "30",
                              "id": 468,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "number",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "10110:1:0",
                              "subdenomination": null,
                              "typeDescriptions": {
                                "typeIdentifier": "t_rational_0_by_1",
                                "typeString": "int_const 0"
                              },
                              "value": "0"
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_rational_0_by_1",
                                "typeString": "int_const 0"
                              }
                            ],
                            "id": 467,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "10102:7:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_address_$",
                              "typeString": "type(address)"
                            },
                            "typeName": "address"
                          },
                          "id": 469,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "10102:10:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_address_payable",
                            "typeString": "address payable"
                          }
                        },
                        "src": "10086:26:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "43616e6e6f742073656e64206665657320746f206e756c6c2061646472657373",
                        "id": 471,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "10114:34:0",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_d1aa37acc318e26ff4bca832531f9e648c2428bd583debe61d1e31c2433c3be0",
                          "typeString": "literal_string \"Cannot send fees to null address\""
                        },
                        "value": "Cannot send fees to null address"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_d1aa37acc318e26ff4bca832531f9e648c2428bd583debe61d1e31c2433c3be0",
                          "typeString": "literal_string \"Cannot send fees to null address\""
                        }
                      ],
                      "id": 465,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        3189,
                        3190
                      ],
                      "referencedDeclaration": 3190,
                      "src": "10078:7:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 472,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "10078:71:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 473,
                  "nodeType": "ExpressionStatement",
                  "src": "10078:71:0"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 478,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "baseExpression": {
                        "argumentTypes": null,
                        "id": 474,
                        "name": "feesCollectedByTokenAddress",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 31,
                        "src": "10159:27:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
                          "typeString": "mapping(address => uint256)"
                        }
                      },
                      "id": 476,
                      "indexExpression": {
                        "argumentTypes": null,
                        "id": 475,
                        "name": "feeTokenAddress",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 445,
                        "src": "10187:15:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "nodeType": "IndexAccess",
                      "src": "10159:44:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 477,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "10206:1:0",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "src": "10159:48:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 479,
                  "nodeType": "ExpressionStatement",
                  "src": "10159:48:0"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 484,
                        "name": "feeRecipient",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 447,
                        "src": "10278:12:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 485,
                        "name": "feesAvailableForWithdrawal",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 453,
                        "src": "10292:26:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 481,
                            "name": "feeTokenAddress",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 445,
                            "src": "10248:15:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          ],
                          "id": 480,
                          "name": "ERC20",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 2837,
                          "src": "10242:5:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_contract$_ERC20_$2837_$",
                            "typeString": "type(contract ERC20)"
                          }
                        },
                        "id": 482,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "typeConversion",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "10242:22:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_ERC20_$2837",
                          "typeString": "contract ERC20"
                        }
                      },
                      "id": 483,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "safeTransfer",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 2970,
                      "src": "10242:35:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20_$2937_$_t_address_$_t_uint256_$returns$__$bound_to$_t_contract$_IERC20_$2937_$",
                        "typeString": "function (contract IERC20,address,uint256)"
                      }
                    },
                    "id": 486,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "10242:77:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 487,
                  "nodeType": "ExpressionStatement",
                  "src": "10242:77:0"
                }
              ]
            },
            "documentation": "@dev allows the owner to remove the fees paid into this contract for minting\n @param feeTokenAddress - address of the erc20 token fees have been paid in\n @param feeRecipient - Recipient address of fees",
            "id": 489,
            "implemented": true,
            "kind": "function",
            "modifiers": [
              {
                "arguments": null,
                "id": 450,
                "modifierName": {
                  "argumentTypes": null,
                  "id": 449,
                  "name": "onlyOwner",
                  "nodeType": "Identifier",
                  "overloadedDeclarations": [],
                  "referencedDeclaration": 2388,
                  "src": "9884:9:0",
                  "typeDescriptions": {
                    "typeIdentifier": "t_modifier$__$",
                    "typeString": "modifier ()"
                  }
                },
                "nodeType": "ModifierInvocation",
                "src": "9884:9:0"
              }
            ],
            "name": "withdrawFees",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 448,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 445,
                  "name": "feeTokenAddress",
                  "nodeType": "VariableDeclaration",
                  "scope": 489,
                  "src": "9830:23:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 444,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "9830:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 447,
                  "name": "feeRecipient",
                  "nodeType": "VariableDeclaration",
                  "scope": 489,
                  "src": "9855:20:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 446,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "9855:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "9829:47:0"
            },
            "returnParameters": {
              "id": 451,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "9894:0:0"
            },
            "scope": 548,
            "src": "9808:518:0",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "public"
          },
          {
            "body": {
              "id": 509,
              "nodeType": "Block",
              "src": "10536:131:0",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        },
                        "id": 501,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 497,
                          "name": "mktTokenAddress",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 491,
                          "src": "10554:15:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_address",
                            "typeString": "address"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "!=",
                        "rightExpression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "hexValue": "30",
                              "id": 499,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "number",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "10581:1:0",
                              "subdenomination": null,
                              "typeDescriptions": {
                                "typeIdentifier": "t_rational_0_by_1",
                                "typeString": "int_const 0"
                              },
                              "value": "0"
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_rational_0_by_1",
                                "typeString": "int_const 0"
                              }
                            ],
                            "id": 498,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "10573:7:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_address_$",
                              "typeString": "type(address)"
                            },
                            "typeName": "address"
                          },
                          "id": 500,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "10573:10:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_address_payable",
                            "typeString": "address payable"
                          }
                        },
                        "src": "10554:29:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "43616e6e6f7420736574204d4b5420546f6b656e204164647265737320546f204e756c6c",
                        "id": 502,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "10585:38:0",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_6aaa7c0f48eef407c5735213ddef339148c71a804362a12bf650ec79a60f65ef",
                          "typeString": "literal_string \"Cannot set MKT Token Address To Null\""
                        },
                        "value": "Cannot set MKT Token Address To Null"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_6aaa7c0f48eef407c5735213ddef339148c71a804362a12bf650ec79a60f65ef",
                          "typeString": "literal_string \"Cannot set MKT Token Address To Null\""
                        }
                      ],
                      "id": 496,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        3189,
                        3190
                      ],
                      "referencedDeclaration": 3190,
                      "src": "10546:7:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 503,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "10546:78:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 504,
                  "nodeType": "ExpressionStatement",
                  "src": "10546:78:0"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 507,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 505,
                      "name": "mktToken",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 23,
                      "src": "10634:8:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_address",
                        "typeString": "address"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "id": 506,
                      "name": "mktTokenAddress",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 491,
                      "src": "10645:15:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_address",
                        "typeString": "address"
                      }
                    },
                    "src": "10634:26:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "id": 508,
                  "nodeType": "ExpressionStatement",
                  "src": "10634:26:0"
                }
              ]
            },
            "documentation": "@dev allows the owner to update the mkt token address in use for fees\n @param mktTokenAddress address of new MKT token",
            "id": 510,
            "implemented": true,
            "kind": "function",
            "modifiers": [
              {
                "arguments": null,
                "id": 494,
                "modifierName": {
                  "argumentTypes": null,
                  "id": 493,
                  "name": "onlyOwner",
                  "nodeType": "Identifier",
                  "overloadedDeclarations": [],
                  "referencedDeclaration": 2388,
                  "src": "10526:9:0",
                  "typeDescriptions": {
                    "typeIdentifier": "t_modifier$__$",
                    "typeString": "modifier ()"
                  }
                },
                "nodeType": "ModifierInvocation",
                "src": "10526:9:0"
              }
            ],
            "name": "setMKTTokenAddress",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 492,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 491,
                  "name": "mktTokenAddress",
                  "nodeType": "VariableDeclaration",
                  "scope": 510,
                  "src": "10494:23:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 490,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "10494:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "10493:25:0"
            },
            "returnParameters": {
              "id": 495,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "10536:0:0"
            },
            "scope": 548,
            "src": "10466:201:0",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "public"
          },
          {
            "body": {
              "id": 530,
              "nodeType": "Block",
              "src": "10927:188:0",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        },
                        "id": 522,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 518,
                          "name": "marketContractRegistryAddress",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 512,
                          "src": "10945:29:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_address",
                            "typeString": "address"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "!=",
                        "rightExpression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "hexValue": "30",
                              "id": 520,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "number",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "10986:1:0",
                              "subdenomination": null,
                              "typeDescriptions": {
                                "typeIdentifier": "t_rational_0_by_1",
                                "typeString": "int_const 0"
                              },
                              "value": "0"
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_rational_0_by_1",
                                "typeString": "int_const 0"
                              }
                            ],
                            "id": 519,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "10978:7:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_address_$",
                              "typeString": "type(address)"
                            },
                            "typeName": "address"
                          },
                          "id": 521,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "10978:10:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_address_payable",
                            "typeString": "address payable"
                          }
                        },
                        "src": "10945:43:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "43616e6e6f7420736574204d61726b657420436f6e7472616374205265676973747279204164647265737320546f204e756c6c",
                        "id": 523,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "10990:53:0",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_bba068bd79d371b9e9c2a9fc1c7bff8a416c5529757f3c7072fa939867b655aa",
                          "typeString": "literal_string \"Cannot set Market Contract Registry Address To Null\""
                        },
                        "value": "Cannot set Market Contract Registry Address To Null"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_bba068bd79d371b9e9c2a9fc1c7bff8a416c5529757f3c7072fa939867b655aa",
                          "typeString": "literal_string \"Cannot set Market Contract Registry Address To Null\""
                        }
                      ],
                      "id": 517,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        3189,
                        3190
                      ],
                      "referencedDeclaration": 3190,
                      "src": "10937:7:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 524,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "10937:107:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 525,
                  "nodeType": "ExpressionStatement",
                  "src": "10937:107:0"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 528,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 526,
                      "name": "marketContractRegistry",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 21,
                      "src": "11054:22:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_address",
                        "typeString": "address"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "id": 527,
                      "name": "marketContractRegistryAddress",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 512,
                      "src": "11079:29:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_address",
                        "typeString": "address"
                      }
                    },
                    "src": "11054:54:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "id": 529,
                  "nodeType": "ExpressionStatement",
                  "src": "11054:54:0"
                }
              ]
            },
            "documentation": "@dev allows the owner to update the mkt token address in use for fees\n @param marketContractRegistryAddress address of new contract registry",
            "id": 531,
            "implemented": true,
            "kind": "function",
            "modifiers": [
              {
                "arguments": null,
                "id": 515,
                "modifierName": {
                  "argumentTypes": null,
                  "id": 514,
                  "name": "onlyOwner",
                  "nodeType": "Identifier",
                  "overloadedDeclarations": [],
                  "referencedDeclaration": 2388,
                  "src": "10917:9:0",
                  "typeDescriptions": {
                    "typeIdentifier": "t_modifier$__$",
                    "typeString": "modifier ()"
                  }
                },
                "nodeType": "ModifierInvocation",
                "src": "10917:9:0"
              }
            ],
            "name": "setMarketContractRegistryAddress",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 513,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 512,
                  "name": "marketContractRegistryAddress",
                  "nodeType": "VariableDeclaration",
                  "scope": 531,
                  "src": "10871:37:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 511,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "10871:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "10870:39:0"
            },
            "returnParameters": {
              "id": 516,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "10927:0:0"
            },
            "scope": 548,
            "src": "10829:286:0",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "public"
          },
          {
            "body": {
              "id": 546,
              "nodeType": "Block",
              "src": "11607:201:0",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 540,
                            "name": "marketContractAddress",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 533,
                            "src": "11715:21:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          ],
                          "expression": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "id": 537,
                                "name": "marketContractRegistry",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 21,
                                "src": "11670:22:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_address",
                                  "typeString": "address"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_address",
                                  "typeString": "address"
                                }
                              ],
                              "id": 536,
                              "name": "MarketContractRegistryInterface",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1161,
                              "src": "11638:31:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_type$_t_contract$_MarketContractRegistryInterface_$1161_$",
                                "typeString": "type(contract MarketContractRegistryInterface)"
                              }
                            },
                            "id": 538,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "typeConversion",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "11638:55:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_contract$_MarketContractRegistryInterface_$1161",
                              "typeString": "contract MarketContractRegistryInterface"
                            }
                          },
                          "id": 539,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "isAddressWhiteListed",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 1160,
                          "src": "11638:76:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_bool_$",
                            "typeString": "function (address) view external returns (bool)"
                          }
                        },
                        "id": 541,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "11638:99:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "436f6e7472616374206973206e6f742077686974656c6973746564",
                        "id": 542,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "11751:29:0",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_c061099c67eeed759bf3ec7295818a4d5c0e9d6ae20bd188f5c0d435db044c24",
                          "typeString": "literal_string \"Contract is not whitelisted\""
                        },
                        "value": "Contract is not whitelisted"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_c061099c67eeed759bf3ec7295818a4d5c0e9d6ae20bd188f5c0d435db044c24",
                          "typeString": "literal_string \"Contract is not whitelisted\""
                        }
                      ],
                      "id": 535,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        3189,
                        3190
                      ],
                      "referencedDeclaration": 3190,
                      "src": "11617:7:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 543,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "11617:173:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 544,
                  "nodeType": "ExpressionStatement",
                  "src": "11617:173:0"
                },
                {
                  "id": 545,
                  "nodeType": "PlaceholderStatement",
                  "src": "11800:1:0"
                }
              ]
            },
            "documentation": "@notice only can be called with a market contract address that currently exists in our whitelist\n this ensure's it is a market contract that has been created by us and therefore has a uniquely created\n long and short token address.  If it didn't we could have spoofed contracts minting tokens with a\n collateral token that wasn't the same as the intended token.",
            "id": 547,
            "name": "onlyWhiteListedAddress",
            "nodeType": "ModifierDefinition",
            "parameters": {
              "id": 534,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 533,
                  "name": "marketContractAddress",
                  "nodeType": "VariableDeclaration",
                  "scope": 547,
                  "src": "11576:29:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 532,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "11576:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "11575:31:0"
            },
            "src": "11544:264:0",
            "visibility": "internal"
          }
        ],
        "scope": 549,
        "src": "1290:10520:0"
      }
    ],
    "src": "608:11203:0"
  },
  "legacyAST": {
    "absolutePath": "/home/travis/build/MARKETProtocol/MARKETProtocol/contracts/MarketCollateralPool.sol",
    "exportedSymbols": {
      "MarketCollateralPool": [
        548
      ]
    },
    "id": 549,
    "nodeType": "SourceUnit",
    "nodes": [
      {
        "id": 1,
        "literals": [
          "solidity",
          "0.5",
          ".2"
        ],
        "nodeType": "PragmaDirective",
        "src": "608:22:0"
      },
      {
        "absolutePath": "/home/travis/build/MARKETProtocol/MARKETProtocol/contracts/libraries/MathLib.sol",
        "file": "./libraries/MathLib.sol",
        "id": 2,
        "nodeType": "ImportDirective",
        "scope": 549,
        "sourceUnit": 1490,
        "src": "632:33:0",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "absolutePath": "/home/travis/build/MARKETProtocol/MARKETProtocol/contracts/MarketContract.sol",
        "file": "./MarketContract.sol",
        "id": 3,
        "nodeType": "ImportDirective",
        "scope": 549,
        "sourceUnit": 945,
        "src": "666:30:0",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "absolutePath": "/home/travis/build/MARKETProtocol/MARKETProtocol/contracts/tokens/PositionToken.sol",
        "file": "./tokens/PositionToken.sol",
        "id": 4,
        "nodeType": "ImportDirective",
        "scope": 549,
        "sourceUnit": 2090,
        "src": "697:36:0",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "absolutePath": "/home/travis/build/MARKETProtocol/MARKETProtocol/contracts/MarketContractRegistryInterface.sol",
        "file": "./MarketContractRegistryInterface.sol",
        "id": 5,
        "nodeType": "ImportDirective",
        "scope": 549,
        "sourceUnit": 1162,
        "src": "734:47:0",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "absolutePath": "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol",
        "file": "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol",
        "id": 6,
        "nodeType": "ImportDirective",
        "scope": 549,
        "sourceUnit": 3153,
        "src": "783:67:0",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "absolutePath": "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol",
        "file": "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol",
        "id": 7,
        "nodeType": "ImportDirective",
        "scope": 549,
        "sourceUnit": 2838,
        "src": "851:63:0",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "absolutePath": "openzeppelin-solidity/contracts/ownership/Ownable.sol",
        "file": "openzeppelin-solidity/contracts/ownership/Ownable.sol",
        "id": 8,
        "nodeType": "ImportDirective",
        "scope": 549,
        "sourceUnit": 2455,
        "src": "915:63:0",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "baseContracts": [
          {
            "arguments": null,
            "baseName": {
              "contractScope": null,
              "id": 9,
              "name": "Ownable",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 2454,
              "src": "1323:7:0",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_Ownable_$2454",
                "typeString": "contract Ownable"
              }
            },
            "id": 10,
            "nodeType": "InheritanceSpecifier",
            "src": "1323:7:0"
          }
        ],
        "contractDependencies": [
          2454
        ],
        "contractKind": "contract",
        "documentation": "@title MarketCollateralPool\n @notice This collateral pool houses all of the collateral for all market contracts currently in circulation.\n This pool facilitates locking of collateral and minting / redemption of position tokens for that collateral.\n @author Phil Elsasser <phil@marketprotocol.io>",
        "fullyImplemented": true,
        "id": 548,
        "linearizedBaseContracts": [
          548,
          2454
        ],
        "name": "MarketCollateralPool",
        "nodeType": "ContractDefinition",
        "nodes": [
          {
            "id": 13,
            "libraryName": {
              "contractScope": null,
              "id": 11,
              "name": "MathLib",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 1489,
              "src": "1343:7:0",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_MathLib_$1489",
                "typeString": "library MathLib"
              }
            },
            "nodeType": "UsingForDirective",
            "src": "1337:23:0",
            "typeName": {
              "id": 12,
              "name": "uint",
              "nodeType": "ElementaryTypeName",
              "src": "1355:4:0",
              "typeDescriptions": {
                "typeIdentifier": "t_uint256",
                "typeString": "uint256"
              }
            }
          },
          {
            "id": 16,
            "libraryName": {
              "contractScope": null,
              "id": 14,
              "name": "MathLib",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 1489,
              "src": "1371:7:0",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_MathLib_$1489",
                "typeString": "library MathLib"
              }
            },
            "nodeType": "UsingForDirective",
            "src": "1365:22:0",
            "typeName": {
              "id": 15,
              "name": "int",
              "nodeType": "ElementaryTypeName",
              "src": "1383:3:0",
              "typeDescriptions": {
                "typeIdentifier": "t_int256",
                "typeString": "int256"
              }
            }
          },
          {
            "id": 19,
            "libraryName": {
              "contractScope": null,
              "id": 17,
              "name": "SafeERC20",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 3152,
              "src": "1398:9:0",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_SafeERC20_$3152",
                "typeString": "library SafeERC20"
              }
            },
            "nodeType": "UsingForDirective",
            "src": "1392:26:0",
            "typeName": {
              "contractScope": null,
              "id": 18,
              "name": "ERC20",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 2837,
              "src": "1412:5:0",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_ERC20_$2837",
                "typeString": "contract ERC20"
              }
            }
          },
          {
            "constant": false,
            "id": 21,
            "name": "marketContractRegistry",
            "nodeType": "VariableDeclaration",
            "scope": 548,
            "src": "1424:37:0",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_address",
              "typeString": "address"
            },
            "typeName": {
              "id": 20,
              "name": "address",
              "nodeType": "ElementaryTypeName",
              "src": "1424:7:0",
              "stateMutability": "nonpayable",
              "typeDescriptions": {
                "typeIdentifier": "t_address",
                "typeString": "address"
              }
            },
            "value": null,
            "visibility": "public"
          },
          {
            "constant": false,
            "id": 23,
            "name": "mktToken",
            "nodeType": "VariableDeclaration",
            "scope": 548,
            "src": "1467:23:0",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_address",
              "typeString": "address"
            },
            "typeName": {
              "id": 22,
              "name": "address",
              "nodeType": "ElementaryTypeName",
              "src": "1467:7:0",
              "stateMutability": "nonpayable",
              "typeDescriptions": {
                "typeIdentifier": "t_address",
                "typeString": "address"
              }
            },
            "value": null,
            "visibility": "public"
          },
          {
            "constant": false,
            "id": 27,
            "name": "contractAddressToCollateralPoolBalance",
            "nodeType": "VariableDeclaration",
            "scope": 548,
            "src": "1497:70:0",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
              "typeString": "mapping(address => uint256)"
            },
            "typeName": {
              "id": 26,
              "keyType": {
                "id": 24,
                "name": "address",
                "nodeType": "ElementaryTypeName",
                "src": "1505:7:0",
                "typeDescriptions": {
                  "typeIdentifier": "t_address",
                  "typeString": "address"
                }
              },
              "nodeType": "Mapping",
              "src": "1497:24:0",
              "typeDescriptions": {
                "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
                "typeString": "mapping(address => uint256)"
              },
              "valueType": {
                "id": 25,
                "name": "uint",
                "nodeType": "ElementaryTypeName",
                "src": "1516:4:0",
                "typeDescriptions": {
                  "typeIdentifier": "t_uint256",
                  "typeString": "uint256"
                }
              }
            },
            "value": null,
            "visibility": "public"
          },
          {
            "constant": false,
            "id": 31,
            "name": "feesCollectedByTokenAddress",
            "nodeType": "VariableDeclaration",
            "scope": 548,
            "src": "1636:59:0",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
              "typeString": "mapping(address => uint256)"
            },
            "typeName": {
              "id": 30,
              "keyType": {
                "id": 28,
                "name": "address",
                "nodeType": "ElementaryTypeName",
                "src": "1644:7:0",
                "typeDescriptions": {
                  "typeIdentifier": "t_address",
                  "typeString": "address"
                }
              },
              "nodeType": "Mapping",
              "src": "1636:24:0",
              "typeDescriptions": {
                "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
                "typeString": "mapping(address => uint256)"
              },
              "valueType": {
                "id": 29,
                "name": "uint",
                "nodeType": "ElementaryTypeName",
                "src": "1655:4:0",
                "typeDescriptions": {
                  "typeIdentifier": "t_uint256",
                  "typeString": "uint256"
                }
              }
            },
            "value": null,
            "visibility": "public"
          },
          {
            "anonymous": false,
            "documentation": null,
            "id": 45,
            "name": "TokensMinted",
            "nodeType": "EventDefinition",
            "parameters": {
              "id": 44,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 33,
                  "indexed": true,
                  "name": "marketContract",
                  "nodeType": "VariableDeclaration",
                  "scope": 45,
                  "src": "1730:30:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 32,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "1730:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 35,
                  "indexed": true,
                  "name": "user",
                  "nodeType": "VariableDeclaration",
                  "scope": 45,
                  "src": "1770:20:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 34,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "1770:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 37,
                  "indexed": true,
                  "name": "feeToken",
                  "nodeType": "VariableDeclaration",
                  "scope": 45,
                  "src": "1800:24:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 36,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "1800:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 39,
                  "indexed": false,
                  "name": "qtyMinted",
                  "nodeType": "VariableDeclaration",
                  "scope": 45,
                  "src": "1834:14:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 38,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "1834:4:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 41,
                  "indexed": false,
                  "name": "collateralLocked",
                  "nodeType": "VariableDeclaration",
                  "scope": 45,
                  "src": "1858:21:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 40,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "1858:4:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 43,
                  "indexed": false,
                  "name": "feesPaid",
                  "nodeType": "VariableDeclaration",
                  "scope": 45,
                  "src": "1889:13:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 42,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "1889:4:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1720:188:0"
            },
            "src": "1702:207:0"
          },
          {
            "anonymous": false,
            "documentation": null,
            "id": 57,
            "name": "TokensRedeemed",
            "nodeType": "EventDefinition",
            "parameters": {
              "id": 56,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 47,
                  "indexed": true,
                  "name": "marketContract",
                  "nodeType": "VariableDeclaration",
                  "scope": 57,
                  "src": "1946:30:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 46,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "1946:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 49,
                  "indexed": true,
                  "name": "user",
                  "nodeType": "VariableDeclaration",
                  "scope": 57,
                  "src": "1986:20:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 48,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "1986:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 51,
                  "indexed": false,
                  "name": "longQtyRedeemed",
                  "nodeType": "VariableDeclaration",
                  "scope": 57,
                  "src": "2016:20:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 50,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2016:4:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 53,
                  "indexed": false,
                  "name": "shortQtyRedeemed",
                  "nodeType": "VariableDeclaration",
                  "scope": 57,
                  "src": "2046:21:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 52,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2046:4:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 55,
                  "indexed": false,
                  "name": "collateralUnlocked",
                  "nodeType": "VariableDeclaration",
                  "scope": 57,
                  "src": "2077:23:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 54,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2077:4:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1936:170:0"
            },
            "src": "1915:192:0"
          },
          {
            "body": {
              "id": 72,
              "nodeType": "Block",
              "src": "2196:107:0",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 66,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 64,
                      "name": "marketContractRegistry",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 21,
                      "src": "2206:22:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_address",
                        "typeString": "address"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "id": 65,
                      "name": "marketContractRegistryAddress",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 59,
                      "src": "2231:29:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_address",
                        "typeString": "address"
                      }
                    },
                    "src": "2206:54:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "id": 67,
                  "nodeType": "ExpressionStatement",
                  "src": "2206:54:0"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 70,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 68,
                      "name": "mktToken",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 23,
                      "src": "2270:8:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_address",
                        "typeString": "address"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "id": 69,
                      "name": "mktTokenAddress",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 61,
                      "src": "2281:15:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_address",
                        "typeString": "address"
                      }
                    },
                    "src": "2270:26:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "id": 71,
                  "nodeType": "ExpressionStatement",
                  "src": "2270:26:0"
                }
              ]
            },
            "documentation": null,
            "id": 73,
            "implemented": true,
            "kind": "constructor",
            "modifiers": [],
            "name": "",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 62,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 59,
                  "name": "marketContractRegistryAddress",
                  "nodeType": "VariableDeclaration",
                  "scope": 73,
                  "src": "2125:37:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 58,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "2125:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 61,
                  "name": "mktTokenAddress",
                  "nodeType": "VariableDeclaration",
                  "scope": 73,
                  "src": "2164:23:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 60,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "2164:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2124:64:0"
            },
            "returnParameters": {
              "id": 63,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "2196:0:0"
            },
            "scope": 548,
            "src": "2113:190:0",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "public"
          },
          {
            "body": {
              "id": 265,
              "nodeType": "Block",
              "src": "3116:2992:0",
              "statements": [
                {
                  "assignments": [
                    86
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 86,
                      "name": "marketContract",
                      "nodeType": "VariableDeclaration",
                      "scope": 265,
                      "src": "3127:29:0",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_contract$_MarketContract_$944",
                        "typeString": "contract MarketContract"
                      },
                      "typeName": {
                        "contractScope": null,
                        "id": 85,
                        "name": "MarketContract",
                        "nodeType": "UserDefinedTypeName",
                        "referencedDeclaration": 944,
                        "src": "3127:14:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_MarketContract_$944",
                          "typeString": "contract MarketContract"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 90,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 88,
                        "name": "marketContractAddress",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 75,
                        "src": "3174:21:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      ],
                      "id": 87,
                      "name": "MarketContract",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 944,
                      "src": "3159:14:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_type$_t_contract$_MarketContract_$944_$",
                        "typeString": "type(contract MarketContract)"
                      }
                    },
                    "id": 89,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "typeConversion",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3159:37:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_MarketContract_$944",
                      "typeString": "contract MarketContract"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3127:69:0"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 95,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "nodeType": "UnaryOperation",
                        "operator": "!",
                        "prefix": true,
                        "src": "3214:27:0",
                        "subExpression": {
                          "argumentTypes": null,
                          "arguments": [],
                          "expression": {
                            "argumentTypes": [],
                            "expression": {
                              "argumentTypes": null,
                              "id": 92,
                              "name": "marketContract",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 86,
                              "src": "3215:14:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_MarketContract_$944",
                                "typeString": "contract MarketContract"
                              }
                            },
                            "id": 93,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "isSettled",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 596,
                            "src": "3215:24:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_view$__$returns$_t_bool_$",
                              "typeString": "function () view external returns (bool)"
                            }
                          },
                          "id": 94,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "3215:26:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "436f6e747261637420697320616c726561647920736574746c6564",
                        "id": 96,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "3243:29:0",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_ca173d03a4252dfa571f586cd2c07cbf7461ad4fb4aa3d483d41782466df287b",
                          "typeString": "literal_string \"Contract is already settled\""
                        },
                        "value": "Contract is already settled"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_ca173d03a4252dfa571f586cd2c07cbf7461ad4fb4aa3d483d41782466df287b",
                          "typeString": "literal_string \"Contract is already settled\""
                        }
                      ],
                      "id": 91,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        3189,
                        3190
                      ],
                      "referencedDeclaration": 3190,
                      "src": "3206:7:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 97,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3206:67:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 98,
                  "nodeType": "ExpressionStatement",
                  "src": "3206:67:0"
                },
                {
                  "assignments": [
                    100
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 100,
                      "name": "collateralTokenAddress",
                      "nodeType": "VariableDeclaration",
                      "scope": 265,
                      "src": "3284:30:0",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_address",
                        "typeString": "address"
                      },
                      "typeName": {
                        "id": 99,
                        "name": "address",
                        "nodeType": "ElementaryTypeName",
                        "src": "3284:7:0",
                        "stateMutability": "nonpayable",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 104,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 101,
                        "name": "marketContract",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 86,
                        "src": "3317:14:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_MarketContract_$944",
                          "typeString": "contract MarketContract"
                        }
                      },
                      "id": 102,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "COLLATERAL_TOKEN_ADDRESS",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 562,
                      "src": "3317:39:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_external_view$__$returns$_t_address_$",
                        "typeString": "function () view external returns (address)"
                      }
                    },
                    "id": 103,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3317:41:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3284:74:0"
                },
                {
                  "assignments": [
                    106
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 106,
                      "name": "neededCollateral",
                      "nodeType": "VariableDeclaration",
                      "scope": 265,
                      "src": "3368:21:0",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 105,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "3368:4:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 114,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 109,
                        "name": "qtyToMint",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 77,
                        "src": "3409:9:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "arguments": [],
                        "expression": {
                          "argumentTypes": [],
                          "expression": {
                            "argumentTypes": null,
                            "id": 110,
                            "name": "marketContract",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 86,
                            "src": "3420:14:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_contract$_MarketContract_$944",
                              "typeString": "contract MarketContract"
                            }
                          },
                          "id": 111,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "COLLATERAL_PER_UNIT",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 574,
                          "src": "3420:34:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                            "typeString": "function () view external returns (uint256)"
                          }
                        },
                        "id": 112,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "3420:36:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 107,
                        "name": "MathLib",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1489,
                        "src": "3392:7:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_contract$_MathLib_$1489_$",
                          "typeString": "type(library MathLib)"
                        }
                      },
                      "id": 108,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "multiply",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 1276,
                      "src": "3392:16:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
                        "typeString": "function (uint256,uint256) pure returns (uint256)"
                      }
                    },
                    "id": 113,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3392:65:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3368:89:0"
                },
                {
                  "assignments": [
                    116
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 116,
                      "name": "isPayFeesInMKT",
                      "nodeType": "VariableDeclaration",
                      "scope": 265,
                      "src": "3751:19:0",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      },
                      "typeName": {
                        "id": 115,
                        "name": "bool",
                        "nodeType": "ElementaryTypeName",
                        "src": "3751:4:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 141,
                  "initialValue": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    },
                    "id": 140,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "components": [
                        {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          },
                          "id": 123,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 117,
                            "name": "isAttemptToPayInMKT",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 79,
                            "src": "3774:19:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bool",
                              "typeString": "bool"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "&&",
                          "rightExpression": {
                            "argumentTypes": null,
                            "commonType": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            },
                            "id": 122,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftExpression": {
                              "argumentTypes": null,
                              "arguments": [],
                              "expression": {
                                "argumentTypes": [],
                                "expression": {
                                  "argumentTypes": null,
                                  "id": 118,
                                  "name": "marketContract",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 86,
                                  "src": "3809:14:0",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_MarketContract_$944",
                                    "typeString": "contract MarketContract"
                                  }
                                },
                                "id": 119,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "MKT_TOKEN_FEE_PER_UNIT",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 578,
                                "src": "3809:37:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                                  "typeString": "function () view external returns (uint256)"
                                }
                              },
                              "id": 120,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "functionCall",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "3809:39:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "nodeType": "BinaryOperation",
                            "operator": "!=",
                            "rightExpression": {
                              "argumentTypes": null,
                              "hexValue": "30",
                              "id": 121,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "number",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "3852:1:0",
                              "subdenomination": null,
                              "typeDescriptions": {
                                "typeIdentifier": "t_rational_0_by_1",
                                "typeString": "int_const 0"
                              },
                              "value": "0"
                            },
                            "src": "3809:44:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bool",
                              "typeString": "bool"
                            }
                          },
                          "src": "3774:79:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        }
                      ],
                      "id": 124,
                      "isConstant": false,
                      "isInlineArray": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "nodeType": "TupleExpression",
                      "src": "3773:81:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "||",
                    "rightExpression": {
                      "argumentTypes": null,
                      "components": [
                        {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          },
                          "id": 138,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "commonType": {
                              "typeIdentifier": "t_bool",
                              "typeString": "bool"
                            },
                            "id": 132,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftExpression": {
                              "argumentTypes": null,
                              "id": 126,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "nodeType": "UnaryOperation",
                              "operator": "!",
                              "prefix": true,
                              "src": "3871:20:0",
                              "subExpression": {
                                "argumentTypes": null,
                                "id": 125,
                                "name": "isAttemptToPayInMKT",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 79,
                                "src": "3872:19:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bool",
                                  "typeString": "bool"
                                }
                              },
                              "typeDescriptions": {
                                "typeIdentifier": "t_bool",
                                "typeString": "bool"
                              }
                            },
                            "nodeType": "BinaryOperation",
                            "operator": "&&",
                            "rightExpression": {
                              "argumentTypes": null,
                              "commonType": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              },
                              "id": 131,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "leftExpression": {
                                "argumentTypes": null,
                                "arguments": [],
                                "expression": {
                                  "argumentTypes": [],
                                  "expression": {
                                    "argumentTypes": null,
                                    "id": 127,
                                    "name": "marketContract",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 86,
                                    "src": "3907:14:0",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_contract$_MarketContract_$944",
                                      "typeString": "contract MarketContract"
                                    }
                                  },
                                  "id": 128,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "MKT_TOKEN_FEE_PER_UNIT",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 578,
                                  "src": "3907:37:0",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                                    "typeString": "function () view external returns (uint256)"
                                  }
                                },
                                "id": 129,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "3907:39:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "nodeType": "BinaryOperation",
                              "operator": "!=",
                              "rightExpression": {
                                "argumentTypes": null,
                                "hexValue": "30",
                                "id": 130,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": true,
                                "kind": "number",
                                "lValueRequested": false,
                                "nodeType": "Literal",
                                "src": "3950:1:0",
                                "subdenomination": null,
                                "typeDescriptions": {
                                  "typeIdentifier": "t_rational_0_by_1",
                                  "typeString": "int_const 0"
                                },
                                "value": "0"
                              },
                              "src": "3907:44:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_bool",
                                "typeString": "bool"
                              }
                            },
                            "src": "3871:80:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bool",
                              "typeString": "bool"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "&&",
                          "rightExpression": {
                            "argumentTypes": null,
                            "commonType": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            },
                            "id": 137,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftExpression": {
                              "argumentTypes": null,
                              "arguments": [],
                              "expression": {
                                "argumentTypes": [],
                                "expression": {
                                  "argumentTypes": null,
                                  "id": 133,
                                  "name": "marketContract",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 86,
                                  "src": "3967:14:0",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_MarketContract_$944",
                                    "typeString": "contract MarketContract"
                                  }
                                },
                                "id": 134,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "COLLATERAL_TOKEN_FEE_PER_UNIT",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 576,
                                "src": "3967:44:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                                  "typeString": "function () view external returns (uint256)"
                                }
                              },
                              "id": 135,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "functionCall",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "3967:46:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "nodeType": "BinaryOperation",
                            "operator": "==",
                            "rightExpression": {
                              "argumentTypes": null,
                              "hexValue": "30",
                              "id": 136,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "number",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "4017:1:0",
                              "subdenomination": null,
                              "typeDescriptions": {
                                "typeIdentifier": "t_rational_0_by_1",
                                "typeString": "int_const 0"
                              },
                              "value": "0"
                            },
                            "src": "3967:51:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bool",
                              "typeString": "bool"
                            }
                          },
                          "src": "3871:147:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        }
                      ],
                      "id": 139,
                      "isConstant": false,
                      "isInlineArray": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "nodeType": "TupleExpression",
                      "src": "3870:149:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      }
                    },
                    "src": "3773:246:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3751:268:0"
                },
                {
                  "assignments": [
                    143
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 143,
                      "name": "feeAmount",
                      "nodeType": "VariableDeclaration",
                      "scope": 265,
                      "src": "4030:14:0",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 142,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "4030:4:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 144,
                  "initialValue": null,
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4030:14:0"
                },
                {
                  "assignments": [
                    146
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 146,
                      "name": "totalCollateralTokenTransferAmount",
                      "nodeType": "VariableDeclaration",
                      "scope": 265,
                      "src": "4054:39:0",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 145,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "4054:4:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 147,
                  "initialValue": null,
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4054:39:0"
                },
                {
                  "assignments": [
                    149
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 149,
                      "name": "feeToken",
                      "nodeType": "VariableDeclaration",
                      "scope": 265,
                      "src": "4103:16:0",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_address",
                        "typeString": "address"
                      },
                      "typeName": {
                        "id": 148,
                        "name": "address",
                        "nodeType": "ElementaryTypeName",
                        "src": "4103:7:0",
                        "stateMutability": "nonpayable",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 150,
                  "initialValue": null,
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4103:16:0"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "id": 151,
                    "name": "isPayFeesInMKT",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 116,
                    "src": "4133:14:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": {
                    "id": 204,
                    "nodeType": "Block",
                    "src": "4654:374:0",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 191,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 183,
                            "name": "feeAmount",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 143,
                            "src": "4730:9:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "id": 186,
                                "name": "qtyToMint",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 77,
                                "src": "4759:9:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              {
                                "argumentTypes": null,
                                "arguments": [],
                                "expression": {
                                  "argumentTypes": [],
                                  "expression": {
                                    "argumentTypes": null,
                                    "id": 187,
                                    "name": "marketContract",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 86,
                                    "src": "4770:14:0",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_contract$_MarketContract_$944",
                                      "typeString": "contract MarketContract"
                                    }
                                  },
                                  "id": 188,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "COLLATERAL_TOKEN_FEE_PER_UNIT",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 576,
                                  "src": "4770:44:0",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                                    "typeString": "function () view external returns (uint256)"
                                  }
                                },
                                "id": 189,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "4770:46:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                },
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              ],
                              "expression": {
                                "argumentTypes": null,
                                "id": 184,
                                "name": "MathLib",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 1489,
                                "src": "4742:7:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_type$_t_contract$_MathLib_$1489_$",
                                  "typeString": "type(library MathLib)"
                                }
                              },
                              "id": 185,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "multiply",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 1276,
                              "src": "4742:16:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
                                "typeString": "function (uint256,uint256) pure returns (uint256)"
                              }
                            },
                            "id": 190,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "4742:75:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "4730:87:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 192,
                        "nodeType": "ExpressionStatement",
                        "src": "4730:87:0"
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 198,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 193,
                            "name": "totalCollateralTokenTransferAmount",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 146,
                            "src": "4831:34:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "id": 196,
                                "name": "feeAmount",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 143,
                                "src": "4889:9:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              ],
                              "expression": {
                                "argumentTypes": null,
                                "id": 194,
                                "name": "neededCollateral",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 106,
                                "src": "4868:16:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "id": 195,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "add",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 1341,
                              "src": "4868:20:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                                "typeString": "function (uint256,uint256) pure returns (uint256)"
                              }
                            },
                            "id": 197,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "4868:31:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "4831:68:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 199,
                        "nodeType": "ExpressionStatement",
                        "src": "4831:68:0"
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 202,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 200,
                            "name": "feeToken",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 149,
                            "src": "4913:8:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "id": 201,
                            "name": "collateralTokenAddress",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 100,
                            "src": "4924:22:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          },
                          "src": "4913:33:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_address",
                            "typeString": "address"
                          }
                        },
                        "id": 203,
                        "nodeType": "ExpressionStatement",
                        "src": "4913:33:0"
                      }
                    ]
                  },
                  "id": 205,
                  "nodeType": "IfStatement",
                  "src": "4129:899:0",
                  "trueBody": {
                    "id": 182,
                    "nodeType": "Block",
                    "src": "4149:499:0",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 160,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 152,
                            "name": "feeAmount",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 143,
                            "src": "4198:9:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "id": 155,
                                "name": "qtyToMint",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 77,
                                "src": "4227:9:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              {
                                "argumentTypes": null,
                                "arguments": [],
                                "expression": {
                                  "argumentTypes": [],
                                  "expression": {
                                    "argumentTypes": null,
                                    "id": 156,
                                    "name": "marketContract",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 86,
                                    "src": "4238:14:0",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_contract$_MarketContract_$944",
                                      "typeString": "contract MarketContract"
                                    }
                                  },
                                  "id": 157,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "MKT_TOKEN_FEE_PER_UNIT",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 578,
                                  "src": "4238:37:0",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                                    "typeString": "function () view external returns (uint256)"
                                  }
                                },
                                "id": 158,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "4238:39:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                },
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              ],
                              "expression": {
                                "argumentTypes": null,
                                "id": 153,
                                "name": "MathLib",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 1489,
                                "src": "4210:7:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_type$_t_contract$_MathLib_$1489_$",
                                  "typeString": "type(library MathLib)"
                                }
                              },
                              "id": 154,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "multiply",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 1276,
                              "src": "4210:16:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
                                "typeString": "function (uint256,uint256) pure returns (uint256)"
                              }
                            },
                            "id": 159,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "4210:68:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "4198:80:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 161,
                        "nodeType": "ExpressionStatement",
                        "src": "4198:80:0"
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 164,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 162,
                            "name": "totalCollateralTokenTransferAmount",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 146,
                            "src": "4292:34:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "id": 163,
                            "name": "neededCollateral",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 106,
                            "src": "4329:16:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "4292:53:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 165,
                        "nodeType": "ExpressionStatement",
                        "src": "4292:53:0"
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 168,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 166,
                            "name": "feeToken",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 149,
                            "src": "4359:8:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "id": 167,
                            "name": "mktToken",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 23,
                            "src": "4370:8:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          },
                          "src": "4359:19:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_address",
                            "typeString": "address"
                          }
                        },
                        "id": 169,
                        "nodeType": "ExpressionStatement",
                        "src": "4359:19:0"
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "expression": {
                                "argumentTypes": null,
                                "id": 174,
                                "name": "msg",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 3186,
                                "src": "4600:3:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_magic_message",
                                  "typeString": "msg"
                                }
                              },
                              "id": 175,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "sender",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": null,
                              "src": "4600:10:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_address_payable",
                                "typeString": "address payable"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "arguments": [
                                {
                                  "argumentTypes": null,
                                  "id": 177,
                                  "name": "this",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 3221,
                                  "src": "4620:4:0",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_contract$_MarketCollateralPool_$548",
                                    "typeString": "contract MarketCollateralPool"
                                  }
                                }
                              ],
                              "expression": {
                                "argumentTypes": [
                                  {
                                    "typeIdentifier": "t_contract$_MarketCollateralPool_$548",
                                    "typeString": "contract MarketCollateralPool"
                                  }
                                ],
                                "id": 176,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": true,
                                "lValueRequested": false,
                                "nodeType": "ElementaryTypeNameExpression",
                                "src": "4612:7:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_type$_t_address_$",
                                  "typeString": "type(address)"
                                },
                                "typeName": "address"
                              },
                              "id": 178,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "typeConversion",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "4612:13:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_address",
                                "typeString": "address"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "id": 179,
                              "name": "feeAmount",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 143,
                              "src": "4627:9:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_address_payable",
                                "typeString": "address payable"
                              },
                              {
                                "typeIdentifier": "t_address",
                                "typeString": "address"
                              },
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "expression": {
                              "argumentTypes": null,
                              "arguments": [
                                {
                                  "argumentTypes": null,
                                  "id": 171,
                                  "name": "mktToken",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 23,
                                  "src": "4573:8:0",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_address",
                                    "typeString": "address"
                                  }
                                }
                              ],
                              "expression": {
                                "argumentTypes": [
                                  {
                                    "typeIdentifier": "t_address",
                                    "typeString": "address"
                                  }
                                ],
                                "id": 170,
                                "name": "ERC20",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 2837,
                                "src": "4567:5:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_type$_t_contract$_ERC20_$2837_$",
                                  "typeString": "type(contract ERC20)"
                                }
                              },
                              "id": 172,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "typeConversion",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "4567:15:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_ERC20_$2837",
                                "typeString": "contract ERC20"
                              }
                            },
                            "id": 173,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "safeTransferFrom",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 2995,
                            "src": "4567:32:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20_$2937_$_t_address_$_t_address_$_t_uint256_$returns$__$bound_to$_t_contract$_IERC20_$2937_$",
                              "typeString": "function (contract IERC20,address,address,uint256)"
                            }
                          },
                          "id": 180,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "4567:70:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_tuple$__$",
                            "typeString": "tuple()"
                          }
                        },
                        "id": 181,
                        "nodeType": "ExpressionStatement",
                        "src": "4567:70:0"
                      }
                    ]
                  }
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "id": 212,
                          "name": "msg",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 3186,
                          "src": "5270:3:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_magic_message",
                            "typeString": "msg"
                          }
                        },
                        "id": 213,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sender",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "5270:10:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 215,
                            "name": "this",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 3221,
                            "src": "5290:4:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_contract$_MarketCollateralPool_$548",
                              "typeString": "contract MarketCollateralPool"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_contract$_MarketCollateralPool_$548",
                              "typeString": "contract MarketCollateralPool"
                            }
                          ],
                          "id": 214,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "lValueRequested": false,
                          "nodeType": "ElementaryTypeNameExpression",
                          "src": "5282:7:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_address_$",
                            "typeString": "type(address)"
                          },
                          "typeName": "address"
                        },
                        "id": 216,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "typeConversion",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "5282:13:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 217,
                        "name": "totalCollateralTokenTransferAmount",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 146,
                        "src": "5297:34:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        },
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "arguments": [],
                            "expression": {
                              "argumentTypes": [],
                              "expression": {
                                "argumentTypes": null,
                                "id": 207,
                                "name": "marketContract",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 86,
                                "src": "5210:14:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_contract$_MarketContract_$944",
                                  "typeString": "contract MarketContract"
                                }
                              },
                              "id": 208,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "COLLATERAL_TOKEN_ADDRESS",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 562,
                              "src": "5210:39:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_external_view$__$returns$_t_address_$",
                                "typeString": "function () view external returns (address)"
                              }
                            },
                            "id": 209,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "5210:41:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          ],
                          "id": 206,
                          "name": "ERC20",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 2837,
                          "src": "5204:5:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_contract$_ERC20_$2837_$",
                            "typeString": "type(contract ERC20)"
                          }
                        },
                        "id": 210,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "typeConversion",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "5204:48:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_ERC20_$2837",
                          "typeString": "contract ERC20"
                        }
                      },
                      "id": 211,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "safeTransferFrom",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 2995,
                      "src": "5204:65:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20_$2937_$_t_address_$_t_address_$_t_uint256_$returns$__$bound_to$_t_contract$_IERC20_$2937_$",
                        "typeString": "function (contract IERC20,address,address,uint256)"
                      }
                    },
                    "id": 218,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "5204:128:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 219,
                  "nodeType": "ExpressionStatement",
                  "src": "5204:128:0"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 222,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 220,
                      "name": "feeAmount",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 143,
                      "src": "5347:9:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "!=",
                    "rightExpression": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 221,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "5360:1:0",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "src": "5347:14:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 235,
                  "nodeType": "IfStatement",
                  "src": "5343:187:0",
                  "trueBody": {
                    "id": 234,
                    "nodeType": "Block",
                    "src": "5363:167:0",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 232,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "baseExpression": {
                              "argumentTypes": null,
                              "id": 223,
                              "name": "feesCollectedByTokenAddress",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 31,
                              "src": "5427:27:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
                                "typeString": "mapping(address => uint256)"
                              }
                            },
                            "id": 225,
                            "indexExpression": {
                              "argumentTypes": null,
                              "id": 224,
                              "name": "feeToken",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 149,
                              "src": "5455:8:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_address",
                                "typeString": "address"
                              }
                            },
                            "isConstant": false,
                            "isLValue": true,
                            "isPure": false,
                            "lValueRequested": true,
                            "nodeType": "IndexAccess",
                            "src": "5427:37:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "id": 230,
                                "name": "feeAmount",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 143,
                                "src": "5509:9:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              ],
                              "expression": {
                                "argumentTypes": null,
                                "baseExpression": {
                                  "argumentTypes": null,
                                  "id": 226,
                                  "name": "feesCollectedByTokenAddress",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 31,
                                  "src": "5467:27:0",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
                                    "typeString": "mapping(address => uint256)"
                                  }
                                },
                                "id": 228,
                                "indexExpression": {
                                  "argumentTypes": null,
                                  "id": 227,
                                  "name": "feeToken",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 149,
                                  "src": "5495:8:0",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_address",
                                    "typeString": "address"
                                  }
                                },
                                "isConstant": false,
                                "isLValue": true,
                                "isPure": false,
                                "lValueRequested": false,
                                "nodeType": "IndexAccess",
                                "src": "5467:37:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "id": 229,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "add",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 1341,
                              "src": "5467:41:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                                "typeString": "function (uint256,uint256) pure returns (uint256)"
                              }
                            },
                            "id": 231,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "5467:52:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "5427:92:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 233,
                        "nodeType": "ExpressionStatement",
                        "src": "5427:92:0"
                      }
                    ]
                  }
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 245,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "baseExpression": {
                        "argumentTypes": null,
                        "id": 236,
                        "name": "contractAddressToCollateralPoolBalance",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 27,
                        "src": "5594:38:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
                          "typeString": "mapping(address => uint256)"
                        }
                      },
                      "id": 238,
                      "indexExpression": {
                        "argumentTypes": null,
                        "id": 237,
                        "name": "marketContractAddress",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 75,
                        "src": "5633:21:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "nodeType": "IndexAccess",
                      "src": "5594:61:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "id": 243,
                          "name": "neededCollateral",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 106,
                          "src": "5746:16:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "baseExpression": {
                            "argumentTypes": null,
                            "id": 239,
                            "name": "contractAddressToCollateralPoolBalance",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 27,
                            "src": "5658:38:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
                              "typeString": "mapping(address => uint256)"
                            }
                          },
                          "id": 241,
                          "indexExpression": {
                            "argumentTypes": null,
                            "id": 240,
                            "name": "marketContractAddress",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 75,
                            "src": "5710:21:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          },
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "nodeType": "IndexAccess",
                          "src": "5658:83:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 242,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "add",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 1341,
                        "src": "5658:87:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                          "typeString": "function (uint256,uint256) pure returns (uint256)"
                        }
                      },
                      "id": 244,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "5658:105:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "5594:169:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 246,
                  "nodeType": "ExpressionStatement",
                  "src": "5594:169:0"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 250,
                        "name": "qtyToMint",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 77,
                        "src": "5884:9:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "id": 251,
                          "name": "msg",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 3186,
                          "src": "5895:3:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_magic_message",
                            "typeString": "msg"
                          }
                        },
                        "id": 252,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sender",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "5895:10:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 247,
                        "name": "marketContract",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 86,
                        "src": "5850:14:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_MarketContract_$944",
                          "typeString": "contract MarketContract"
                        }
                      },
                      "id": 249,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "mintPositionTokens",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 802,
                      "src": "5850:33:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_external_nonpayable$_t_uint256_$_t_address_$returns$__$",
                        "typeString": "function (uint256,address) external"
                      }
                    },
                    "id": 253,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "5850:56:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 254,
                  "nodeType": "ExpressionStatement",
                  "src": "5850:56:0"
                },
                {
                  "eventCall": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 256,
                        "name": "marketContractAddress",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 75,
                        "src": "5948:21:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "id": 257,
                          "name": "msg",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 3186,
                          "src": "5983:3:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_magic_message",
                            "typeString": "msg"
                          }
                        },
                        "id": 258,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sender",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "5983:10:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 259,
                        "name": "feeToken",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 149,
                        "src": "6007:8:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 260,
                        "name": "qtyToMint",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 77,
                        "src": "6029:9:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 261,
                        "name": "neededCollateral",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 106,
                        "src": "6052:16:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 262,
                        "name": "feeAmount",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 143,
                        "src": "6082:9:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        },
                        {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        },
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "id": 255,
                      "name": "TokensMinted",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 45,
                      "src": "5922:12:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$",
                        "typeString": "function (address,address,address,uint256,uint256,uint256)"
                      }
                    },
                    "id": 263,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "5922:179:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 264,
                  "nodeType": "EmitStatement",
                  "src": "5917:184:0"
                }
              ]
            },
            "documentation": "@notice Called by a user that would like to mint a new set of long and short token for a specified\n market contract.  This will transfer and lock the correct amount of collateral into the pool\n and issue them the requested qty of long and short tokens\n @param marketContractAddress            address of the market contract to redeem tokens for\n @param qtyToMint                      quantity of long / short tokens to mint.\n @param isAttemptToPayInMKT            if possible, attempt to pay fee's in MKT rather than collateral tokens",
            "id": 266,
            "implemented": true,
            "kind": "function",
            "modifiers": [
              {
                "arguments": [
                  {
                    "argumentTypes": null,
                    "id": 82,
                    "name": "marketContractAddress",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 75,
                    "src": "3089:21:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  }
                ],
                "id": 83,
                "modifierName": {
                  "argumentTypes": null,
                  "id": 81,
                  "name": "onlyWhiteListedAddress",
                  "nodeType": "Identifier",
                  "overloadedDeclarations": [],
                  "referencedDeclaration": 547,
                  "src": "3066:22:0",
                  "typeDescriptions": {
                    "typeIdentifier": "t_modifier$_t_address_$",
                    "typeString": "modifier (address)"
                  }
                },
                "nodeType": "ModifierInvocation",
                "src": "3066:45:0"
              }
            ],
            "name": "mintPositionTokens",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 80,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 75,
                  "name": "marketContractAddress",
                  "nodeType": "VariableDeclaration",
                  "scope": 266,
                  "src": "2963:29:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 74,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "2963:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 77,
                  "name": "qtyToMint",
                  "nodeType": "VariableDeclaration",
                  "scope": 266,
                  "src": "3002:14:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 76,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "3002:4:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 79,
                  "name": "isAttemptToPayInMKT",
                  "nodeType": "VariableDeclaration",
                  "scope": 266,
                  "src": "3026:24:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 78,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "3026:4:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2953:103:0"
            },
            "returnParameters": {
              "id": 84,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "3116:0:0"
            },
            "scope": 548,
            "src": "2926:3182:0",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "external"
          },
          {
            "body": {
              "id": 339,
              "nodeType": "Block",
              "src": "6615:928:0",
              "statements": [
                {
                  "assignments": [
                    277
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 277,
                      "name": "marketContract",
                      "nodeType": "VariableDeclaration",
                      "scope": 339,
                      "src": "6625:29:0",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_contract$_MarketContract_$944",
                        "typeString": "contract MarketContract"
                      },
                      "typeName": {
                        "contractScope": null,
                        "id": 276,
                        "name": "MarketContract",
                        "nodeType": "UserDefinedTypeName",
                        "referencedDeclaration": 944,
                        "src": "6625:14:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_MarketContract_$944",
                          "typeString": "contract MarketContract"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 281,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 279,
                        "name": "marketContractAddress",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 268,
                        "src": "6672:21:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      ],
                      "id": 278,
                      "name": "MarketContract",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 944,
                      "src": "6657:14:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_type$_t_contract$_MarketContract_$944_$",
                        "typeString": "type(contract MarketContract)"
                      }
                    },
                    "id": 280,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "typeConversion",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "6657:37:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_MarketContract_$944",
                      "typeString": "contract MarketContract"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "6625:69:0"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 285,
                        "name": "qtyToRedeem",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 270,
                        "src": "6736:11:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "id": 286,
                          "name": "msg",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 3186,
                          "src": "6749:3:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_magic_message",
                            "typeString": "msg"
                          }
                        },
                        "id": 287,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sender",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "6749:10:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 282,
                        "name": "marketContract",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 277,
                        "src": "6705:14:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_MarketContract_$944",
                          "typeString": "contract MarketContract"
                        }
                      },
                      "id": 284,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "redeemLongToken",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 820,
                      "src": "6705:30:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_external_nonpayable$_t_uint256_$_t_address_$returns$__$",
                        "typeString": "function (uint256,address) external"
                      }
                    },
                    "id": 288,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "6705:55:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 289,
                  "nodeType": "ExpressionStatement",
                  "src": "6705:55:0"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 293,
                        "name": "qtyToRedeem",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 270,
                        "src": "6802:11:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "id": 294,
                          "name": "msg",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 3186,
                          "src": "6815:3:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_magic_message",
                            "typeString": "msg"
                          }
                        },
                        "id": 295,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sender",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "6815:10:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 290,
                        "name": "marketContract",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 277,
                        "src": "6770:14:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_MarketContract_$944",
                          "typeString": "contract MarketContract"
                        }
                      },
                      "id": 292,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "redeemShortToken",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 838,
                      "src": "6770:31:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_external_nonpayable$_t_uint256_$_t_address_$returns$__$",
                        "typeString": "function (uint256,address) external"
                      }
                    },
                    "id": 296,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "6770:56:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 297,
                  "nodeType": "ExpressionStatement",
                  "src": "6770:56:0"
                },
                {
                  "assignments": [
                    299
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 299,
                      "name": "collateralToReturn",
                      "nodeType": "VariableDeclaration",
                      "scope": 339,
                      "src": "6903:23:0",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 298,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "6903:4:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 307,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 302,
                        "name": "qtyToRedeem",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 270,
                        "src": "6946:11:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "arguments": [],
                        "expression": {
                          "argumentTypes": [],
                          "expression": {
                            "argumentTypes": null,
                            "id": 303,
                            "name": "marketContract",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 277,
                            "src": "6959:14:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_contract$_MarketContract_$944",
                              "typeString": "contract MarketContract"
                            }
                          },
                          "id": 304,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "COLLATERAL_PER_UNIT",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 574,
                          "src": "6959:34:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                            "typeString": "function () view external returns (uint256)"
                          }
                        },
                        "id": 305,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "6959:36:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 300,
                        "name": "MathLib",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1489,
                        "src": "6929:7:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_contract$_MathLib_$1489_$",
                          "typeString": "type(library MathLib)"
                        }
                      },
                      "id": 301,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "multiply",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 1276,
                      "src": "6929:16:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
                        "typeString": "function (uint256,uint256) pure returns (uint256)"
                      }
                    },
                    "id": 306,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "6929:67:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "6903:93:0"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 317,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "baseExpression": {
                        "argumentTypes": null,
                        "id": 308,
                        "name": "contractAddressToCollateralPoolBalance",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 27,
                        "src": "7006:38:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
                          "typeString": "mapping(address => uint256)"
                        }
                      },
                      "id": 310,
                      "indexExpression": {
                        "argumentTypes": null,
                        "id": 309,
                        "name": "marketContractAddress",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 268,
                        "src": "7045:21:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "nodeType": "IndexAccess",
                      "src": "7006:61:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "id": 315,
                          "name": "collateralToReturn",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 299,
                          "src": "7163:18:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "baseExpression": {
                            "argumentTypes": null,
                            "id": 311,
                            "name": "contractAddressToCollateralPoolBalance",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 27,
                            "src": "7070:38:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
                              "typeString": "mapping(address => uint256)"
                            }
                          },
                          "id": 313,
                          "indexExpression": {
                            "argumentTypes": null,
                            "id": 312,
                            "name": "marketContractAddress",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 268,
                            "src": "7122:21:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          },
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "nodeType": "IndexAccess",
                          "src": "7070:83:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 314,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "subtract",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 1316,
                        "src": "7070:92:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                          "typeString": "function (uint256,uint256) pure returns (uint256)"
                        }
                      },
                      "id": 316,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "7070:112:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "7006:176:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 318,
                  "nodeType": "ExpressionStatement",
                  "src": "7006:176:0"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "id": 325,
                          "name": "msg",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 3186,
                          "src": "7324:3:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_magic_message",
                            "typeString": "msg"
                          }
                        },
                        "id": 326,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sender",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "7324:10:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 327,
                        "name": "collateralToReturn",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 299,
                        "src": "7336:18:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "arguments": [],
                            "expression": {
                              "argumentTypes": [],
                              "expression": {
                                "argumentTypes": null,
                                "id": 320,
                                "name": "marketContract",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 277,
                                "src": "7268:14:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_contract$_MarketContract_$944",
                                  "typeString": "contract MarketContract"
                                }
                              },
                              "id": 321,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "COLLATERAL_TOKEN_ADDRESS",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 562,
                              "src": "7268:39:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_external_view$__$returns$_t_address_$",
                                "typeString": "function () view external returns (address)"
                              }
                            },
                            "id": 322,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "7268:41:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          ],
                          "id": 319,
                          "name": "ERC20",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 2837,
                          "src": "7262:5:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_contract$_ERC20_$2837_$",
                            "typeString": "type(contract ERC20)"
                          }
                        },
                        "id": 323,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "typeConversion",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "7262:48:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_ERC20_$2837",
                          "typeString": "contract ERC20"
                        }
                      },
                      "id": 324,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "safeTransfer",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 2970,
                      "src": "7262:61:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20_$2937_$_t_address_$_t_uint256_$returns$__$bound_to$_t_contract$_IERC20_$2937_$",
                        "typeString": "function (contract IERC20,address,uint256)"
                      }
                    },
                    "id": 328,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "7262:93:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 329,
                  "nodeType": "ExpressionStatement",
                  "src": "7262:93:0"
                },
                {
                  "eventCall": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 331,
                        "name": "marketContractAddress",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 268,
                        "src": "7399:21:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "id": 332,
                          "name": "msg",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 3186,
                          "src": "7434:3:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_magic_message",
                            "typeString": "msg"
                          }
                        },
                        "id": 333,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sender",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "7434:10:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 334,
                        "name": "qtyToRedeem",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 270,
                        "src": "7458:11:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 335,
                        "name": "qtyToRedeem",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 270,
                        "src": "7483:11:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 336,
                        "name": "collateralToReturn",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 299,
                        "src": "7508:18:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        },
                        {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "id": 330,
                      "name": "TokensRedeemed",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 57,
                      "src": "7371:14:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$",
                        "typeString": "function (address,address,uint256,uint256,uint256)"
                      }
                    },
                    "id": 337,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "7371:165:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 338,
                  "nodeType": "EmitStatement",
                  "src": "7366:170:0"
                }
              ]
            },
            "documentation": "@notice Called by a user that currently holds both short and long position tokens and would like to redeem them\n for their collateral.\n @param marketContractAddress            address of the market contract to redeem tokens for\n @param qtyToRedeem                      quantity of long / short tokens to redeem.",
            "id": 340,
            "implemented": true,
            "kind": "function",
            "modifiers": [
              {
                "arguments": [
                  {
                    "argumentTypes": null,
                    "id": 273,
                    "name": "marketContractAddress",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 268,
                    "src": "6588:21:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  }
                ],
                "id": 274,
                "modifierName": {
                  "argumentTypes": null,
                  "id": 272,
                  "name": "onlyWhiteListedAddress",
                  "nodeType": "Identifier",
                  "overloadedDeclarations": [],
                  "referencedDeclaration": 547,
                  "src": "6565:22:0",
                  "typeDescriptions": {
                    "typeIdentifier": "t_modifier$_t_address_$",
                    "typeString": "modifier (address)"
                  }
                },
                "nodeType": "ModifierInvocation",
                "src": "6565:45:0"
              }
            ],
            "name": "redeemPositionTokens",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 271,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 268,
                  "name": "marketContractAddress",
                  "nodeType": "VariableDeclaration",
                  "scope": 340,
                  "src": "6494:29:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 267,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "6494:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 270,
                  "name": "qtyToRedeem",
                  "nodeType": "VariableDeclaration",
                  "scope": 340,
                  "src": "6533:16:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 269,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "6533:4:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6484:71:0"
            },
            "returnParameters": {
              "id": 275,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "6615:0:0"
            },
            "scope": 548,
            "src": "6455:1088:0",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "external"
          },
          {
            "body": {
              "id": 442,
              "nodeType": "Block",
              "src": "8205:1373:0",
              "statements": [
                {
                  "assignments": [
                    353
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 353,
                      "name": "marketContract",
                      "nodeType": "VariableDeclaration",
                      "scope": 442,
                      "src": "8215:29:0",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_contract$_MarketContract_$944",
                        "typeString": "contract MarketContract"
                      },
                      "typeName": {
                        "contractScope": null,
                        "id": 352,
                        "name": "MarketContract",
                        "nodeType": "UserDefinedTypeName",
                        "referencedDeclaration": 944,
                        "src": "8215:14:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_MarketContract_$944",
                          "typeString": "contract MarketContract"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 357,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 355,
                        "name": "marketContractAddress",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 342,
                        "src": "8262:21:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      ],
                      "id": 354,
                      "name": "MarketContract",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 944,
                      "src": "8247:14:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_type$_t_contract$_MarketContract_$944_$",
                        "typeString": "type(contract MarketContract)"
                      }
                    },
                    "id": 356,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "typeConversion",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "8247:37:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_MarketContract_$944",
                      "typeString": "contract MarketContract"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "8215:69:0"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "arguments": [],
                        "expression": {
                          "argumentTypes": [],
                          "expression": {
                            "argumentTypes": null,
                            "id": 359,
                            "name": "marketContract",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 353,
                            "src": "8302:14:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_contract$_MarketContract_$944",
                              "typeString": "contract MarketContract"
                            }
                          },
                          "id": 360,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "isPostSettlementDelay",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 854,
                          "src": "8302:36:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_external_view$__$returns$_t_bool_$",
                            "typeString": "function () view external returns (bool)"
                          }
                        },
                        "id": 361,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "8302:38:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "436f6e7472616374206973206e6f74207061737420736574746c656d656e742064656c6179",
                        "id": 362,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "8342:39:0",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_8b486410106c11bcd850323e93c47a2f7b1d84230ecebf1a4ff45a53ce0cc707",
                          "typeString": "literal_string \"Contract is not past settlement delay\""
                        },
                        "value": "Contract is not past settlement delay"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_8b486410106c11bcd850323e93c47a2f7b1d84230ecebf1a4ff45a53ce0cc707",
                          "typeString": "literal_string \"Contract is not past settlement delay\""
                        }
                      ],
                      "id": 358,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        3189,
                        3190
                      ],
                      "referencedDeclaration": 3190,
                      "src": "8294:7:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 363,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "8294:88:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 364,
                  "nodeType": "ExpressionStatement",
                  "src": "8294:88:0"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 367,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 365,
                      "name": "longQtyToRedeem",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 344,
                      "src": "8436:15:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">",
                    "rightExpression": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 366,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "8454:1:0",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "src": "8436:19:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 377,
                  "nodeType": "IfStatement",
                  "src": "8432:109:0",
                  "trueBody": {
                    "id": 376,
                    "nodeType": "Block",
                    "src": "8457:84:0",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 371,
                              "name": "longQtyToRedeem",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 344,
                              "src": "8502:15:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "expression": {
                                "argumentTypes": null,
                                "id": 372,
                                "name": "msg",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 3186,
                                "src": "8519:3:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_magic_message",
                                  "typeString": "msg"
                                }
                              },
                              "id": 373,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "sender",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": null,
                              "src": "8519:10:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_address_payable",
                                "typeString": "address payable"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              },
                              {
                                "typeIdentifier": "t_address_payable",
                                "typeString": "address payable"
                              }
                            ],
                            "expression": {
                              "argumentTypes": null,
                              "id": 368,
                              "name": "marketContract",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 353,
                              "src": "8471:14:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_MarketContract_$944",
                                "typeString": "contract MarketContract"
                              }
                            },
                            "id": 370,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "redeemLongToken",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 820,
                            "src": "8471:30:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_nonpayable$_t_uint256_$_t_address_$returns$__$",
                              "typeString": "function (uint256,address) external"
                            }
                          },
                          "id": 374,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "8471:59:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_tuple$__$",
                            "typeString": "tuple()"
                          }
                        },
                        "id": 375,
                        "nodeType": "ExpressionStatement",
                        "src": "8471:59:0"
                      }
                    ]
                  }
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 380,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 378,
                      "name": "shortQtyToRedeem",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 346,
                      "src": "8555:16:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">",
                    "rightExpression": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 379,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "8574:1:0",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "src": "8555:20:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 390,
                  "nodeType": "IfStatement",
                  "src": "8551:112:0",
                  "trueBody": {
                    "id": 389,
                    "nodeType": "Block",
                    "src": "8577:86:0",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 384,
                              "name": "shortQtyToRedeem",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 346,
                              "src": "8623:16:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "expression": {
                                "argumentTypes": null,
                                "id": 385,
                                "name": "msg",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 3186,
                                "src": "8641:3:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_magic_message",
                                  "typeString": "msg"
                                }
                              },
                              "id": 386,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "sender",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": null,
                              "src": "8641:10:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_address_payable",
                                "typeString": "address payable"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              },
                              {
                                "typeIdentifier": "t_address_payable",
                                "typeString": "address payable"
                              }
                            ],
                            "expression": {
                              "argumentTypes": null,
                              "id": 381,
                              "name": "marketContract",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 353,
                              "src": "8591:14:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_MarketContract_$944",
                                "typeString": "contract MarketContract"
                              }
                            },
                            "id": 383,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "redeemShortToken",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 838,
                            "src": "8591:31:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_nonpayable$_t_uint256_$_t_address_$returns$__$",
                              "typeString": "function (uint256,address) external"
                            }
                          },
                          "id": 387,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "8591:61:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_tuple$__$",
                            "typeString": "tuple()"
                          }
                        },
                        "id": 388,
                        "nodeType": "ExpressionStatement",
                        "src": "8591:61:0"
                      }
                    ]
                  }
                },
                {
                  "assignments": [
                    392
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 392,
                      "name": "collateralToReturn",
                      "nodeType": "VariableDeclaration",
                      "scope": 442,
                      "src": "8751:23:0",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 391,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "8751:4:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 410,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "arguments": [],
                        "expression": {
                          "argumentTypes": [],
                          "expression": {
                            "argumentTypes": null,
                            "id": 395,
                            "name": "marketContract",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 353,
                            "src": "8826:14:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_contract$_MarketContract_$944",
                              "typeString": "contract MarketContract"
                            }
                          },
                          "id": 396,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "PRICE_FLOOR",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 568,
                          "src": "8826:26:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                            "typeString": "function () view external returns (uint256)"
                          }
                        },
                        "id": 397,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "8826:28:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "arguments": [],
                        "expression": {
                          "argumentTypes": [],
                          "expression": {
                            "argumentTypes": null,
                            "id": 398,
                            "name": "marketContract",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 353,
                            "src": "8868:14:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_contract$_MarketContract_$944",
                              "typeString": "contract MarketContract"
                            }
                          },
                          "id": 399,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "PRICE_CAP",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 566,
                          "src": "8868:24:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                            "typeString": "function () view external returns (uint256)"
                          }
                        },
                        "id": 400,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "8868:26:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "arguments": [],
                        "expression": {
                          "argumentTypes": [],
                          "expression": {
                            "argumentTypes": null,
                            "id": 401,
                            "name": "marketContract",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 353,
                            "src": "8908:14:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_contract$_MarketContract_$944",
                              "typeString": "contract MarketContract"
                            }
                          },
                          "id": 402,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "QTY_MULTIPLIER",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 572,
                          "src": "8908:29:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                            "typeString": "function () view external returns (uint256)"
                          }
                        },
                        "id": 403,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "8908:31:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 404,
                        "name": "longQtyToRedeem",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 344,
                        "src": "8953:15:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 405,
                        "name": "shortQtyToRedeem",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 346,
                        "src": "8982:16:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "arguments": [],
                        "expression": {
                          "argumentTypes": [],
                          "expression": {
                            "argumentTypes": null,
                            "id": 406,
                            "name": "marketContract",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 353,
                            "src": "9012:14:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_contract$_MarketContract_$944",
                              "typeString": "contract MarketContract"
                            }
                          },
                          "id": 407,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "settlementPrice",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 591,
                          "src": "9012:30:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
                            "typeString": "function () view external returns (uint256)"
                          }
                        },
                        "id": 408,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "9012:32:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 393,
                        "name": "MathLib",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1489,
                        "src": "8777:7:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_contract$_MathLib_$1489_$",
                          "typeString": "type(library MathLib)"
                        }
                      },
                      "id": 394,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "calculateCollateralToReturn",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 1435,
                      "src": "8777:35:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
                        "typeString": "function (uint256,uint256,uint256,uint256,uint256,uint256) pure returns (uint256)"
                      }
                    },
                    "id": 409,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "8777:277:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "8751:303:0"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 420,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "baseExpression": {
                        "argumentTypes": null,
                        "id": 411,
                        "name": "contractAddressToCollateralPoolBalance",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 27,
                        "src": "9065:38:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
                          "typeString": "mapping(address => uint256)"
                        }
                      },
                      "id": 413,
                      "indexExpression": {
                        "argumentTypes": null,
                        "id": 412,
                        "name": "marketContractAddress",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 342,
                        "src": "9104:21:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "nodeType": "IndexAccess",
                      "src": "9065:61:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "id": 418,
                          "name": "collateralToReturn",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 392,
                          "src": "9222:18:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "baseExpression": {
                            "argumentTypes": null,
                            "id": 414,
                            "name": "contractAddressToCollateralPoolBalance",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 27,
                            "src": "9129:38:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
                              "typeString": "mapping(address => uint256)"
                            }
                          },
                          "id": 416,
                          "indexExpression": {
                            "argumentTypes": null,
                            "id": 415,
                            "name": "marketContractAddress",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 342,
                            "src": "9181:21:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          },
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "nodeType": "IndexAccess",
                          "src": "9129:83:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 417,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "subtract",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 1316,
                        "src": "9129:92:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                          "typeString": "function (uint256,uint256) pure returns (uint256)"
                        }
                      },
                      "id": 419,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "9129:112:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "9065:176:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 421,
                  "nodeType": "ExpressionStatement",
                  "src": "9065:176:0"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "id": 428,
                          "name": "msg",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 3186,
                          "src": "9350:3:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_magic_message",
                            "typeString": "msg"
                          }
                        },
                        "id": 429,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sender",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "9350:10:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 430,
                        "name": "collateralToReturn",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 392,
                        "src": "9362:18:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "arguments": [],
                            "expression": {
                              "argumentTypes": [],
                              "expression": {
                                "argumentTypes": null,
                                "id": 423,
                                "name": "marketContract",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 353,
                                "src": "9294:14:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_contract$_MarketContract_$944",
                                  "typeString": "contract MarketContract"
                                }
                              },
                              "id": 424,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "COLLATERAL_TOKEN_ADDRESS",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 562,
                              "src": "9294:39:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_external_view$__$returns$_t_address_$",
                                "typeString": "function () view external returns (address)"
                              }
                            },
                            "id": 425,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "9294:41:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          ],
                          "id": 422,
                          "name": "ERC20",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 2837,
                          "src": "9288:5:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_contract$_ERC20_$2837_$",
                            "typeString": "type(contract ERC20)"
                          }
                        },
                        "id": 426,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "typeConversion",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "9288:48:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_ERC20_$2837",
                          "typeString": "contract ERC20"
                        }
                      },
                      "id": 427,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "safeTransfer",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 2970,
                      "src": "9288:61:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20_$2937_$_t_address_$_t_uint256_$returns$__$bound_to$_t_contract$_IERC20_$2937_$",
                        "typeString": "function (contract IERC20,address,uint256)"
                      }
                    },
                    "id": 431,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "9288:93:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 432,
                  "nodeType": "ExpressionStatement",
                  "src": "9288:93:0"
                },
                {
                  "eventCall": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 434,
                        "name": "marketContractAddress",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 342,
                        "src": "9425:21:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "id": 435,
                          "name": "msg",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 3186,
                          "src": "9460:3:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_magic_message",
                            "typeString": "msg"
                          }
                        },
                        "id": 436,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sender",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "9460:10:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 437,
                        "name": "longQtyToRedeem",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 344,
                        "src": "9484:15:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 438,
                        "name": "shortQtyToRedeem",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 346,
                        "src": "9513:16:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 439,
                        "name": "collateralToReturn",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 392,
                        "src": "9543:18:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        },
                        {
                          "typeIdentifier": "t_address_payable",
                          "typeString": "address payable"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "id": 433,
                      "name": "TokensRedeemed",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 57,
                      "src": "9397:14:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$",
                        "typeString": "function (address,address,uint256,uint256,uint256)"
                      }
                    },
                    "id": 440,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "9397:174:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 441,
                  "nodeType": "EmitStatement",
                  "src": "9392:179:0"
                }
              ]
            },
            "documentation": "@param marketContractAddress address of the MARKET Contract being traded.\n @param longQtyToRedeem qty to redeem of long tokens\n @param shortQtyToRedeem qty to redeem of short tokens",
            "id": 443,
            "implemented": true,
            "kind": "function",
            "modifiers": [
              {
                "arguments": [
                  {
                    "argumentTypes": null,
                    "id": 349,
                    "name": "marketContractAddress",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 342,
                    "src": "8178:21:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  }
                ],
                "id": 350,
                "modifierName": {
                  "argumentTypes": null,
                  "id": 348,
                  "name": "onlyWhiteListedAddress",
                  "nodeType": "Identifier",
                  "overloadedDeclarations": [],
                  "referencedDeclaration": 547,
                  "src": "8155:22:0",
                  "typeDescriptions": {
                    "typeIdentifier": "t_modifier$_t_address_$",
                    "typeString": "modifier (address)"
                  }
                },
                "nodeType": "ModifierInvocation",
                "src": "8155:45:0"
              }
            ],
            "name": "settleAndClose",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 347,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 342,
                  "name": "marketContractAddress",
                  "nodeType": "VariableDeclaration",
                  "scope": 443,
                  "src": "8049:29:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 341,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "8049:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 344,
                  "name": "longQtyToRedeem",
                  "nodeType": "VariableDeclaration",
                  "scope": 443,
                  "src": "8088:20:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 343,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "8088:4:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 346,
                  "name": "shortQtyToRedeem",
                  "nodeType": "VariableDeclaration",
                  "scope": 443,
                  "src": "8118:21:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 345,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "8118:4:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8039:106:0"
            },
            "returnParameters": {
              "id": 351,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "8205:0:0"
            },
            "scope": 548,
            "src": "8016:1562:0",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "external"
          },
          {
            "body": {
              "id": 488,
              "nodeType": "Block",
              "src": "9894:432:0",
              "statements": [
                {
                  "assignments": [
                    453
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 453,
                      "name": "feesAvailableForWithdrawal",
                      "nodeType": "VariableDeclaration",
                      "scope": 488,
                      "src": "9904:31:0",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 452,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "9904:4:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 457,
                  "initialValue": {
                    "argumentTypes": null,
                    "baseExpression": {
                      "argumentTypes": null,
                      "id": 454,
                      "name": "feesCollectedByTokenAddress",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 31,
                      "src": "9938:27:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
                        "typeString": "mapping(address => uint256)"
                      }
                    },
                    "id": 456,
                    "indexExpression": {
                      "argumentTypes": null,
                      "id": 455,
                      "name": "feeTokenAddress",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 445,
                      "src": "9966:15:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_address",
                        "typeString": "address"
                      }
                    },
                    "isConstant": false,
                    "isLValue": true,
                    "isPure": false,
                    "lValueRequested": false,
                    "nodeType": "IndexAccess",
                    "src": "9938:44:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "9904:78:0"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 461,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 459,
                          "name": "feesAvailableForWithdrawal",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 453,
                          "src": "10000:26:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "!=",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "30",
                          "id": 460,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "10030:1:0",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_0_by_1",
                            "typeString": "int_const 0"
                          },
                          "value": "0"
                        },
                        "src": "10000:31:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "4e6f206665657320617661696c61626c6520666f72207769746864726177616c",
                        "id": 462,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "10033:34:0",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_54ec81e8f99a6c2d788b48bee377b616fca564eb699db703307200d2904e1ee4",
                          "typeString": "literal_string \"No fees available for withdrawal\""
                        },
                        "value": "No fees available for withdrawal"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_54ec81e8f99a6c2d788b48bee377b616fca564eb699db703307200d2904e1ee4",
                          "typeString": "literal_string \"No fees available for withdrawal\""
                        }
                      ],
                      "id": 458,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        3189,
                        3190
                      ],
                      "referencedDeclaration": 3190,
                      "src": "9992:7:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 463,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "9992:76:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 464,
                  "nodeType": "ExpressionStatement",
                  "src": "9992:76:0"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        },
                        "id": 470,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 466,
                          "name": "feeRecipient",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 447,
                          "src": "10086:12:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_address",
                            "typeString": "address"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "!=",
                        "rightExpression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "hexValue": "30",
                              "id": 468,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "number",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "10110:1:0",
                              "subdenomination": null,
                              "typeDescriptions": {
                                "typeIdentifier": "t_rational_0_by_1",
                                "typeString": "int_const 0"
                              },
                              "value": "0"
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_rational_0_by_1",
                                "typeString": "int_const 0"
                              }
                            ],
                            "id": 467,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "10102:7:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_address_$",
                              "typeString": "type(address)"
                            },
                            "typeName": "address"
                          },
                          "id": 469,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "10102:10:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_address_payable",
                            "typeString": "address payable"
                          }
                        },
                        "src": "10086:26:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "43616e6e6f742073656e64206665657320746f206e756c6c2061646472657373",
                        "id": 471,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "10114:34:0",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_d1aa37acc318e26ff4bca832531f9e648c2428bd583debe61d1e31c2433c3be0",
                          "typeString": "literal_string \"Cannot send fees to null address\""
                        },
                        "value": "Cannot send fees to null address"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_d1aa37acc318e26ff4bca832531f9e648c2428bd583debe61d1e31c2433c3be0",
                          "typeString": "literal_string \"Cannot send fees to null address\""
                        }
                      ],
                      "id": 465,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        3189,
                        3190
                      ],
                      "referencedDeclaration": 3190,
                      "src": "10078:7:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 472,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "10078:71:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 473,
                  "nodeType": "ExpressionStatement",
                  "src": "10078:71:0"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 478,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "baseExpression": {
                        "argumentTypes": null,
                        "id": 474,
                        "name": "feesCollectedByTokenAddress",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 31,
                        "src": "10159:27:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
                          "typeString": "mapping(address => uint256)"
                        }
                      },
                      "id": 476,
                      "indexExpression": {
                        "argumentTypes": null,
                        "id": 475,
                        "name": "feeTokenAddress",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 445,
                        "src": "10187:15:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "nodeType": "IndexAccess",
                      "src": "10159:44:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 477,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "10206:1:0",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "src": "10159:48:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 479,
                  "nodeType": "ExpressionStatement",
                  "src": "10159:48:0"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 484,
                        "name": "feeRecipient",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 447,
                        "src": "10278:12:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 485,
                        "name": "feesAvailableForWithdrawal",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 453,
                        "src": "10292:26:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 481,
                            "name": "feeTokenAddress",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 445,
                            "src": "10248:15:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          ],
                          "id": 480,
                          "name": "ERC20",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 2837,
                          "src": "10242:5:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_contract$_ERC20_$2837_$",
                            "typeString": "type(contract ERC20)"
                          }
                        },
                        "id": 482,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "typeConversion",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "10242:22:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_ERC20_$2837",
                          "typeString": "contract ERC20"
                        }
                      },
                      "id": 483,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "safeTransfer",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 2970,
                      "src": "10242:35:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20_$2937_$_t_address_$_t_uint256_$returns$__$bound_to$_t_contract$_IERC20_$2937_$",
                        "typeString": "function (contract IERC20,address,uint256)"
                      }
                    },
                    "id": 486,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "10242:77:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 487,
                  "nodeType": "ExpressionStatement",
                  "src": "10242:77:0"
                }
              ]
            },
            "documentation": "@dev allows the owner to remove the fees paid into this contract for minting\n @param feeTokenAddress - address of the erc20 token fees have been paid in\n @param feeRecipient - Recipient address of fees",
            "id": 489,
            "implemented": true,
            "kind": "function",
            "modifiers": [
              {
                "arguments": null,
                "id": 450,
                "modifierName": {
                  "argumentTypes": null,
                  "id": 449,
                  "name": "onlyOwner",
                  "nodeType": "Identifier",
                  "overloadedDeclarations": [],
                  "referencedDeclaration": 2388,
                  "src": "9884:9:0",
                  "typeDescriptions": {
                    "typeIdentifier": "t_modifier$__$",
                    "typeString": "modifier ()"
                  }
                },
                "nodeType": "ModifierInvocation",
                "src": "9884:9:0"
              }
            ],
            "name": "withdrawFees",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 448,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 445,
                  "name": "feeTokenAddress",
                  "nodeType": "VariableDeclaration",
                  "scope": 489,
                  "src": "9830:23:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 444,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "9830:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 447,
                  "name": "feeRecipient",
                  "nodeType": "VariableDeclaration",
                  "scope": 489,
                  "src": "9855:20:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 446,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "9855:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "9829:47:0"
            },
            "returnParameters": {
              "id": 451,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "9894:0:0"
            },
            "scope": 548,
            "src": "9808:518:0",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "public"
          },
          {
            "body": {
              "id": 509,
              "nodeType": "Block",
              "src": "10536:131:0",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        },
                        "id": 501,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 497,
                          "name": "mktTokenAddress",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 491,
                          "src": "10554:15:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_address",
                            "typeString": "address"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "!=",
                        "rightExpression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "hexValue": "30",
                              "id": 499,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "number",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "10581:1:0",
                              "subdenomination": null,
                              "typeDescriptions": {
                                "typeIdentifier": "t_rational_0_by_1",
                                "typeString": "int_const 0"
                              },
                              "value": "0"
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_rational_0_by_1",
                                "typeString": "int_const 0"
                              }
                            ],
                            "id": 498,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "10573:7:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_address_$",
                              "typeString": "type(address)"
                            },
                            "typeName": "address"
                          },
                          "id": 500,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "10573:10:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_address_payable",
                            "typeString": "address payable"
                          }
                        },
                        "src": "10554:29:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "43616e6e6f7420736574204d4b5420546f6b656e204164647265737320546f204e756c6c",
                        "id": 502,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "10585:38:0",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_6aaa7c0f48eef407c5735213ddef339148c71a804362a12bf650ec79a60f65ef",
                          "typeString": "literal_string \"Cannot set MKT Token Address To Null\""
                        },
                        "value": "Cannot set MKT Token Address To Null"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_6aaa7c0f48eef407c5735213ddef339148c71a804362a12bf650ec79a60f65ef",
                          "typeString": "literal_string \"Cannot set MKT Token Address To Null\""
                        }
                      ],
                      "id": 496,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        3189,
                        3190
                      ],
                      "referencedDeclaration": 3190,
                      "src": "10546:7:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 503,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "10546:78:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 504,
                  "nodeType": "ExpressionStatement",
                  "src": "10546:78:0"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 507,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 505,
                      "name": "mktToken",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 23,
                      "src": "10634:8:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_address",
                        "typeString": "address"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "id": 506,
                      "name": "mktTokenAddress",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 491,
                      "src": "10645:15:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_address",
                        "typeString": "address"
                      }
                    },
                    "src": "10634:26:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "id": 508,
                  "nodeType": "ExpressionStatement",
                  "src": "10634:26:0"
                }
              ]
            },
            "documentation": "@dev allows the owner to update the mkt token address in use for fees\n @param mktTokenAddress address of new MKT token",
            "id": 510,
            "implemented": true,
            "kind": "function",
            "modifiers": [
              {
                "arguments": null,
                "id": 494,
                "modifierName": {
                  "argumentTypes": null,
                  "id": 493,
                  "name": "onlyOwner",
                  "nodeType": "Identifier",
                  "overloadedDeclarations": [],
                  "referencedDeclaration": 2388,
                  "src": "10526:9:0",
                  "typeDescriptions": {
                    "typeIdentifier": "t_modifier$__$",
                    "typeString": "modifier ()"
                  }
                },
                "nodeType": "ModifierInvocation",
                "src": "10526:9:0"
              }
            ],
            "name": "setMKTTokenAddress",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 492,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 491,
                  "name": "mktTokenAddress",
                  "nodeType": "VariableDeclaration",
                  "scope": 510,
                  "src": "10494:23:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 490,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "10494:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "10493:25:0"
            },
            "returnParameters": {
              "id": 495,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "10536:0:0"
            },
            "scope": 548,
            "src": "10466:201:0",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "public"
          },
          {
            "body": {
              "id": 530,
              "nodeType": "Block",
              "src": "10927:188:0",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        },
                        "id": 522,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 518,
                          "name": "marketContractRegistryAddress",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 512,
                          "src": "10945:29:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_address",
                            "typeString": "address"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "!=",
                        "rightExpression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "hexValue": "30",
                              "id": 520,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "number",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "10986:1:0",
                              "subdenomination": null,
                              "typeDescriptions": {
                                "typeIdentifier": "t_rational_0_by_1",
                                "typeString": "int_const 0"
                              },
                              "value": "0"
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_rational_0_by_1",
                                "typeString": "int_const 0"
                              }
                            ],
                            "id": 519,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "10978:7:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_address_$",
                              "typeString": "type(address)"
                            },
                            "typeName": "address"
                          },
                          "id": 521,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "10978:10:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_address_payable",
                            "typeString": "address payable"
                          }
                        },
                        "src": "10945:43:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "43616e6e6f7420736574204d61726b657420436f6e7472616374205265676973747279204164647265737320546f204e756c6c",
                        "id": 523,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "10990:53:0",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_bba068bd79d371b9e9c2a9fc1c7bff8a416c5529757f3c7072fa939867b655aa",
                          "typeString": "literal_string \"Cannot set Market Contract Registry Address To Null\""
                        },
                        "value": "Cannot set Market Contract Registry Address To Null"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_bba068bd79d371b9e9c2a9fc1c7bff8a416c5529757f3c7072fa939867b655aa",
                          "typeString": "literal_string \"Cannot set Market Contract Registry Address To Null\""
                        }
                      ],
                      "id": 517,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        3189,
                        3190
                      ],
                      "referencedDeclaration": 3190,
                      "src": "10937:7:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 524,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "10937:107:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 525,
                  "nodeType": "ExpressionStatement",
                  "src": "10937:107:0"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 528,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 526,
                      "name": "marketContractRegistry",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 21,
                      "src": "11054:22:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_address",
                        "typeString": "address"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "id": 527,
                      "name": "marketContractRegistryAddress",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 512,
                      "src": "11079:29:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_address",
                        "typeString": "address"
                      }
                    },
                    "src": "11054:54:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "id": 529,
                  "nodeType": "ExpressionStatement",
                  "src": "11054:54:0"
                }
              ]
            },
            "documentation": "@dev allows the owner to update the mkt token address in use for fees\n @param marketContractRegistryAddress address of new contract registry",
            "id": 531,
            "implemented": true,
            "kind": "function",
            "modifiers": [
              {
                "arguments": null,
                "id": 515,
                "modifierName": {
                  "argumentTypes": null,
                  "id": 514,
                  "name": "onlyOwner",
                  "nodeType": "Identifier",
                  "overloadedDeclarations": [],
                  "referencedDeclaration": 2388,
                  "src": "10917:9:0",
                  "typeDescriptions": {
                    "typeIdentifier": "t_modifier$__$",
                    "typeString": "modifier ()"
                  }
                },
                "nodeType": "ModifierInvocation",
                "src": "10917:9:0"
              }
            ],
            "name": "setMarketContractRegistryAddress",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 513,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 512,
                  "name": "marketContractRegistryAddress",
                  "nodeType": "VariableDeclaration",
                  "scope": 531,
                  "src": "10871:37:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 511,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "10871:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "10870:39:0"
            },
            "returnParameters": {
              "id": 516,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "10927:0:0"
            },
            "scope": 548,
            "src": "10829:286:0",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "public"
          },
          {
            "body": {
              "id": 546,
              "nodeType": "Block",
              "src": "11607:201:0",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 540,
                            "name": "marketContractAddress",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 533,
                            "src": "11715:21:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          ],
                          "expression": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "id": 537,
                                "name": "marketContractRegistry",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 21,
                                "src": "11670:22:0",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_address",
                                  "typeString": "address"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_address",
                                  "typeString": "address"
                                }
                              ],
                              "id": 536,
                              "name": "MarketContractRegistryInterface",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1161,
                              "src": "11638:31:0",
                              "typeDescriptions": {
                                "typeIdentifier": "t_type$_t_contract$_MarketContractRegistryInterface_$1161_$",
                                "typeString": "type(contract MarketContractRegistryInterface)"
                              }
                            },
                            "id": 538,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "typeConversion",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "11638:55:0",
                            "typeDescriptions": {
                              "typeIdentifier": "t_contract$_MarketContractRegistryInterface_$1161",
                              "typeString": "contract MarketContractRegistryInterface"
                            }
                          },
                          "id": 539,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "isAddressWhiteListed",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 1160,
                          "src": "11638:76:0",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_bool_$",
                            "typeString": "function (address) view external returns (bool)"
                          }
                        },
                        "id": 541,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "11638:99:0",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "436f6e7472616374206973206e6f742077686974656c6973746564",
                        "id": 542,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "11751:29:0",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_c061099c67eeed759bf3ec7295818a4d5c0e9d6ae20bd188f5c0d435db044c24",
                          "typeString": "literal_string \"Contract is not whitelisted\""
                        },
                        "value": "Contract is not whitelisted"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_c061099c67eeed759bf3ec7295818a4d5c0e9d6ae20bd188f5c0d435db044c24",
                          "typeString": "literal_string \"Contract is not whitelisted\""
                        }
                      ],
                      "id": 535,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        3189,
                        3190
                      ],
                      "referencedDeclaration": 3190,
                      "src": "11617:7:0",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 543,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "11617:173:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 544,
                  "nodeType": "ExpressionStatement",
                  "src": "11617:173:0"
                },
                {
                  "id": 545,
                  "nodeType": "PlaceholderStatement",
                  "src": "11800:1:0"
                }
              ]
            },
            "documentation": "@notice only can be called with a market contract address that currently exists in our whitelist\n this ensure's it is a market contract that has been created by us and therefore has a uniquely created\n long and short token address.  If it didn't we could have spoofed contracts minting tokens with a\n collateral token that wasn't the same as the intended token.",
            "id": 547,
            "name": "onlyWhiteListedAddress",
            "nodeType": "ModifierDefinition",
            "parameters": {
              "id": 534,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 533,
                  "name": "marketContractAddress",
                  "nodeType": "VariableDeclaration",
                  "scope": 547,
                  "src": "11576:29:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 532,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "11576:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "11575:31:0"
            },
            "src": "11544:264:0",
            "visibility": "internal"
          }
        ],
        "scope": 549,
        "src": "1290:10520:0"
      }
    ],
    "src": "608:11203:0"
  },
  "compiler": {
    "name": "solc",
    "version": "0.5.2+commit.1df8f40c.Emscripten.clang"
  },
  "networks": {},
  "schemaVersion": "3.0.9",
  "updatedAt": "2019-05-28T23:53:01.569Z",
  "devdoc": {
    "author": "Phil Elsasser <phil@marketprotocol.io>",
    "methods": {
      "isOwner()": {
        "return": "true if `msg.sender` is the owner of the contract."
      },
      "mintPositionTokens(address,uint256,bool)": {
        "params": {
          "isAttemptToPayInMKT": "if possible, attempt to pay fee's in MKT rather than collateral tokens",
          "marketContractAddress": "address of the market contract to redeem tokens for",
          "qtyToMint": "quantity of long / short tokens to mint."
        }
      },
      "owner()": {
        "return": "the address of the owner."
      },
      "redeemPositionTokens(address,uint256)": {
        "params": {
          "marketContractAddress": "address of the market contract to redeem tokens for",
          "qtyToRedeem": "quantity of long / short tokens to redeem."
        }
      },
      "renounceOwnership()": {
        "details": "Allows the current owner to relinquish control of the contract. It will not be possible to call the functions with the `onlyOwner` modifier anymore."
      },
      "setMKTTokenAddress(address)": {
        "details": "allows the owner to update the mkt token address in use for fees",
        "params": {
          "mktTokenAddress": "address of new MKT token"
        }
      },
      "setMarketContractRegistryAddress(address)": {
        "details": "allows the owner to update the mkt token address in use for fees",
        "params": {
          "marketContractRegistryAddress": "address of new contract registry"
        }
      },
      "settleAndClose(address,uint256,uint256)": {
        "params": {
          "longQtyToRedeem": "qty to redeem of long tokens",
          "marketContractAddress": "address of the MARKET Contract being traded.",
          "shortQtyToRedeem": "qty to redeem of short tokens"
        }
      },
      "transferOwnership(address)": {
        "details": "Allows the current owner to transfer control of the contract to a newOwner.",
        "params": {
          "newOwner": "The address to transfer ownership to."
        }
      },
      "withdrawFees(address,address)": {
        "details": "allows the owner to remove the fees paid into this contract for minting",
        "params": {
          "feeRecipient": "- Recipient address of fees",
          "feeTokenAddress": "- address of the erc20 token fees have been paid in"
        }
      }
    },
    "title": "MarketCollateralPool"
  },
  "userdoc": {
    "methods": {
      "mintPositionTokens(address,uint256,bool)": {
        "notice": "Called by a user that would like to mint a new set of long and short token for a specified market contract.  This will transfer and lock the correct amount of collateral into the pool and issue them the requested qty of long and short tokens"
      },
      "redeemPositionTokens(address,uint256)": {
        "notice": "Called by a user that currently holds both short and long position tokens and would like to redeem them for their collateral."
      },
      "renounceOwnership()": {
        "notice": "Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner."
      }
    },
    "notice": "This collateral pool houses all of the collateral for all market contracts currently in circulation. This pool facilitates locking of collateral and minting / redemption of position tokens for that collateral."
  }
}