MEDIUM severity: The vulnerability lies in the implementation of the Leverage Vault on sidechains that support Curve . The vulnerability lies in the implementation of the Leverage Vault on sidechains that support Curve V2 pools. Specifically, the code is designed to work on the Ethereum mainnet, but not on Arbitrum and Optimism sidechains. This is because the `IS_CURVE_V2` variable is always set to `false` on these...

Vulnerable code:
```\nFile: Curve2TokenPoolMixin.sol\n\nconstructor(\n    NotionalProxy notional_,\n    DeploymentParams memory params\n) SingleSidedLPVaultBase(notional_, params.tradingModule) {\n    CURVE_POOL = params.pool;\n\n    bool isCurveV2 = false;\n    if (Deployments.CHAIN_ID == Constants.CHAIN_ID_MAINNET) {\n        address[10] memory handlers = \n            Deployments.CURVE_META_REGISTRY.get_registry_handlers_from_pool(address(CURVE_POOL));\n\n        require(\n            handlers[0] == Deployments.CURVE_V1_HANDLER ||\n            handlers[0] == Deployments.CURVE_V2_HANDLER\n        );\n        isCurveV2 = (handlers[0] == Deployments.CURVE_V2_HANDLER);\n    }\n    IS_CURVE_V2 = isCurveV2;\n```\n```\nFile: Curve2TokenConvexVault.sol\n\nfunction _joinPoolAndStake(\n    // Slightly different method signatures in v1 and v2\n    if (IS_CURVE_V2) {\n        lpTokens = ICurve2TokenPoolV2(CURVE_POOL).add_liquidity{value: msgValue}(\n            amounts, minPoolClaim, 0 < msgValue // use_eth = true if msgValue > 0\n        );\n    } else {\n        lpTokens = ICurve2TokenPoolV1(CURVE_POOL).add_liquidity{value: msgValue}(\n            amounts, minPoolClaim\n        );\n    }\n```\n```\ndef add_liquidity(\n    amounts: uint256[N_COINS],\n    min_mint_amount: uint256,\n    use_eth: bool = False,\n    receiver: address = msg.sender\n) -> uint256:\n    """\n    @notice Adds liquidity into the pool.\n    @param amounts Amounts of each coin to add.\n    @param min_mint_amount Minimum amount of LP to mint.\n    @param use_eth True if native token is being added to the pool.\n    @param receiver Address to send the LP tokens to. Default is msg.sender\n    @return uint256 Amount of LP tokens received by the `receiver\n    """\n\n    # --------------------- Get prices, balances -----------------------------\n    # -------------------------------------- Update balances and calculate xp.\n    # ---------------- transferFrom token into the pool ----------------------\n\n    for i in range(N_COINS):\n        if amounts[i] > 0:\n            if coins[i] == WETH20:\n                self._transfer_in(\n                    coins[i],\n                    amounts[i],\n                    0,\n                    msg.value,\n                    address(0),\n                    bytes32(0),\n                    msg.sender,\n                    address(0),\n                    use_eth\n                )\n```\n```\ndef _transfer_in(\n    use_eth: bool\n):\n    """\n    @params use_eth True if the transfer is ETH, False otherwise.\n    """\n\n    if use_eth and _coin == WETH20:\n        assert mvalue == dx  # dev: incorrect eth amount\n    else:\n        if _coin == WETH20:\n            WETH(WETH20).withdraw(dx)  # if WETH was transferred in\n            # previous step and `not use_eth`, withdraw WETH to ETH.\n```