{
    "Function": "slitherConstructorConstantVariables",
    "File": "contracts/v3/strategies/NativeStrategyCurve3Crv.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 NativeStrategyCurve3Crv is BaseStrategy {\n    // used for Crv -> weth -> [dai/usdc/usdt] -> 3crv route\n    address public immutable crv;\n\n    // for add_liquidity via curve.fi to get back 3CRV (use getMostPremium() for the best stable coin used in the route)\n    address public immutable dai;\n    address public immutable usdc;\n    address public immutable usdt;\n\n    Mintr public immutable crvMintr;\n    IStableSwap3Pool public immutable stableSwap3Pool;\n    Gauge public immutable gauge; // 3Crv Gauge\n\n    constructor(\n        string memory _name,\n        address _want,\n        address _crv,\n        address _weth,\n        address _dai,\n        address _usdc,\n        address _usdt,\n        Gauge _gauge,\n        Mintr _crvMintr,\n        IStableSwap3Pool _stableSwap3Pool,\n        address _controller,\n        address _manager,\n        address _router\n    )\n        public\n        BaseStrategy(_name, _controller, _manager, _want, _weth, _router)\n    {\n        crv = _crv;\n        dai = _dai;\n        usdc = _usdc;\n        usdt = _usdt;\n        stableSwap3Pool = _stableSwap3Pool;\n        gauge = _gauge;\n        crvMintr = _crvMintr;\n        IERC20(_want).safeApprove(address(_gauge), type(uint256).max);\n        IERC20(_crv).safeApprove(address(_router), type(uint256).max);\n        IERC20(_dai).safeApprove(address(_stableSwap3Pool), type(uint256).max);\n        IERC20(_usdc).safeApprove(address(_stableSwap3Pool), type(uint256).max);\n        IERC20(_usdt).safeApprove(address(_stableSwap3Pool), type(uint256).max);\n        IERC20(_want).safeApprove(address(_stableSwap3Pool), type(uint256).max);\n    }\n\n    function _deposit()\n        internal\n        override\n    {\n        uint256 _wantBal = balanceOfWant();\n        if (_wantBal > 0) {\n            // deposit [want] to Gauge\n            gauge.deposit(_wantBal);\n        }\n    }\n\n    function _claimReward()\n        internal\n    {\n        crvMintr.mint(address(gauge));\n    }\n\n    function _addLiquidity()\n        internal\n    {\n        uint256[3] memory amounts;\n        amounts[0] = IERC20(dai).balanceOf(address(this));\n        amounts[1] = IERC20(usdc).balanceOf(address(this));\n        amounts[2] = IERC20(usdt).balanceOf(address(this));\n        stableSwap3Pool.add_liquidity(amounts, 1);\n    }\n\n    function getMostPremium()\n        public\n        view\n        returns (address, uint256)\n    {\n        uint daiBalance = stableSwap3Pool.balances(0);\n        // USDC - Supports a change up to the 18 decimal standard\n        uint usdcBalance = stableSwap3Pool.balances(1).mul(10**18).div(10**(ExtendedIERC20(usdc).decimals()));\n        uint usdtBalance = stableSwap3Pool.balances(2).mul(10**12);\n\n        if (daiBalance <= usdcBalance && daiBalance <= usdtBalance) {\n            return (dai, 0);\n        }\n\n        if (usdcBalance <= daiBalance && usdcBalance <= usdtBalance) {\n            return (usdc, 1);\n        }\n\n        if (usdtBalance <= daiBalance && usdtBalance <= usdcBalance) {\n            return (usdt, 2);\n        }\n\n        return (dai, 0); // If they're somehow equal, we just want DAI\n    }\n\n    function _harvest(\n        uint256 _estimatedWETH,\n        uint256 _estimatedYAXIS\n    )\n        internal\n        override\n    {\n        _claimReward();\n        uint256 _remainingWeth = _payHarvestFees(crv, _estimatedWETH, _estimatedYAXIS);\n\n        if (_remainingWeth > 0) {\n            (address _stableCoin,) = getMostPremium(); // stablecoin we want to convert to\n            _swapTokens(weth, _stableCoin, _remainingWeth, 1);\n            _addLiquidity();\n\n            _deposit();\n        }\n    }\n\n    function _withdrawAll()\n        internal\n        override\n    {\n        uint256 _bal = gauge.balanceOf(address(this));\n        _withdraw(_bal);\n    }\n\n    function _withdraw(\n        uint256 _amount\n    )\n        internal\n        override\n    {\n        gauge.withdraw(_amount);\n    }\n\n    function balanceOfPool()\n        public\n        view\n        override\n        returns (uint256)\n    {\n        return gauge.balanceOf(address(this));\n    }\n}"
}