{
    "Function": "slitherConstructorConstantVariables",
    "File": "contracts/v3/strategies/MIMConvexStrategy.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 MIMConvexStrategy is BaseStrategy {\n    // used for Crv -> weth -> [mim/3crv] -> mimCrv route\n    address public immutable crv;\n    address public immutable cvx;\n\n    address public immutable mim;\n    address public immutable crv3;\n\n    uint256 public immutable pid;\n    IConvexVault public immutable convexVault;\n    address public immutable mimCvxDepositLP;\n    IConvexRewards public immutable crvRewards;\n    IStableSwap2Pool public immutable stableSwap2Pool;\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 _mim The address of MIM\n     * @param _crv3 The address of 3CRV\n     * @param _pid The pool id of convex\n     * @param _convexVault The address of the convex vault\n     * @param _stableSwap2Pool 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 _mim,\n        address _crv3,\n        uint256 _pid,\n        IConvexVault _convexVault,\n        IStableSwap2Pool _stableSwap2Pool,\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(_mim) != address(0), '!_mim');\n        require(address(_crv3) != address(0), '!_crv3');\n        require(address(_convexVault) != address(0), '!_convexVault');\n        require(address(_stableSwap2Pool) != address(0), '!_stableSwap2Pool');\n\n        (, address _token, , address _crvRewards, , ) = _convexVault.poolInfo(_pid);\n        crv = _crv;\n        cvx = _cvx;\n        mim = _mim;\n        crv3 = _crv3;\n        pid = _pid;\n        convexVault = _convexVault;\n        mimCvxDepositLP = _token;\n        crvRewards = IConvexRewards(_crvRewards);\n        stableSwap2Pool = _stableSwap2Pool;\n        // Required to overcome \"Stack Too Deep\" error\n        _setApprovals(\n            _want,\n            _crv,\n            _cvx,\n            _mim,\n            _crv3,\n            address(_convexVault),\n            address(_stableSwap2Pool)\n        );\n    }\n\n    function _setApprovals(\n        address _want,\n        address _crv,\n        address _cvx,\n        address _mim,\n        address _crv3,\n        address _convexVault,\n        address _stableSwap2Pool\n    ) internal {\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(_mim).safeApprove(address(_stableSwap2Pool), type(uint256).max);\n        IERC20(_crv3).safeApprove(address(_stableSwap2Pool), type(uint256).max);\n        IERC20(_want).safeApprove(address(_stableSwap2Pool), type(uint256).max);\n    }\n\n    function _deposit() internal override {\n        if (balanceOfWant() > 0) {\n            convexVault.depositAll(pid, true);\n        }\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] = IERC20(mim).balanceOf(address(this));\n        amounts[1] = IERC20(crv3).balanceOf(address(this));\n        stableSwap2Pool.add_liquidity(amounts, 1);\n    }\n\n    function getMostPremium() public view returns (address, uint256) {\n        // both MIM and 3CRV have 18 decimals\n        if (stableSwap2Pool.balances(0) > stableSwap2Pool.balances(1)) {\n            return (crv3, 1);\n        }\n\n        return (mim, 0); // If they're somehow equal, we just want MIM\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 _token, ) = getMostPremium(); // stablecoin we want to convert to\n            _swapTokens(weth, _token, _remainingWeth, 1);\n            _addLiquidity();\n            _deposit();\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(mimCvxDepositLP).balanceOf(address(this));\n    }\n}"
}