{
    "Function": "_payHarvestFees",
    "File": "contracts/v3/strategies/BaseStrategy.sol",
    "Parent Contracts": [
        "contracts/v3/interfaces/IStrategy.sol"
    ],
    "High-Level Calls": [
        "IERC20",
        "SafeERC20",
        "IERC20",
        "IERC20",
        "IERC20",
        "SafeMath",
        "IManager",
        "SafeMath"
    ],
    "Internal Calls": [
        "_swapTokens",
        "_swapTokens"
    ],
    "Library Calls": [
        "mul",
        "safeTransfer",
        "div"
    ],
    "Low-Level Calls": [],
    "Code": "function _payHarvestFees(\n        address _poolToken,\n        uint256 _estimatedWETH,\n        uint256 _estimatedYAXIS\n    )\n        internal\n        returns (uint256 _wethBal)\n    {\n        uint256 _amount = IERC20(_poolToken).balanceOf(address(this));\n        _swapTokens(_poolToken, weth, _amount, _estimatedWETH);\n        _wethBal = IERC20(weth).balanceOf(address(this));\n\n        if (_wethBal > 0) {\n            // get all the necessary variables in a single call\n            (\n                address yaxis,\n                address treasury,\n                uint256 treasuryFee\n            ) = manager.getHarvestFeeInfo();\n\n            uint256 _fee;\n\n            // pay the treasury with YAX\n            if (treasuryFee > 0 && treasury != address(0)) {\n                _fee = _wethBal.mul(treasuryFee).div(ONE_HUNDRED_PERCENT);\n                _swapTokens(weth, yaxis, _fee, _estimatedYAXIS);\n                IERC20(yaxis).safeTransfer(treasury, IERC20(yaxis).balanceOf(address(this)));\n            }\n\n            // return the remaining WETH balance\n            _wethBal = IERC20(weth).balanceOf(address(this));\n        }\n    }"
}