{
    "Function": "slitherConstructorConstantVariables",
    "File": "contracts/v3/strategies/ETHConvexStrategy.sol",
    "Parent Contracts": [
        "contracts/v3/strategies/BaseStrategy.sol",
        "contracts/v3/interfaces/IStrategy.sol"
    ],
    "High-Level Calls": [],
    "Internal Calls": [],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "contract ETHConvexStrategy is BaseStrategy {\n    using SafeMath for uint8;\n\n    address public immutable crv;\n    address public immutable cvx;\n    address public immutable aleth;\n\n    uint256 public immutable pid;\n    IConvexVault public immutable convexVault;\n    address public immutable cvxDepositLP;\n    IConvexRewards public immutable crvRewards;\n    IStableSwap2Pool public immutable stableSwapPool;\n\n    /**\n     * @param _name The strategy name\n     * @param _want The desired token of the strategy\n     * @param _crv The address of CRV\n     * @param _cvx The address of CVX\n     * @param _weth The address of WETH\n     * @param _aleth The address of alternative ETH\n     * @param _pid The pool id of convex\n     * @param _convexVault The address of the convex vault\n     * @param _stableSwapPool The address of the stable swap pool\n     * @param _controller The address of the controller\n     * @param _manager The address of the manager\n     * @param _router The address of the router for swapping tokens\n     */\n    constructor(\n        string memory _name,\n        address _want,\n        address _crv,\n        address _cvx,\n        address _weth,\n        address _aleth,\n        uint256 _pid,\n        IConvexVault _convexVault,\n        address _stableSwapPool,\n        address _controller,\n        address _manager,\n        address _router\n    ) public BaseStrategy(_name, _controller, _manager, _want, _weth, _router) {\n        require(address(_crv) != address(0), '!_crv');\n        require(address(_cvx) != address(0), '!_cvx');\n        require(address(_aleth) != address(0), '!_aleth');\n        require(address(_convexVault) != address(0), '!_convexVault');\n        require(address(_stableSwapPool) != address(0), '!_stableSwapPool');\n\n        (, address _token, , address _crvRewards, , ) = _convexVault.poolInfo(_pid);\n        crv = _crv;\n        cvx = _cvx;\n        aleth = _aleth;\n        pid = _pid;\n        convexVault = _convexVault;\n        cvxDepositLP = _token;\n        crvRewards = IConvexRewards(_crvRewards);\n        stableSwapPool = IStableSwap2Pool(_stableSwapPool);\n\n        IERC20(_want).safeApprove(address(_convexVault), type(uint256).max);\n        IERC20(_crv).safeApprove(address(_router), type(uint256).max);\n        IERC20(_cvx).safeApprove(address(_router), type(uint256).max);\n        IERC20(_want).safeApprove(address(_stableSwapPool), type(uint256).max);\n        IERC20(_aleth).safeApprove(_stableSwapPool, type(uint256).max);\n    }\n\n    function _deposit() internal override {\n        convexVault.depositAll(pid, true);\n    }\n\n    function _claimReward() internal {\n        crvRewards.getReward(address(this), true);\n    }\n\n    function _addLiquidity() internal {\n        uint256[2] memory amounts;\n        amounts[0] = address(this).balance;\n        amounts[1] = IERC20(aleth).balanceOf(address(this));\n        stableSwapPool.add_liquidity(amounts, 1);\n        return;\n    }\n\n    function getMostPremium() public view returns (address, uint256) {\n        uint256 balance0 = address(this).balance;\n        uint256 balance1 = stableSwapPool.balances(1);\n\n        if (balance0 > balance1) {\n            return (aleth, 1);\n        }\n\n        return (address(0), 0);\n    }\n\n    function _harvest(uint256 _estimatedWETH, uint256 _estimatedYAXIS) internal override {\n        _claimReward();\n        uint256 _cvxBalance = IERC20(cvx).balanceOf(address(this));\n        if (_cvxBalance > 0) {\n            _swapTokens(cvx, crv, _cvxBalance, 1);\n        }\n\n        uint256 _extraRewardsLength = crvRewards.extraRewardsLength();\n        for (uint256 i = 0; i < _extraRewardsLength; i++) {\n            address _rewardToken = IConvexRewards(crvRewards.extraRewards(i)).rewardToken();\n            uint256 _extraRewardBalance = IERC20(_rewardToken).balanceOf(address(this));\n            if (_extraRewardBalance > 0) {\n                _swapTokens(_rewardToken, weth, _extraRewardBalance, 1);\n            }\n        }\n\n        uint256 _remainingWeth = _payHarvestFees(crv, _estimatedWETH, _estimatedYAXIS);\n        if (_remainingWeth > 0) {\n            (address _targetCoin, ) = getMostPremium();\n            if (_targetCoin != address(0)) {\n                _swapTokens(weth, _targetCoin, _remainingWeth, 1);\n            } else {\n                IWETH(weth).withdraw(_remainingWeth);\n            }\n            _addLiquidity();\n\n            if (balanceOfWant() > 0) {\n                _deposit();\n            }\n        }\n    }\n\n    function _withdrawAll() internal override {\n        convexVault.withdrawAll(pid);\n    }\n\n    function _withdraw(uint256 _amount) internal override {\n        convexVault.withdraw(pid, _amount);\n    }\n\n    function balanceOfPool() public view override returns (uint256) {\n        return IERC20(cvxDepositLP).balanceOf(address(this));\n    }\n}"
}