{
    "Function": "_mintLiquidity",
    "File": "contracts/SemiFungiblePositionManager.sol",
    "Parent Contracts": [
        "contracts/multicall/Multicall.sol",
        "contracts/tokens/ERC1155Minimal.sol"
    ],
    "High-Level Calls": [
        "LeftRight",
        "IUniswapV3Pool",
        "LiquidityChunk",
        "LeftRight",
        "LiquidityChunk",
        "IUniswapV3Pool",
        "IUniswapV3Pool",
        "IUniswapV3Pool",
        "LiquidityChunk"
    ],
    "Internal Calls": [
        "abi.encode()"
    ],
    "Library Calls": [
        "tickLower",
        "tickUpper",
        "liquidity",
        "toRightSlot",
        "toLeftSlot"
    ],
    "Low-Level Calls": [],
    "Code": "function _mintLiquidity(\n        uint256 liquidityChunk,\n        IUniswapV3Pool univ3pool\n    ) internal returns (int256 movedAmounts) {\n        // build callback data\n        bytes memory mintdata = abi.encode(\n            CallbackLib.CallbackData({ // compute by reading values from univ3pool every time\n                    poolFeatures: CallbackLib.PoolFeatures({\n                        token0: univ3pool.token0(),\n                        token1: univ3pool.token1(),\n                        fee: univ3pool.fee()\n                    }),\n                    payer: msg.sender\n                })\n        );\n\n        /// mint the required amount in the Uniswap pool\n        /// @dev this triggers the uniswap mint callback function\n        (uint256 amount0, uint256 amount1) = univ3pool.mint(\n            address(this),\n            liquidityChunk.tickLower(),\n            liquidityChunk.tickUpper(),\n            liquidityChunk.liquidity(),\n            mintdata\n        );\n\n        // amount0 The amount of token0 that was paid to mint the given amount of liquidity\n        // amount1 The amount of token1 that was paid to mint the given amount of liquidity\n        // no need to safecast to int from uint here as the max position size is int128\n        // from msg.sender to the uniswap pool, stored as negative value to represent amount debited\n        movedAmounts = int256(0).toRightSlot(int128(int256(amount0))).toLeftSlot(\n            int128(int256(amount1))\n        );\n    }"
}