{
    "Function": "processWithdraw",
    "File": "src/InvestmentManager.sol",
    "Parent Contracts": [
        "src/util/Auth.sol"
    ],
    "High-Level Calls": [],
    "Internal Calls": [
        "_redeem",
        "auth",
        "_calculateTrancheTokenAmount",
        "calculateRedeemPrice",
        "_toUint128",
        "require(bool,string)",
        "require(bool,string)"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function processWithdraw(uint256 currencyAmount, address receiver, address user)\n        public\n        auth\n        returns (uint256 trancheTokenAmount)\n    {\n        address liquidityPool = msg.sender;\n        uint128 _currencyAmount = _toUint128(currencyAmount);\n        require(\n            (_currencyAmount <= orderbook[user][liquidityPool].maxWithdraw && _currencyAmount != 0),\n            \"InvestmentManager/amount-exceeds-withdraw-limits\"\n        );\n\n        uint256 redeemPrice = calculateRedeemPrice(user, liquidityPool);\n        require(redeemPrice != 0, \"LiquidityPool/redeem-token-price-0\");\n\n        uint128 _trancheTokenAmount = _calculateTrancheTokenAmount(_currencyAmount, liquidityPool, redeemPrice);\n        _redeem(_trancheTokenAmount, _currencyAmount, liquidityPool, receiver, user);\n        trancheTokenAmount = uint256(_trancheTokenAmount);\n    }"
}