{
    "Function": "requestDeposit",
    "File": "src/InvestmentManager.sol",
    "Parent Contracts": [
        "src/util/Auth.sol"
    ],
    "High-Level Calls": [
        "LiquidityPoolLike",
        "GatewayLike",
        "PoolManagerLike",
        "LiquidityPoolLike",
        "SafeTransferLib",
        "GatewayLike",
        "LiquidityPoolLike",
        "LiquidityPoolLike",
        "LiquidityPoolLike",
        "PoolManagerLike",
        "PoolManagerLike",
        "LiquidityPoolLike",
        "LiquidityPoolLike",
        "LiquidityPoolLike",
        "LiquidityPoolLike",
        "LiquidityPoolLike"
    ],
    "Internal Calls": [
        "_toUint128",
        "_isAllowedToInvest",
        "auth"
    ],
    "Library Calls": [
        "safeTransferFrom"
    ],
    "Low-Level Calls": [],
    "Code": "function requestDeposit(uint256 currencyAmount, address user) public auth {\n        address liquidityPool = msg.sender;\n        LiquidityPoolLike lPool = LiquidityPoolLike(liquidityPool);\n        address currency = lPool.asset();\n        uint128 _currencyAmount = _toUint128(currencyAmount);\n\n        // Check if liquidity pool currency is supported by the Centrifuge pool\n        poolManager.isAllowedAsPoolCurrency(lPool.poolId(), currency);\n        // Check if user is allowed to hold the restricted tranche tokens\n        _isAllowedToInvest(lPool.poolId(), lPool.trancheId(), currency, user);\n        if (_currencyAmount == 0) {\n            // Case: outstanding investment orders only needed to be cancelled\n            gateway.cancelInvestOrder(\n                lPool.poolId(), lPool.trancheId(), user, poolManager.currencyAddressToId(lPool.asset())\n            );\n            return;\n        }\n\n        // Transfer the currency amount from user to escrow. (lock currency in escrow).\n        SafeTransferLib.safeTransferFrom(currency, user, address(escrow), _currencyAmount);\n\n        gateway.increaseInvestOrder(\n            lPool.poolId(), lPool.trancheId(), user, poolManager.currencyAddressToId(lPool.asset()), _currencyAmount\n        );\n    }"
}