{
    "Function": "_getPackedFeeParameters",
    "File": "src/LBFactory.sol",
    "Parent Contracts": [
        "src/interfaces/ILBFactory.sol",
        "src/libraries/PendingOwnable.sol",
        "src/interfaces/IPendingOwnable.sol"
    ],
    "High-Level Calls": [],
    "Internal Calls": [],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function _getPackedFeeParameters(\n        uint16 _binStep,\n        uint16 _baseFactor,\n        uint16 _filterPeriod,\n        uint16 _decayPeriod,\n        uint16 _reductionFactor,\n        uint24 _variableFeeControl,\n        uint16 _protocolShare,\n        uint24 _maxVolatilityAccumulated\n    ) private pure returns (bytes32) {\n        if (_binStep < MIN_BIN_STEP || _binStep > MAX_BIN_STEP)\n            revert LBFactory__BinStepRequirementsBreached(MIN_BIN_STEP, _binStep, MAX_BIN_STEP);\n\n        if (_baseFactor > Constants.BASIS_POINT_MAX)\n            revert LBFactory__BaseFactorOverflows(_baseFactor, Constants.BASIS_POINT_MAX);\n\n        if (_filterPeriod >= _decayPeriod) revert LBFactory__DecreasingPeriods(_filterPeriod, _decayPeriod);\n\n        if (_reductionFactor > Constants.BASIS_POINT_MAX)\n            revert LBFactory__ReductionFactorOverflows(_reductionFactor, Constants.BASIS_POINT_MAX);\n\n        if (_protocolShare > MAX_PROTOCOL_SHARE)\n            revert LBFactory__ProtocolShareOverflows(_protocolShare, MAX_PROTOCOL_SHARE);\n\n        {\n            uint256 _baseFee = (uint256(_baseFactor) * _binStep) * 1e10;\n\n            // Can't overflow as the max value is `max(uint24) * (max(uint24) * max(uint16)) ** 2 < max(uint104)`\n            // It returns 18 decimals as:\n            // decimals(variableFeeControl * (volatilityAccumulated * binStep)**2 / 100) = 4 + (4 + 4) * 2 - 2 = 18\n            uint256 _prod = uint256(_maxVolatilityAccumulated) * _binStep;\n            uint256 _maxVariableFee = (_prod * _prod * _variableFeeControl) / 100;\n\n            if (_baseFee + _maxVariableFee > MAX_FEE)\n                revert LBFactory__FeesAboveMax(_baseFee + _maxVariableFee, MAX_FEE);\n        }\n\n        /// @dev It's very important that the sum of the sizes of those values is exactly 256 bits\n        /// here, (112 + 24) + 16 + 24 + 16 + 16 + 16 + 16 + 16 = 256\n        return\n            bytes32(\n                abi.encodePacked(\n                    uint136(_maxVolatilityAccumulated), // The first 112 bits are reserved for the dynamic parameters\n                    _protocolShare,\n                    _variableFeeControl,\n                    _reductionFactor,\n                    _decayPeriod,\n                    _filterPeriod,\n                    _baseFactor,\n                    _binStep\n                )\n            );\n    }"
}