{
    "Function": "_deposit",
    "File": "contracts/adapters/liquidity/CurveLPAdapter.sol",
    "Parent Contracts": [
        "contracts/adapters/BaseAdapter.sol",
        "contracts/interfaces/IBaseAdapter.sol"
    ],
    "High-Level Calls": [
        "ICurveStableSwap",
        "SafeERC20",
        "ICurveStableSwap",
        "ICurveStableSwap"
    ],
    "Internal Calls": [
        "require(bool,string)"
    ],
    "Library Calls": [
        "safeApprove"
    ],
    "Low-Level Calls": [],
    "Code": "function _deposit(\n        uint256 amount,\n        address tokenIn,\n        address pool,\n        address[8] memory coins\n    ) internal {\n        IERC20(tokenIn).safeApprove(pool, amount);\n        uint256 coinsInPool;\n        uint256 tokenIndex = 8; //Outside of possible index range. If index not found function will fail\n        for (uint256 i = 0; i < 8; i++) {\n          if (coins[i] == address(0)) {\n              coinsInPool = i;\n              break;\n          }\n          if (coins[i] == tokenIn) tokenIndex = i;\n        }\n        require(tokenIndex < 8, \"Token not found\");\n        if (coinsInPool == 4) {\n            uint256[4] memory depositAmounts;\n            depositAmounts[tokenIndex] = amount;\n            ICurveStableSwap(pool).add_liquidity(depositAmounts, 0);\n        } else if (coinsInPool == 3) {\n            uint256[3] memory depositAmounts;\n            depositAmounts[tokenIndex] = amount;\n            ICurveStableSwap(pool).add_liquidity(depositAmounts, 0);\n        } else if (coinsInPool == 2) {\n            uint256[2] memory depositAmounts;\n            depositAmounts[tokenIndex] = amount;\n            ICurveStableSwap(pool).add_liquidity(depositAmounts, 0);\n        }\n    }"
}