{
    "Function": "_withdraw",
    "File": "contracts/adapters/liquidity/CurveLPAdapter.sol",
    "Parent Contracts": [
        "contracts/adapters/BaseAdapter.sol",
        "contracts/interfaces/IBaseAdapter.sol"
    ],
    "High-Level Calls": [
        "ICurveDeposit",
        "ICurveDepositZapRegistry",
        "SafeERC20",
        "ICurveDeposit",
        "ICurveDepositZapRegistry"
    ],
    "Internal Calls": [
        "require(bool,string)",
        "revert(string)"
    ],
    "Library Calls": [
        "safeApprove"
    ],
    "Low-Level Calls": [],
    "Code": "function _withdraw(\n        uint256 amount,\n        address tokenIn,\n        address tokenOut,\n        address pool,\n        address[8] memory coins\n    ) internal {\n        address zap = zapRegistry.getZap(tokenIn);\n        if (zap == address(0)) zap = pool;\n\n        int128 tokenIndex;\n        for (uint256 i = 0; i < 8; i++) {\n            require(coins[i] != address(0), \"Token not found in pool\");\n            if (coins[i] == tokenOut) {\n                tokenIndex = int128(i);\n                break;\n            }\n        }\n\n        if (zap != pool)\n            IERC20(tokenIn).safeApprove(zap, amount);\n\n        uint256 indexType = zapRegistry.getIndexType(zap);\n        if (indexType == 0) { //int128\n            ICurveDeposit(zap).remove_liquidity_one_coin(amount, tokenIndex, 1);\n        } else if (indexType == 1) { //uint256\n            ICurveDeposit(zap).remove_liquidity_one_coin(amount, uint256(tokenIndex), 1);\n        } else {\n            return revert(\"Unknown index type\");\n        }\n    }"
}