{
    "Function": "updateFees",
    "File": "src/libraries/SwapHelper.sol",
    "Parent Contracts": [],
    "High-Level Calls": [
        "FeeDistributionHelper",
        "FeeDistributionHelper"
    ],
    "Internal Calls": [],
    "Library Calls": [
        "getTokenPerShare",
        "getTokenPerShare"
    ],
    "Low-Level Calls": [],
    "Code": "function updateFees(\n        ILBPair.Bin memory bin,\n        FeeHelper.FeesDistribution memory pairFees,\n        FeeHelper.FeesDistribution memory fees,\n        bool swapForY,\n        uint256 totalSupply\n    ) internal pure {\n        pairFees.total += fees.total;\n        // unsafe math is fine because total >= protocol\n        unchecked {\n            pairFees.protocol += fees.protocol;\n        }\n\n        if (swapForY) {\n            bin.accTokenXPerShare += fees.getTokenPerShare(totalSupply);\n        } else {\n            bin.accTokenYPerShare += fees.getTokenPerShare(totalSupply);\n        }\n    }"
}