Logic Error due to different representation of Native ETH (0x0 & 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
Unexpected results might occur during vault initialization if either of the pool's tokens is a Native ETH due to the confusion between `Deployments.ETH_ADDRESS (address(0))` and `Deployments.ALT_ETH_ADDRESS (0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)`.\\nThe `PRIMARY_TOKEN` or `SECONDARY_TOKEN` is explicitly converted to `Deployments.ETH_ADDRESS (address(0)` during deployment.\\n```\\nFile: Curve2TokenPoolMixin.sol\\nabstract contract Curve2TokenPoolMixin is CurvePoolMixin {\\n..SNIP..\\n    constructor(\\n        NotionalProxy notional_,\\n        ConvexVaultDeploymentParams memory params\\n    ) CurvePoolMixin(notional_, params) {\\n        address primaryToken = _getNotionalUnderlyingToken(params.baseParams.primaryBorrowCurrencyId);\\n\\n        PRIMARY_TOKEN = primaryToken;\\n\\n        // Curve uses ALT_ETH_ADDRESS\\n        if (primaryToken == Deployments.ETH_ADDRESS) {\\n            primaryToken = Deployments.ALT_ETH_ADDRESS;\\n        }\\n\\n        address token0 = CURVE_POOL.coins(0);\\n        address token1 = CURVE_POOL.coins(1);\\n        \\n        uint8 primaryIndex;\\n        address secondaryToken;\\n        if (token0 == primaryToken) {\\n            primaryIndex = 0;\\n            secondaryToken = token1;\\n        } else {\\n            primaryIndex = 1;\\n            secondaryToken = token0;\\n        }\\n\\n        if (secondaryToken == Deployments.ALT_ETH_ADDRESS) {\\n            secondaryToken = Deployments.ETH_ADDRESS;\\n        }\\n\\n        PRIMARY_INDEX = primaryIndex;\\n        SECONDARY_TOKEN = secondaryToken;\\n```\\n\\nIt was observed that there is a logic error within the `Curve2TokenConvexVault.initialize` function. Based on Lines 56 and 59 within the `Curve2TokenConvexVault.initialize` function, it assumes that if either the primary or secondary token is ETH, then the `PRIMARY_TOKEN` or `SECONDARY_TOKEN` will be set to `Deployments.ALT_ETH_ADDRESS`, which point to `0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE`.\\nHowever, this is incorrect as the `PRIMARY_TOKEN` or `SECONDARY_TOKEN` has already been converted to `Deployments.ETH_ADDRESS (address(0))` during deployment. Refer to the constructor of `Curve2TokenPoolMixin`.\\nThus, the `PRIMARY_TOKEN` or `SECONDARY_TOKEN` will never be equal to `Deployments.ALT_ETH_ADDRESS`, and the condition at Lines 56 and 59 will always evaluate to True.\\n```\\nFile: Curve2TokenConvexVault.sol\\ncontract Curve2TokenConvexVault is Curve2TokenVaultMixin {\\n..SNIP..\\n    function initialize(InitParams calldata params)\\n        external\\n        initializer\\n        onlyNotionalOwner\\n    {\\n        __INIT_VAULT(params.name, params.borrowCurrencyId);\\n        CurveVaultStorage.setStrategyVaultSettings(params.settings);\\n\\n        if (PRIMARY_TOKEN != Deployments.ALT_ETH_ADDRESS) {\\n            IERC20(PRIMARY_TOKEN).checkApprove(address(CURVE_POOL), type(uint256).max);\\n        }\\n        if (SECONDARY_TOKEN != Deployments.ALT_ETH_ADDRESS) {\\n            IERC20(SECONDARY_TOKEN).checkApprove(address(CURVE_POOL), type(uint256).max);\\n        }\\n\\n        CURVE_POOL_TOKEN.checkApprove(address(CONVEX_BOOSTER), type(uint256).max);\\n    }\\n```\\n\\nAs a result, if the `PRIMARY_TOKEN` or `SECONDARY_TOKEN` is `Deployments.ETH_ADDRESS (address(0))`, the code will go ahead to call the `checkApprove` function, which might cause unexpected results during vault initialization.
If the `PRIMARY_TOKEN` or `SECONDARY_TOKEN` is equal to `Deployments.ALT_ETH_ADDRESS` or `Deployments.ETH_ADDRESS`, this means that it points to native ETH and the `checkApprove` can be safely skipped.\\n```\\nfunction initialize(InitParams calldata params)\\n external\\n initializer\\n onlyNotionalOwner\\n{\\n __INIT_VAULT(params.name, params.borrowCurrencyId);\\n CurveVaultStorage.setStrategyVaultSettings(params.settings);\\n\\n// Remove the line below\\n if (PRIMARY_TOKEN != Deployments.ALT_ETH_ADDRESS) {\\n// Add the line below\\n if (PRIMARY_TOKEN != Deployments.ALT_ETH_ADDRESS || PRIMARY_TOKEN != Deployments.ETH_ADDRESS) {\\n  IERC20(PRIMARY_TOKEN).checkApprove(address(CURVE_POOL), type(uint256).max);\\n }\\n// Remove the line below\\n if (SECONDARY_TOKEN != Deployments.ALT_ETH_ADDRESS) {\\n// Add the line below\\n if (SECONDARY_TOKEN != Deployments.ALT_ETH_ADDRESS || SECONDARY_TOKEN != Deployments.ETH_ADDRESS) {\\n  IERC20(SECONDARY_TOKEN).checkApprove(address(CURVE_POOL), type(uint256).max);\\n }\\n\\n CURVE_POOL_TOKEN.checkApprove(address(CONVEX_BOOSTER), type(uint256).max);\\n}\\n```\\n
Unexpected results during vault initialization if either of the pool's tokens is a Native ETH.
```\\nFile: Curve2TokenPoolMixin.sol\\nabstract contract Curve2TokenPoolMixin is CurvePoolMixin {\\n..SNIP..\\n    constructor(\\n        NotionalProxy notional_,\\n        ConvexVaultDeploymentParams memory params\\n    ) CurvePoolMixin(notional_, params) {\\n        address primaryToken = _getNotionalUnderlyingToken(params.baseParams.primaryBorrowCurrencyId);\\n\\n        PRIMARY_TOKEN = primaryToken;\\n\\n        // Curve uses ALT_ETH_ADDRESS\\n        if (primaryToken == Deployments.ETH_ADDRESS) {\\n            primaryToken = Deployments.ALT_ETH_ADDRESS;\\n        }\\n\\n        address token0 = CURVE_POOL.coins(0);\\n        address token1 = CURVE_POOL.coins(1);\\n        \\n        uint8 primaryIndex;\\n        address secondaryToken;\\n        if (token0 == primaryToken) {\\n            primaryIndex = 0;\\n            secondaryToken = token1;\\n        } else {\\n            primaryIndex = 1;\\n            secondaryToken = token0;\\n        }\\n\\n        if (secondaryToken == Deployments.ALT_ETH_ADDRESS) {\\n            secondaryToken = Deployments.ETH_ADDRESS;\\n        }\\n\\n        PRIMARY_INDEX = primaryIndex;\\n        SECONDARY_TOKEN = secondaryToken;\\n```\\n