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