{"file_path":"contracts/core/FirelightVault.sol","creation_status":"success","source_code":"// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport {ERC4626Upgradeable} from \"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC4626Upgradeable.sol\";\nimport {ERC20Upgradeable} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {AccessControlUpgradeable} from \"@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol\";\nimport {PausableUpgradeable} from \"@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol\";\nimport {ReentrancyGuardUpgradeable} from \"@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol\";\nimport {SafeERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {Math} from \"@openzeppelin/contracts/utils/math/Math.sol\";\nimport {Time} from \"@openzeppelin/contracts/utils/types/Time.sol\";\n\nimport {FirelightVaultStorage} from \"./FirelightVaultStorage.sol\";\nimport {Checkpoints} from \"./lib/Checkpoints.sol\";\n\n/**\n * @title FirelightVault\n * @notice Upgradeable ERC4626-compatible vault with delayed withdrawals.\n *\n * @dev FirelightVault is an ERC4626 vault that intentionally deviates from the standard.\n * It overrides `withdraw` and `redeem` to implement delayed withdrawals.\n * Instead of transferring assets immediately, these functions create a withdrawal request,\n * which must be completed later via `claimWithdraw` after a set delay.\n *\n * The standard `Withdraw` event is not emitted. Instead, `WithdrawRequest` and `CompleteWithdraw`\n * are used to track the withdrawal process.\n *\n * Off-chain and on-chain tools must account for this custom flow and event structure.\n *\n * @custom:security-contact securityreport@firelight.finance\n */\ncontract FirelightVault is\n    FirelightVaultStorage,\n    ERC4626Upgradeable,\n    AccessControlUpgradeable,\n    PausableUpgradeable,\n    ReentrancyGuardUpgradeable\n{\n    using Checkpoints for Checkpoints.Trace256;\n    using SafeERC20 for IERC20;\n    using Math for uint256;\n\n    /**\n     * @notice Initial parameters needed for the vault's deployment.\n     * @param defaultAdmin Vault's admin that grants and revokes roles.\n     * @param limitUpdater Address assigned the DEPOSIT_LIMIT_UPDATE_ROLE at initialization.\n     * @param blocklister Address assigned the BLOCKLIST_ROLE at initialization.\n     * @param pauser Address assigned the PAUSE_ROLE at initialization.\n     * @param periodConfigurationUpdater Address assigned the PERIOD_CONFIGURATION_UPDATE_ROLE at initialization.\n     * @param rescuer Address assigned the RESCUER_ROLE at initialization.\n     * @param depositLimit Initial total deposit limit.\n     * @param periodConfigurationDuration Initial period duration of the vault.\n     */\n    struct InitParams {\n        address defaultAdmin;\n        address limitUpdater;\n        address blocklister;\n        address pauser;\n        address periodConfigurationUpdater;\n        address rescuer;\n        uint256 depositLimit;\n        uint48 periodConfigurationDuration;\n    }\n\n    /**\n     * @notice Emitted when the vault's deposit limit is updated.\n     * @param limit The new maximum amount of assets allowed in the vault.\n     */\n    event DepositLimitUpdated(uint256 limit);\n\n    /**\n     * @notice Emitted when a new periodConfiguration is added.\n     * @param periodConfiguration The details of the newly added periodConfiguration.\n     */\n    event PeriodConfigurationAdded(PeriodConfiguration periodConfiguration);\n\n    /**\n     * @notice Emitted when a withdrawal request is created by a user.\n     * @param sender The caller who initiated the withdrawal request.\n     * @param receiver The address that will receive the assets in the next period.\n     * @param owner The address whose shares are being redeemed, using allowance.\n     * @param period The period when the withdrawal will be available.\n     * @param assets The amount of assets to be withdrawn.\n     * @param shares The number of shares burned for the withdrawal.\n     */\n    event WithdrawRequest(\n        address indexed sender,\n        address indexed receiver,\n        address indexed owner,\n        uint256 period,\n        uint256 assets,\n        uint256 shares\n    );\n\n    /**\n     * @notice Emitted when a user successfully claims a withdrawal for a given period.\n     * @param receiver The address that received the withdrawn assets.\n     * @param assets The amount of assets withdrawn.\n     * @param period The period for which the withdrawal was claimed.\n     */\n    event CompleteWithdraw(address indexed receiver, uint256 assets, uint256 period);\n\n    /**\n     * @notice Emitted when a user with RESCUER_ROLE successfully rescues shares from a blocklisted address.\n     * @param from The blocklisted address.\n     * @param to The beneficiary of the rescued shares.\n     * @param rescuedShares The amount of shares rescued.\n     */\n    event SharesRescuedFromBlocklisted(address from, address to, uint256 rescuedShares);\n\n    /**\n     * @notice Emitted when a user with RESCUER_ROLE successfully rescues pending withdrawals\n     * from a blocklisted address.\n     * @param from The blocklisted address.\n     * @param to The beneficiary of the rescued withdrawals.\n     * @param periods The array of periods rescued.\n     * @param rescuedShares The array of pending shares from withdrawals rescued for each period.\n     */\n    event WithdrawRescuedFromBlocklisted(address from, address to, uint256[] periods, uint256[] rescuedShares);\n\n    /**\n     * @notice Emitted when an incident payout is processed, including when no assets can be paid.\n     * @param to The allowlisted payout receiver.\n     * @param requestedAmount The requested payout amount, in vault asset units.\n     * @param paidAmount The amount actually transferred, which may be less than requested or zero.\n     * @param captureTimestamp The incident capture timestamp that determines the covered period and payout window.\n     */\n    event PayoutExecuted(address indexed to, uint256 requestedAmount, uint256 paidAmount, uint48 captureTimestamp);\n\n    /**\n     * @notice Emitted when a period's active incident flag is set.\n     * @param period The period whose active incident flag was set.\n     * @param active Whether the period has an active incident.\n     */\n    event ActiveIncidentUpdated(uint256 indexed period, bool active);\n\n    /**\n     * @notice Emitted when an address is added to the blocklist.\n     * @param account The blocklisted address.\n     */\n    event AddedToBlocklist(address indexed account);\n\n    /**\n     * @notice Emitted when an address is removed from the blocklist.\n     * @param account The address removed from the blocklist.\n     */\n    event RemovedFromBlocklist(address indexed account);\n\n    /**\n     * @notice Emitted when an address is added to the payout allowlist.\n     * @param account The allowlisted address.\n     */\n    event AddedToPayoutAllowlist(address indexed account);\n\n    /**\n     * @notice Emitted when an address is removed from the payout allowlist.\n     * @param account The address removed from the payout allowlist.\n     */\n    event RemovedFromPayoutAllowlist(address indexed account);\n\n    /**\n     * @notice Emitted when a total-assets checkpoint is recorded outside deposit/withdraw flows.\n     * @param totalAssets The total assets recorded, excluding assets pending withdrawal.\n     */\n    event TotalAssetsCheckpointed(uint256 totalAssets);\n\n    /// @notice An account involved in the operation is blocklisted.\n    error BlocklistedAddress();\n\n    /// @notice The account is not blocklisted.\n    error NotBlocklistedAddress();\n\n    /// @notice A deposit or mint would increase total assets above the deposit limit.\n    error DepositLimitExceeded();\n\n    /// @notice The deposit limit is zero.\n    error InvalidDepositLimit();\n\n    /// @notice The period configuration epoch is too early or not aligned with a period boundary.\n    error InvalidPeriodConfigurationEpoch();\n\n    /// @notice The period duration is outside the allowed range or not a multiple of SMALLEST_PERIOD_DURATION.\n    error InvalidPeriodConfigurationDuration();\n\n    /// @notice The account has insufficient shares for the withdrawal or no shares to rescue.\n    error InsufficientShares();\n\n    /// @notice The underlying asset address is zero.\n    error InvalidAssetAddress();\n\n    /// @notice The default admin address is zero.\n    error InvalidAdminAddress();\n\n    /// @notice An account address required by the operation is zero.\n    error InvalidAddress();\n\n    /// @notice The requested amount is zero or converts to zero shares or assets.\n    error InvalidAmount();\n\n    /// @notice No period configuration applies to the query, or the withdrawal period has not ended.\n    error InvalidPeriod();\n\n    /// @notice A future period configuration is already scheduled.\n    error CurrentPeriodConfigurationNotLast();\n\n    /// @notice The array of withdrawal periods to rescue is empty.\n    error InvalidArrayLength();\n\n    /// @notice A withdrawal for the account and period has already been claimed.\n    /// @param period The period whose withdrawal has already been claimed.\n    error AlreadyClaimedPeriod(uint256 period);\n\n    /// @notice The account has no withdrawal shares or claimable assets for the period.\n    /// @param period The period with no withdrawal shares or claimable assets.\n    error NoWithdrawalAmount(uint256 period);\n\n    /// @notice The payout receiver is not on the payout allowlist.\n    error AccountNotAllowlisted();\n\n    /// @notice The capture period is neither the current period nor the previous period.\n    error InvalidCapturePeriod();\n\n    /// @notice An active incident in the current or previous period blocks deposits and mints.\n    error CurrentPeriodHasActiveIncident();\n\n    modifier notBlocklisted(address account) {\n        _requireNotBlocklisted(account);\n        _;\n    }\n\n    function _requireNotBlocklisted(address account) private view {\n        if (isBlocklisted[account]) {\n            revert BlocklistedAddress();\n        }\n    }\n\n    modifier onlyBlocklisted(address account) {\n        if (!isBlocklisted[account]) {\n            revert NotBlocklistedAddress();\n        }\n        _;\n    }\n\n    /**\n     * @notice Prevents unauthorized direct deployment via the constructor.\n     */\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    /**\n     * @notice Initializes the FirelightVault contract with given parameters\n     * @param _asset The underlying collateral ERC20 token.\n     * @param _name The name of the vault token.\n     * @param _symbol The symbol of the vault token.\n     * @param _initParams Initial parameters.\n     */\n    function initialize(\n        IERC20 _asset,\n        string memory _name,\n        string memory _symbol,\n        bytes memory _initParams\n    ) public initializer {\n        InitParams memory initParams = abi.decode(_initParams, (InitParams));\n        __ERC20_init(_name, _symbol);\n        __ERC4626_init(_asset);\n        __Pausable_init();\n        __ReentrancyGuard_init();\n        __AccessControl_init();\n\n        if (address(_asset) == address(0)) {\n            revert InvalidAssetAddress();\n        }\n\n        _updateDepositLimit(initParams.depositLimit);\n\n        if (initParams.periodConfigurationDuration == 0) {\n            revert InvalidPeriodConfigurationDuration();\n        }\n\n        if (initParams.defaultAdmin == address(0)) {\n            revert InvalidAdminAddress();\n        }\n\n        _addPeriodConfiguration(Time.timestamp(), initParams.periodConfigurationDuration);\n        contractVersion = 2;\n\n        _grantRole(DEFAULT_ADMIN_ROLE, initParams.defaultAdmin);\n\n        if (initParams.limitUpdater != address(0)) {\n            _grantRole(DEPOSIT_LIMIT_UPDATE_ROLE, initParams.limitUpdater);\n        }\n\n        if (initParams.blocklister != address(0)) {\n            _grantRole(BLOCKLIST_ROLE, initParams.blocklister);\n        }\n\n        if (initParams.pauser != address(0)) {\n            _grantRole(PAUSE_ROLE, initParams.pauser);\n        }\n\n        if (initParams.periodConfigurationUpdater != address(0)) {\n            _grantRole(PERIOD_CONFIGURATION_UPDATE_ROLE, initParams.periodConfigurationUpdater);\n        }\n\n        if (initParams.rescuer != address(0)) {\n            _grantRole(RESCUER_ROLE, initParams.rescuer);\n        }\n    }\n\n    /**\n     * @notice Intended to be called atomically during upgrade via `upgradeToAndCall`.\n     */\n    function initializeV2() external reinitializer(2) {\n        contractVersion = 2;\n    }\n\n    /**\n     * @notice Returns the period configuration corresponding to a given timestamp.\n     * @dev Return value may be unreliable if timestamp given is far away in the future\n     * @dev given that new period configurations can be added after nextPeriodEnd().\n     * @param timestamp The timestamp to find the period configuration for.\n     * @return The period configuration corresponding to the given timestamp.\n     */\n    function periodConfigurationAtTimestamp(uint48 timestamp) public view returns (PeriodConfiguration memory) {\n        uint256 length = periodConfigurations.length;\n        if (length == 0) revert InvalidPeriod();\n\n        PeriodConfiguration memory periodConfiguration;\n        for (uint256 i = 0; i < length; i++) {\n            if (timestamp < periodConfigurations[i].epoch)\n                break;\n            periodConfiguration = periodConfigurations[i];\n        }\n        if (periodConfiguration.epoch == 0) revert InvalidPeriod();\n        return periodConfiguration;\n    }\n\n    /**\n     * @notice Returns the period configuration corresponding to a given period number.\n     * @dev Return value may be unreliable if period number given is far away in the future\n     * @dev given that new period configurations can be added after nextPeriodEnd().\n     * @param periodNumber The period number to find the period configuration for.\n     * @return The period configuration corresponding to the given period number.\n     */\n    function periodConfigurationAtNumber(uint256 periodNumber) public view returns (PeriodConfiguration memory) {\n        uint256 length = periodConfigurations.length;\n        if (length == 0) revert InvalidPeriod();\n\n        PeriodConfiguration memory periodConfiguration;\n        for (uint256 i = 0; i < length; i++) {\n            if (periodNumber < periodConfigurations[i].startingPeriod)\n                break;\n            periodConfiguration = periodConfigurations[i];\n        }\n        if (periodConfiguration.epoch == 0) revert InvalidPeriod();\n        return periodConfiguration;\n    }\n\n    /**\n     * @notice Returns the period number for the timestamp given.\n     * @dev Return value may be unreliable if period number given is far away in the future\n     * @dev given that new period configurations can be added after nextPeriodEnd().\n     * @return The period number corresponding to the given timestamp.\n     */\n    function periodAtTimestamp(uint48 timestamp) public view returns (uint256) {\n        PeriodConfiguration memory periodConfiguration = periodConfigurationAtTimestamp(timestamp);\n        // solhint-disable-next-line max-line-length\n        return periodConfiguration.startingPeriod + _timestampSinceEpoch(timestamp, periodConfiguration.epoch) / periodConfiguration.duration;\n    }\n\n    /**\n     * @notice Returns the period configuration for the current period.\n     * @return The period configuration corresponding to the current period.\n     */\n    function currentPeriodConfiguration() public view returns (PeriodConfiguration memory) {\n        return periodConfigurationAtTimestamp(Time.timestamp());\n    }\n\n    /**\n     * @notice Returns the current active period.\n     * @return The current period number since contract deployment.\n     */\n    function currentPeriod() public view returns (uint256) {\n        return periodAtTimestamp(Time.timestamp());\n    }\n\n    /**\n     * @notice Returns the start timestamp of the current period.\n     * @return Timestamp of the current period start.\n     */\n    function currentPeriodStart() external view returns (uint48) {\n        PeriodConfiguration memory currentPC = currentPeriodConfiguration();\n        return currentPC.epoch + (_nowSinceEpoch(currentPC.epoch) / currentPC.duration) * currentPC.duration;\n    }\n\n    /**\n     * @notice Returns the end timestamp of the current period.\n     * @return Timestamp of the current period end.\n     */\n    function currentPeriodEnd() public view returns (uint48) {\n        PeriodConfiguration memory currentPC = currentPeriodConfiguration();\n        return currentPC.epoch + (_nowSinceEpoch(currentPC.epoch) / currentPC.duration + 1) * currentPC.duration;\n    }\n\n    /**\n     * @notice Returns the end timestamp of the period following the current period.\n     * @return Timestamp of the next period end.\n     */\n    function nextPeriodEnd() public view returns (uint48) {\n        uint48 currentEnd = currentPeriodEnd();\n        return currentEnd + periodConfigurationAtTimestamp(currentEnd).duration;\n    }\n\n    /**\n     * @notice Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver,\n     * through a deposit call.\n     * @param receiver The address of the deposit receiver.\n     * @return amount Maximum amount of assets that can be deposited.\n     */\n    function maxDeposit(address receiver) public view override returns (uint256 amount) {\n        uint256 assets = totalAssets();\n        if (isBlocklisted[receiver] || paused() || _hasActiveIncident() || assets > depositLimit) {\n            return 0;\n        }\n\n        uint256 remaining = depositLimit - assets;\n        if (previewDeposit(remaining) == 0) return 0;\n        return remaining;\n    }\n\n    /**\n     * @notice Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call.\n     * @param receiver The address of the mint receiver.\n     * @return amount Maximum amount of shares that can be minted.\n     */\n    function maxMint(address receiver) public view override returns (uint256 amount) {\n        return previewDeposit(maxDeposit(receiver));\n    }\n\n    /**\n     * @notice Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the\n     * Vault, through a withdraw call.\n     * @param owner The owner of the assets.\n     * @return amount Maximum amount of assets that can be withdrawn.\n     */\n    function maxWithdraw(address owner) public view override returns (uint256 amount) {\n        if (isBlocklisted[owner] || paused()) {\n            return 0;\n        } else {\n            return _convertToAssets(balanceOf(owner), Math.Rounding.Floor);\n        }\n    }\n\n    /**\n     * @notice Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault,\n     * through a redeem call.\n     * @param owner The owner of the shares.\n     * @return amount Maximum amount of shares that can be redeemed.\n     */\n    function maxRedeem(address owner) public view override returns (uint256 amount) {\n        if (isBlocklisted[owner] || paused()) {\n            return 0;\n        } else {\n            uint256 shares = balanceOf(owner);\n            return _convertToAssets(shares, Math.Rounding.Floor) == 0 ? 0 : shares;\n        }\n    }\n\n    /**\n     * @notice Returns the total assets in the vault excluding those marked for withdrawal.\n     * @return The total assets held by the vault.\n     */\n    function totalAssets() public view override returns (uint256) {\n        return super.totalAssets() - pendingWithdrawAssets;\n    }\n\n    /**\n     * @notice Returns the effective total shares for `account` at a specific `timestamp`.\n     * @param account The address whose share balance is being queried.\n     * @param timestamp The point in time for which the balance is being checked.\n     * @return The shares owned by `account` at the specified time.\n     */\n    function balanceOfAt(address account, uint48 timestamp) external view returns (uint256) {\n        return _traceBalanceOf[account].upperLookupRecent(timestamp);\n    }\n\n    /**\n     * @notice Returns the total supply of shares at a specific `timestamp`.\n     * @param timestamp The point in time for which the total supply is being checked.\n     * @return The total shares in existence at the specified time.\n     */\n    function totalSupplyAt(uint48 timestamp) external view returns (uint256) {\n        return _traceTotalSupply.upperLookupRecent(timestamp);\n    }\n\n    /**\n     * @notice Returns the total underlying assets held by the vault at a specific `timestamp`, excluding any assets\n     * marked for withdrawal.\n     * @param timestamp The point in time for which the total assets are being checked.\n     * @return The total underlying assets held by the vault at the specified time.\n     */\n    function totalAssetsAt(uint48 timestamp) public view returns (uint256) {\n        return _traceTotalAssets.upperLookupRecent(timestamp);\n    }\n\n    /**\n     * @notice Returns the amount that was made withdrawable for the given period and account, whether claimed or not.\n     * @param period Period number to check.\n     * @param account Account address.\n     * @return Amount of assets claimable for that period.\n     */\n    function withdrawalsOf(uint256 period, address account) external view returns (uint256) {\n        return\n            _convertToAssetsTotals(\n                withdrawSharesOf[period][account],\n                withdrawShares[period],\n                withdrawAssets[period],\n                Math.Rounding.Floor\n            );\n    }\n\n    /**\n     * @notice Returns whether a period is inside the payout window.\n     * @param period Vault period to check.\n     * @return True if the period can still be used for payout.\n     */\n    function isPeriodInPayoutWindow(uint256 period) external view returns (bool) {\n        return _isPeriodInPayoutWindow(period, currentPeriod());\n    }\n\n    /**\n     * @notice Returns the length of the periodConfigurations array.\n     * @return Length of the periodConfigurations array.\n     */\n    function periodConfigurationsLength() public view returns (uint256) {\n        return periodConfigurations.length;\n    }\n\n    /**\n     * @notice Pauses the contract. Requires PAUSE_ROLE.\n     */\n    function pause() external onlyRole(PAUSE_ROLE) {\n        _pause();\n    }\n\n    /**\n     * @notice Unpauses the contract. Requires PAUSE_ROLE.\n     */\n    function unpause() external onlyRole(PAUSE_ROLE) {\n        _unpause();\n    }\n\n    /**\n     * @notice Sets whether deposits are blocked for a period due to an active incident.\n     */\n    function setActiveIncident(uint256 period, bool active) external onlyRole(INCIDENT_ROLE) {\n        hasActiveIncident[period] = active;\n        emit ActiveIncidentUpdated(period, active);\n    }\n\n    /**\n     * @notice Records a checkpoint of the current total assets. Requires CHECKPOINT_ROLE.\n     * @dev Assets forwarded directly to the vault (e.g. reward distribution) do not trigger\n     * the deposit/withdraw checkpoints, so historical `totalAssetsAt` lookups would miss them\n     * until the next flow. The reward distributor calls this atomically after forwarding so\n     * period-start snapshots include the forwarded assets. Restricted to a role because\n     * checkpoint growth on a low-fee chain would otherwise be spammable.\n     */\n    function checkpointTotalAssets() external onlyRole(CHECKPOINT_ROLE) {\n        uint256 assets = totalAssets();\n        _traceTotalAssets.push(Time.timestamp(), assets);\n        emit TotalAssetsCheckpointed(assets);\n    }\n\n    /**\n     * @notice Updates the maximum deposit limit for the vault. Requires DEPOSIT_LIMIT_UPDATE_ROLE.\n     * @param newLimit The new deposit limit.\n     */\n    function updateDepositLimit(uint256 newLimit) external onlyRole(DEPOSIT_LIMIT_UPDATE_ROLE) {\n        _updateDepositLimit(newLimit);\n    }\n\n    /**\n     * @notice Adds a period configuration. Requires PERIOD_CONFIGURATION_UPDATE_ROLE.\n     * @param epoch The epoch timestamp.\n     * @param duration The period duration.\n     */\n    function addPeriodConfiguration(uint48 epoch, uint48 duration) external onlyRole(PERIOD_CONFIGURATION_UPDATE_ROLE) {\n        _addPeriodConfiguration(epoch, duration);\n    }\n\n    /**\n     * @notice Adds an address to the blocklist. Requires BLOCKLIST_ROLE.\n     * @param account Address to blocklist. Cannot be zero address nor blocklisted.\n     */\n    function addToBlocklist(address account) external onlyRole(BLOCKLIST_ROLE) notBlocklisted(account) {\n        if (account == address(0)) revert InvalidAddress();\n        isBlocklisted[account] = true;\n        emit AddedToBlocklist(account);\n    }\n\n    /**\n     * @notice Removes an address from the blocklist. Requires BLOCKLIST_ROLE.\n     * @param account Address to remove from blocklist. Must be blocklisted.\n     */\n    function removeFromBlocklist(address account) external onlyRole(BLOCKLIST_ROLE) onlyBlocklisted(account) {\n        isBlocklisted[account] = false;\n        emit RemovedFromBlocklist(account);\n    }\n\n    /**\n     * @notice Adds an address to the payout allowlist. Requires PAYOUT_ALLOWLIST_ROLE.\n     * @param account Address to add. Cannot be zero address.\n     */\n    function addToPayoutAllowlist(address account) external onlyRole(PAYOUT_ALLOWLIST_ROLE) {\n        if (account == address(0)) revert InvalidAddress();\n        isPayoutAllowlisted[account] = true;\n        emit AddedToPayoutAllowlist(account);\n    }\n\n    /**\n     * @notice Removes an address from the payout allowlist. Requires PAYOUT_ALLOWLIST_ROLE.\n     * @param account Address to remove.\n     */\n    function removeFromPayoutAllowlist(address account) external onlyRole(PAYOUT_ALLOWLIST_ROLE) {\n        isPayoutAllowlisted[account] = false;\n        emit RemovedFromPayoutAllowlist(account);\n    }\n\n    /**\n     * @notice Transfers shares to an address, with blocklist and pause checks.\n     * @param to Recipient address.\n     * @param shares Number of shares to transfer.\n     * @return Boolean indicating transfer success.\n     */\n    function transfer(\n        address to,\n        uint256 shares\n    )\n        public\n        override(ERC20Upgradeable, IERC20)\n        whenNotPaused\n        notBlocklisted(_msgSender())\n        notBlocklisted(to)\n        returns (bool)\n    {\n        super.transfer(to, shares);\n\n        uint48 ts = Time.timestamp();\n        address sender = _msgSender();\n        _traceBalanceOf[sender].push(ts, balanceOf(sender));\n        _traceBalanceOf[to].push(ts, balanceOf(to));\n\n        return true;\n    }\n\n    /**\n     * @notice Transfers shares from one account to another using allowance, with blocklist and pause checks.\n     * @param from Address sending the shares.\n     * @param to Address receiving the shares.\n     * @param shares Number of shares to transfer.\n     * @return Boolean indicating transfer success.\n     */\n    function transferFrom(\n        address from,\n        address to,\n        uint256 shares\n    )\n        public\n        override(ERC20Upgradeable, IERC20)\n        whenNotPaused\n        notBlocklisted(_msgSender())\n        notBlocklisted(from)\n        notBlocklisted(to)\n        returns (bool)\n    {\n        super.transferFrom(from, to, shares);\n\n        uint48 ts = Time.timestamp();\n        _traceBalanceOf[from].push(ts, balanceOf(from));\n        _traceBalanceOf[to].push(ts, balanceOf(to));\n\n        return true;\n    }\n\n    /**\n     * @notice Deposits assets into the vault and receives shares, with blocklist, active incident and pause checks.\n     * @param assets Amount of assets to deposit.\n     * @param receiver Address receiving the shares.\n     * @return Amount of shares received.\n     */\n    function deposit(\n        uint256 assets,\n        address receiver\n    )\n        public\n        override\n        whenNotPaused\n        notBlocklisted(_msgSender())\n        notBlocklisted(receiver)\n        nonReentrant\n        returns (uint256)\n    {\n        if (assets == 0) revert InvalidAmount();\n\n        if (_hasActiveIncident()) revert CurrentPeriodHasActiveIncident();\n\n        (uint256 shares, uint256 _totalSupply, uint256 _totalAssets) = _previewTotals(\n            assets,\n            true,\n            Math.Rounding.Floor\n        );\n        // A dust deposit can floor to zero shares once the share price exceeds 1;\n        // reject it instead of pulling assets in exchange for nothing.\n        if (shares == 0) revert InvalidAmount();\n\n        _depositFunds(_msgSender(), receiver, assets, shares, _totalSupply, _totalAssets);\n\n        return shares;\n    }\n\n    /**\n     * @notice Mints shares by depositing the required amount of assets into the vault,\n     * with blocklist, active incident and pause checks.\n     * @param shares Amount of shares to mint.\n     * @param receiver Address receiving the shares.\n     * @return Amount of assets deposited.\n     */\n    function mint(\n        uint256 shares,\n        address receiver\n    )\n        public\n        override\n        whenNotPaused\n        notBlocklisted(_msgSender())\n        notBlocklisted(receiver)\n        nonReentrant\n        returns (uint256)\n    {\n        if (shares == 0) revert InvalidAmount();\n\n        if (_hasActiveIncident()) revert CurrentPeriodHasActiveIncident();\n\n        (uint256 assets, uint256 _totalSupply, uint256 _totalAssets) = _previewTotals(\n            shares,\n            false,\n            Math.Rounding.Ceil\n        );\n\n        _depositFunds(_msgSender(), receiver, assets, shares, _totalSupply, _totalAssets);\n\n        return assets;\n    }\n\n    /**\n     * @notice Redeems shares from the vault and receives underlying assets, with blocklist and pause checks.\n     * Creates a withdrawal request, which will be available in the next period. Shares are burned.\n     * @param shares Amount of shares to redeem.\n     * @param receiver Address to receive the assets in the next period.\n     * @param owner Address whose shares are being redeemed.\n     * @return Amount of assets that will be received in the next period.\n     */\n    function redeem(\n        uint256 shares,\n        address receiver,\n        address owner\n    )\n        public\n        override\n        whenNotPaused\n        notBlocklisted(_msgSender())\n        notBlocklisted(owner)\n        notBlocklisted(receiver)\n        nonReentrant\n        returns (uint256)\n    {\n        if (shares == 0) revert InvalidAmount();\n\n        (uint256 assets, uint256 _totalSupply, uint256 _totalAssets) = _previewTotals(\n            shares,\n            false,\n            Math.Rounding.Floor\n        );\n\n        if (assets == 0) revert InvalidAmount();\n\n        uint256 ownerBalance = _requestWithdraw(assets, shares, receiver, owner);\n\n        _logTrace(owner, ownerBalance, _totalSupply - shares, _totalAssets - assets, true);\n\n        return assets;\n    }\n\n    /**\n     * @notice Initiates a withdrawal request from the vault, with blocklist and pause checks.\n     * The request becomes claimable starting from the period after the next full period.\n     * The calculated shares are burned.\n     * @param assets The amount of assets to withdraw.\n     * @param receiver The address to receive the assets in the next period.\n     * @param owner The address whose shares are being withdrawn.\n     * @return The amount of shares that were burned.\n     */\n    function withdraw(\n        uint256 assets,\n        address receiver,\n        address owner\n    )\n        public\n        override\n        whenNotPaused\n        notBlocklisted(_msgSender())\n        notBlocklisted(owner)\n        notBlocklisted(receiver)\n        nonReentrant\n        returns (uint256)\n    {\n        if (assets == 0) revert InvalidAmount();\n\n        (uint256 shares, uint256 _totalSupply, uint256 _totalAssets) = _previewTotals(assets, true, Math.Rounding.Ceil);\n\n        uint256 ownerBalance = _requestWithdraw(assets, shares, receiver, owner);\n\n        _logTrace(owner, ownerBalance, _totalSupply - shares, _totalAssets - assets, true);\n\n        return shares;\n    }\n\n    /**\n     * @notice Claims a pending withdrawal for a given period.\n     * Transfers the corresponding assets to the caller if not already claimed.\n     * Can only be called after the specified period has ended.\n     * Reverts if the withdrawal has already been claimed or if no withdrawal amount is available for the period.\n     * @param period The period number for which to claim the withdrawal.\n     * @return assets The amount of assets transferred to the caller.\n     */\n    function claimWithdraw(\n        uint256 period\n    ) external whenNotPaused notBlocklisted(_msgSender()) nonReentrant returns (uint256 assets) {\n        if (period >= currentPeriod()) revert InvalidPeriod();\n\n        address sender = _msgSender();\n        if (isWithdrawClaimed[period][sender]) revert AlreadyClaimedPeriod(period);\n\n        assets = _convertToAssetsTotals(\n            withdrawSharesOf[period][sender],\n            withdrawShares[period],\n            withdrawAssets[period],\n            Math.Rounding.Floor\n        );\n\n        if (assets == 0) revert NoWithdrawalAmount(period);\n\n        pendingWithdrawAssets -= assets;\n        isWithdrawClaimed[period][sender] = true;\n\n        IERC20(asset()).safeTransfer(sender, assets);\n\n        emit CompleteWithdraw(sender, assets, period);\n    }\n\n    /**\n     * @notice Rescues shares from a blocklisted address. Requires RESCUER_ROLE.\n     * @param from The blocklisted address.\n     * @param to The address to transfer the shares. Must not be blocklisted.\n     */\n    function rescueSharesFromBlocklisted(\n        address from,\n        address to\n    )\n        external\n        onlyRole(RESCUER_ROLE)\n        onlyBlocklisted(from)\n        notBlocklisted(to)\n    {\n        uint256 rescuedShares = balanceOf(from);\n        if( rescuedShares == 0) revert InsufficientShares();\n\n        _transfer(from, to, rescuedShares);\n\n        uint48 ts = Time.timestamp();\n        _traceBalanceOf[from].push(ts, 0);\n        _traceBalanceOf[to].push(ts, balanceOf(to));\n\n        emit SharesRescuedFromBlocklisted(from, to, rescuedShares);\n    }\n\n    /**\n    * @notice Rescues pending withdrawals from a blocklisted address. Requires RESCUER_ROLE.\n    * @param from The blocklisted address.\n    * @param to The address to transfer the shares to. Must not be blocklisted.\n    * @param periods An array of periods to rescue.\n    */\n    function rescueWithdrawFromBlocklisted(\n        address from,\n        address to,\n        uint256[] calldata periods\n    )\n        external\n        onlyRole(RESCUER_ROLE)\n        onlyBlocklisted(from)\n        notBlocklisted(to)\n    {\n        if (to == address(0)) revert InvalidAddress();\n\n        uint256 len = periods.length;\n        if(len == 0 ) revert InvalidArrayLength();\n\n        uint256[] memory rescuedShares = new uint256[](len);\n        for (uint256 i = 0; i < len; i++) {\n            uint256 _withdrawOf = withdrawSharesOf[periods[i]][from];\n\n            if (isWithdrawClaimed[periods[i]][from]) revert AlreadyClaimedPeriod(periods[i]);\n            if (isWithdrawClaimed[periods[i]][to]) revert AlreadyClaimedPeriod(periods[i]);\n            if (_withdrawOf == 0) revert NoWithdrawalAmount(periods[i]);\n\n            withdrawSharesOf[periods[i]][to] += _withdrawOf;\n            withdrawSharesOf[periods[i]][from] = 0;\n\n            rescuedShares[i] = _withdrawOf;\n        }\n\n        emit WithdrawRescuedFromBlocklisted(from, to, periods, rescuedShares);\n    }\n\n    /**\n     * @notice Pays an incident claim to an allowlisted receiver from the assets exposed to the incident's\n     * capture period. Callable only by PAYOUT_ROLE.\n     * @dev Allowed only during the capture period or the one after it. The amount is capped by the active assets\n     * at the capture-period start (an exposure cap, not a segregated bucket) and by currently payable assets, and\n     * is drawn proportionally from active assets and still-exposed withdrawals. `paidAmount` may be zero.\n     *\n     * The vault applies only these per-call limits; ensuring aggregate payouts stay within underwritten exposure\n     * is the responsibility of the curator and assessor roles.\n     * @param to Allowlisted payout receiver.\n     * @param amount Requested payout amount, in vault asset units.\n     * @param captureTimestamp Incident capture timestamp; sets the covered period and payout window.\n     * @return paidAmount Amount actually transferred; may be less than `amount`, including zero.\n     */\n    function payout(\n        address to,\n        uint256 amount,\n        uint48 captureTimestamp\n    ) external onlyRole(PAYOUT_ROLE) nonReentrant returns (uint256 paidAmount) {\n        if (!isPayoutAllowlisted[to]) revert AccountNotAllowlisted();\n        if (amount == 0) revert InvalidAmount();\n\n        (uint256 capturePeriod, uint48 capturePeriodStart) = _periodAndStartAt(captureTimestamp);\n        uint256 _currentPeriod = currentPeriod();\n\n        // Payout can execute during the incident period or the following period.\n        // After that, withdrawals for the incident period can become claimable.\n        if (!_isPeriodInPayoutWindow(capturePeriod, _currentPeriod)) {\n            revert InvalidCapturePeriod();\n        }\n\n        // Cap by the active assets committed at the start of the covered period.\n        // This is an exposure cap, not a segregated asset bucket.\n        // Use capturePeriodStart - 1 so the inclusive lookup selects timestamps < capturePeriodStart.\n        // This excludes deposits and withdrawals at the period start from the payout snapshot.\n        // capturePeriodStart is always > 0 (deploy epoch), so the subtraction cannot underflow.\n        uint256 assetsAtCapturePeriod = totalAssetsAt(capturePeriodStart - 1);\n        uint256 currentActiveAssets = totalAssets();\n\n        // Withdrawals requested during the capture period are assigned to capturePeriod + 1\n        // and remain payable while payout is allowed.\n        uint256 capturePeriodWithdrawals = withdrawAssets[capturePeriod + 1];\n\n        // If payout happens in the following period, withdrawals requested before payout\n        // during that following period are assigned to capturePeriod + 2 and should also\n        // remain payable; otherwise exposed assets could escape by withdrawing first.\n        uint256 nextPeriodWithdrawals;\n        if (_currentPeriod == capturePeriod + 1) {\n            nextPeriodWithdrawals = withdrawAssets[capturePeriod + 2];\n        }\n\n        uint256 activePayableAmount = currentActiveAssets + capturePeriodWithdrawals + nextPeriodWithdrawals;\n        paidAmount = Math.min(amount, Math.min(assetsAtCapturePeriod, activePayableAmount));\n\n        // The incident must be processed with the available amount, even if paidAmount is zero.\n        if (paidAmount > 0) {\n            uint256 paidFromActive;\n            uint256 paidFromNextWithdrawals;\n            uint256 paidFromCaptureWithdrawals;\n\n            if (_currentPeriod == capturePeriod) {\n                uint256 payableAmount = currentActiveAssets + capturePeriodWithdrawals;\n                paidFromActive = paidAmount.mulDiv(currentActiveAssets, payableAmount);\n                paidFromCaptureWithdrawals = paidAmount - paidFromActive;\n            } else {\n                uint256 payableAmount = currentActiveAssets + capturePeriodWithdrawals + nextPeriodWithdrawals;\n                paidFromActive = paidAmount.mulDiv(currentActiveAssets, payableAmount);\n                paidFromNextWithdrawals = paidAmount.mulDiv(nextPeriodWithdrawals, payableAmount);\n                paidFromCaptureWithdrawals = paidAmount - paidFromActive - paidFromNextWithdrawals;\n\n                if (capturePeriodWithdrawals < paidFromCaptureWithdrawals) {\n                    uint256 overflow = paidFromCaptureWithdrawals - capturePeriodWithdrawals;\n                    paidFromCaptureWithdrawals = capturePeriodWithdrawals;\n                    paidFromNextWithdrawals += overflow;\n                }\n            }\n\n            _traceTotalAssets.push(Time.timestamp(), currentActiveAssets - paidFromActive);\n\n            withdrawAssets[capturePeriod + 1] = capturePeriodWithdrawals - paidFromCaptureWithdrawals;\n\n            if (paidFromNextWithdrawals > 0) {\n                withdrawAssets[capturePeriod + 2] = nextPeriodWithdrawals - paidFromNextWithdrawals;\n            }\n\n            pendingWithdrawAssets -= paidFromCaptureWithdrawals + paidFromNextWithdrawals;\n\n            IERC20(asset()).safeTransfer(to, paidAmount);\n        }\n\n        emit PayoutExecuted(to, amount, paidAmount, captureTimestamp);\n    }\n\n    function _updateDepositLimit(uint256 newLimit) internal {\n        if (newLimit == 0) {\n            revert InvalidDepositLimit();\n        }\n        depositLimit = newLimit;\n        emit DepositLimitUpdated(newLimit);\n    }\n\n    function _depositFunds(\n        address caller,\n        address receiver,\n        uint256 assets,\n        uint256 shares,\n        uint256 _totalSupply,\n        uint256 _totalAssets\n    ) private {\n        _totalSupply += shares;\n        _totalAssets += assets;\n\n        if (_totalAssets > depositLimit) revert DepositLimitExceeded();\n\n        _deposit(caller, receiver, assets, shares);\n\n        _logTrace(receiver, balanceOf(receiver), _totalSupply, _totalAssets, true);\n    }\n\n    function _requestWithdraw(\n        uint256 assets,\n        uint256 shares,\n        address receiver,\n        address owner\n    ) private returns (uint256 ownerBalance) {\n        if (receiver == address(0) || owner == address(0)) revert InvalidAddress();\n\n        ownerBalance = balanceOf(owner);\n        if (shares > ownerBalance) revert InsufficientShares();\n        ownerBalance -= shares;\n\n        address sender = _msgSender();\n\n        uint256 period = currentPeriod() + 1;\n        uint256 sharesWithdraw = _convertToSharesTotals(\n            assets,\n            withdrawShares[period],\n            withdrawAssets[period],\n            Math.Rounding.Floor\n        );\n        withdrawAssets[period] += assets;\n        withdrawShares[period] += sharesWithdraw;\n        withdrawSharesOf[period][receiver] += sharesWithdraw;\n\n        pendingWithdrawAssets += assets;\n\n        if (sender != owner) {\n            _spendAllowance(owner, sender, shares);\n        }\n\n        _update(owner, address(0), shares);\n\n        emit WithdrawRequest(sender, receiver, owner, period, assets, shares);\n    }\n\n    function _previewTotals(\n        uint256 assetsOrShares,\n        bool isAssets,\n        Math.Rounding rounding\n    ) private view returns (uint256 amount, uint256 _totalSupply, uint256 _totalAssets) {\n        _totalSupply = totalSupply();\n        _totalAssets = totalAssets();\n        if (isAssets) {\n            amount = _convertToSharesTotals(assetsOrShares, _totalSupply, _totalAssets, rounding);\n        } else {\n            amount = _convertToAssetsTotals(assetsOrShares, _totalSupply, _totalAssets, rounding);\n        }\n    }\n\n    function _logTrace(\n        address owner,\n        uint256 balance,\n        uint256 _totalSupply,\n        uint256 _totalAssets,\n        bool isLogAssets\n    ) private {\n        uint48 ts = Time.timestamp();\n        _traceBalanceOf[owner].push(ts, balance);\n        _traceTotalSupply.push(ts, _totalSupply);\n\n        if (isLogAssets) _traceTotalAssets.push(ts, _totalAssets);\n    }\n\n    function _convertToSharesTotals(\n        uint256 assets,\n        uint256 totSupply,\n        uint256 totAssets,\n        Math.Rounding rounding\n    ) private view returns (uint256) {\n        return assets.mulDiv(totSupply + 10 ** _decimalsOffset(), totAssets + 1, rounding);\n    }\n\n    function _convertToAssetsTotals(\n        uint256 shares,\n        uint256 totSupply,\n        uint256 totAssets,\n        Math.Rounding rounding\n    ) private view returns (uint256) {\n        return shares.mulDiv(totAssets + 1, totSupply + 10 ** _decimalsOffset(), rounding);\n    }\n\n    function _nowSinceEpoch(uint48 epoch) private view returns (uint48) {\n        return _timestampSinceEpoch(Time.timestamp(), epoch);\n    }\n\n    function _timestampSinceEpoch(uint48 timestamp, uint48 epoch) private pure returns (uint48) {\n        return timestamp - epoch;\n    }\n\n    function _addPeriodConfiguration(uint48 newEpoch, uint48 newDuration) private {\n        if (\n            newDuration < SMALLEST_PERIOD_DURATION ||\n            newDuration > MAX_PERIOD_DURATION ||\n            newDuration % SMALLEST_PERIOD_DURATION != 0\n        ) revert InvalidPeriodConfigurationDuration();\n\n        uint256 startingPeriod;\n        if (periodConfigurations.length > 0) {\n            PeriodConfiguration memory currentPC = currentPeriodConfiguration();\n            if (currentPC.epoch != periodConfigurations[periodConfigurations.length - 1].epoch)\n                revert CurrentPeriodConfigurationNotLast();\n            if (newEpoch < nextPeriodEnd() || (newEpoch - currentPC.epoch) % currentPC.duration != 0)\n                revert InvalidPeriodConfigurationEpoch();\n\n            startingPeriod = currentPC.startingPeriod + (newEpoch - currentPC.epoch) / currentPC.duration;\n        } else {\n            if (newEpoch < Time.timestamp()) revert InvalidPeriodConfigurationEpoch();\n\n            startingPeriod = 0;\n        }\n\n        PeriodConfiguration memory newPeriod = PeriodConfiguration({\n            epoch: newEpoch,\n            duration: newDuration,\n            startingPeriod: startingPeriod\n        });\n        periodConfigurations.push(newPeriod);\n        emit PeriodConfigurationAdded(newPeriod);\n    }\n\n    /// @dev True while an incident is active in the current period or the previous one. The previous period is\n    /// included because a claim captured then is still payable this period, so deposits stay blocked through the\n    /// following period, until that payout window closes; otherwise fresh deposits would back unresolved exposure.\n    function _hasActiveIncident() internal view returns (bool) {\n        uint256 period = currentPeriod();\n        return hasActiveIncident[period] || (period > 0 && hasActiveIncident[period - 1]);\n    }\n\n    /// @dev Resolves a timestamp's period number and period start from a single scan of the\n    ///      configuration history: the configuration governing the timestamp also governs\n    ///      its period, so both derive from one lookup.\n    function _periodAndStartAt(uint48 timestamp) internal view returns (uint256 period, uint48 start) {\n        PeriodConfiguration memory pc = periodConfigurationAtTimestamp(timestamp);\n        uint48 periodsSinceEpoch = _timestampSinceEpoch(timestamp, pc.epoch) / pc.duration;\n        period = pc.startingPeriod + periodsSinceEpoch;\n        start = pc.epoch + periodsSinceEpoch * pc.duration;\n    }\n\n    function _isPeriodInPayoutWindow(uint256 period, uint256 current) internal pure returns (bool) {\n        return current == period || current == period + 1;\n    }\n}\n","deployed_bytecode":"0x6080604052600436101561001257600080fd5b60003560e01c806301e1d1141461055d57806301ffc9a714610558578063032eec2714610553578063060406181461054e57806306fdde031461054957806307a2d13a146104b3578063095ea7b3146105445780630a28a4771461053f5780630a8665501461053a5780630f3d6a37146105355780630f41ee621461053057806318160ddd1461052b57806319810f3c146105265780631ad0234f14610521578063234782e21461051c57806323b872dd14610517578063248a9ca31461051257806324adbbcd1461050d57806324b6757514610508578063267eb9ed1461050357806327debc0f146104fe57806328cfe840146104f95780632f2ff15d146104f4578063313ce567146104ef57806336568abe146104ea57806337cbfb54146104e5578063389ed267146104e057806338d52e0f146104db57806338fd7f03146104d657806339b4b0c4146104d157806339e8bd9b146104cc5780633f4ba83a146104c7578063402d267d146104c25780634179a8f6146104bd5780634b369abd146104b85780634cdad506146104b35780634d483d5c146104ae57806358794456146104a9578063592ca850146104a4578063596b1f4d1461049f5780635c975abb1461049a5780635cd8a76b146104955780636e553f651461049057806370a082311461048b578063713725441461048657806372f13e9a14610481578063742bca181461047c5780637fb84bed146104775780637fe8e78a146104725780638456cb591461046d5780638ab7ce2c146104685780638e204c431461046357806391d148541461045e57806394bf804d1461045957806395c3a4921461045457806395d89b411461044f57806399d2eb461461044a578063a0a8e46014610445578063a217fddf14610440578063a7a47d491461043b578063a9059cbb14610436578063ad8f3eb914610431578063b000d10c1461042c578063b13acedd14610427578063b3d7f6b914610422578063b460af941461041d578063b774bce214610418578063ba08765214610413578063bf9c5ee61461040e578063c63d75b614610409578063c6e6f592146103cd578063c798b0a014610404578063c83fae91146103ff578063ce96cb77146103fa578063d012b952146103f5578063d1033c07146103f0578063d547741f146103eb578063d905777e146103e6578063d9b7dc73146103e1578063dd62ed3e146103dc578063e9efd4cf146103d7578063ecf70858146103d2578063ef8b30f7146103cd578063f119a582146103c85763f5e7ee0f146103c357600080fd5b612bbb565b612b9d565b612713565b612b7f565b612a7a565b612a2a565b6128f3565b6128a7565b612857565b61282b565b612810565b6127e9565b61276c565b612731565b6126e9565b6126c7565b61264a565b612628565b61256b565b6124f0565b612361565b612326565b6122d4565b612213565b6121d8565b6121bc565b61219e565b6120ca565b611fe4565b611ec7565b611e58565b611e00565b611dbd565b611d9a565b611d26565b611ccf565b611cb1565b611c76565b611bf1565b611bb6565b611b6b565b611ab1565b611981565b611951565b611916565b611883565b611868565b6117e6565b610798565b61176e565b611733565b61170c565b611689565b611658565b6115f3565b611588565b611542565b611507565b61143e565b6113f4565b6113a8565b611353565b611310565b611282565b6111e9565b611001565b610c68565b610c2e565b610b1f565b610ae4565b610a40565b610a04565b6109d9565b6109bb565b61096a565b610912565b6108bb565b6107c7565b61067d565b610615565b6105db565b610585565b34610580576000366003190112610580576020610578612c62565b604051908152f35b600080fd5b346105805760203660031901126105805760043563ffffffff60e01b811680910361058057602090637965db0b60e01b81149081156105ca575b506040519015158152f35b6301ffc9a760e01b149050386105bf565b3461058057602036600319011261058057602061060b600435610605610600426153a6565b6136a3565b906137f5565b6040519015158152f35b34610580576000366003190112610580576020610578610600426153a6565b91909160208152825180602083015260005b818110610667575060409293506000838284010152601f8019910116010190565b8060208092870101516040828601015201610646565b346105805760003660031901126105805760405160007f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace03546106be81612d04565b808452906001811690811561077457506001146106f6575b6106f2836106e681850382611136565b60405191829182610634565b0390f35b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0360009081527f2ae08a8e29253f69ac5d979a101956ab8f8d9d7ded63fa7a83b16fc47648eab0939250905b80821061075a575090915081016020016106e66106d6565b919260018160209254838588010152019101909291610742565b60ff191660208086019190915291151560051b840190910191506106e690506106d6565b34610580576020366003190112610580576020610578600435613816565b6001600160a01b0381160361058057565b34610580576040366003190112610580576004356107e4816107b6565b60243533156108a5576001600160a01b03821691821561088f57610857829161083f336001600160a01b03166000527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace01602052604060002090565b906001600160a01b0316600052602052604060002090565b556040519081527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560203392a3602060405160018152f35b634a1406b160e11b600052600060045260246000fd5b63e602df0560e01b600052600060045260246000fd5b3461058057602036600319011261058057600435600080516020615e37833981519152546001810180911161090d576108f2612c62565b916001830180931161090d57602092610578926001926153d7565b612c30565b34610580576000366003190112610580576020600254604051908152f35b634e487b7160e01b600052603260045260246000fd5b60035481101561096557600360005260206000209060011b0190600090565b610930565b346105805760203660031901126105805760043560035481101561058057610993606091610946565b506001815491015465ffffffffffff60405192818116845260301c1660208301526040820152f35b34610580576000366003190112610580576020604051620151808152f35b34610580576000366003190112610580576020600080516020615e3783398151915254604051908152f35b346105805760203660031901126105805760043560005260046020526020604060002054604051908152f35b65ffffffffffff81160361058057565b3461058057604036600319011261058057600435610a5d81610a30565b602435610a6981610a30565b3360009081527fe59af921f5af895cea4501d68fee3e1bbb120c3501ccc5b9d1b07e137c6af806602052604090205460ff1615610aab57610aa991613bf8565b005b63e2517d3f60e01b600052336004527f6c6a5de61c8667e917ea675d182a58870b6de23041e69efc8e0465f7ef75e7b960245260446000fd5b346105805760003660031901126105805760206040517f1668f9bcd7c4fcee6cb5efd784e7251568ebcc2e65d2c4b9cb4a65b7ef5d16078152f35b3461058057606036600319011261058057610c20600435610b3f816107b6565b60243590610b4c826107b6565b610b87604435610b5a613dff565b610b6333613e29565b610b6c83613e29565b610b7584613e29565b610b80813385615437565b838361526c565b610bdd610b93426153a6565b916001600160a01b038116600052600960205282610bd66040600020926001600160a01b0316600052600080516020615e17833981519152602052604060002090565b54916140ea565b50506001600160a01b0382166000526009602052610bd66040600020926001600160a01b0316600052600080516020615e17833981519152602052604060002090565b505060405160018152602090f35b34610580576020366003190112610580576020610578600435600052600080516020615e5783398151915260205260016040600020015490565b3461058057606036600319011261058057600435610c85816107b6565b60443590602435610c9583610a30565b610c9d61388c565b610ca56141cb565b610cd3610ccf610cc8846001600160a01b0316600052600e602052604060002090565b5460ff1690565b1590565b610ff0578015610fdf57610ce68361422b565b9390610cf4610600426153a6565b93610d02610ccf86846137f5565b610fce57610deb7f078fbca360185c631ed2be37dc2b19fdd965a77f6cd598420ceb658919b3af48936001600160a01b0393610d48610d436106f29a612d3e565b614e73565b90610d51612c62565b610d6d610d5d83612d79565b6000526005602052604060002090565b5491600093610d7b82612d79565b8c14610fb0575b610da8610db391610d9c87610d978888612d95565b612d95565b90818082109118021890565b808c18818d10021890565b9a8b9182610e27575b50509250505060405194859416968491604091949365ffffffffffff9160608501968552602085015216910152565b0390a2610e1760017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b6040519081529081906020820190565b610eb095610eab95610ea3956000948403610f27579481610e8087610e67610e60610e59610e8797610e7a9b9c612d95565b838761429f565b8095612c55565b9788945b610e74426153a6565b92612c55565b90613ee0565b5050612c55565b610e93610d5d84612d79565b558380610f08575b505050612d95565b600254612c55565b600255565b610efd8784610ef8610eec610eec6001600160a01b037f0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e00541690565b6001600160a01b031690565b614334565b388080898180610dbc565b610f18610d5d91610f1e93612c55565b92612d87565b55388083610e9b565b610f57959450610f64610f3e84610d978585612d95565b95610f5f610f4d88858461429f565b988998878461429f565b988992612c55565b612c55565b94858310610f7f575b91610e808692610e7a610e8795610e6b565b95909491610e80610f9382610e8795612c55565b96610e7a610fa384998a96612d95565b9993955050925050610f6d565b9350610db3610da8610fc4610d5d84612d87565b5495915050610d82565b6379bd610b60e01b60005260046000fd5b63162908e360e11b60005260046000fd5b630d2045db60e31b60005260046000fd5b346105805760403660031901126105805760043560243580151590818103610580573360009081527ffe258d406dd87b5efd2b2423d3d148a22f1c8d08441e749d34141d1f31132dfe602052604090205460ff16156110a9577fda545faa460bc45cd72288a34bdc1e4d67f4aa9a4933ec9003c94a0c16fe0dd2916110a060209285600052600f845260406000209060ff801983541691151516179055565b604051908152a2005b63e2517d3f60e01b600052336004527f19e830aae39b97388d5da7cf0f558c39ea94b9456ab7d5c568d881f389f3ccd560245260446000fd5b634e487b7160e01b600052604160045260246000fd5b610100810190811067ffffffffffffffff82111761111557604052565b6110e2565b6060810190811067ffffffffffffffff82111761111557604052565b90601f8019910116810190811067ffffffffffffffff82111761111557604052565b60405190611167606083611136565b565b60405190611167604083611136565b67ffffffffffffffff811161111557601f01601f191660200190565b9291926111a082611178565b916111ae6040519384611136565b829481845281830111610580578281602093846000960137010152565b9080601f83011215610580578160206111e693359101611194565b90565b3461058057608036600319011261058057600435611206816107b6565b60243567ffffffffffffffff8111610580576112269036906004016111cb565b9060443567ffffffffffffffff8111610580576112479036906004016111cb565b6064359267ffffffffffffffff841161058057366023850112156105805761127c610aa9943690602481600401359101611194565b92612da2565b34610580576020366003190112610580573360009081527f380487fe7531efd35292df0d5fc34ef3330fbb38e4f720b678db17ec96fe6e1760205260409020546004359060ff16156112d757610aa9906145e5565b63e2517d3f60e01b600052336004527f7a239212a00ca755b79509a034715154386895f9f9e24abe8401e5b1b9a1a5a060245260446000fd5b34610580576020366003190112610580576001600160a01b03600435611335816107b6565b16600052600e602052602060ff604060002054166040519015158152f35b3461058057604036600319011261058057610aa9602435600435611376826107b6565b6113a361139e82600052600080516020615e5783398151915260205260016040600020015490565b613ac6565b614b0c565b346105805760003660031901126105805760ff7f0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e005460a01c1660ff811161090d57602090604051908152f35b3461058057604036600319011261058057600435602435611414816107b6565b336001600160a01b0382160361142d57610aa991614bca565b63334bd91960e11b60005260046000fd5b34610580576000366003190112610580573360009081527f54d2ed9d50568a5499fc1fd4495c05a18492e440a8c72fc578e0ecacbbc2eb2a602052604090205460ff16156114ce577ff643d9ba3899c52e69d6a2903ea9ece743231bd106cac5c41ee746d967e5778f60206114b1612c62565b6114c3816114be426153a6565b613ee0565b5050604051908152a1005b63e2517d3f60e01b600052336004527f1668f9bcd7c4fcee6cb5efd784e7251568ebcc2e65d2c4b9cb4a65b7ef5d160760245260446000fd5b346105805760003660031901126105805760206040517f139c2898040ef16910dc9f44dc697df79363da767d8bc92f2e310312b816e46d8152f35b346105805760003660031901126105805760206001600160a01b037f0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e005416604051908152f35b34610580576020366003190112610580576001600160a01b036004356115ad816107b6565b6115b56138fe565b1680600052600e602052604060002060ff1981541690557f2ac23d4a3a90a35ea325832dd4d205ea852c6d2b158b748c5bced1f02ca94829600080a2005b346105805760003660031901126105805761160c61317e565b506106f261162161161c426153a6565b613601565b60405191829182919091604080606083019465ffffffffffff815116845265ffffffffffff60208201511660208501520151910152565b3461058057602036600319011261058057600435600052600f602052602060ff604060002054166040519015158152f35b34610580576000366003190112610580576116a2613970565b600080516020615e778339815191525460ff8116156116fb5760ff1916600080516020615e77833981519152557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a1005b638dfc202b60e01b60005260046000fd5b3461058057602036600319011261058057602061057860043561172e816107b6565b6131b2565b346105805760003660031901126105805760206040517f5612063648f807201ec1c6d4f999a34ed02c6a8b521b7b99e155a6823c5687368152f35b346105805760603660031901126105805760043561178b816107b6565b602435611797816107b6565b6044359167ffffffffffffffff831161058057366023840112156105805782600401359167ffffffffffffffff8311610580573660248460051b86010111610580576024610aa9940191613244565b34610580576000366003190112610580576117ff61317e565b50602061185861181161161c426153a6565b61185265ffffffffffff8251169165ffffffffffff6118498661183c86611837426153a6565b612d5b565b9301928284511690613502565b91511690613523565b90613544565b65ffffffffffff60405191168152f35b34610580576000366003190112610580576020611858613562565b34610580576020366003190112610580576001600160a01b036004356118a8816107b6565b6118b06139e2565b1680600052600860205260ff604060002054161561190557806000526008602052604060002060ff1981541690557fa4fe411171f397b84dcdfc3c9a03b2c1dc1aa15b0a76cb4529ba4d0b9777e1ad600080a2005b637622da2760e01b60005260046000fd5b346105805760003660031901126105805760206040517fdef752f6ad59be9880423e079755189539de01983d091b3c097e4742fd9916d18152f35b3461058057600036600319011261058057602060ff600080516020615e7783398151915254166040519015158152f35b3461058057600036600319011261058057600080516020615e978339815191525460ff8160401c16908115611a9b575b50611a8a576119e9600267ffffffffffffffff19600080516020615e97833981519152541617600080516020615e9783398151915255565b600160401b68ff000000000000000019600080516020615e97833981519152541617600080516020615e9783398151915255611a256002600155565b611a5668ff000000000000000019600080516020615e978339815191525416600080516020615e9783398151915255565b604051600281527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29080602081015b0390a1005b63f92ee8a960e01b60005260046000fd5b6002915067ffffffffffffffff161015386119b1565b3461058057604036600319011261058057602435600435611ad1826107b6565b611ad9613dff565b611ae233613e29565b611aeb82613e29565b611af36141cb565b8015610fdf57611b01614c7f565b611b5a57611b0e81614cd7565b9082939215610fdf5783611b26936106f29633614d4d565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00556040519081529081906020820190565b63f502e41560e01b60005260046000fd5b34610580576020366003190112610580576001600160a01b03600435611b90816107b6565b16600052600080516020615e178339815191526020526020604060002054604051908152f35b346105805760003660031901126105805760206040517fcf6f9f892731e14b8859835f2ff35575f447fb501f46243c4eb8bac19e31a0508152f35b34610580576020366003190112610580576001600160a01b03600435611c16816107b6565b611c1e6138fe565b168015611c655780600052600e6020526040600020600160ff198254161790557fbc8ca2d78250b3f96cf26129ddbcbbd21b69df85b725d37e6a9ac835aa64ec17600080a2005b63e6c4247b60e01b60005260046000fd5b346105805760003660031901126105805760206040517faa59e6b4b3a101ef2c0076432a11c30ca6753f82679d30e2198a9894013fef0c8152f35b346105805760003660031901126105805760206040516276a7008152f35b3461058057604036600319011261058057602060ff611d1a602435600435611cf6826107b6565b600052600784526040600020906001600160a01b0316600052602052604060002090565b54166040519015158152f35b3461058057600036600319011261058057611d3f613970565b611d47613dff565b600160ff19600080516020615e77833981519152541617600080516020615e77833981519152557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a1005b34610580576020366003190112610580576106f261162160043561161c81610a30565b34610580576020366003190112610580576001600160a01b03600435611de2816107b6565b166000526008602052602060ff604060002054166040519015158152f35b3461058057604036600319011261058057602060ff611d1a602435600435611e27826107b6565b600052600080516020615e5783398151915284526040600020906001600160a01b0316600052602052604060002090565b3461058057604036600319011261058057600435602435611e78816107b6565b611e80613dff565b611e8933613e29565b611e9281613e29565b611e9a6141cb565b8115610fdf57611ea8614c7f565b611b5a57611b2682611ebc6106f294614d03565b929091809533614d4d565b3461058057604036600319011261058057600435611ee4816107b6565b6001600160a01b0360243591611ef983610a30565b1660005260096020526040600020600090805482938160058111611f8a575b5090602094611f279284615dad565b80611f615750815b6001600160d01b03831615611f595750610578916001611f4f9201613e5a565b90549060031b1c90565b915050610578565b611f7d611f70611f8492612c46565b8360005260206000200190565b5460301c90565b91611f2f565b94611f9486615c42565b860395861161090d57602095611f279385875265ffffffffffff8289892001541665ffffffffffff851610600014611fd25750915b91925094611f18565b929150611fde90612d79565b90611fc9565b346105805760003660031901126105805760405160007f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace045461202581612d04565b8084529060018116908115610774575060011461204c576106f2836106e681850382611136565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0460009081527f46a2803e59a4de4e7a4c574b1243f25977ac4c77d5a1a4a609b5394cebb4a2aa939250905b8082106120b0575090915081016020016106e66106d6565b919260018160209254838588010152019101909291612098565b34610580576020366003190112610580576004356120e661317e565b50600354801561215257906120f961317e565b916000915b818310612163575b50505065ffffffffffff612120825165ffffffffffff1690565b16156121525760408051825165ffffffffffff9081168252602080850151909116908201529181015190820152606090f35b6302e8f35960e31b60005260046000fd5b909192600161217185610946565b50015482106121985750600161218f61218985610946565b506135d0565b930191906120fe565b92612106565b34610580576000366003190112610580576020600154604051908152f35b3461058057600036600319011261058057602060405160008152f35b346105805760003660031901126105805760206040517f7a239212a00ca755b79509a034715154386895f9f9e24abe8401e5b1b9a1a5a08152f35b3461058057604036600319011261058057610c20600435612233816107b6565b61225a602435612241613dff565b61224a33613e29565b61225383613e29565b823361526c565b6001600160a01b0361226b426153a6565b913360005260096020526122a0604060002033600052600080516020615e1783398151915260205284604060002054916140ea565b50501690816000526009602052604060002091600052600080516020615e17833981519152602052604060002054916140ea565b3461058057604036600319011261058057602061231d6024356004356122f9826107b6565b600052600683526040600020906001600160a01b0316600052602052604060002090565b54604051908152f35b346105805760003660031901126105805760206040517f6c6a5de61c8667e917ea675d182a58870b6de23041e69efc8e0465f7ef75e7b98152f35b346105805760203660031901126105805760043561237d613dff565b61238633613e29565b61238e6141cb565b61239a610600426153a6565b811015612152576123bc610cc83361083f846000526007602052604060002090565b6124dc5761240c6123db3361083f846000526006602052604060002090565b546123f0836000526004602052604060002090565b54612405846000526005602052604060002090565b5491614f4b565b80156124c5576106f291612425610eab83600254612c55565b61244d6124403361083f846000526007602052604060002090565b805460ff19166001179055565b6124898233610ef8610eec610eec7f0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e00546001600160a01b031690565b60408051838152602081019290925233917fa7952fcf1aa05ca494ca81b36018d749ac933a4f76e87ccdcd31cc6a202a785e9181908101610deb565b6395dece8d60e01b600052600482905260245b6000fd5b631e77842160e01b60005260045260246000fd5b346105805760203660031901126105805760043561250c612c62565b6001810180911161090d57600080516020615e3783398151915254916001830180931161090d57602092610578926001926153d7565b6060906003190112610580576004359060243561255e816107b6565b906044356111e6816107b6565b346105805761257936612542565b612581613dff565b61258a33613e29565b61259381613e29565b61259c82613e29565b6125a46141cb565b8215610fdf57600080516020615e37833981519152546125c2612c62565b906125dc836125d4600185858a615859565b958688614f8f565b9484820391821161090d57820391821161090d576020946125fc9361511e565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055604051908152f35b3461058057602036600319011261058057602061057860043561060081610a30565b346105805761265836612542565b612660613dff565b61266933613e29565b61267281613e29565b61267b82613e29565b6126836141cb565b8215610fdf5761269283614d2c565b91938415610fdf57836126a6918787614f8f565b94810390811161090d5783820391821161090d576106f294611b269361511e565b34610580576020366003190112610580576020610578600435610d4381610a30565b3461058057602036600319011261058057602061057861270e60043561172e816107b6565b613851565b34610580576020366003190112610580576020610578600435613851565b346105805760003660031901126105805760206040517f19e830aae39b97388d5da7cf0f558c39ea94b9456ab7d5c568d881f389f3ccd58152f35b34610580576020366003190112610580576001600160a01b03600435612791816107b6565b6127996139e2565b6127a281613e29565b168015611c65578060005260086020526040600020600160ff198254161790557f2e5413219814041322ad93e464b59b110565b5068e1b84de73293f6ce422f246600080a2005b3461058057602036600319011261058057602061057860043561280b816107b6565b6136e3565b3461058057600036600319011261058057602061185861374c565b346105805760203660031901126105805760043560005260056020526020604060002054604051908152f35b3461058057604036600319011261058057610aa960243560043561287a826107b6565b6128a261139e82600052600080516020615e5783398151915260205260016040600020015490565b614bca565b346105805760203660031901126105805760206105786004356128c9816107b6565b613772565b6040906003190112610580576004356128e6816107b6565b906024356111e6816107b6565b3461058057612901366128ce565b612909613a54565b6001600160a01b0382169182600052600860205260ff60406000205416156119055761293482613e29565b82600052600080516020615e17833981519152602052604060002054928315612a1957836129ef611a859261298b7f3f2f178018e94aef45bee04ba81187d58b2b86d43fd6dcbef9243f20f66327e197878761526c565b612994426153a6565b9060005260096020526129ab816040600020613ff3565b50506001600160a01b0386166000526009602052604060002090610bd6876001600160a01b0316600052600080516020615e17833981519152602052604060002090565b5050604051938493846001600160a01b036040929594938160608401971683521660208201520152565b633999656760e01b60005260046000fd5b3461058057602061231d61083f612a40366128ce565b91906001600160a01b03166000527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace01602052604060002090565b3461058057602036600319011261058057600435612a9781610a30565b6000600a5481928160058111612b24575b5090602093612ab892600a615dad565b80612ae55750805b6001600160d01b03821615612ade5750611f4f61057891600b613e5a565b9050610578565b611f7d612af4612b1e92612c46565b600a6000527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80190565b90612ac0565b93612b2e85615c42565b850394851161090d57602094612ab893600a865265ffffffffffff8288882001541665ffffffffffff851610600014612b6d5750915b91925093612aa8565b929150612b7990612d79565b90612b64565b34610580576000366003190112610580576020600054604051908152f35b34610580576000366003190112610580576020600354604051908152f35b34610580576040366003190112610580576106f2610e17600435612c0a602435612be4816107b6565b8260005260066020526040600020906001600160a01b0316600052602052604060002090565b549080600052600460205260406000205490600052600560205260406000205491614f4b565b634e487b7160e01b600052601160045260246000fd5b60001981019190821161090d57565b9190820391821161090d57565b602460206001600160a01b037f0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e005416604051928380926370a0823160e01b82523060048301525afa908115612cf857600091612cc9575b50600254810390811161090d5790565b612ceb915060203d602011612cf1575b612ce38183611136565b8101906137e6565b38612cb9565b503d612cd9565b6040513d6000823e3d90fd5b90600182811c92168015612d34575b6020831014612d1e57565b634e487b7160e01b600052602260045260246000fd5b91607f1691612d13565b65ffffffffffff6000199116019065ffffffffffff821161090d57565b9065ffffffffffff8091169116039065ffffffffffff821161090d57565b906001820180921161090d57565b906002820180921161090d57565b9190820180921161090d57565b600080516020615e9783398151915254939092909167ffffffffffffffff612dda604087901c60ff16159667ffffffffffffffff1690565b1680159081612ef6575b6001149081612eec575b159081612ee3575b50611a8a57612e3c9385612e33600167ffffffffffffffff19600080516020615e97833981519152541617600080516020615e9783398151915255565b612ea757612faa565b612e4257565b612e7368ff000000000000000019600080516020615e978339815191525416600080516020615e9783398151915255565b604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29080602081015b0390a1565b612ede600160401b68ff000000000000000019600080516020615e97833981519152541617600080516020615e9783398151915255565b612faa565b90501538612df6565b303b159150612dee565b869150612de4565b5190611167826107b6565b519061116782610a30565b908161010091031261058057612fa260e060405192612f32846110f8565b612f3b81612efe565b8452612f4960208201612efe565b6020850152612f5a60408201612efe565b6040850152612f6b60608201612efe565b6060850152612f7c60808201612efe565b6080850152612f8d60a08201612efe565b60a085015260c081015160c085015201612f09565b60e082015290565b90926001600160a01b0392612fcb612fd19260208082518301019101612f14565b94614370565b612fda816144f5565b612fe26155cb565b612fea6145af565b612ff26155cb565b161561316d5761300560c08201516145e5565b60e0810165ffffffffffff613020825165ffffffffffff1690565b161561315c5761303a610eec83516001600160a01b031690565b1561314b576130ee9161306860a092613062613055426153a6565b915165ffffffffffff1690565b90613bf8565b6130726002600155565b61308b61308682516001600160a01b031690565b61462d565b5060208101516001600160a01b03168061313b575b5060408101516001600160a01b03168061312b575b5060608101516001600160a01b03168061311b575b5060808101516001600160a01b03168061310b575b5001516001600160a01b031690565b6001600160a01b0381166130ff5750565b61310890614a35565b50565b6131149061495e565b50386130df565b61312490614887565b50386130ca565b613134906147b0565b50386130b5565b613144906146d9565b50386130a0565b63016ed19f60e21b60005260046000fd5b638db7cf7560e01b60005260046000fd5b630ccd248560e21b60005260046000fd5b6040519061318b8261111a565b60006040838281528260208201520152565b6131a561317e565b506111e661161c426153a6565b6001600160a01b036131c2612c62565b9116600052600860205260ff60406000205416801561322b575b801561321d575b8015613212575b61320c5760005490810390811161090d5761320481613851565b1561320c5790565b50600090565b5060005481116131ea565b50613226614c7f565b6131e3565b5060ff600080516020615e7783398151915254166131dc565b9392919091613251613a54565b6001600160a01b038516600052600860205260ff60406000205416156119055761327a83613e29565b6001600160a01b03831615611c655780156133d357613298816133fc565b9160005b8281106132d9575091612ea2917f8a0766d7b4a07e2db9039b140504b0d9c5ea2af33ee94f0268f11b3d1e5db8d595969360405195869586613452565b6132fc8761083f6132eb84878761342e565b356000526006602052604060002090565b54613323610cc88961083f61331286898961342e565b356000526007602052604060002090565b6133b15761333c610cc88761083f61331286898961342e565b6133b157801561338f579060019161335c8761083f6132eb85898961342e565b613367828254612d95565b9055600061337d8a61083f6132eb868a8a61342e565b55613388828761343e565b520161329c565b506124d89261339d9261342e565b6395dece8d60e01b60005235600452602490565b506124d8926133bf9261342e565b631e77842160e01b60005235600452602490565b634ec4810560e11b60005260046000fd5b67ffffffffffffffff81116111155760051b60200190565b90613406826133e4565b6134136040519182611136565b8281528092613424601f19916133e4565b0190602036910137565b91908110156109655760051b0190565b80518210156109655760209160051b010190565b93916001600160a01b038092168552166020840152608060408401528060808401527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81116105805760209160c09160051b809160a0860137830160a0810193606060a08284030191015284518094520192019060005b8181106134d65750505090565b82518452602093840193909201916001016134c9565b634e487b7160e01b600052601260045260246000fd5b9065ffffffffffff1690811561351e5765ffffffffffff160490565b6134ec565b9065ffffffffffff8091169116029065ffffffffffff821691820361090d57565b9065ffffffffffff8091169116019065ffffffffffff821161090d57565b61356a61317e565b5061357761161c426153a6565b65ffffffffffff815116600165ffffffffffff6135a9602061359c85611837426153a6565b9501948286511690613502565b16019165ffffffffffff831161090d576111e69265ffffffffffff61185292511690613523565b906040516135dd8161111a565b60406001829465ffffffffffff8154818116865260301c1660208501520154910152565b61360961317e565b50600354908115612152579061361d61317e565b916000905b82821061364d575b50505065ffffffffffff613644825165ffffffffffff1690565b16156121525790565b90919261367761366c61365f85610946565b505465ffffffffffff1690565b65ffffffffffff1690565b65ffffffffffff83161061369d5750600161369461218984610946565b93920190613622565b9261362a565b65ffffffffffff6136d66136b683613601565b8260206136cc6040840151968385511690612d5b565b9201511690613502565b16810180911161090d5790565b6001600160a01b031680600052600860205260ff604060002054168015613733575b156137105750600090565b600052600080516020615e178339815191526020526111e6604060002054613816565b5060ff600080516020615e778339815191525416613705565b6111e6613757613562565b65ffffffffffff602061376983613601565b01511690613544565b6001600160a01b031680600052600860205260ff6040600020541680156137cd575b1561379f5750600090565b600052600080516020615e178339815191526020526040600020546137c381613816565b6111e65750600090565b5060ff600080516020615e778339815191525416613794565b90816020910312610580575190565b80821491821561380457505090565b9091506001820180921161090d571490565b61381e612c62565b906001820180921161090d57600080516020615e37833981519152546001810180911161090d576111e6926000926153d7565b600080516020615e3783398151915254906001820180921161090d57613875612c62565b6001810180911161090d576111e6926000926153d7565b3360009081527ffd4d1ad051ccd730be4c0ee67ff229738ff97783963c92cf035bdd0b019f83e4602052604090205460ff16156138c557565b63e2517d3f60e01b600052336004527f5612063648f807201ec1c6d4f999a34ed02c6a8b521b7b99e155a6823c56873660245260446000fd5b3360009081527f4f35b9cd413361eec3953522e48bc4ab4e254a628603805979f29cef4e82580c602052604090205460ff161561393757565b63e2517d3f60e01b600052336004527faa59e6b4b3a101ef2c0076432a11c30ca6753f82679d30e2198a9894013fef0c60245260446000fd5b3360009081527f85aa68ae9688c2bba3dc27a57a38bf2786c03751927fe89ecfd8b396d55ff133602052604090205460ff16156139a957565b63e2517d3f60e01b600052336004527f139c2898040ef16910dc9f44dc697df79363da767d8bc92f2e310312b816e46d60245260446000fd5b3360009081527fb98cfbfdec3d08ae99f42084ab7aed4a6d9e4ff06c9f2eb9793fc8285bc0e5a0602052604090205460ff1615613a1b57565b63e2517d3f60e01b600052336004527fdef752f6ad59be9880423e079755189539de01983d091b3c097e4742fd9916d160245260446000fd5b3360009081527f4da8a1b1ef30f1fd88a8e1c233b1bfb80c3644052b98cefed86e7b79ef2f613c602052604090205460ff1615613a8d57565b63e2517d3f60e01b600052336004527fcf6f9f892731e14b8859835f2ff35575f447fb501f46243c4eb8bac19e31a05060245260446000fd5b80600052600080516020615e5783398151915260205260ff613aff336040600020906001600160a01b0316600052602052604060002090565b541615613b095750565b63e2517d3f60e01b6000523360045260245260446000fd5b9065ffffffffffff1690811561351e5765ffffffffffff160690565b634e487b7160e01b600052600060045260246000fd5b600354600160401b81101561111557600181016003556000600354821015610965576003905260011b7fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01908051825465ffffffffffff191665ffffffffffff9190911617825560019060409060208101516bffffffffffff00000000000085549160301b16906bffffffffffff00000000000019161784550151910155565b613b3d565b65ffffffffffff8216620151808110908115613df2575b508015613dda575b61315c57600354908115613d8c57613c2d61319d565b9165ffffffffffff613c5c61366c61365f613c57613c51885165ffffffffffff1690565b95612c46565b610946565b911603613d7b57613c6e61366c61374c565b65ffffffffffff8216108015613d3c575b613d2b577f33fe1ca399d3a98a744972188c401c0f608d5aec1a5a6a22be53e3bf6318255992613d1d613cf384613ced61366c6040612ea298015192613ce76020613cd9613cd3845165ffffffffffff1690565b8b612d5b565b92015165ffffffffffff1690565b90613502565b90612d95565b915b613d0e613d00611158565b65ffffffffffff9095168552565b65ffffffffffff166020840152565b604082015261162181613b53565b6393e5ca0160e01b60005260046000fd5b5065ffffffffffff613d73613d60613d5a855165ffffffffffff1690565b84612d5b565b602085015165ffffffffffff1690613b21565b161515613c7f565b634bb292f960e01b60005260046000fd5b919050613d9b61366c426153a6565b65ffffffffffff831610613d2b577f33fe1ca399d3a98a744972188c401c0f608d5aec1a5a6a22be53e3bf6318255991612ea291613d1d600091613cf5565b5065ffffffffffff6201518083821606161515613c17565b6276a70091501138613c0f565b60ff600080516020615e778339815191525416613e1857565b63d93c066560e01b60005260046000fd5b6001600160a01b0316600052600860205260ff60406000205416613e4957565b6326c57c4f60e01b60005260046000fd5b80548210156109655760005260206000200190600090565b8054600160401b81101561111557613e8f91600182018155613e5a565b815460001960039290921b9190911b19169055565b90815491600160401b8310156111155782613ec791600161116795018155613e5a565b90919082549060031b91821b91600019901b1916179055565b90809291600d5415613fe4575b613ef7600c615520565b50929091600d5492600c5460008115600014613fa257505060005b6001600160d01b03811615613f9957613f2c90600d613e5a565b90549060031b1c945b81613f7f575b5015613f5c5750613ec7613f51613f5893612c46565b600d613e5a565b9190565b613f72926001600160d01b03169150600c615a25565b5050613f5883600d613ea4565b65ffffffffffff91501665ffffffffffff82161438613f3b565b50600094613f35565b9080945060001981011161090d57600c90527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c69092015486929060301c613f12565b613fee600d613e72565b613eed565b9060018201908154156140dc575b61400a83615520565b50939091835492825460009080156000146140bc57505060005b6001600160d01b038116156140b35761403d9086613e5a565b90549060031b1c955b81614099575b5015614072575050613ec761406c92614066600093612c46565b90613e5a565b90600090565b614094939161408d916001600160d01b036000951691615a25565b5050613ea4565b61406c565b65ffffffffffff91501665ffffffffffff8216143861404c565b50600095614046565b8060001981011161090d578482526020600019922001015460301c614024565b6140e582613e72565b614001565b9092919283600183018054156141bd575b61410484615520565b5094909382549482546000811560001461419857505060005b6001600160d01b0381161561418f576141369085613e5a565b90549060031b1c965b81614175575b501561415d575050613ec790614066613f5894612c46565b9061408d916001600160d01b03613f58961691615a25565b65ffffffffffff91501665ffffffffffff82161438614145565b5060009661413f565b9080965060001981011161090d5789958482526020600019922001015460301c61411d565b6141c681613e72565b6140fb565b60027f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00541461421a5760027f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b633ee5aeb560e01b60005260046000fd5b9061424961423883613601565b9265ffffffffffff84511690612d5b565b614261602084019165ffffffffffff83511690613502565b90604084015165ffffffffffff8316810180911161090d576111e69265ffffffffffff806118529397511693511690613523565b811561351e570490565b918183029160001981850993838086109503948086039514614327578483111561431a5790829109816000038216809204600281600302188082026002030280820260020302808202600203028082026002030280820260020302809102600203029360018380600003040190848311900302920304170290565b6011600384150218615562565b5050906111e69250614295565b611167926001600160a01b036040519363a9059cbb60e01b602086015216602484015260448301526044825261436b606483611136565b615573565b6143786155cb565b6143806155cb565b80519067ffffffffffffffff8211611115576143c5826143c07f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0354612d04565b6155f9565b602090601f831160011461442d5791806143fb926111679594600092614422575b50508160011b916000199060031b1c19161790565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace03556156bd565b0151905038806143e6565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace03600052601f19831691907f2ae08a8e29253f69ac5d979a101956ab8f8d9d7ded63fa7a83b16fc47648eab09260005b8181106144dd5750916001939185611167979694106144c4575b505050811b017f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace03556156bd565b015160001960f88460031b161c19169055388080614497565b9293602060018192878601518155019501930161447d565b6144fd6155cb565b6145056155cb565b61450e81615afc565b90156145a657905b7fffffffffffffffffffffff00000000000000000000000000000000000000000074ff00000000000000000000000000000000000000006001600160a01b037f0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e005493169360a01b16911617177f0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e0055565b50601290614516565b6145b76155cb565b6145bf6155cb565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b801561461c576020817fc512617347fd848ec9d7347c99c10e4fa7059132c92d0445930a7fb0c8252ff592600055604051908152a1565b637fb1277b60e01b60005260046000fd5b6001600160a01b03811660009081527fb7db2dd08fcb62d0c9e08c51941cae53c267786a0b75803fb7960902fc8ef97d602052604090205460ff1661320c576001600160a01b031660008181527fb7db2dd08fcb62d0c9e08c51941cae53c267786a0b75803fb7960902fc8ef97d60205260408120805460ff191660011790553391907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8180a4600190565b6001600160a01b03811660009081527f380487fe7531efd35292df0d5fc34ef3330fbb38e4f720b678db17ec96fe6e17602052604090205460ff1661320c576001600160a01b03811660009081527f380487fe7531efd35292df0d5fc34ef3330fbb38e4f720b678db17ec96fe6e1760205260409020805460ff1916600117905533906001600160a01b03167f7a239212a00ca755b79509a034715154386895f9f9e24abe8401e5b1b9a1a5a07f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a4600190565b6001600160a01b03811660009081527fb98cfbfdec3d08ae99f42084ab7aed4a6d9e4ff06c9f2eb9793fc8285bc0e5a0602052604090205460ff1661320c576001600160a01b03811660009081527fb98cfbfdec3d08ae99f42084ab7aed4a6d9e4ff06c9f2eb9793fc8285bc0e5a060205260409020805460ff1916600117905533906001600160a01b03167fdef752f6ad59be9880423e079755189539de01983d091b3c097e4742fd9916d17f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a4600190565b6001600160a01b03811660009081527f85aa68ae9688c2bba3dc27a57a38bf2786c03751927fe89ecfd8b396d55ff133602052604090205460ff1661320c576001600160a01b03811660009081527f85aa68ae9688c2bba3dc27a57a38bf2786c03751927fe89ecfd8b396d55ff13360205260409020805460ff1916600117905533906001600160a01b03167f139c2898040ef16910dc9f44dc697df79363da767d8bc92f2e310312b816e46d7f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a4600190565b6001600160a01b03811660009081527fe59af921f5af895cea4501d68fee3e1bbb120c3501ccc5b9d1b07e137c6af806602052604090205460ff1661320c576001600160a01b03811660009081527fe59af921f5af895cea4501d68fee3e1bbb120c3501ccc5b9d1b07e137c6af80660205260409020805460ff1916600117905533906001600160a01b03167f6c6a5de61c8667e917ea675d182a58870b6de23041e69efc8e0465f7ef75e7b97f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a4600190565b6001600160a01b03811660009081527f4da8a1b1ef30f1fd88a8e1c233b1bfb80c3644052b98cefed86e7b79ef2f613c602052604090205460ff1661320c576001600160a01b03811660009081527f4da8a1b1ef30f1fd88a8e1c233b1bfb80c3644052b98cefed86e7b79ef2f613c60205260409020805460ff1916600117905533906001600160a01b03167fcf6f9f892731e14b8859835f2ff35575f447fb501f46243c4eb8bac19e31a0507f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a4600190565b80600052600080516020615e5783398151915260205260ff614b45836040600020906001600160a01b0316600052602052604060002090565b5416614bc35780600052600080516020615e57833981519152602052614b82826040600020906001600160a01b0316600052602052604060002090565b805460ff1916600117905533916001600160a01b0316907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a4600190565b5050600090565b80600052600080516020615e5783398151915260205260ff614c03836040600020906001600160a01b0316600052602052604060002090565b541615614bc35780600052600080516020615e57833981519152602052614c41826040600020906001600160a01b0316600052602052604060002090565b805460ff1916905533916001600160a01b0316907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b600080a4600190565b614c8b610600426153a6565b80600052600f60205260ff60406000205416908115614ca8575090565b801515915081614cb6575090565b60001981019150811161090d57600052600f60205260ff6040600020541690565b600090614d00600080516020615e3783398151915254928392614cf8612c62565b938491615859565b92565b600190614d00600080516020615e3783398151915254928392614d24612c62565b938491614f6e565b600090614d00600080516020615e3783398151915254928392614d24612c62565b90919493929485840180941161090d5780850180951161090d576000548511614e62577f0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e00546040516323b872dd60e01b60208201526001600160a01b03848116602483015230604483015260648083018590528252611167987fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d793614e2e939192614dff92911661436b608483611136565b614e098187615ba5565b6040805194855260208501919091526001600160a01b03868116951693918291820190565b0390a3614e5b816001600160a01b0316600052600080516020615e17833981519152602052604060002090565b549061511e565b630d5befc560e31b60005260046000fd5b600c54906000829160058411614ef4575b614e909350600c615dad565b80614eb6575060005b6001600160d01b0381161561320c57611f4f6111e691600d613e5a565b611f7d614ec5614eef92612c46565b600c6000527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c70190565b614e99565b9192614eff81615c42565b810390811161090d57614e9093600c60005265ffffffffffff82602060002001541665ffffffffffff851610600014614f39575091614e84565b929150614f4590612d79565b90614e84565b906001830180931161090d576001810180911161090d576111e6926000926153d7565b92916001810180911161090d576001820180921161090d576111e6936153d7565b9392916001600160a01b038116918215801561510d575b611c6557614fd4846001600160a01b0316600052600080516020615e17833981519152602052604060002090565b5490818111612a1957615008817f4c948e0796277db886e0e3cc43f49c0d3096770520db8b66a179269a2f02b97d93612c55565b9661501d615018610600426153a6565b612d79565b936150b76150af61505861503b886000526004602052604060002090565b54615050896000526005602052604060002090565b549086615835565b9261506d886000526005602052604060002090565b615078868254612d95565b905561508e886000526004602052604060002090565b615099858254612d95565b905561083f886000526006602052604060002090565b918254612d95565b90556150c8610eab82600254612d95565b6150e3826001600160a01b038816978833036150fd5761587b565b6040805194855260208501919091528301523391606090a4565b615108823383615437565b61587b565b506001600160a01b03841615614fa6565b9061514c909392936001600160a01b03615137426153a6565b931660005260096020528260406000206140ea565b5050600092600b541561525d575b615164600a615520565b5090600b5490600a54801560001461521957508390876151cc985b6001600160d01b038116156152125761519a9150600b613e5a565b90549060031b1c935b816151f8575b50156151d057613ec76151be6151c593612c46565b600b613e5a565b5050613ee0565b5050565b506001600160d01b036151e6911684600a615a25565b50506151f382600b613ea4565b6151c5565b65ffffffffffff91501665ffffffffffff861614386151a9565b50936151a3565b908160001981011161090d57600a88527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a7909101546151cc9785929160301c61517f565b615267600b613e72565b61515a565b90916001600160a01b038216918215615390576001600160a01b03841693841561537a576000916152bd816001600160a01b0316600052600080516020615e17833981519152602052604060002090565b5484811061535457916153419161531a867fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef97969503916001600160a01b0316600052600080516020615e17833981519152602052604060002090565b556001600160a01b0316600052600080516020615e17833981519152602052604060002090565b80548301905550604051908152602090a3565b63391434e360e21b84526001600160a01b03909116600452602452506044829052606490fd5b63ec442f0560e01b600052600060045260246000fd5b634b637e8f60e11b600052600060045260246000fd5b65ffffffffffff81116153be5765ffffffffffff1690565b6306dfcc6560e41b600052603060045260245260446000fd5b91906153e482828561429f565b93600481101561542157600180911614928361540c575b5050501515810180911161090d5790565b90918093501561351e570915153880806153fb565b634e487b7160e01b600052602160045260246000fd5b91906154798161083f856001600160a01b03166000527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace01602052604060002090565b54600019811061548a575b50505050565b8281106154fb576001600160a01b038416156108a5576001600160a01b0382161561088f576154f19261083f9103936001600160a01b03166000527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace01602052604060002090565b5538808080615484565b906001600160a01b0390637dc7a0d960e11b6000521660045260245260445260646000fd5b80549081615535575050600090600090600090565b8160001981011161090d5760005260001990602060002001015460019165ffffffffffff82169160301c90565b634e487b716000526020526024601cfd5b906000602091828151910182855af115612cf8576000513d6155c257506001600160a01b0381163b155b6155a45750565b6001600160a01b0390635274afe760e01b6000521660045260246000fd5b6001141561559d565b60ff600080516020615e978339815191525460401c16156155e857565b631afcd79f60e31b60005260046000fd5b601f8111615605575050565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace036000526020600020906020601f840160051c83019310615661575b601f0160051c01905b818110615655575050565b6000815560010161564a565b9091508190615641565b601f821161567857505050565b6000526020600020906020601f840160051c830193106156b3575b601f0160051c01905b8181106156a7575050565b6000815560010161569c565b9091508190615693565b90815167ffffffffffffffff811161111557615723816156fd7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0454612d04565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0461566b565b602092601f821160011461577857615754929382916000926144225750508160011b916000199060031b1c19161790565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0455565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace04600052601f198216937f46a2803e59a4de4e7a4c574b1243f25977ac4c77d5a1a4a609b5394cebb4a2aa9160005b86811061581d5750836001959610615804575b505050811b017f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0455565b015160001960f88460031b161c191690553880806157da565b919260206001819286850151815501940192016157c7565b90916001830180931161090d576001810180911161090d576111e6926000926153d7565b9291906001810180911161090d576001820180921161090d576111e6936153d7565b6001600160a01b038116919082615900575090600080516020615e378339815191525482810180911161090d576000927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91600080516020615e37833981519152555b600080516020615e3783398151915280548290039055604051908152602090a3565b61592a816001600160a01b0316600052600080516020615e17833981519152602052604060002090565b5482811061598b57917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91615985826000969503916001600160a01b0316600052600080516020615e17833981519152602052604060002090565b556158de565b63391434e360e21b6000526001600160a01b0390911660045260245260445260646000fd5b8054600160401b811015611115576159cd91600182018155613e5a565b613bf3576001600160d01b03602083615a0665ffffffffffff611167965116859065ffffffffffff1665ffffffffffff19825416179055565b0151825465ffffffffffff16911660301b65ffffffffffff1916179055565b80549293928015615ad157615a3c615a4991612c46565b8260005260206000200190565b8054603081901c9365ffffffffffff91821692918116808411615ac057879303615a8c5750613f5892509065ffffffffffff82549181199060301b169116179055565b915050613f5891615aac615a9e611169565b65ffffffffffff9093168352565b6001600160d01b03861660208301526159b0565b632520601d60e01b60005260046000fd5b5090615af691615ae2615a9e611169565b6001600160d01b03851660208301526159b0565b60009190565b600080916040516001600160a01b03602082019163313ce56760e01b835260048152615b29602482611136565b5192165afa3d15615b9d573d90615b3f82611178565b91615b4d6040519384611136565b82523d6000602084013e5b80615b91575b615b6c575b50600090600090565b80602080615b7f935183010191016137e6565b60ff8111615b63579060ff6001921690565b50602081511015615b5e565b606090615b58565b906001600160a01b03821691821561537a57600080516020615e37833981519152549082820180921161090d57600092615c336020927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef94600080516020615e37833981519152556001600160a01b0316600052600080516020615e17833981519152602052604060002090565b818154019055604051908152a3565b60018111156111e657806001700100000000000000000000000000000000831015615d70575b615d16615d0c615d02615cf8615cee615ce4615cd3615d1d9760048a600160401b615d229c1015615d63575b640100000000811015615d56575b62010000811015615d49575b610100811015615d3c575b6010811015615d2f575b1015615d27575b60030260011c90565b615cdd818b614295565b0160011c90565b615cdd818a614295565b615cdd8189614295565b615cdd8188614295565b615cdd8187614295565b615cdd8186614295565b8093614295565b821190565b900390565b60011b615cca565b60041c9160021b91615cc3565b60081c9160041b91615cb9565b60101c9160081b91615cae565b60201c9160101b91615ca2565b60401c9160201b91615c94565b5050615d22615d1d615d16615d0c615d02615cf8615cee615ce4615cd3615d978a60801c90565b9850600160401b9750615c689650505050505050565b91905b838210615dbd5750505090565b9091928083169080841860011c820180921161090d578460005265ffffffffffff82602060002001541665ffffffffffff841610600014615e025750925b9190615db0565b9392506001810180911161090d5791615dfb56fe52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0052c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0202dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800cd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00a26469706673582212206bd28bc71fbf2c204a8c9a35a3a707e725421e4dd9eb3e8dc264737228dc791a64736f6c634300081c0033","optimization_enabled":true,"verified_twin_address_hash":null,"is_verified":true,"compiler_settings":{"evmVersion":"london","libraries":{},"optimizer":{"enabled":true,"runs":800},"outputSelection":{"*":{"":["*"],"*":["*"]}},"viaIR":true},"optimization_runs":800,"sourcify_repo_url":null,"decoded_constructor_args":null,"compiler_version":"v0.8.28+commit.7893614a","is_verified_via_verifier_alliance":false,"verified_at":"2026-09-30T02:48:18.927840Z","implementations":[],"proxy_type":null,"external_libraries":[],"creation_bytecode":"0x6080806040523460d2577ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460ff8160401c1660c1576002600160401b03196001600160401b03821601605c575b604051615eec90816100d88239f35b6001600160401b0319166001600160401b039081177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005581527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a13880604d565b63f92ee8a960e01b60005260046000fd5b600080fdfe6080604052600436101561001257600080fd5b60003560e01c806301e1d1141461055d57806301ffc9a714610558578063032eec2714610553578063060406181461054e57806306fdde031461054957806307a2d13a146104b3578063095ea7b3146105445780630a28a4771461053f5780630a8665501461053a5780630f3d6a37146105355780630f41ee621461053057806318160ddd1461052b57806319810f3c146105265780631ad0234f14610521578063234782e21461051c57806323b872dd14610517578063248a9ca31461051257806324adbbcd1461050d57806324b6757514610508578063267eb9ed1461050357806327debc0f146104fe57806328cfe840146104f95780632f2ff15d146104f4578063313ce567146104ef57806336568abe146104ea57806337cbfb54146104e5578063389ed267146104e057806338d52e0f146104db57806338fd7f03146104d657806339b4b0c4146104d157806339e8bd9b146104cc5780633f4ba83a146104c7578063402d267d146104c25780634179a8f6146104bd5780634b369abd146104b85780634cdad506146104b35780634d483d5c146104ae57806358794456146104a9578063592ca850146104a4578063596b1f4d1461049f5780635c975abb1461049a5780635cd8a76b146104955780636e553f651461049057806370a082311461048b578063713725441461048657806372f13e9a14610481578063742bca181461047c5780637fb84bed146104775780637fe8e78a146104725780638456cb591461046d5780638ab7ce2c146104685780638e204c431461046357806391d148541461045e57806394bf804d1461045957806395c3a4921461045457806395d89b411461044f57806399d2eb461461044a578063a0a8e46014610445578063a217fddf14610440578063a7a47d491461043b578063a9059cbb14610436578063ad8f3eb914610431578063b000d10c1461042c578063b13acedd14610427578063b3d7f6b914610422578063b460af941461041d578063b774bce214610418578063ba08765214610413578063bf9c5ee61461040e578063c63d75b614610409578063c6e6f592146103cd578063c798b0a014610404578063c83fae91146103ff578063ce96cb77146103fa578063d012b952146103f5578063d1033c07146103f0578063d547741f146103eb578063d905777e146103e6578063d9b7dc73146103e1578063dd62ed3e146103dc578063e9efd4cf146103d7578063ecf70858146103d2578063ef8b30f7146103cd578063f119a582146103c85763f5e7ee0f146103c357600080fd5b612bbb565b612b9d565b612713565b612b7f565b612a7a565b612a2a565b6128f3565b6128a7565b612857565b61282b565b612810565b6127e9565b61276c565b612731565b6126e9565b6126c7565b61264a565b612628565b61256b565b6124f0565b612361565b612326565b6122d4565b612213565b6121d8565b6121bc565b61219e565b6120ca565b611fe4565b611ec7565b611e58565b611e00565b611dbd565b611d9a565b611d26565b611ccf565b611cb1565b611c76565b611bf1565b611bb6565b611b6b565b611ab1565b611981565b611951565b611916565b611883565b611868565b6117e6565b610798565b61176e565b611733565b61170c565b611689565b611658565b6115f3565b611588565b611542565b611507565b61143e565b6113f4565b6113a8565b611353565b611310565b611282565b6111e9565b611001565b610c68565b610c2e565b610b1f565b610ae4565b610a40565b610a04565b6109d9565b6109bb565b61096a565b610912565b6108bb565b6107c7565b61067d565b610615565b6105db565b610585565b34610580576000366003190112610580576020610578612c62565b604051908152f35b600080fd5b346105805760203660031901126105805760043563ffffffff60e01b811680910361058057602090637965db0b60e01b81149081156105ca575b506040519015158152f35b6301ffc9a760e01b149050386105bf565b3461058057602036600319011261058057602061060b600435610605610600426153a6565b6136a3565b906137f5565b6040519015158152f35b34610580576000366003190112610580576020610578610600426153a6565b91909160208152825180602083015260005b818110610667575060409293506000838284010152601f8019910116010190565b8060208092870101516040828601015201610646565b346105805760003660031901126105805760405160007f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace03546106be81612d04565b808452906001811690811561077457506001146106f6575b6106f2836106e681850382611136565b60405191829182610634565b0390f35b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0360009081527f2ae08a8e29253f69ac5d979a101956ab8f8d9d7ded63fa7a83b16fc47648eab0939250905b80821061075a575090915081016020016106e66106d6565b919260018160209254838588010152019101909291610742565b60ff191660208086019190915291151560051b840190910191506106e690506106d6565b34610580576020366003190112610580576020610578600435613816565b6001600160a01b0381160361058057565b34610580576040366003190112610580576004356107e4816107b6565b60243533156108a5576001600160a01b03821691821561088f57610857829161083f336001600160a01b03166000527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace01602052604060002090565b906001600160a01b0316600052602052604060002090565b556040519081527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560203392a3602060405160018152f35b634a1406b160e11b600052600060045260246000fd5b63e602df0560e01b600052600060045260246000fd5b3461058057602036600319011261058057600435600080516020615e37833981519152546001810180911161090d576108f2612c62565b916001830180931161090d57602092610578926001926153d7565b612c30565b34610580576000366003190112610580576020600254604051908152f35b634e487b7160e01b600052603260045260246000fd5b60035481101561096557600360005260206000209060011b0190600090565b610930565b346105805760203660031901126105805760043560035481101561058057610993606091610946565b506001815491015465ffffffffffff60405192818116845260301c1660208301526040820152f35b34610580576000366003190112610580576020604051620151808152f35b34610580576000366003190112610580576020600080516020615e3783398151915254604051908152f35b346105805760203660031901126105805760043560005260046020526020604060002054604051908152f35b65ffffffffffff81160361058057565b3461058057604036600319011261058057600435610a5d81610a30565b602435610a6981610a30565b3360009081527fe59af921f5af895cea4501d68fee3e1bbb120c3501ccc5b9d1b07e137c6af806602052604090205460ff1615610aab57610aa991613bf8565b005b63e2517d3f60e01b600052336004527f6c6a5de61c8667e917ea675d182a58870b6de23041e69efc8e0465f7ef75e7b960245260446000fd5b346105805760003660031901126105805760206040517f1668f9bcd7c4fcee6cb5efd784e7251568ebcc2e65d2c4b9cb4a65b7ef5d16078152f35b3461058057606036600319011261058057610c20600435610b3f816107b6565b60243590610b4c826107b6565b610b87604435610b5a613dff565b610b6333613e29565b610b6c83613e29565b610b7584613e29565b610b80813385615437565b838361526c565b610bdd610b93426153a6565b916001600160a01b038116600052600960205282610bd66040600020926001600160a01b0316600052600080516020615e17833981519152602052604060002090565b54916140ea565b50506001600160a01b0382166000526009602052610bd66040600020926001600160a01b0316600052600080516020615e17833981519152602052604060002090565b505060405160018152602090f35b34610580576020366003190112610580576020610578600435600052600080516020615e5783398151915260205260016040600020015490565b3461058057606036600319011261058057600435610c85816107b6565b60443590602435610c9583610a30565b610c9d61388c565b610ca56141cb565b610cd3610ccf610cc8846001600160a01b0316600052600e602052604060002090565b5460ff1690565b1590565b610ff0578015610fdf57610ce68361422b565b9390610cf4610600426153a6565b93610d02610ccf86846137f5565b610fce57610deb7f078fbca360185c631ed2be37dc2b19fdd965a77f6cd598420ceb658919b3af48936001600160a01b0393610d48610d436106f29a612d3e565b614e73565b90610d51612c62565b610d6d610d5d83612d79565b6000526005602052604060002090565b5491600093610d7b82612d79565b8c14610fb0575b610da8610db391610d9c87610d978888612d95565b612d95565b90818082109118021890565b808c18818d10021890565b9a8b9182610e27575b50509250505060405194859416968491604091949365ffffffffffff9160608501968552602085015216910152565b0390a2610e1760017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b6040519081529081906020820190565b610eb095610eab95610ea3956000948403610f27579481610e8087610e67610e60610e59610e8797610e7a9b9c612d95565b838761429f565b8095612c55565b9788945b610e74426153a6565b92612c55565b90613ee0565b5050612c55565b610e93610d5d84612d79565b558380610f08575b505050612d95565b600254612c55565b600255565b610efd8784610ef8610eec610eec6001600160a01b037f0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e00541690565b6001600160a01b031690565b614334565b388080898180610dbc565b610f18610d5d91610f1e93612c55565b92612d87565b55388083610e9b565b610f57959450610f64610f3e84610d978585612d95565b95610f5f610f4d88858461429f565b988998878461429f565b988992612c55565b612c55565b94858310610f7f575b91610e808692610e7a610e8795610e6b565b95909491610e80610f9382610e8795612c55565b96610e7a610fa384998a96612d95565b9993955050925050610f6d565b9350610db3610da8610fc4610d5d84612d87565b5495915050610d82565b6379bd610b60e01b60005260046000fd5b63162908e360e11b60005260046000fd5b630d2045db60e31b60005260046000fd5b346105805760403660031901126105805760043560243580151590818103610580573360009081527ffe258d406dd87b5efd2b2423d3d148a22f1c8d08441e749d34141d1f31132dfe602052604090205460ff16156110a9577fda545faa460bc45cd72288a34bdc1e4d67f4aa9a4933ec9003c94a0c16fe0dd2916110a060209285600052600f845260406000209060ff801983541691151516179055565b604051908152a2005b63e2517d3f60e01b600052336004527f19e830aae39b97388d5da7cf0f558c39ea94b9456ab7d5c568d881f389f3ccd560245260446000fd5b634e487b7160e01b600052604160045260246000fd5b610100810190811067ffffffffffffffff82111761111557604052565b6110e2565b6060810190811067ffffffffffffffff82111761111557604052565b90601f8019910116810190811067ffffffffffffffff82111761111557604052565b60405190611167606083611136565b565b60405190611167604083611136565b67ffffffffffffffff811161111557601f01601f191660200190565b9291926111a082611178565b916111ae6040519384611136565b829481845281830111610580578281602093846000960137010152565b9080601f83011215610580578160206111e693359101611194565b90565b3461058057608036600319011261058057600435611206816107b6565b60243567ffffffffffffffff8111610580576112269036906004016111cb565b9060443567ffffffffffffffff8111610580576112479036906004016111cb565b6064359267ffffffffffffffff841161058057366023850112156105805761127c610aa9943690602481600401359101611194565b92612da2565b34610580576020366003190112610580573360009081527f380487fe7531efd35292df0d5fc34ef3330fbb38e4f720b678db17ec96fe6e1760205260409020546004359060ff16156112d757610aa9906145e5565b63e2517d3f60e01b600052336004527f7a239212a00ca755b79509a034715154386895f9f9e24abe8401e5b1b9a1a5a060245260446000fd5b34610580576020366003190112610580576001600160a01b03600435611335816107b6565b16600052600e602052602060ff604060002054166040519015158152f35b3461058057604036600319011261058057610aa9602435600435611376826107b6565b6113a361139e82600052600080516020615e5783398151915260205260016040600020015490565b613ac6565b614b0c565b346105805760003660031901126105805760ff7f0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e005460a01c1660ff811161090d57602090604051908152f35b3461058057604036600319011261058057600435602435611414816107b6565b336001600160a01b0382160361142d57610aa991614bca565b63334bd91960e11b60005260046000fd5b34610580576000366003190112610580573360009081527f54d2ed9d50568a5499fc1fd4495c05a18492e440a8c72fc578e0ecacbbc2eb2a602052604090205460ff16156114ce577ff643d9ba3899c52e69d6a2903ea9ece743231bd106cac5c41ee746d967e5778f60206114b1612c62565b6114c3816114be426153a6565b613ee0565b5050604051908152a1005b63e2517d3f60e01b600052336004527f1668f9bcd7c4fcee6cb5efd784e7251568ebcc2e65d2c4b9cb4a65b7ef5d160760245260446000fd5b346105805760003660031901126105805760206040517f139c2898040ef16910dc9f44dc697df79363da767d8bc92f2e310312b816e46d8152f35b346105805760003660031901126105805760206001600160a01b037f0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e005416604051908152f35b34610580576020366003190112610580576001600160a01b036004356115ad816107b6565b6115b56138fe565b1680600052600e602052604060002060ff1981541690557f2ac23d4a3a90a35ea325832dd4d205ea852c6d2b158b748c5bced1f02ca94829600080a2005b346105805760003660031901126105805761160c61317e565b506106f261162161161c426153a6565b613601565b60405191829182919091604080606083019465ffffffffffff815116845265ffffffffffff60208201511660208501520151910152565b3461058057602036600319011261058057600435600052600f602052602060ff604060002054166040519015158152f35b34610580576000366003190112610580576116a2613970565b600080516020615e778339815191525460ff8116156116fb5760ff1916600080516020615e77833981519152557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a1005b638dfc202b60e01b60005260046000fd5b3461058057602036600319011261058057602061057860043561172e816107b6565b6131b2565b346105805760003660031901126105805760206040517f5612063648f807201ec1c6d4f999a34ed02c6a8b521b7b99e155a6823c5687368152f35b346105805760603660031901126105805760043561178b816107b6565b602435611797816107b6565b6044359167ffffffffffffffff831161058057366023840112156105805782600401359167ffffffffffffffff8311610580573660248460051b86010111610580576024610aa9940191613244565b34610580576000366003190112610580576117ff61317e565b50602061185861181161161c426153a6565b61185265ffffffffffff8251169165ffffffffffff6118498661183c86611837426153a6565b612d5b565b9301928284511690613502565b91511690613523565b90613544565b65ffffffffffff60405191168152f35b34610580576000366003190112610580576020611858613562565b34610580576020366003190112610580576001600160a01b036004356118a8816107b6565b6118b06139e2565b1680600052600860205260ff604060002054161561190557806000526008602052604060002060ff1981541690557fa4fe411171f397b84dcdfc3c9a03b2c1dc1aa15b0a76cb4529ba4d0b9777e1ad600080a2005b637622da2760e01b60005260046000fd5b346105805760003660031901126105805760206040517fdef752f6ad59be9880423e079755189539de01983d091b3c097e4742fd9916d18152f35b3461058057600036600319011261058057602060ff600080516020615e7783398151915254166040519015158152f35b3461058057600036600319011261058057600080516020615e978339815191525460ff8160401c16908115611a9b575b50611a8a576119e9600267ffffffffffffffff19600080516020615e97833981519152541617600080516020615e9783398151915255565b600160401b68ff000000000000000019600080516020615e97833981519152541617600080516020615e9783398151915255611a256002600155565b611a5668ff000000000000000019600080516020615e978339815191525416600080516020615e9783398151915255565b604051600281527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29080602081015b0390a1005b63f92ee8a960e01b60005260046000fd5b6002915067ffffffffffffffff161015386119b1565b3461058057604036600319011261058057602435600435611ad1826107b6565b611ad9613dff565b611ae233613e29565b611aeb82613e29565b611af36141cb565b8015610fdf57611b01614c7f565b611b5a57611b0e81614cd7565b9082939215610fdf5783611b26936106f29633614d4d565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00556040519081529081906020820190565b63f502e41560e01b60005260046000fd5b34610580576020366003190112610580576001600160a01b03600435611b90816107b6565b16600052600080516020615e178339815191526020526020604060002054604051908152f35b346105805760003660031901126105805760206040517fcf6f9f892731e14b8859835f2ff35575f447fb501f46243c4eb8bac19e31a0508152f35b34610580576020366003190112610580576001600160a01b03600435611c16816107b6565b611c1e6138fe565b168015611c655780600052600e6020526040600020600160ff198254161790557fbc8ca2d78250b3f96cf26129ddbcbbd21b69df85b725d37e6a9ac835aa64ec17600080a2005b63e6c4247b60e01b60005260046000fd5b346105805760003660031901126105805760206040517faa59e6b4b3a101ef2c0076432a11c30ca6753f82679d30e2198a9894013fef0c8152f35b346105805760003660031901126105805760206040516276a7008152f35b3461058057604036600319011261058057602060ff611d1a602435600435611cf6826107b6565b600052600784526040600020906001600160a01b0316600052602052604060002090565b54166040519015158152f35b3461058057600036600319011261058057611d3f613970565b611d47613dff565b600160ff19600080516020615e77833981519152541617600080516020615e77833981519152557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a1005b34610580576020366003190112610580576106f261162160043561161c81610a30565b34610580576020366003190112610580576001600160a01b03600435611de2816107b6565b166000526008602052602060ff604060002054166040519015158152f35b3461058057604036600319011261058057602060ff611d1a602435600435611e27826107b6565b600052600080516020615e5783398151915284526040600020906001600160a01b0316600052602052604060002090565b3461058057604036600319011261058057600435602435611e78816107b6565b611e80613dff565b611e8933613e29565b611e9281613e29565b611e9a6141cb565b8115610fdf57611ea8614c7f565b611b5a57611b2682611ebc6106f294614d03565b929091809533614d4d565b3461058057604036600319011261058057600435611ee4816107b6565b6001600160a01b0360243591611ef983610a30565b1660005260096020526040600020600090805482938160058111611f8a575b5090602094611f279284615dad565b80611f615750815b6001600160d01b03831615611f595750610578916001611f4f9201613e5a565b90549060031b1c90565b915050610578565b611f7d611f70611f8492612c46565b8360005260206000200190565b5460301c90565b91611f2f565b94611f9486615c42565b860395861161090d57602095611f279385875265ffffffffffff8289892001541665ffffffffffff851610600014611fd25750915b91925094611f18565b929150611fde90612d79565b90611fc9565b346105805760003660031901126105805760405160007f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace045461202581612d04565b8084529060018116908115610774575060011461204c576106f2836106e681850382611136565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0460009081527f46a2803e59a4de4e7a4c574b1243f25977ac4c77d5a1a4a609b5394cebb4a2aa939250905b8082106120b0575090915081016020016106e66106d6565b919260018160209254838588010152019101909291612098565b34610580576020366003190112610580576004356120e661317e565b50600354801561215257906120f961317e565b916000915b818310612163575b50505065ffffffffffff612120825165ffffffffffff1690565b16156121525760408051825165ffffffffffff9081168252602080850151909116908201529181015190820152606090f35b6302e8f35960e31b60005260046000fd5b909192600161217185610946565b50015482106121985750600161218f61218985610946565b506135d0565b930191906120fe565b92612106565b34610580576000366003190112610580576020600154604051908152f35b3461058057600036600319011261058057602060405160008152f35b346105805760003660031901126105805760206040517f7a239212a00ca755b79509a034715154386895f9f9e24abe8401e5b1b9a1a5a08152f35b3461058057604036600319011261058057610c20600435612233816107b6565b61225a602435612241613dff565b61224a33613e29565b61225383613e29565b823361526c565b6001600160a01b0361226b426153a6565b913360005260096020526122a0604060002033600052600080516020615e1783398151915260205284604060002054916140ea565b50501690816000526009602052604060002091600052600080516020615e17833981519152602052604060002054916140ea565b3461058057604036600319011261058057602061231d6024356004356122f9826107b6565b600052600683526040600020906001600160a01b0316600052602052604060002090565b54604051908152f35b346105805760003660031901126105805760206040517f6c6a5de61c8667e917ea675d182a58870b6de23041e69efc8e0465f7ef75e7b98152f35b346105805760203660031901126105805760043561237d613dff565b61238633613e29565b61238e6141cb565b61239a610600426153a6565b811015612152576123bc610cc83361083f846000526007602052604060002090565b6124dc5761240c6123db3361083f846000526006602052604060002090565b546123f0836000526004602052604060002090565b54612405846000526005602052604060002090565b5491614f4b565b80156124c5576106f291612425610eab83600254612c55565b61244d6124403361083f846000526007602052604060002090565b805460ff19166001179055565b6124898233610ef8610eec610eec7f0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e00546001600160a01b031690565b60408051838152602081019290925233917fa7952fcf1aa05ca494ca81b36018d749ac933a4f76e87ccdcd31cc6a202a785e9181908101610deb565b6395dece8d60e01b600052600482905260245b6000fd5b631e77842160e01b60005260045260246000fd5b346105805760203660031901126105805760043561250c612c62565b6001810180911161090d57600080516020615e3783398151915254916001830180931161090d57602092610578926001926153d7565b6060906003190112610580576004359060243561255e816107b6565b906044356111e6816107b6565b346105805761257936612542565b612581613dff565b61258a33613e29565b61259381613e29565b61259c82613e29565b6125a46141cb565b8215610fdf57600080516020615e37833981519152546125c2612c62565b906125dc836125d4600185858a615859565b958688614f8f565b9484820391821161090d57820391821161090d576020946125fc9361511e565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055604051908152f35b3461058057602036600319011261058057602061057860043561060081610a30565b346105805761265836612542565b612660613dff565b61266933613e29565b61267281613e29565b61267b82613e29565b6126836141cb565b8215610fdf5761269283614d2c565b91938415610fdf57836126a6918787614f8f565b94810390811161090d5783820391821161090d576106f294611b269361511e565b34610580576020366003190112610580576020610578600435610d4381610a30565b3461058057602036600319011261058057602061057861270e60043561172e816107b6565b613851565b34610580576020366003190112610580576020610578600435613851565b346105805760003660031901126105805760206040517f19e830aae39b97388d5da7cf0f558c39ea94b9456ab7d5c568d881f389f3ccd58152f35b34610580576020366003190112610580576001600160a01b03600435612791816107b6565b6127996139e2565b6127a281613e29565b168015611c65578060005260086020526040600020600160ff198254161790557f2e5413219814041322ad93e464b59b110565b5068e1b84de73293f6ce422f246600080a2005b3461058057602036600319011261058057602061057860043561280b816107b6565b6136e3565b3461058057600036600319011261058057602061185861374c565b346105805760203660031901126105805760043560005260056020526020604060002054604051908152f35b3461058057604036600319011261058057610aa960243560043561287a826107b6565b6128a261139e82600052600080516020615e5783398151915260205260016040600020015490565b614bca565b346105805760203660031901126105805760206105786004356128c9816107b6565b613772565b6040906003190112610580576004356128e6816107b6565b906024356111e6816107b6565b3461058057612901366128ce565b612909613a54565b6001600160a01b0382169182600052600860205260ff60406000205416156119055761293482613e29565b82600052600080516020615e17833981519152602052604060002054928315612a1957836129ef611a859261298b7f3f2f178018e94aef45bee04ba81187d58b2b86d43fd6dcbef9243f20f66327e197878761526c565b612994426153a6565b9060005260096020526129ab816040600020613ff3565b50506001600160a01b0386166000526009602052604060002090610bd6876001600160a01b0316600052600080516020615e17833981519152602052604060002090565b5050604051938493846001600160a01b036040929594938160608401971683521660208201520152565b633999656760e01b60005260046000fd5b3461058057602061231d61083f612a40366128ce565b91906001600160a01b03166000527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace01602052604060002090565b3461058057602036600319011261058057600435612a9781610a30565b6000600a5481928160058111612b24575b5090602093612ab892600a615dad565b80612ae55750805b6001600160d01b03821615612ade5750611f4f61057891600b613e5a565b9050610578565b611f7d612af4612b1e92612c46565b600a6000527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80190565b90612ac0565b93612b2e85615c42565b850394851161090d57602094612ab893600a865265ffffffffffff8288882001541665ffffffffffff851610600014612b6d5750915b91925093612aa8565b929150612b7990612d79565b90612b64565b34610580576000366003190112610580576020600054604051908152f35b34610580576000366003190112610580576020600354604051908152f35b34610580576040366003190112610580576106f2610e17600435612c0a602435612be4816107b6565b8260005260066020526040600020906001600160a01b0316600052602052604060002090565b549080600052600460205260406000205490600052600560205260406000205491614f4b565b634e487b7160e01b600052601160045260246000fd5b60001981019190821161090d57565b9190820391821161090d57565b602460206001600160a01b037f0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e005416604051928380926370a0823160e01b82523060048301525afa908115612cf857600091612cc9575b50600254810390811161090d5790565b612ceb915060203d602011612cf1575b612ce38183611136565b8101906137e6565b38612cb9565b503d612cd9565b6040513d6000823e3d90fd5b90600182811c92168015612d34575b6020831014612d1e57565b634e487b7160e01b600052602260045260246000fd5b91607f1691612d13565b65ffffffffffff6000199116019065ffffffffffff821161090d57565b9065ffffffffffff8091169116039065ffffffffffff821161090d57565b906001820180921161090d57565b906002820180921161090d57565b9190820180921161090d57565b600080516020615e9783398151915254939092909167ffffffffffffffff612dda604087901c60ff16159667ffffffffffffffff1690565b1680159081612ef6575b6001149081612eec575b159081612ee3575b50611a8a57612e3c9385612e33600167ffffffffffffffff19600080516020615e97833981519152541617600080516020615e9783398151915255565b612ea757612faa565b612e4257565b612e7368ff000000000000000019600080516020615e978339815191525416600080516020615e9783398151915255565b604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29080602081015b0390a1565b612ede600160401b68ff000000000000000019600080516020615e97833981519152541617600080516020615e9783398151915255565b612faa565b90501538612df6565b303b159150612dee565b869150612de4565b5190611167826107b6565b519061116782610a30565b908161010091031261058057612fa260e060405192612f32846110f8565b612f3b81612efe565b8452612f4960208201612efe565b6020850152612f5a60408201612efe565b6040850152612f6b60608201612efe565b6060850152612f7c60808201612efe565b6080850152612f8d60a08201612efe565b60a085015260c081015160c085015201612f09565b60e082015290565b90926001600160a01b0392612fcb612fd19260208082518301019101612f14565b94614370565b612fda816144f5565b612fe26155cb565b612fea6145af565b612ff26155cb565b161561316d5761300560c08201516145e5565b60e0810165ffffffffffff613020825165ffffffffffff1690565b161561315c5761303a610eec83516001600160a01b031690565b1561314b576130ee9161306860a092613062613055426153a6565b915165ffffffffffff1690565b90613bf8565b6130726002600155565b61308b61308682516001600160a01b031690565b61462d565b5060208101516001600160a01b03168061313b575b5060408101516001600160a01b03168061312b575b5060608101516001600160a01b03168061311b575b5060808101516001600160a01b03168061310b575b5001516001600160a01b031690565b6001600160a01b0381166130ff5750565b61310890614a35565b50565b6131149061495e565b50386130df565b61312490614887565b50386130ca565b613134906147b0565b50386130b5565b613144906146d9565b50386130a0565b63016ed19f60e21b60005260046000fd5b638db7cf7560e01b60005260046000fd5b630ccd248560e21b60005260046000fd5b6040519061318b8261111a565b60006040838281528260208201520152565b6131a561317e565b506111e661161c426153a6565b6001600160a01b036131c2612c62565b9116600052600860205260ff60406000205416801561322b575b801561321d575b8015613212575b61320c5760005490810390811161090d5761320481613851565b1561320c5790565b50600090565b5060005481116131ea565b50613226614c7f565b6131e3565b5060ff600080516020615e7783398151915254166131dc565b9392919091613251613a54565b6001600160a01b038516600052600860205260ff60406000205416156119055761327a83613e29565b6001600160a01b03831615611c655780156133d357613298816133fc565b9160005b8281106132d9575091612ea2917f8a0766d7b4a07e2db9039b140504b0d9c5ea2af33ee94f0268f11b3d1e5db8d595969360405195869586613452565b6132fc8761083f6132eb84878761342e565b356000526006602052604060002090565b54613323610cc88961083f61331286898961342e565b356000526007602052604060002090565b6133b15761333c610cc88761083f61331286898961342e565b6133b157801561338f579060019161335c8761083f6132eb85898961342e565b613367828254612d95565b9055600061337d8a61083f6132eb868a8a61342e565b55613388828761343e565b520161329c565b506124d89261339d9261342e565b6395dece8d60e01b60005235600452602490565b506124d8926133bf9261342e565b631e77842160e01b60005235600452602490565b634ec4810560e11b60005260046000fd5b67ffffffffffffffff81116111155760051b60200190565b90613406826133e4565b6134136040519182611136565b8281528092613424601f19916133e4565b0190602036910137565b91908110156109655760051b0190565b80518210156109655760209160051b010190565b93916001600160a01b038092168552166020840152608060408401528060808401527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81116105805760209160c09160051b809160a0860137830160a0810193606060a08284030191015284518094520192019060005b8181106134d65750505090565b82518452602093840193909201916001016134c9565b634e487b7160e01b600052601260045260246000fd5b9065ffffffffffff1690811561351e5765ffffffffffff160490565b6134ec565b9065ffffffffffff8091169116029065ffffffffffff821691820361090d57565b9065ffffffffffff8091169116019065ffffffffffff821161090d57565b61356a61317e565b5061357761161c426153a6565b65ffffffffffff815116600165ffffffffffff6135a9602061359c85611837426153a6565b9501948286511690613502565b16019165ffffffffffff831161090d576111e69265ffffffffffff61185292511690613523565b906040516135dd8161111a565b60406001829465ffffffffffff8154818116865260301c1660208501520154910152565b61360961317e565b50600354908115612152579061361d61317e565b916000905b82821061364d575b50505065ffffffffffff613644825165ffffffffffff1690565b16156121525790565b90919261367761366c61365f85610946565b505465ffffffffffff1690565b65ffffffffffff1690565b65ffffffffffff83161061369d5750600161369461218984610946565b93920190613622565b9261362a565b65ffffffffffff6136d66136b683613601565b8260206136cc6040840151968385511690612d5b565b9201511690613502565b16810180911161090d5790565b6001600160a01b031680600052600860205260ff604060002054168015613733575b156137105750600090565b600052600080516020615e178339815191526020526111e6604060002054613816565b5060ff600080516020615e778339815191525416613705565b6111e6613757613562565b65ffffffffffff602061376983613601565b01511690613544565b6001600160a01b031680600052600860205260ff6040600020541680156137cd575b1561379f5750600090565b600052600080516020615e178339815191526020526040600020546137c381613816565b6111e65750600090565b5060ff600080516020615e778339815191525416613794565b90816020910312610580575190565b80821491821561380457505090565b9091506001820180921161090d571490565b61381e612c62565b906001820180921161090d57600080516020615e37833981519152546001810180911161090d576111e6926000926153d7565b600080516020615e3783398151915254906001820180921161090d57613875612c62565b6001810180911161090d576111e6926000926153d7565b3360009081527ffd4d1ad051ccd730be4c0ee67ff229738ff97783963c92cf035bdd0b019f83e4602052604090205460ff16156138c557565b63e2517d3f60e01b600052336004527f5612063648f807201ec1c6d4f999a34ed02c6a8b521b7b99e155a6823c56873660245260446000fd5b3360009081527f4f35b9cd413361eec3953522e48bc4ab4e254a628603805979f29cef4e82580c602052604090205460ff161561393757565b63e2517d3f60e01b600052336004527faa59e6b4b3a101ef2c0076432a11c30ca6753f82679d30e2198a9894013fef0c60245260446000fd5b3360009081527f85aa68ae9688c2bba3dc27a57a38bf2786c03751927fe89ecfd8b396d55ff133602052604090205460ff16156139a957565b63e2517d3f60e01b600052336004527f139c2898040ef16910dc9f44dc697df79363da767d8bc92f2e310312b816e46d60245260446000fd5b3360009081527fb98cfbfdec3d08ae99f42084ab7aed4a6d9e4ff06c9f2eb9793fc8285bc0e5a0602052604090205460ff1615613a1b57565b63e2517d3f60e01b600052336004527fdef752f6ad59be9880423e079755189539de01983d091b3c097e4742fd9916d160245260446000fd5b3360009081527f4da8a1b1ef30f1fd88a8e1c233b1bfb80c3644052b98cefed86e7b79ef2f613c602052604090205460ff1615613a8d57565b63e2517d3f60e01b600052336004527fcf6f9f892731e14b8859835f2ff35575f447fb501f46243c4eb8bac19e31a05060245260446000fd5b80600052600080516020615e5783398151915260205260ff613aff336040600020906001600160a01b0316600052602052604060002090565b541615613b095750565b63e2517d3f60e01b6000523360045260245260446000fd5b9065ffffffffffff1690811561351e5765ffffffffffff160690565b634e487b7160e01b600052600060045260246000fd5b600354600160401b81101561111557600181016003556000600354821015610965576003905260011b7fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01908051825465ffffffffffff191665ffffffffffff9190911617825560019060409060208101516bffffffffffff00000000000085549160301b16906bffffffffffff00000000000019161784550151910155565b613b3d565b65ffffffffffff8216620151808110908115613df2575b508015613dda575b61315c57600354908115613d8c57613c2d61319d565b9165ffffffffffff613c5c61366c61365f613c57613c51885165ffffffffffff1690565b95612c46565b610946565b911603613d7b57613c6e61366c61374c565b65ffffffffffff8216108015613d3c575b613d2b577f33fe1ca399d3a98a744972188c401c0f608d5aec1a5a6a22be53e3bf6318255992613d1d613cf384613ced61366c6040612ea298015192613ce76020613cd9613cd3845165ffffffffffff1690565b8b612d5b565b92015165ffffffffffff1690565b90613502565b90612d95565b915b613d0e613d00611158565b65ffffffffffff9095168552565b65ffffffffffff166020840152565b604082015261162181613b53565b6393e5ca0160e01b60005260046000fd5b5065ffffffffffff613d73613d60613d5a855165ffffffffffff1690565b84612d5b565b602085015165ffffffffffff1690613b21565b161515613c7f565b634bb292f960e01b60005260046000fd5b919050613d9b61366c426153a6565b65ffffffffffff831610613d2b577f33fe1ca399d3a98a744972188c401c0f608d5aec1a5a6a22be53e3bf6318255991612ea291613d1d600091613cf5565b5065ffffffffffff6201518083821606161515613c17565b6276a70091501138613c0f565b60ff600080516020615e778339815191525416613e1857565b63d93c066560e01b60005260046000fd5b6001600160a01b0316600052600860205260ff60406000205416613e4957565b6326c57c4f60e01b60005260046000fd5b80548210156109655760005260206000200190600090565b8054600160401b81101561111557613e8f91600182018155613e5a565b815460001960039290921b9190911b19169055565b90815491600160401b8310156111155782613ec791600161116795018155613e5a565b90919082549060031b91821b91600019901b1916179055565b90809291600d5415613fe4575b613ef7600c615520565b50929091600d5492600c5460008115600014613fa257505060005b6001600160d01b03811615613f9957613f2c90600d613e5a565b90549060031b1c945b81613f7f575b5015613f5c5750613ec7613f51613f5893612c46565b600d613e5a565b9190565b613f72926001600160d01b03169150600c615a25565b5050613f5883600d613ea4565b65ffffffffffff91501665ffffffffffff82161438613f3b565b50600094613f35565b9080945060001981011161090d57600c90527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c69092015486929060301c613f12565b613fee600d613e72565b613eed565b9060018201908154156140dc575b61400a83615520565b50939091835492825460009080156000146140bc57505060005b6001600160d01b038116156140b35761403d9086613e5a565b90549060031b1c955b81614099575b5015614072575050613ec761406c92614066600093612c46565b90613e5a565b90600090565b614094939161408d916001600160d01b036000951691615a25565b5050613ea4565b61406c565b65ffffffffffff91501665ffffffffffff8216143861404c565b50600095614046565b8060001981011161090d578482526020600019922001015460301c614024565b6140e582613e72565b614001565b9092919283600183018054156141bd575b61410484615520565b5094909382549482546000811560001461419857505060005b6001600160d01b0381161561418f576141369085613e5a565b90549060031b1c965b81614175575b501561415d575050613ec790614066613f5894612c46565b9061408d916001600160d01b03613f58961691615a25565b65ffffffffffff91501665ffffffffffff82161438614145565b5060009661413f565b9080965060001981011161090d5789958482526020600019922001015460301c61411d565b6141c681613e72565b6140fb565b60027f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00541461421a5760027f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b633ee5aeb560e01b60005260046000fd5b9061424961423883613601565b9265ffffffffffff84511690612d5b565b614261602084019165ffffffffffff83511690613502565b90604084015165ffffffffffff8316810180911161090d576111e69265ffffffffffff806118529397511693511690613523565b811561351e570490565b918183029160001981850993838086109503948086039514614327578483111561431a5790829109816000038216809204600281600302188082026002030280820260020302808202600203028082026002030280820260020302809102600203029360018380600003040190848311900302920304170290565b6011600384150218615562565b5050906111e69250614295565b611167926001600160a01b036040519363a9059cbb60e01b602086015216602484015260448301526044825261436b606483611136565b615573565b6143786155cb565b6143806155cb565b80519067ffffffffffffffff8211611115576143c5826143c07f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0354612d04565b6155f9565b602090601f831160011461442d5791806143fb926111679594600092614422575b50508160011b916000199060031b1c19161790565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace03556156bd565b0151905038806143e6565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace03600052601f19831691907f2ae08a8e29253f69ac5d979a101956ab8f8d9d7ded63fa7a83b16fc47648eab09260005b8181106144dd5750916001939185611167979694106144c4575b505050811b017f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace03556156bd565b015160001960f88460031b161c19169055388080614497565b9293602060018192878601518155019501930161447d565b6144fd6155cb565b6145056155cb565b61450e81615afc565b90156145a657905b7fffffffffffffffffffffff00000000000000000000000000000000000000000074ff00000000000000000000000000000000000000006001600160a01b037f0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e005493169360a01b16911617177f0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e0055565b50601290614516565b6145b76155cb565b6145bf6155cb565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b801561461c576020817fc512617347fd848ec9d7347c99c10e4fa7059132c92d0445930a7fb0c8252ff592600055604051908152a1565b637fb1277b60e01b60005260046000fd5b6001600160a01b03811660009081527fb7db2dd08fcb62d0c9e08c51941cae53c267786a0b75803fb7960902fc8ef97d602052604090205460ff1661320c576001600160a01b031660008181527fb7db2dd08fcb62d0c9e08c51941cae53c267786a0b75803fb7960902fc8ef97d60205260408120805460ff191660011790553391907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8180a4600190565b6001600160a01b03811660009081527f380487fe7531efd35292df0d5fc34ef3330fbb38e4f720b678db17ec96fe6e17602052604090205460ff1661320c576001600160a01b03811660009081527f380487fe7531efd35292df0d5fc34ef3330fbb38e4f720b678db17ec96fe6e1760205260409020805460ff1916600117905533906001600160a01b03167f7a239212a00ca755b79509a034715154386895f9f9e24abe8401e5b1b9a1a5a07f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a4600190565b6001600160a01b03811660009081527fb98cfbfdec3d08ae99f42084ab7aed4a6d9e4ff06c9f2eb9793fc8285bc0e5a0602052604090205460ff1661320c576001600160a01b03811660009081527fb98cfbfdec3d08ae99f42084ab7aed4a6d9e4ff06c9f2eb9793fc8285bc0e5a060205260409020805460ff1916600117905533906001600160a01b03167fdef752f6ad59be9880423e079755189539de01983d091b3c097e4742fd9916d17f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a4600190565b6001600160a01b03811660009081527f85aa68ae9688c2bba3dc27a57a38bf2786c03751927fe89ecfd8b396d55ff133602052604090205460ff1661320c576001600160a01b03811660009081527f85aa68ae9688c2bba3dc27a57a38bf2786c03751927fe89ecfd8b396d55ff13360205260409020805460ff1916600117905533906001600160a01b03167f139c2898040ef16910dc9f44dc697df79363da767d8bc92f2e310312b816e46d7f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a4600190565b6001600160a01b03811660009081527fe59af921f5af895cea4501d68fee3e1bbb120c3501ccc5b9d1b07e137c6af806602052604090205460ff1661320c576001600160a01b03811660009081527fe59af921f5af895cea4501d68fee3e1bbb120c3501ccc5b9d1b07e137c6af80660205260409020805460ff1916600117905533906001600160a01b03167f6c6a5de61c8667e917ea675d182a58870b6de23041e69efc8e0465f7ef75e7b97f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a4600190565b6001600160a01b03811660009081527f4da8a1b1ef30f1fd88a8e1c233b1bfb80c3644052b98cefed86e7b79ef2f613c602052604090205460ff1661320c576001600160a01b03811660009081527f4da8a1b1ef30f1fd88a8e1c233b1bfb80c3644052b98cefed86e7b79ef2f613c60205260409020805460ff1916600117905533906001600160a01b03167fcf6f9f892731e14b8859835f2ff35575f447fb501f46243c4eb8bac19e31a0507f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a4600190565b80600052600080516020615e5783398151915260205260ff614b45836040600020906001600160a01b0316600052602052604060002090565b5416614bc35780600052600080516020615e57833981519152602052614b82826040600020906001600160a01b0316600052602052604060002090565b805460ff1916600117905533916001600160a01b0316907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a4600190565b5050600090565b80600052600080516020615e5783398151915260205260ff614c03836040600020906001600160a01b0316600052602052604060002090565b541615614bc35780600052600080516020615e57833981519152602052614c41826040600020906001600160a01b0316600052602052604060002090565b805460ff1916905533916001600160a01b0316907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b600080a4600190565b614c8b610600426153a6565b80600052600f60205260ff60406000205416908115614ca8575090565b801515915081614cb6575090565b60001981019150811161090d57600052600f60205260ff6040600020541690565b600090614d00600080516020615e3783398151915254928392614cf8612c62565b938491615859565b92565b600190614d00600080516020615e3783398151915254928392614d24612c62565b938491614f6e565b600090614d00600080516020615e3783398151915254928392614d24612c62565b90919493929485840180941161090d5780850180951161090d576000548511614e62577f0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e00546040516323b872dd60e01b60208201526001600160a01b03848116602483015230604483015260648083018590528252611167987fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d793614e2e939192614dff92911661436b608483611136565b614e098187615ba5565b6040805194855260208501919091526001600160a01b03868116951693918291820190565b0390a3614e5b816001600160a01b0316600052600080516020615e17833981519152602052604060002090565b549061511e565b630d5befc560e31b60005260046000fd5b600c54906000829160058411614ef4575b614e909350600c615dad565b80614eb6575060005b6001600160d01b0381161561320c57611f4f6111e691600d613e5a565b611f7d614ec5614eef92612c46565b600c6000527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c70190565b614e99565b9192614eff81615c42565b810390811161090d57614e9093600c60005265ffffffffffff82602060002001541665ffffffffffff851610600014614f39575091614e84565b929150614f4590612d79565b90614e84565b906001830180931161090d576001810180911161090d576111e6926000926153d7565b92916001810180911161090d576001820180921161090d576111e6936153d7565b9392916001600160a01b038116918215801561510d575b611c6557614fd4846001600160a01b0316600052600080516020615e17833981519152602052604060002090565b5490818111612a1957615008817f4c948e0796277db886e0e3cc43f49c0d3096770520db8b66a179269a2f02b97d93612c55565b9661501d615018610600426153a6565b612d79565b936150b76150af61505861503b886000526004602052604060002090565b54615050896000526005602052604060002090565b549086615835565b9261506d886000526005602052604060002090565b615078868254612d95565b905561508e886000526004602052604060002090565b615099858254612d95565b905561083f886000526006602052604060002090565b918254612d95565b90556150c8610eab82600254612d95565b6150e3826001600160a01b038816978833036150fd5761587b565b6040805194855260208501919091528301523391606090a4565b615108823383615437565b61587b565b506001600160a01b03841615614fa6565b9061514c909392936001600160a01b03615137426153a6565b931660005260096020528260406000206140ea565b5050600092600b541561525d575b615164600a615520565b5090600b5490600a54801560001461521957508390876151cc985b6001600160d01b038116156152125761519a9150600b613e5a565b90549060031b1c935b816151f8575b50156151d057613ec76151be6151c593612c46565b600b613e5a565b5050613ee0565b5050565b506001600160d01b036151e6911684600a615a25565b50506151f382600b613ea4565b6151c5565b65ffffffffffff91501665ffffffffffff861614386151a9565b50936151a3565b908160001981011161090d57600a88527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a7909101546151cc9785929160301c61517f565b615267600b613e72565b61515a565b90916001600160a01b038216918215615390576001600160a01b03841693841561537a576000916152bd816001600160a01b0316600052600080516020615e17833981519152602052604060002090565b5484811061535457916153419161531a867fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef97969503916001600160a01b0316600052600080516020615e17833981519152602052604060002090565b556001600160a01b0316600052600080516020615e17833981519152602052604060002090565b80548301905550604051908152602090a3565b63391434e360e21b84526001600160a01b03909116600452602452506044829052606490fd5b63ec442f0560e01b600052600060045260246000fd5b634b637e8f60e11b600052600060045260246000fd5b65ffffffffffff81116153be5765ffffffffffff1690565b6306dfcc6560e41b600052603060045260245260446000fd5b91906153e482828561429f565b93600481101561542157600180911614928361540c575b5050501515810180911161090d5790565b90918093501561351e570915153880806153fb565b634e487b7160e01b600052602160045260246000fd5b91906154798161083f856001600160a01b03166000527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace01602052604060002090565b54600019811061548a575b50505050565b8281106154fb576001600160a01b038416156108a5576001600160a01b0382161561088f576154f19261083f9103936001600160a01b03166000527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace01602052604060002090565b5538808080615484565b906001600160a01b0390637dc7a0d960e11b6000521660045260245260445260646000fd5b80549081615535575050600090600090600090565b8160001981011161090d5760005260001990602060002001015460019165ffffffffffff82169160301c90565b634e487b716000526020526024601cfd5b906000602091828151910182855af115612cf8576000513d6155c257506001600160a01b0381163b155b6155a45750565b6001600160a01b0390635274afe760e01b6000521660045260246000fd5b6001141561559d565b60ff600080516020615e978339815191525460401c16156155e857565b631afcd79f60e31b60005260046000fd5b601f8111615605575050565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace036000526020600020906020601f840160051c83019310615661575b601f0160051c01905b818110615655575050565b6000815560010161564a565b9091508190615641565b601f821161567857505050565b6000526020600020906020601f840160051c830193106156b3575b601f0160051c01905b8181106156a7575050565b6000815560010161569c565b9091508190615693565b90815167ffffffffffffffff811161111557615723816156fd7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0454612d04565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0461566b565b602092601f821160011461577857615754929382916000926144225750508160011b916000199060031b1c19161790565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0455565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace04600052601f198216937f46a2803e59a4de4e7a4c574b1243f25977ac4c77d5a1a4a609b5394cebb4a2aa9160005b86811061581d5750836001959610615804575b505050811b017f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0455565b015160001960f88460031b161c191690553880806157da565b919260206001819286850151815501940192016157c7565b90916001830180931161090d576001810180911161090d576111e6926000926153d7565b9291906001810180911161090d576001820180921161090d576111e6936153d7565b6001600160a01b038116919082615900575090600080516020615e378339815191525482810180911161090d576000927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91600080516020615e37833981519152555b600080516020615e3783398151915280548290039055604051908152602090a3565b61592a816001600160a01b0316600052600080516020615e17833981519152602052604060002090565b5482811061598b57917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91615985826000969503916001600160a01b0316600052600080516020615e17833981519152602052604060002090565b556158de565b63391434e360e21b6000526001600160a01b0390911660045260245260445260646000fd5b8054600160401b811015611115576159cd91600182018155613e5a565b613bf3576001600160d01b03602083615a0665ffffffffffff611167965116859065ffffffffffff1665ffffffffffff19825416179055565b0151825465ffffffffffff16911660301b65ffffffffffff1916179055565b80549293928015615ad157615a3c615a4991612c46565b8260005260206000200190565b8054603081901c9365ffffffffffff91821692918116808411615ac057879303615a8c5750613f5892509065ffffffffffff82549181199060301b169116179055565b915050613f5891615aac615a9e611169565b65ffffffffffff9093168352565b6001600160d01b03861660208301526159b0565b632520601d60e01b60005260046000fd5b5090615af691615ae2615a9e611169565b6001600160d01b03851660208301526159b0565b60009190565b600080916040516001600160a01b03602082019163313ce56760e01b835260048152615b29602482611136565b5192165afa3d15615b9d573d90615b3f82611178565b91615b4d6040519384611136565b82523d6000602084013e5b80615b91575b615b6c575b50600090600090565b80602080615b7f935183010191016137e6565b60ff8111615b63579060ff6001921690565b50602081511015615b5e565b606090615b58565b906001600160a01b03821691821561537a57600080516020615e37833981519152549082820180921161090d57600092615c336020927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef94600080516020615e37833981519152556001600160a01b0316600052600080516020615e17833981519152602052604060002090565b818154019055604051908152a3565b60018111156111e657806001700100000000000000000000000000000000831015615d70575b615d16615d0c615d02615cf8615cee615ce4615cd3615d1d9760048a600160401b615d229c1015615d63575b640100000000811015615d56575b62010000811015615d49575b610100811015615d3c575b6010811015615d2f575b1015615d27575b60030260011c90565b615cdd818b614295565b0160011c90565b615cdd818a614295565b615cdd8189614295565b615cdd8188614295565b615cdd8187614295565b615cdd8186614295565b8093614295565b821190565b900390565b60011b615cca565b60041c9160021b91615cc3565b60081c9160041b91615cb9565b60101c9160081b91615cae565b60201c9160101b91615ca2565b60401c9160201b91615c94565b5050615d22615d1d615d16615d0c615d02615cf8615cee615ce4615cd3615d978a60801c90565b9850600160401b9750615c689650505050505050565b91905b838210615dbd5750505090565b9091928083169080841860011c820180921161090d578460005265ffffffffffff82602060002001541665ffffffffffff841610600014615e025750925b9190615db0565b9392506001810180911161090d5791615dfb56fe52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0052c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0202dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800cd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00a26469706673582212206bd28bc71fbf2c204a8c9a35a3a707e725421e4dd9eb3e8dc264737228dc791a64736f6c634300081c0033","name":"FirelightVault","is_blueprint":false,"license_type":"none","is_fully_verified":true,"is_verified_via_eth_bytecode_db":false,"language":"solidity","evm_version":"london","can_be_visualized_via_sol2uml":false,"is_verified_via_sourcify":false,"additional_sources":[{"file_path":"@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.20;\n\nimport {IAccessControl} from \"@openzeppelin/contracts/access/IAccessControl.sol\";\nimport {ContextUpgradeable} from \"../utils/ContextUpgradeable.sol\";\nimport {IERC165} from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport {ERC165Upgradeable} from \"../utils/introspection/ERC165Upgradeable.sol\";\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n *     require(hasRole(MY_ROLE, msg.sender));\n *     ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControl, ERC165Upgradeable {\n    struct RoleData {\n        mapping(address account => bool) hasRole;\n        bytes32 adminRole;\n    }\n\n    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n\n    /// @custom:storage-location erc7201:openzeppelin.storage.AccessControl\n    struct AccessControlStorage {\n        mapping(bytes32 role => RoleData) _roles;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.AccessControl\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant AccessControlStorageLocation = 0x02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800;\n\n    function _getAccessControlStorage() private pure returns (AccessControlStorage storage $) {\n        assembly {\n            $.slot := AccessControlStorageLocation\n        }\n    }\n\n    /**\n     * @dev Modifier that checks that an account has a specific role. Reverts\n     * with an {AccessControlUnauthorizedAccount} error including the required role.\n     */\n    modifier onlyRole(bytes32 role) {\n        _checkRole(role);\n        _;\n    }\n\n    function __AccessControl_init() internal onlyInitializing {\n    }\n\n    function __AccessControl_init_unchained() internal onlyInitializing {\n    }\n    /// @inheritdoc IERC165\n    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n    }\n\n    /**\n     * @dev Returns `true` if `account` has been granted `role`.\n     */\n    function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n        AccessControlStorage storage $ = _getAccessControlStorage();\n        return $._roles[role].hasRole[account];\n    }\n\n    /**\n     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n     * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n     */\n    function _checkRole(bytes32 role) internal view virtual {\n        _checkRole(role, _msgSender());\n    }\n\n    /**\n     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n     * is missing `role`.\n     */\n    function _checkRole(bytes32 role, address account) internal view virtual {\n        if (!hasRole(role, account)) {\n            revert AccessControlUnauthorizedAccount(account, role);\n        }\n    }\n\n    /**\n     * @dev Returns the admin role that controls `role`. See {grantRole} and\n     * {revokeRole}.\n     *\n     * To change a role's admin, use {_setRoleAdmin}.\n     */\n    function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n        AccessControlStorage storage $ = _getAccessControlStorage();\n        return $._roles[role].adminRole;\n    }\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * If `account` had not been already granted `role`, emits a {RoleGranted}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     *\n     * May emit a {RoleGranted} event.\n     */\n    function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n        _grantRole(role, account);\n    }\n\n    /**\n     * @dev Revokes `role` from `account`.\n     *\n     * If `account` had been granted `role`, emits a {RoleRevoked} event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     *\n     * May emit a {RoleRevoked} event.\n     */\n    function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n        _revokeRole(role, account);\n    }\n\n    /**\n     * @dev Revokes `role` from the calling account.\n     *\n     * Roles are often managed via {grantRole} and {revokeRole}: this function's\n     * purpose is to provide a mechanism for accounts to lose their privileges\n     * if they are compromised (such as when a trusted device is misplaced).\n     *\n     * If the calling account had been revoked `role`, emits a {RoleRevoked}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must be `callerConfirmation`.\n     *\n     * May emit a {RoleRevoked} event.\n     */\n    function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n        if (callerConfirmation != _msgSender()) {\n            revert AccessControlBadConfirmation();\n        }\n\n        _revokeRole(role, callerConfirmation);\n    }\n\n    /**\n     * @dev Sets `adminRole` as ``role``'s admin role.\n     *\n     * Emits a {RoleAdminChanged} event.\n     */\n    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n        AccessControlStorage storage $ = _getAccessControlStorage();\n        bytes32 previousAdminRole = getRoleAdmin(role);\n        $._roles[role].adminRole = adminRole;\n        emit RoleAdminChanged(role, previousAdminRole, adminRole);\n    }\n\n    /**\n     * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n     *\n     * Internal function without access restriction.\n     *\n     * May emit a {RoleGranted} event.\n     */\n    function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n        AccessControlStorage storage $ = _getAccessControlStorage();\n        if (!hasRole(role, account)) {\n            $._roles[role].hasRole[account] = true;\n            emit RoleGranted(role, account, _msgSender());\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * @dev Attempts to revoke `role` from `account` and returns a boolean indicating if `role` was revoked.\n     *\n     * Internal function without access restriction.\n     *\n     * May emit a {RoleRevoked} event.\n     */\n    function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n        AccessControlStorage storage $ = _getAccessControlStorage();\n        if (hasRole(role, account)) {\n            $._roles[role].hasRole[account] = false;\n            emit RoleRevoked(role, account, _msgSender());\n            return true;\n        } else {\n            return false;\n        }\n    }\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n *     function initialize() initializer public {\n *         __ERC20_init(\"MyToken\", \"MTK\");\n *     }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n *     function initializeV2() reinitializer(2) public {\n *         __ERC20Permit_init(\"MyToken\");\n *     }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n *     _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Storage of the initializable contract.\n     *\n     * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\n     * when using with upgradeable contracts.\n     *\n     * @custom:storage-location erc7201:openzeppelin.storage.Initializable\n     */\n    struct InitializableStorage {\n        /**\n         * @dev Indicates that the contract has been initialized.\n         */\n        uint64 _initialized;\n        /**\n         * @dev Indicates that the contract is in the process of being initialized.\n         */\n        bool _initializing;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Initializable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;\n\n    /**\n     * @dev The contract is already initialized.\n     */\n    error InvalidInitialization();\n\n    /**\n     * @dev The contract is not initializing.\n     */\n    error NotInitializing();\n\n    /**\n     * @dev Triggered when the contract has been initialized or reinitialized.\n     */\n    event Initialized(uint64 version);\n\n    /**\n     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n     * `onlyInitializing` functions can be used to initialize parent contracts.\n     *\n     * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any\n     * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in\n     * production.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier initializer() {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        // Cache values to avoid duplicated sloads\n        bool isTopLevelCall = !$._initializing;\n        uint64 initialized = $._initialized;\n\n        // Allowed calls:\n        // - initialSetup: the contract is not in the initializing state and no previous version was\n        //                 initialized\n        // - construction: the contract is initialized at version 1 (no reinitialization) and the\n        //                 current contract is just being deployed\n        bool initialSetup = initialized == 0 && isTopLevelCall;\n        bool construction = initialized == 1 && address(this).code.length == 0;\n\n        if (!initialSetup && !construction) {\n            revert InvalidInitialization();\n        }\n        $._initialized = 1;\n        if (isTopLevelCall) {\n            $._initializing = true;\n        }\n        _;\n        if (isTopLevelCall) {\n            $._initializing = false;\n            emit Initialized(1);\n        }\n    }\n\n    /**\n     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n     * used to initialize parent contracts.\n     *\n     * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n     * are added through upgrades and that require initialization.\n     *\n     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n     * cannot be nested. If one is invoked in the context of another, execution will revert.\n     *\n     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n     * a contract, executing them in the right order is up to the developer or operator.\n     *\n     * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier reinitializer(uint64 version) {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing || $._initialized >= version) {\n            revert InvalidInitialization();\n        }\n        $._initialized = version;\n        $._initializing = true;\n        _;\n        $._initializing = false;\n        emit Initialized(version);\n    }\n\n    /**\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n     * {initializer} and {reinitializer} modifiers, directly or indirectly.\n     */\n    modifier onlyInitializing() {\n        _checkInitializing();\n        _;\n    }\n\n    /**\n     * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\n     */\n    function _checkInitializing() internal view virtual {\n        if (!_isInitializing()) {\n            revert NotInitializing();\n        }\n    }\n\n    /**\n     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n     * through proxies.\n     *\n     * Emits an {Initialized} event the first time it is successfully executed.\n     */\n    function _disableInitializers() internal virtual {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing) {\n            revert InvalidInitialization();\n        }\n        if ($._initialized != type(uint64).max) {\n            $._initialized = type(uint64).max;\n            emit Initialized(type(uint64).max);\n        }\n    }\n\n    /**\n     * @dev Returns the highest version that has been initialized. See {reinitializer}.\n     */\n    function _getInitializedVersion() internal view returns (uint64) {\n        return _getInitializableStorage()._initialized;\n    }\n\n    /**\n     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n     */\n    function _isInitializing() internal view returns (bool) {\n        return _getInitializableStorage()._initializing;\n    }\n\n    /**\n     * @dev Pointer to storage slot. Allows integrators to override it with a custom storage location.\n     *\n     * NOTE: Consider following the ERC-7201 formula to derive storage locations.\n     */\n    function _initializableStorageSlot() internal pure virtual returns (bytes32) {\n        return INITIALIZABLE_STORAGE;\n    }\n\n    /**\n     * @dev Returns a pointer to the storage namespace.\n     */\n    // solhint-disable-next-line var-name-mixedcase\n    function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\n        bytes32 slot = _initializableStorageSlot();\n        assembly {\n            $.slot := slot\n        }\n    }\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {IERC20Metadata} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {ContextUpgradeable} from \"../../utils/ContextUpgradeable.sol\";\nimport {IERC20Errors} from \"@openzeppelin/contracts/interfaces/draft-IERC6093.sol\";\nimport {Initializable} from \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * The default value of {decimals} is 18. To change this, you should override\n * this function so it returns a different value.\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC-20\n * applications.\n */\nabstract contract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20, IERC20Metadata, IERC20Errors {\n    /// @custom:storage-location erc7201:openzeppelin.storage.ERC20\n    struct ERC20Storage {\n        mapping(address account => uint256) _balances;\n\n        mapping(address account => mapping(address spender => uint256)) _allowances;\n\n        uint256 _totalSupply;\n\n        string _name;\n        string _symbol;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.ERC20\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant ERC20StorageLocation = 0x52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00;\n\n    function _getERC20Storage() private pure returns (ERC20Storage storage $) {\n        assembly {\n            $.slot := ERC20StorageLocation\n        }\n    }\n\n    /**\n     * @dev Sets the values for {name} and {symbol}.\n     *\n     * Both values are immutable: they can only be set once during construction.\n     */\n    function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {\n        __ERC20_init_unchained(name_, symbol_);\n    }\n\n    function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {\n        ERC20Storage storage $ = _getERC20Storage();\n        $._name = name_;\n        $._symbol = symbol_;\n    }\n\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() public view virtual returns (string memory) {\n        ERC20Storage storage $ = _getERC20Storage();\n        return $._name;\n    }\n\n    /**\n     * @dev Returns the symbol of the token, usually a shorter version of the\n     * name.\n     */\n    function symbol() public view virtual returns (string memory) {\n        ERC20Storage storage $ = _getERC20Storage();\n        return $._symbol;\n    }\n\n    /**\n     * @dev Returns the number of decimals used to get its user representation.\n     * For example, if `decimals` equals `2`, a balance of `505` tokens should\n     * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n     *\n     * Tokens usually opt for a value of 18, imitating the relationship between\n     * Ether and Wei. This is the default value returned by this function, unless\n     * it's overridden.\n     *\n     * NOTE: This information is only used for _display_ purposes: it in\n     * no way affects any of the arithmetic of the contract, including\n     * {IERC20-balanceOf} and {IERC20-transfer}.\n     */\n    function decimals() public view virtual returns (uint8) {\n        return 18;\n    }\n\n    /// @inheritdoc IERC20\n    function totalSupply() public view virtual returns (uint256) {\n        ERC20Storage storage $ = _getERC20Storage();\n        return $._totalSupply;\n    }\n\n    /// @inheritdoc IERC20\n    function balanceOf(address account) public view virtual returns (uint256) {\n        ERC20Storage storage $ = _getERC20Storage();\n        return $._balances[account];\n    }\n\n    /**\n     * @dev See {IERC20-transfer}.\n     *\n     * Requirements:\n     *\n     * - `to` cannot be the zero address.\n     * - the caller must have a balance of at least `value`.\n     */\n    function transfer(address to, uint256 value) public virtual returns (bool) {\n        address owner = _msgSender();\n        _transfer(owner, to, value);\n        return true;\n    }\n\n    /// @inheritdoc IERC20\n    function allowance(address owner, address spender) public view virtual returns (uint256) {\n        ERC20Storage storage $ = _getERC20Storage();\n        return $._allowances[owner][spender];\n    }\n\n    /**\n     * @dev See {IERC20-approve}.\n     *\n     * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on\n     * `transferFrom`. This is semantically equivalent to an infinite approval.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     */\n    function approve(address spender, uint256 value) public virtual returns (bool) {\n        address owner = _msgSender();\n        _approve(owner, spender, value);\n        return true;\n    }\n\n    /**\n     * @dev See {IERC20-transferFrom}.\n     *\n     * Skips emitting an {Approval} event indicating an allowance update. This is not\n     * required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve].\n     *\n     * NOTE: Does not update the allowance if the current allowance\n     * is the maximum `uint256`.\n     *\n     * Requirements:\n     *\n     * - `from` and `to` cannot be the zero address.\n     * - `from` must have a balance of at least `value`.\n     * - the caller must have allowance for ``from``'s tokens of at least\n     * `value`.\n     */\n    function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {\n        address spender = _msgSender();\n        _spendAllowance(from, spender, value);\n        _transfer(from, to, value);\n        return true;\n    }\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to`.\n     *\n     * This internal function is equivalent to {transfer}, and can be used to\n     * e.g. implement automatic token fees, slashing mechanisms, etc.\n     *\n     * Emits a {Transfer} event.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead.\n     */\n    function _transfer(address from, address to, uint256 value) internal {\n        if (from == address(0)) {\n            revert ERC20InvalidSender(address(0));\n        }\n        if (to == address(0)) {\n            revert ERC20InvalidReceiver(address(0));\n        }\n        _update(from, to, value);\n    }\n\n    /**\n     * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`\n     * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding\n     * this function.\n     *\n     * Emits a {Transfer} event.\n     */\n    function _update(address from, address to, uint256 value) internal virtual {\n        ERC20Storage storage $ = _getERC20Storage();\n        if (from == address(0)) {\n            // Overflow check required: The rest of the code assumes that totalSupply never overflows\n            $._totalSupply += value;\n        } else {\n            uint256 fromBalance = $._balances[from];\n            if (fromBalance < value) {\n                revert ERC20InsufficientBalance(from, fromBalance, value);\n            }\n            unchecked {\n                // Overflow not possible: value <= fromBalance <= totalSupply.\n                $._balances[from] = fromBalance - value;\n            }\n        }\n\n        if (to == address(0)) {\n            unchecked {\n                // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.\n                $._totalSupply -= value;\n            }\n        } else {\n            unchecked {\n                // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.\n                $._balances[to] += value;\n            }\n        }\n\n        emit Transfer(from, to, value);\n    }\n\n    /**\n     * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).\n     * Relies on the `_update` mechanism\n     *\n     * Emits a {Transfer} event with `from` set to the zero address.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead.\n     */\n    function _mint(address account, uint256 value) internal {\n        if (account == address(0)) {\n            revert ERC20InvalidReceiver(address(0));\n        }\n        _update(address(0), account, value);\n    }\n\n    /**\n     * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.\n     * Relies on the `_update` mechanism.\n     *\n     * Emits a {Transfer} event with `to` set to the zero address.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead\n     */\n    function _burn(address account, uint256 value) internal {\n        if (account == address(0)) {\n            revert ERC20InvalidSender(address(0));\n        }\n        _update(account, address(0), value);\n    }\n\n    /**\n     * @dev Sets `value` as the allowance of `spender` over the `owner`'s tokens.\n     *\n     * This internal function is equivalent to `approve`, and can be used to\n     * e.g. set automatic allowances for certain subsystems, etc.\n     *\n     * Emits an {Approval} event.\n     *\n     * Requirements:\n     *\n     * - `owner` cannot be the zero address.\n     * - `spender` cannot be the zero address.\n     *\n     * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n     */\n    function _approve(address owner, address spender, uint256 value) internal {\n        _approve(owner, spender, value, true);\n    }\n\n    /**\n     * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.\n     *\n     * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by\n     * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any\n     * `Approval` event during `transferFrom` operations.\n     *\n     * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to\n     * true using the following override:\n     *\n     * ```solidity\n     * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {\n     *     super._approve(owner, spender, value, true);\n     * }\n     * ```\n     *\n     * Requirements are the same as {_approve}.\n     */\n    function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {\n        ERC20Storage storage $ = _getERC20Storage();\n        if (owner == address(0)) {\n            revert ERC20InvalidApprover(address(0));\n        }\n        if (spender == address(0)) {\n            revert ERC20InvalidSpender(address(0));\n        }\n        $._allowances[owner][spender] = value;\n        if (emitEvent) {\n            emit Approval(owner, spender, value);\n        }\n    }\n\n    /**\n     * @dev Updates `owner`'s allowance for `spender` based on spent `value`.\n     *\n     * Does not update the allowance value in case of infinite allowance.\n     * Revert if not enough allowance is available.\n     *\n     * Does not emit an {Approval} event.\n     */\n    function _spendAllowance(address owner, address spender, uint256 value) internal virtual {\n        uint256 currentAllowance = allowance(owner, spender);\n        if (currentAllowance < type(uint256).max) {\n            if (currentAllowance < value) {\n                revert ERC20InsufficientAllowance(spender, currentAllowance, value);\n            }\n            unchecked {\n                _approve(owner, spender, currentAllowance - value, false);\n            }\n        }\n    }\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC4626Upgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/extensions/ERC4626.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {IERC20Metadata} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {ERC20Upgradeable} from \"../ERC20Upgradeable.sol\";\nimport {SafeERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {IERC4626} from \"@openzeppelin/contracts/interfaces/IERC4626.sol\";\nimport {Math} from \"@openzeppelin/contracts/utils/math/Math.sol\";\nimport {Initializable} from \"../../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the ERC-4626 \"Tokenized Vault Standard\" as defined in\n * https://eips.ethereum.org/EIPS/eip-4626[ERC-4626].\n *\n * This extension allows the minting and burning of \"shares\" (represented using the ERC-20 inheritance) in exchange for\n * underlying \"assets\" through standardized {deposit}, {mint}, {redeem} and {burn} workflows. This contract extends\n * the ERC-20 standard. Any additional extensions included along it would affect the \"shares\" token represented by this\n * contract and not the \"assets\" token which is an independent contract.\n *\n * [CAUTION]\n * ====\n * In empty (or nearly empty) ERC-4626 vaults, deposits are at high risk of being stolen through frontrunning\n * with a \"donation\" to the vault that inflates the price of a share. This is variously known as a donation or inflation\n * attack and is essentially a problem of slippage. Vault deployers can protect against this attack by making an initial\n * deposit of a non-trivial amount of the asset, such that price manipulation becomes infeasible. Withdrawals may\n * similarly be affected by slippage. Users can protect against this attack as well as unexpected slippage in general by\n * verifying the amount received is as expected, using a wrapper that performs these checks such as\n * https://github.com/fei-protocol/ERC4626#erc4626router-and-base[ERC4626Router].\n *\n * Since v4.9, this implementation introduces configurable virtual assets and shares to help developers mitigate that risk.\n * The `_decimalsOffset()` corresponds to an offset in the decimal representation between the underlying asset's decimals\n * and the vault decimals. This offset also determines the rate of virtual shares to virtual assets in the vault, which\n * itself determines the initial exchange rate. While not fully preventing the attack, analysis shows that the default\n * offset (0) makes it non-profitable even if an attacker is able to capture value from multiple user deposits, as a result\n * of the value being captured by the virtual shares (out of the attacker's donation) matching the attacker's expected gains.\n * With a larger offset, the attack becomes orders of magnitude more expensive than it is profitable. More details about the\n * underlying math can be found xref:ROOT:erc4626.adoc#inflation-attack[here].\n *\n * The drawback of this approach is that the virtual shares do capture (a very small) part of the value being accrued\n * to the vault. Also, if the vault experiences losses, the users try to exit the vault, the virtual shares and assets\n * will cause the first user to exit to experience reduced losses in detriment to the last users that will experience\n * bigger losses. Developers willing to revert back to the pre-v4.9 behavior just need to override the\n * `_convertToShares` and `_convertToAssets` functions.\n *\n * To learn more, check out our xref:ROOT:erc4626.adoc[ERC-4626 guide].\n * ====\n */\nabstract contract ERC4626Upgradeable is Initializable, ERC20Upgradeable, IERC4626 {\n    using Math for uint256;\n\n    /// @custom:storage-location erc7201:openzeppelin.storage.ERC4626\n    struct ERC4626Storage {\n        IERC20 _asset;\n        uint8 _underlyingDecimals;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.ERC4626\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant ERC4626StorageLocation = 0x0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e00;\n\n    function _getERC4626Storage() private pure returns (ERC4626Storage storage $) {\n        assembly {\n            $.slot := ERC4626StorageLocation\n        }\n    }\n\n    /**\n     * @dev Attempted to deposit more assets than the max amount for `receiver`.\n     */\n    error ERC4626ExceededMaxDeposit(address receiver, uint256 assets, uint256 max);\n\n    /**\n     * @dev Attempted to mint more shares than the max amount for `receiver`.\n     */\n    error ERC4626ExceededMaxMint(address receiver, uint256 shares, uint256 max);\n\n    /**\n     * @dev Attempted to withdraw more assets than the max amount for `receiver`.\n     */\n    error ERC4626ExceededMaxWithdraw(address owner, uint256 assets, uint256 max);\n\n    /**\n     * @dev Attempted to redeem more shares than the max amount for `receiver`.\n     */\n    error ERC4626ExceededMaxRedeem(address owner, uint256 shares, uint256 max);\n\n    /**\n     * @dev Set the underlying asset contract. This must be an ERC20-compatible contract (ERC-20 or ERC-777).\n     */\n    function __ERC4626_init(IERC20 asset_) internal onlyInitializing {\n        __ERC4626_init_unchained(asset_);\n    }\n\n    function __ERC4626_init_unchained(IERC20 asset_) internal onlyInitializing {\n        ERC4626Storage storage $ = _getERC4626Storage();\n        (bool success, uint8 assetDecimals) = _tryGetAssetDecimals(asset_);\n        $._underlyingDecimals = success ? assetDecimals : 18;\n        $._asset = asset_;\n    }\n\n    /**\n     * @dev Attempts to fetch the asset decimals. A return value of false indicates that the attempt failed in some way.\n     */\n    function _tryGetAssetDecimals(IERC20 asset_) private view returns (bool ok, uint8 assetDecimals) {\n        (bool success, bytes memory encodedDecimals) = address(asset_).staticcall(\n            abi.encodeCall(IERC20Metadata.decimals, ())\n        );\n        if (success && encodedDecimals.length >= 32) {\n            uint256 returnedDecimals = abi.decode(encodedDecimals, (uint256));\n            if (returnedDecimals <= type(uint8).max) {\n                return (true, uint8(returnedDecimals));\n            }\n        }\n        return (false, 0);\n    }\n\n    /**\n     * @dev Decimals are computed by adding the decimal offset on top of the underlying asset's decimals. This\n     * \"original\" value is cached during construction of the vault contract. If this read operation fails (e.g., the\n     * asset has not been created yet), a default of 18 is used to represent the underlying asset's decimals.\n     *\n     * See {IERC20Metadata-decimals}.\n     */\n    function decimals() public view virtual override(IERC20Metadata, ERC20Upgradeable) returns (uint8) {\n        ERC4626Storage storage $ = _getERC4626Storage();\n        return $._underlyingDecimals + _decimalsOffset();\n    }\n\n    /// @inheritdoc IERC4626\n    function asset() public view virtual returns (address) {\n        ERC4626Storage storage $ = _getERC4626Storage();\n        return address($._asset);\n    }\n\n    /// @inheritdoc IERC4626\n    function totalAssets() public view virtual returns (uint256) {\n        return IERC20(asset()).balanceOf(address(this));\n    }\n\n    /// @inheritdoc IERC4626\n    function convertToShares(uint256 assets) public view virtual returns (uint256) {\n        return _convertToShares(assets, Math.Rounding.Floor);\n    }\n\n    /// @inheritdoc IERC4626\n    function convertToAssets(uint256 shares) public view virtual returns (uint256) {\n        return _convertToAssets(shares, Math.Rounding.Floor);\n    }\n\n    /// @inheritdoc IERC4626\n    function maxDeposit(address) public view virtual returns (uint256) {\n        return type(uint256).max;\n    }\n\n    /// @inheritdoc IERC4626\n    function maxMint(address) public view virtual returns (uint256) {\n        return type(uint256).max;\n    }\n\n    /// @inheritdoc IERC4626\n    function maxWithdraw(address owner) public view virtual returns (uint256) {\n        return _convertToAssets(balanceOf(owner), Math.Rounding.Floor);\n    }\n\n    /// @inheritdoc IERC4626\n    function maxRedeem(address owner) public view virtual returns (uint256) {\n        return balanceOf(owner);\n    }\n\n    /// @inheritdoc IERC4626\n    function previewDeposit(uint256 assets) public view virtual returns (uint256) {\n        return _convertToShares(assets, Math.Rounding.Floor);\n    }\n\n    /// @inheritdoc IERC4626\n    function previewMint(uint256 shares) public view virtual returns (uint256) {\n        return _convertToAssets(shares, Math.Rounding.Ceil);\n    }\n\n    /// @inheritdoc IERC4626\n    function previewWithdraw(uint256 assets) public view virtual returns (uint256) {\n        return _convertToShares(assets, Math.Rounding.Ceil);\n    }\n\n    /// @inheritdoc IERC4626\n    function previewRedeem(uint256 shares) public view virtual returns (uint256) {\n        return _convertToAssets(shares, Math.Rounding.Floor);\n    }\n\n    /// @inheritdoc IERC4626\n    function deposit(uint256 assets, address receiver) public virtual returns (uint256) {\n        uint256 maxAssets = maxDeposit(receiver);\n        if (assets > maxAssets) {\n            revert ERC4626ExceededMaxDeposit(receiver, assets, maxAssets);\n        }\n\n        uint256 shares = previewDeposit(assets);\n        _deposit(_msgSender(), receiver, assets, shares);\n\n        return shares;\n    }\n\n    /// @inheritdoc IERC4626\n    function mint(uint256 shares, address receiver) public virtual returns (uint256) {\n        uint256 maxShares = maxMint(receiver);\n        if (shares > maxShares) {\n            revert ERC4626ExceededMaxMint(receiver, shares, maxShares);\n        }\n\n        uint256 assets = previewMint(shares);\n        _deposit(_msgSender(), receiver, assets, shares);\n\n        return assets;\n    }\n\n    /// @inheritdoc IERC4626\n    function withdraw(uint256 assets, address receiver, address owner) public virtual returns (uint256) {\n        uint256 maxAssets = maxWithdraw(owner);\n        if (assets > maxAssets) {\n            revert ERC4626ExceededMaxWithdraw(owner, assets, maxAssets);\n        }\n\n        uint256 shares = previewWithdraw(assets);\n        _withdraw(_msgSender(), receiver, owner, assets, shares);\n\n        return shares;\n    }\n\n    /// @inheritdoc IERC4626\n    function redeem(uint256 shares, address receiver, address owner) public virtual returns (uint256) {\n        uint256 maxShares = maxRedeem(owner);\n        if (shares > maxShares) {\n            revert ERC4626ExceededMaxRedeem(owner, shares, maxShares);\n        }\n\n        uint256 assets = previewRedeem(shares);\n        _withdraw(_msgSender(), receiver, owner, assets, shares);\n\n        return assets;\n    }\n\n    /**\n     * @dev Internal conversion function (from assets to shares) with support for rounding direction.\n     */\n    function _convertToShares(uint256 assets, Math.Rounding rounding) internal view virtual returns (uint256) {\n        return assets.mulDiv(totalSupply() + 10 ** _decimalsOffset(), totalAssets() + 1, rounding);\n    }\n\n    /**\n     * @dev Internal conversion function (from shares to assets) with support for rounding direction.\n     */\n    function _convertToAssets(uint256 shares, Math.Rounding rounding) internal view virtual returns (uint256) {\n        return shares.mulDiv(totalAssets() + 1, totalSupply() + 10 ** _decimalsOffset(), rounding);\n    }\n\n    /**\n     * @dev Deposit/mint common workflow.\n     */\n    function _deposit(address caller, address receiver, uint256 assets, uint256 shares) internal virtual {\n        // If asset() is ERC-777, `transferFrom` can trigger a reentrancy BEFORE the transfer happens through the\n        // `tokensToSend` hook. On the other hand, the `tokenReceived` hook, that is triggered after the transfer,\n        // calls the vault, which is assumed not malicious.\n        //\n        // Conclusion: we need to do the transfer before we mint so that any reentrancy would happen before the\n        // assets are transferred and before the shares are minted, which is a valid state.\n        // slither-disable-next-line reentrancy-no-eth\n        SafeERC20.safeTransferFrom(IERC20(asset()), caller, address(this), assets);\n        _mint(receiver, shares);\n\n        emit Deposit(caller, receiver, assets, shares);\n    }\n\n    /**\n     * @dev Withdraw/redeem common workflow.\n     */\n    function _withdraw(\n        address caller,\n        address receiver,\n        address owner,\n        uint256 assets,\n        uint256 shares\n    ) internal virtual {\n        if (caller != owner) {\n            _spendAllowance(owner, caller, shares);\n        }\n\n        // If asset() is ERC-777, `transfer` can trigger a reentrancy AFTER the transfer happens through the\n        // `tokensReceived` hook. On the other hand, the `tokensToSend` hook, that is triggered before the transfer,\n        // calls the vault, which is assumed not malicious.\n        //\n        // Conclusion: we need to do the transfer after the burn so that any reentrancy would happen after the\n        // shares are burned and after the assets are transferred, which is a valid state.\n        _burn(owner, shares);\n        SafeERC20.safeTransfer(IERC20(asset()), receiver, assets);\n\n        emit Withdraw(caller, receiver, owner, assets, shares);\n    }\n\n    function _decimalsOffset() internal view virtual returns (uint8) {\n        return 0;\n    }\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n    function __Context_init() internal onlyInitializing {\n    }\n\n    function __Context_init_unchained() internal onlyInitializing {\n    }\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    function _contextSuffixLength() internal view virtual returns (uint256) {\n        return 0;\n    }\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/Pausable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ContextUpgradeable} from \"../utils/ContextUpgradeable.sol\";\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\n    /// @custom:storage-location erc7201:openzeppelin.storage.Pausable\n    struct PausableStorage {\n        bool _paused;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Pausable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant PausableStorageLocation = 0xcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300;\n\n    function _getPausableStorage() private pure returns (PausableStorage storage $) {\n        assembly {\n            $.slot := PausableStorageLocation\n        }\n    }\n\n    /**\n     * @dev Emitted when the pause is triggered by `account`.\n     */\n    event Paused(address account);\n\n    /**\n     * @dev Emitted when the pause is lifted by `account`.\n     */\n    event Unpaused(address account);\n\n    /**\n     * @dev The operation failed because the contract is paused.\n     */\n    error EnforcedPause();\n\n    /**\n     * @dev The operation failed because the contract is not paused.\n     */\n    error ExpectedPause();\n\n    /**\n     * @dev Modifier to make a function callable only when the contract is not paused.\n     *\n     * Requirements:\n     *\n     * - The contract must not be paused.\n     */\n    modifier whenNotPaused() {\n        _requireNotPaused();\n        _;\n    }\n\n    /**\n     * @dev Modifier to make a function callable only when the contract is paused.\n     *\n     * Requirements:\n     *\n     * - The contract must be paused.\n     */\n    modifier whenPaused() {\n        _requirePaused();\n        _;\n    }\n\n    function __Pausable_init() internal onlyInitializing {\n    }\n\n    function __Pausable_init_unchained() internal onlyInitializing {\n    }\n    /**\n     * @dev Returns true if the contract is paused, and false otherwise.\n     */\n    function paused() public view virtual returns (bool) {\n        PausableStorage storage $ = _getPausableStorage();\n        return $._paused;\n    }\n\n    /**\n     * @dev Throws if the contract is paused.\n     */\n    function _requireNotPaused() internal view virtual {\n        if (paused()) {\n            revert EnforcedPause();\n        }\n    }\n\n    /**\n     * @dev Throws if the contract is not paused.\n     */\n    function _requirePaused() internal view virtual {\n        if (!paused()) {\n            revert ExpectedPause();\n        }\n    }\n\n    /**\n     * @dev Triggers stopped state.\n     *\n     * Requirements:\n     *\n     * - The contract must not be paused.\n     */\n    function _pause() internal virtual whenNotPaused {\n        PausableStorage storage $ = _getPausableStorage();\n        $._paused = true;\n        emit Paused(_msgSender());\n    }\n\n    /**\n     * @dev Returns to normal state.\n     *\n     * Requirements:\n     *\n     * - The contract must be paused.\n     */\n    function _unpause() internal virtual whenPaused {\n        PausableStorage storage $ = _getPausableStorage();\n        $._paused = false;\n        emit Unpaused(_msgSender());\n    }\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol)\n\npragma solidity ^0.8.20;\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,\n * consider using {ReentrancyGuardTransient} instead.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n    // Booleans are more expensive than uint256 or any type that takes up a full\n    // word because each write operation emits an extra SLOAD to first read the\n    // slot's contents, replace the bits taken up by the boolean, and then write\n    // back. This is the compiler's defense against contract upgrades and\n    // pointer aliasing, and it cannot be disabled.\n\n    // The values being non-zero value makes deployment a bit more expensive,\n    // but in exchange the refund on every call to nonReentrant will be lower in\n    // amount. Since refunds are capped to a percentage of the total\n    // transaction's gas, it is best to keep them low in cases like this one, to\n    // increase the likelihood of the full refund coming into effect.\n    uint256 private constant NOT_ENTERED = 1;\n    uint256 private constant ENTERED = 2;\n\n    /// @custom:storage-location erc7201:openzeppelin.storage.ReentrancyGuard\n    struct ReentrancyGuardStorage {\n        uint256 _status;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.ReentrancyGuard\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant ReentrancyGuardStorageLocation = 0x9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00;\n\n    function _getReentrancyGuardStorage() private pure returns (ReentrancyGuardStorage storage $) {\n        assembly {\n            $.slot := ReentrancyGuardStorageLocation\n        }\n    }\n\n    /**\n     * @dev Unauthorized reentrant call.\n     */\n    error ReentrancyGuardReentrantCall();\n\n    function __ReentrancyGuard_init() internal onlyInitializing {\n        __ReentrancyGuard_init_unchained();\n    }\n\n    function __ReentrancyGuard_init_unchained() internal onlyInitializing {\n        ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();\n        $._status = NOT_ENTERED;\n    }\n\n    /**\n     * @dev Prevents a contract from calling itself, directly or indirectly.\n     * Calling a `nonReentrant` function from another `nonReentrant`\n     * function is not supported. It is possible to prevent this from happening\n     * by making the `nonReentrant` function external, and making it call a\n     * `private` function that does the actual work.\n     */\n    modifier nonReentrant() {\n        _nonReentrantBefore();\n        _;\n        _nonReentrantAfter();\n    }\n\n    function _nonReentrantBefore() private {\n        ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();\n        // On the first call to nonReentrant, _status will be NOT_ENTERED\n        if ($._status == ENTERED) {\n            revert ReentrancyGuardReentrantCall();\n        }\n\n        // Any calls to nonReentrant after this point will fail\n        $._status = ENTERED;\n    }\n\n    function _nonReentrantAfter() private {\n        ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();\n        // By storing the original value once again, a refund is triggered (see\n        // https://eips.ethereum.org/EIPS/eip-2200)\n        $._status = NOT_ENTERED;\n    }\n\n    /**\n     * @dev Returns true if the reentrancy guard is currently set to \"entered\", which indicates there is a\n     * `nonReentrant` function in the call stack.\n     */\n    function _reentrancyGuardEntered() internal view returns (bool) {\n        ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();\n        return $._status == ENTERED;\n    }\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport {Initializable} from \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165Upgradeable is Initializable, IERC165 {\n    function __ERC165_init() internal onlyInitializing {\n    }\n\n    function __ERC165_init_unchained() internal onlyInitializing {\n    }\n    /// @inheritdoc IERC165\n    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n        return interfaceId == type(IERC165).interfaceId;\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/access/IAccessControl.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (access/IAccessControl.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev External interface of AccessControl declared to support ERC-165 detection.\n */\ninterface IAccessControl {\n    /**\n     * @dev The `account` is missing a role.\n     */\n    error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n    /**\n     * @dev The caller of a function is not the expected one.\n     *\n     * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n     */\n    error AccessControlBadConfirmation();\n\n    /**\n     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n     *\n     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n     * {RoleAdminChanged} not being emitted signaling this.\n     */\n    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n    /**\n     * @dev Emitted when `account` is granted `role`.\n     *\n     * `sender` is the account that originated the contract call. This account bears the admin role (for the granted role).\n     * Expected in cases where the role was granted using the internal {AccessControl-_grantRole}.\n     */\n    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n    /**\n     * @dev Emitted when `account` is revoked `role`.\n     *\n     * `sender` is the account that originated the contract call:\n     *   - if using `revokeRole`, it is the admin role bearer\n     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)\n     */\n    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n    /**\n     * @dev Returns `true` if `account` has been granted `role`.\n     */\n    function hasRole(bytes32 role, address account) external view returns (bool);\n\n    /**\n     * @dev Returns the admin role that controls `role`. See {grantRole} and\n     * {revokeRole}.\n     *\n     * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n     */\n    function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * If `account` had not been already granted `role`, emits a {RoleGranted}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     */\n    function grantRole(bytes32 role, address account) external;\n\n    /**\n     * @dev Revokes `role` from `account`.\n     *\n     * If `account` had been granted `role`, emits a {RoleRevoked} event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     */\n    function revokeRole(bytes32 role, address account) external;\n\n    /**\n     * @dev Revokes `role` from the calling account.\n     *\n     * Roles are often managed via {grantRole} and {revokeRole}: this function's\n     * purpose is to provide a mechanism for accounts to lose their privileges\n     * if they are compromised (such as when a trusted device is misplaced).\n     *\n     * If the calling account had been granted `role`, emits a {RoleRevoked}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must be `callerConfirmation`.\n     */\n    function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n"},{"file_path":"@openzeppelin/contracts/interfaces/IERC1363.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"./IERC20.sol\";\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @title IERC1363\n * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].\n *\n * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract\n * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.\n */\ninterface IERC1363 is IERC20, IERC165 {\n    /*\n     * Note: the ERC-165 identifier for this interface is 0xb0202a11.\n     * 0xb0202a11 ===\n     *   bytes4(keccak256('transferAndCall(address,uint256)')) ^\n     *   bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^\n     *   bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^\n     *   bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^\n     *   bytes4(keccak256('approveAndCall(address,uint256)')) ^\n     *   bytes4(keccak256('approveAndCall(address,uint256,bytes)'))\n     */\n\n    /**\n     * @dev Moves a `value` amount of tokens from the caller's account to `to`\n     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\n     * @param to The address which you want to transfer to.\n     * @param value The amount of tokens to be transferred.\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\n     */\n    function transferAndCall(address to, uint256 value) external returns (bool);\n\n    /**\n     * @dev Moves a `value` amount of tokens from the caller's account to `to`\n     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\n     * @param to The address which you want to transfer to.\n     * @param value The amount of tokens to be transferred.\n     * @param data Additional data with no specified format, sent in call to `to`.\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\n     */\n    function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism\n     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\n     * @param from The address which you want to send tokens from.\n     * @param to The address which you want to transfer to.\n     * @param value The amount of tokens to be transferred.\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\n     */\n    function transferFromAndCall(address from, address to, uint256 value) external returns (bool);\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism\n     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\n     * @param from The address which you want to send tokens from.\n     * @param to The address which you want to transfer to.\n     * @param value The amount of tokens to be transferred.\n     * @param data Additional data with no specified format, sent in call to `to`.\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\n     */\n    function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);\n\n    /**\n     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.\n     * @param spender The address which will spend the funds.\n     * @param value The amount of tokens to be spent.\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\n     */\n    function approveAndCall(address spender, uint256 value) external returns (bool);\n\n    /**\n     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.\n     * @param spender The address which will spend the funds.\n     * @param value The amount of tokens to be spent.\n     * @param data Additional data with no specified format, sent in call to `spender`.\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\n     */\n    function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);\n}\n"},{"file_path":"@openzeppelin/contracts/interfaces/IERC165.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../utils/introspection/IERC165.sol\";\n"},{"file_path":"@openzeppelin/contracts/interfaces/IERC20.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../token/ERC20/IERC20.sol\";\n"},{"file_path":"@openzeppelin/contracts/interfaces/IERC4626.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC4626.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../token/ERC20/IERC20.sol\";\nimport {IERC20Metadata} from \"../token/ERC20/extensions/IERC20Metadata.sol\";\n\n/**\n * @dev Interface of the ERC-4626 \"Tokenized Vault Standard\", as defined in\n * https://eips.ethereum.org/EIPS/eip-4626[ERC-4626].\n */\ninterface IERC4626 is IERC20, IERC20Metadata {\n    event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares);\n\n    event Withdraw(\n        address indexed sender,\n        address indexed receiver,\n        address indexed owner,\n        uint256 assets,\n        uint256 shares\n    );\n\n    /**\n     * @dev Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing.\n     *\n     * - MUST be an ERC-20 token contract.\n     * - MUST NOT revert.\n     */\n    function asset() external view returns (address assetTokenAddress);\n\n    /**\n     * @dev Returns the total amount of the underlying asset that is “managed” by Vault.\n     *\n     * - SHOULD include any compounding that occurs from yield.\n     * - MUST be inclusive of any fees that are charged against assets in the Vault.\n     * - MUST NOT revert.\n     */\n    function totalAssets() external view returns (uint256 totalManagedAssets);\n\n    /**\n     * @dev Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal\n     * scenario where all the conditions are met.\n     *\n     * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.\n     * - MUST NOT show any variations depending on the caller.\n     * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.\n     * - MUST NOT revert.\n     *\n     * NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the\n     * “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and\n     * from.\n     */\n    function convertToShares(uint256 assets) external view returns (uint256 shares);\n\n    /**\n     * @dev Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal\n     * scenario where all the conditions are met.\n     *\n     * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.\n     * - MUST NOT show any variations depending on the caller.\n     * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.\n     * - MUST NOT revert.\n     *\n     * NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the\n     * “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and\n     * from.\n     */\n    function convertToAssets(uint256 shares) external view returns (uint256 assets);\n\n    /**\n     * @dev Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver,\n     * through a deposit call.\n     *\n     * - MUST return a limited value if receiver is subject to some deposit limit.\n     * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited.\n     * - MUST NOT revert.\n     */\n    function maxDeposit(address receiver) external view returns (uint256 maxAssets);\n\n    /**\n     * @dev Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given\n     * current on-chain conditions.\n     *\n     * - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit\n     *   call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called\n     *   in the same transaction.\n     * - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the\n     *   deposit would be accepted, regardless if the user has enough tokens approved, etc.\n     * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.\n     * - MUST NOT revert.\n     *\n     * NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in\n     * share price or some other type of condition, meaning the depositor will lose assets by depositing.\n     */\n    function previewDeposit(uint256 assets) external view returns (uint256 shares);\n\n    /**\n     * @dev Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens.\n     *\n     * - MUST emit the Deposit event.\n     * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\n     *   deposit execution, and are accounted for during deposit.\n     * - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not\n     *   approving enough underlying tokens to the Vault contract, etc).\n     *\n     * NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.\n     */\n    function deposit(uint256 assets, address receiver) external returns (uint256 shares);\n\n    /**\n     * @dev Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call.\n     * - MUST return a limited value if receiver is subject to some mint limit.\n     * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted.\n     * - MUST NOT revert.\n     */\n    function maxMint(address receiver) external view returns (uint256 maxShares);\n\n    /**\n     * @dev Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given\n     * current on-chain conditions.\n     *\n     * - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call\n     *   in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the\n     *   same transaction.\n     * - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint\n     *   would be accepted, regardless if the user has enough tokens approved, etc.\n     * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.\n     * - MUST NOT revert.\n     *\n     * NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in\n     * share price or some other type of condition, meaning the depositor will lose assets by minting.\n     */\n    function previewMint(uint256 shares) external view returns (uint256 assets);\n\n    /**\n     * @dev Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens.\n     *\n     * - MUST emit the Deposit event.\n     * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint\n     *   execution, and are accounted for during mint.\n     * - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not\n     *   approving enough underlying tokens to the Vault contract, etc).\n     *\n     * NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.\n     */\n    function mint(uint256 shares, address receiver) external returns (uint256 assets);\n\n    /**\n     * @dev Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the\n     * Vault, through a withdraw call.\n     *\n     * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.\n     * - MUST NOT revert.\n     */\n    function maxWithdraw(address owner) external view returns (uint256 maxAssets);\n\n    /**\n     * @dev Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block,\n     * given current on-chain conditions.\n     *\n     * - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw\n     *   call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if\n     *   called\n     *   in the same transaction.\n     * - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though\n     *   the withdrawal would be accepted, regardless if the user has enough shares, etc.\n     * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.\n     * - MUST NOT revert.\n     *\n     * NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in\n     * share price or some other type of condition, meaning the depositor will lose assets by depositing.\n     */\n    function previewWithdraw(uint256 assets) external view returns (uint256 shares);\n\n    /**\n     * @dev Burns shares from owner and sends exactly assets of underlying tokens to receiver.\n     *\n     * - MUST emit the Withdraw event.\n     * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\n     *   withdraw execution, and are accounted for during withdraw.\n     * - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner\n     *   not having enough shares, etc).\n     *\n     * Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed.\n     * Those methods should be performed separately.\n     */\n    function withdraw(uint256 assets, address receiver, address owner) external returns (uint256 shares);\n\n    /**\n     * @dev Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault,\n     * through a redeem call.\n     *\n     * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.\n     * - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock.\n     * - MUST NOT revert.\n     */\n    function maxRedeem(address owner) external view returns (uint256 maxShares);\n\n    /**\n     * @dev Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block,\n     * given current on-chain conditions.\n     *\n     * - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call\n     *   in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the\n     *   same transaction.\n     * - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the\n     *   redemption would be accepted, regardless if the user has enough shares, etc.\n     * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.\n     * - MUST NOT revert.\n     *\n     * NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in\n     * share price or some other type of condition, meaning the depositor will lose assets by redeeming.\n     */\n    function previewRedeem(uint256 shares) external view returns (uint256 assets);\n\n    /**\n     * @dev Burns exactly shares from owner and sends assets of underlying tokens to receiver.\n     *\n     * - MUST emit the Withdraw event.\n     * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\n     *   redeem execution, and are accounted for during redeem.\n     * - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner\n     *   not having enough shares, etc).\n     *\n     * NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed.\n     * Those methods should be performed separately.\n     */\n    function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets);\n}\n"},{"file_path":"@openzeppelin/contracts/interfaces/draft-IERC6093.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard ERC-20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.\n */\ninterface IERC20Errors {\n    /**\n     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param balance Current balance for the interacting account.\n     * @param needed Minimum amount required to perform a transfer.\n     */\n    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC20InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC20InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n     * @param spender Address that may be allowed to operate on tokens without being their owner.\n     * @param allowance Amount of tokens a `spender` is allowed to operate with.\n     * @param needed Minimum amount required to perform a transfer.\n     */\n    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC20InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n     * @param spender Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC20InvalidSpender(address spender);\n}\n\n/**\n * @dev Standard ERC-721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.\n */\ninterface IERC721Errors {\n    /**\n     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.\n     * Used in balance queries.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC721InvalidOwner(address owner);\n\n    /**\n     * @dev Indicates a `tokenId` whose `owner` is the zero address.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC721NonexistentToken(uint256 tokenId);\n\n    /**\n     * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param tokenId Identifier number of a token.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC721InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC721InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC721InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC721InvalidOperator(address operator);\n}\n\n/**\n * @dev Standard ERC-1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.\n */\ninterface IERC1155Errors {\n    /**\n     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param balance Current balance for the interacting account.\n     * @param needed Minimum amount required to perform a transfer.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC1155InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC1155InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC1155MissingApprovalForAll(address operator, address owner);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC1155InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC1155InvalidOperator(address operator);\n\n    /**\n     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n     * Used in batch transfers.\n     * @param idsLength Length of the array of token identifiers\n     * @param valuesLength Length of the array of token amounts\n     */\n    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n"},{"file_path":"@openzeppelin/contracts/token/ERC20/IERC20.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC-20 standard as defined in the ERC.\n */\ninterface IERC20 {\n    /**\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\n     * another (`to`).\n     *\n     * Note that `value` may be zero.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /**\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n     * a call to {approve}. `value` is the new allowance.\n     */\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n\n    /**\n     * @dev Returns the value of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the value of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transfer(address to, uint256 value) external returns (bool);\n\n    /**\n     * @dev Returns the remaining number of tokens that `spender` will be\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\n     * zero by default.\n     *\n     * This value changes when {approve} or {transferFrom} are called.\n     */\n    function allowance(address owner, address spender) external view returns (uint256);\n\n    /**\n     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n     * caller's tokens.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\n     * that someone may use both the old and the new allowance by unfortunate\n     * transaction ordering. One possible solution to mitigate this race\n     * condition is to first reduce the spender's allowance to 0 and set the\n     * desired value afterwards:\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address spender, uint256 value) external returns (bool);\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to` using the\n     * allowance mechanism. `value` is then deducted from the caller's\n     * allowance.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n"},{"file_path":"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC-20 standard.\n */\ninterface IERC20Metadata is IERC20 {\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() external view returns (string memory);\n\n    /**\n     * @dev Returns the symbol of the token.\n     */\n    function symbol() external view returns (string memory);\n\n    /**\n     * @dev Returns the decimals places of the token.\n     */\n    function decimals() external view returns (uint8);\n}\n"},{"file_path":"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.2.0) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../IERC20.sol\";\nimport {IERC1363} from \"../../../interfaces/IERC1363.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC-20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n    /**\n     * @dev An operation with an ERC-20 token failed.\n     */\n    error SafeERC20FailedOperation(address token);\n\n    /**\n     * @dev Indicates a failed `decreaseAllowance` request.\n     */\n    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\n\n    /**\n     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     */\n    function safeTransfer(IERC20 token, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\n    }\n\n    /**\n     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n     */\n    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n    }\n\n    /**\n     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     *\n     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the \"client\"\n     * smart contract uses ERC-7674 to set temporary allowances, then the \"client\" smart contract should avoid using\n     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract\n     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.\n     */\n    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n        uint256 oldAllowance = token.allowance(address(this), spender);\n        forceApprove(token, spender, oldAllowance + value);\n    }\n\n    /**\n     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\n     * value, non-reverting calls are assumed to be successful.\n     *\n     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the \"client\"\n     * smart contract uses ERC-7674 to set temporary allowances, then the \"client\" smart contract should avoid using\n     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract\n     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.\n     */\n    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\n        unchecked {\n            uint256 currentAllowance = token.allowance(address(this), spender);\n            if (currentAllowance < requestedDecrease) {\n                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\n            }\n            forceApprove(token, spender, currentAllowance - requestedDecrease);\n        }\n    }\n\n    /**\n     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n     * to be set to zero before setting it to a non-zero value, such as USDT.\n     *\n     * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function\n     * only sets the \"standard\" allowance. Any temporary allowance will remain active, in addition to the value being\n     * set here.\n     */\n    function forceApprove(IERC20 token, address spender, uint256 value) internal {\n        bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\n\n        if (!_callOptionalReturnBool(token, approvalCall)) {\n            _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\n            _callOptionalReturn(token, approvalCall);\n        }\n    }\n\n    /**\n     * @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no\n     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\n     * targeting contracts.\n     *\n     * Reverts if the returned value is other than `true`.\n     */\n    function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {\n        if (to.code.length == 0) {\n            safeTransfer(token, to, value);\n        } else if (!token.transferAndCall(to, value, data)) {\n            revert SafeERC20FailedOperation(address(token));\n        }\n    }\n\n    /**\n     * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target\n     * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\n     * targeting contracts.\n     *\n     * Reverts if the returned value is other than `true`.\n     */\n    function transferFromAndCallRelaxed(\n        IERC1363 token,\n        address from,\n        address to,\n        uint256 value,\n        bytes memory data\n    ) internal {\n        if (to.code.length == 0) {\n            safeTransferFrom(token, from, to, value);\n        } else if (!token.transferFromAndCall(from, to, value, data)) {\n            revert SafeERC20FailedOperation(address(token));\n        }\n    }\n\n    /**\n     * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no\n     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\n     * targeting contracts.\n     *\n     * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.\n     * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}\n     * once without retrying, and relies on the returned value to be true.\n     *\n     * Reverts if the returned value is other than `true`.\n     */\n    function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {\n        if (to.code.length == 0) {\n            forceApprove(token, to, value);\n        } else if (!token.approveAndCall(to, value, data)) {\n            revert SafeERC20FailedOperation(address(token));\n        }\n    }\n\n    /**\n     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n     * on the return value: the return value is optional (but if data is returned, it must not be false).\n     * @param token The token targeted by the call.\n     * @param data The call data (encoded using abi.encode or one of its variants).\n     *\n     * This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.\n     */\n    function _callOptionalReturn(IERC20 token, bytes memory data) private {\n        uint256 returnSize;\n        uint256 returnValue;\n        assembly (\"memory-safe\") {\n            let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)\n            // bubble errors\n            if iszero(success) {\n                let ptr := mload(0x40)\n                returndatacopy(ptr, 0, returndatasize())\n                revert(ptr, returndatasize())\n            }\n            returnSize := returndatasize()\n            returnValue := mload(0)\n        }\n\n        if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {\n            revert SafeERC20FailedOperation(address(token));\n        }\n    }\n\n    /**\n     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n     * on the return value: the return value is optional (but if data is returned, it must not be false).\n     * @param token The token targeted by the call.\n     * @param data The call data (encoded using abi.encode or one of its variants).\n     *\n     * This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.\n     */\n    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n        bool success;\n        uint256 returnSize;\n        uint256 returnValue;\n        assembly (\"memory-safe\") {\n            success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)\n            returnSize := returndatasize()\n            returnValue := mload(0)\n        }\n        return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/utils/Panic.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Helper library for emitting standardized panic codes.\n *\n * ```solidity\n * contract Example {\n *      using Panic for uint256;\n *\n *      // Use any of the declared internal constants\n *      function foo() { Panic.GENERIC.panic(); }\n *\n *      // Alternatively\n *      function foo() { Panic.panic(Panic.GENERIC); }\n * }\n * ```\n *\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\n *\n * _Available since v5.1._\n */\n// slither-disable-next-line unused-state\nlibrary Panic {\n    /// @dev generic / unspecified error\n    uint256 internal constant GENERIC = 0x00;\n    /// @dev used by the assert() builtin\n    uint256 internal constant ASSERT = 0x01;\n    /// @dev arithmetic underflow or overflow\n    uint256 internal constant UNDER_OVERFLOW = 0x11;\n    /// @dev division or modulo by zero\n    uint256 internal constant DIVISION_BY_ZERO = 0x12;\n    /// @dev enum conversion error\n    uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\n    /// @dev invalid encoding in storage\n    uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\n    /// @dev empty array pop\n    uint256 internal constant EMPTY_ARRAY_POP = 0x31;\n    /// @dev array out of bounds access\n    uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\n    /// @dev resource error (too large allocation or too large array)\n    uint256 internal constant RESOURCE_ERROR = 0x41;\n    /// @dev calling invalid internal function\n    uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\n\n    /// @dev Reverts with a panic code. Recommended to use with\n    /// the internal constants with predefined codes.\n    function panic(uint256 code) internal pure {\n        assembly (\"memory-safe\") {\n            mstore(0x00, 0x4e487b71)\n            mstore(0x20, code)\n            revert(0x1c, 0x24)\n        }\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/utils/introspection/IERC165.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC-165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n    /**\n     * @dev Returns true if this contract implements the interface defined by\n     * `interfaceId`. See the corresponding\n     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\n     * to learn more about how these ids are created.\n     *\n     * This function call must use less than 30 000 gas.\n     */\n    function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"},{"file_path":"@openzeppelin/contracts/utils/math/Math.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.20;\n\nimport {Panic} from \"../Panic.sol\";\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n    enum Rounding {\n        Floor, // Toward negative infinity\n        Ceil, // Toward positive infinity\n        Trunc, // Toward zero\n        Expand // Away from zero\n    }\n\n    /**\n     * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\n     */\n    function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            uint256 c = a + b;\n            if (c < a) return (false, 0);\n            return (true, c);\n        }\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\n     */\n    function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            if (b > a) return (false, 0);\n            return (true, a - b);\n        }\n    }\n\n    /**\n     * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\n     */\n    function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n            // benefit is lost if 'b' is also tested.\n            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n            if (a == 0) return (true, 0);\n            uint256 c = a * b;\n            if (c / a != b) return (false, 0);\n            return (true, c);\n        }\n    }\n\n    /**\n     * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\n     */\n    function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            if (b == 0) return (false, 0);\n            return (true, a / b);\n        }\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\n     */\n    function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            if (b == 0) return (false, 0);\n            return (true, a % b);\n        }\n    }\n\n    /**\n     * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n     *\n     * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n     * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n     * one branch when needed, making this function more expensive.\n     */\n    function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\n        unchecked {\n            // branchless ternary works because:\n            // b ^ (a ^ b) == a\n            // b ^ 0 == b\n            return b ^ ((a ^ b) * SafeCast.toUint(condition));\n        }\n    }\n\n    /**\n     * @dev Returns the largest of two numbers.\n     */\n    function max(uint256 a, uint256 b) internal pure returns (uint256) {\n        return ternary(a > b, a, b);\n    }\n\n    /**\n     * @dev Returns the smallest of two numbers.\n     */\n    function min(uint256 a, uint256 b) internal pure returns (uint256) {\n        return ternary(a < b, a, b);\n    }\n\n    /**\n     * @dev Returns the average of two numbers. The result is rounded towards\n     * zero.\n     */\n    function average(uint256 a, uint256 b) internal pure returns (uint256) {\n        // (a + b) / 2 can overflow.\n        return (a & b) + (a ^ b) / 2;\n    }\n\n    /**\n     * @dev Returns the ceiling of the division of two numbers.\n     *\n     * This differs from standard division with `/` in that it rounds towards infinity instead\n     * of rounding towards zero.\n     */\n    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n        if (b == 0) {\n            // Guarantee the same behavior as in a regular Solidity division.\n            Panic.panic(Panic.DIVISION_BY_ZERO);\n        }\n\n        // The following calculation ensures accurate ceiling division without overflow.\n        // Since a is non-zero, (a - 1) / b will not overflow.\n        // The largest possible result occurs when (a - 1) / b is type(uint256).max,\n        // but the largest value we can obtain is type(uint256).max - 1, which happens\n        // when a = type(uint256).max and b = 1.\n        unchecked {\n            return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\n        }\n    }\n\n    /**\n     * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\n     * denominator == 0.\n     *\n     * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\n     * Uniswap Labs also under MIT license.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n        unchecked {\n            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2²⁵⁶ and mod 2²⁵⁶ - 1, then use\n            // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n            // variables such that product = prod1 * 2²⁵⁶ + prod0.\n            uint256 prod0 = x * y; // Least significant 256 bits of the product\n            uint256 prod1; // Most significant 256 bits of the product\n            assembly {\n                let mm := mulmod(x, y, not(0))\n                prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n            }\n\n            // Handle non-overflow cases, 256 by 256 division.\n            if (prod1 == 0) {\n                // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n                // The surrounding unchecked block does not change this fact.\n                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n                return prod0 / denominator;\n            }\n\n            // Make sure the result is less than 2²⁵⁶. Also prevents denominator == 0.\n            if (denominator <= prod1) {\n                Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\n            }\n\n            ///////////////////////////////////////////////\n            // 512 by 256 division.\n            ///////////////////////////////////////////////\n\n            // Make division exact by subtracting the remainder from [prod1 prod0].\n            uint256 remainder;\n            assembly {\n                // Compute remainder using mulmod.\n                remainder := mulmod(x, y, denominator)\n\n                // Subtract 256 bit number from 512 bit number.\n                prod1 := sub(prod1, gt(remainder, prod0))\n                prod0 := sub(prod0, remainder)\n            }\n\n            // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\n            // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\n\n            uint256 twos = denominator & (0 - denominator);\n            assembly {\n                // Divide denominator by twos.\n                denominator := div(denominator, twos)\n\n                // Divide [prod1 prod0] by twos.\n                prod0 := div(prod0, twos)\n\n                // Flip twos such that it is 2²⁵⁶ / twos. If twos is zero, then it becomes one.\n                twos := add(div(sub(0, twos), twos), 1)\n            }\n\n            // Shift in bits from prod1 into prod0.\n            prod0 |= prod1 * twos;\n\n            // Invert denominator mod 2²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such\n            // that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for\n            // four bits. That is, denominator * inv ≡ 1 mod 2⁴.\n            uint256 inverse = (3 * denominator) ^ 2;\n\n            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\n            // works in modular arithmetic, doubling the correct bits in each step.\n            inverse *= 2 - denominator * inverse; // inverse mod 2⁸\n            inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶\n            inverse *= 2 - denominator * inverse; // inverse mod 2³²\n            inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴\n            inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸\n            inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶\n\n            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n            // This will give us the correct result modulo 2²⁵⁶. Since the preconditions guarantee that the outcome is\n            // less than 2²⁵⁶, this is the final result. We don't need to compute the high bits of the result and prod1\n            // is no longer required.\n            result = prod0 * inverse;\n            return result;\n        }\n    }\n\n    /**\n     * @dev Calculates x * y / denominator with full precision, following the selected rounding direction.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n        return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\n    }\n\n    /**\n     * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\n     *\n     * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\n     * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\n     *\n     * If the input value is not inversible, 0 is returned.\n     *\n     * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\n     * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\n     */\n    function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\n        unchecked {\n            if (n == 0) return 0;\n\n            // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\n            // Used to compute integers x and y such that: ax + ny = gcd(a, n).\n            // When the gcd is 1, then the inverse of a modulo n exists and it's x.\n            // ax + ny = 1\n            // ax = 1 + (-y)n\n            // ax ≡ 1 (mod n) # x is the inverse of a modulo n\n\n            // If the remainder is 0 the gcd is n right away.\n            uint256 remainder = a % n;\n            uint256 gcd = n;\n\n            // Therefore the initial coefficients are:\n            // ax + ny = gcd(a, n) = n\n            // 0a + 1n = n\n            int256 x = 0;\n            int256 y = 1;\n\n            while (remainder != 0) {\n                uint256 quotient = gcd / remainder;\n\n                (gcd, remainder) = (\n                    // The old remainder is the next gcd to try.\n                    remainder,\n                    // Compute the next remainder.\n                    // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\n                    // where gcd is at most n (capped to type(uint256).max)\n                    gcd - remainder * quotient\n                );\n\n                (x, y) = (\n                    // Increment the coefficient of a.\n                    y,\n                    // Decrement the coefficient of n.\n                    // Can overflow, but the result is casted to uint256 so that the\n                    // next value of y is \"wrapped around\" to a value between 0 and n - 1.\n                    x - y * int256(quotient)\n                );\n            }\n\n            if (gcd != 1) return 0; // No inverse exists.\n            return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\n        }\n    }\n\n    /**\n     * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\n     *\n     * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\n     * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that\n     * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\n     *\n     * NOTE: this function does NOT check that `p` is a prime greater than `2`.\n     */\n    function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\n        unchecked {\n            return Math.modExp(a, p - 2, p);\n        }\n    }\n\n    /**\n     * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\n     *\n     * Requirements:\n     * - modulus can't be zero\n     * - underlying staticcall to precompile must succeed\n     *\n     * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\n     * sure the chain you're using it on supports the precompiled contract for modular exponentiation\n     * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\n     * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\n     * interpreted as 0.\n     */\n    function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\n        (bool success, uint256 result) = tryModExp(b, e, m);\n        if (!success) {\n            Panic.panic(Panic.DIVISION_BY_ZERO);\n        }\n        return result;\n    }\n\n    /**\n     * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\n     * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\n     * to operate modulo 0 or if the underlying precompile reverted.\n     *\n     * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\n     * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\n     * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\n     * of a revert, but the result may be incorrectly interpreted as 0.\n     */\n    function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\n        if (m == 0) return (false, 0);\n        assembly (\"memory-safe\") {\n            let ptr := mload(0x40)\n            // | Offset    | Content    | Content (Hex)                                                      |\n            // |-----------|------------|--------------------------------------------------------------------|\n            // | 0x00:0x1f | size of b  | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n            // | 0x20:0x3f | size of e  | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n            // | 0x40:0x5f | size of m  | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n            // | 0x60:0x7f | value of b | 0x<.............................................................b> |\n            // | 0x80:0x9f | value of e | 0x<.............................................................e> |\n            // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\n            mstore(ptr, 0x20)\n            mstore(add(ptr, 0x20), 0x20)\n            mstore(add(ptr, 0x40), 0x20)\n            mstore(add(ptr, 0x60), b)\n            mstore(add(ptr, 0x80), e)\n            mstore(add(ptr, 0xa0), m)\n\n            // Given the result < m, it's guaranteed to fit in 32 bytes,\n            // so we can use the memory scratch space located at offset 0.\n            success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\n            result := mload(0x00)\n        }\n    }\n\n    /**\n     * @dev Variant of {modExp} that supports inputs of arbitrary length.\n     */\n    function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\n        (bool success, bytes memory result) = tryModExp(b, e, m);\n        if (!success) {\n            Panic.panic(Panic.DIVISION_BY_ZERO);\n        }\n        return result;\n    }\n\n    /**\n     * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\n     */\n    function tryModExp(\n        bytes memory b,\n        bytes memory e,\n        bytes memory m\n    ) internal view returns (bool success, bytes memory result) {\n        if (_zeroBytes(m)) return (false, new bytes(0));\n\n        uint256 mLen = m.length;\n\n        // Encode call args in result and move the free memory pointer\n        result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\n\n        assembly (\"memory-safe\") {\n            let dataPtr := add(result, 0x20)\n            // Write result on top of args to avoid allocating extra memory.\n            success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\n            // Overwrite the length.\n            // result.length > returndatasize() is guaranteed because returndatasize() == m.length\n            mstore(result, mLen)\n            // Set the memory pointer after the returned data.\n            mstore(0x40, add(dataPtr, mLen))\n        }\n    }\n\n    /**\n     * @dev Returns whether the provided byte array is zero.\n     */\n    function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\n        for (uint256 i = 0; i < byteArray.length; ++i) {\n            if (byteArray[i] != 0) {\n                return false;\n            }\n        }\n        return true;\n    }\n\n    /**\n     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\n     * towards zero.\n     *\n     * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\n     * using integer operations.\n     */\n    function sqrt(uint256 a) internal pure returns (uint256) {\n        unchecked {\n            // Take care of easy edge cases when a == 0 or a == 1\n            if (a <= 1) {\n                return a;\n            }\n\n            // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a\n            // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\n            // the current value as `ε_n = | x_n - sqrt(a) |`.\n            //\n            // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\n            // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is\n            // bigger than any uint256.\n            //\n            // By noticing that\n            // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)`\n            // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\n            // to the msb function.\n            uint256 aa = a;\n            uint256 xn = 1;\n\n            if (aa >= (1 << 128)) {\n                aa >>= 128;\n                xn <<= 64;\n            }\n            if (aa >= (1 << 64)) {\n                aa >>= 64;\n                xn <<= 32;\n            }\n            if (aa >= (1 << 32)) {\n                aa >>= 32;\n                xn <<= 16;\n            }\n            if (aa >= (1 << 16)) {\n                aa >>= 16;\n                xn <<= 8;\n            }\n            if (aa >= (1 << 8)) {\n                aa >>= 8;\n                xn <<= 4;\n            }\n            if (aa >= (1 << 4)) {\n                aa >>= 4;\n                xn <<= 2;\n            }\n            if (aa >= (1 << 2)) {\n                xn <<= 1;\n            }\n\n            // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1).\n            //\n            // We can refine our estimation by noticing that the middle of that interval minimizes the error.\n            // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).\n            // This is going to be our x_0 (and ε_0)\n            xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)\n\n            // From here, Newton's method give us:\n            // x_{n+1} = (x_n + a / x_n) / 2\n            //\n            // One should note that:\n            // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a\n            //              = ((x_n² + a) / (2 * x_n))² - a\n            //              = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a\n            //              = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)\n            //              = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)\n            //              = (x_n² - a)² / (2 * x_n)²\n            //              = ((x_n² - a) / (2 * x_n))²\n            //              ≥ 0\n            // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n\n            //\n            // This gives us the proof of quadratic convergence of the sequence:\n            // ε_{n+1} = | x_{n+1} - sqrt(a) |\n            //         = | (x_n + a / x_n) / 2 - sqrt(a) |\n            //         = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |\n            //         = | (x_n - sqrt(a))² / (2 * x_n) |\n            //         = | ε_n² / (2 * x_n) |\n            //         = ε_n² / | (2 * x_n) |\n            //\n            // For the first iteration, we have a special case where x_0 is known:\n            // ε_1 = ε_0² / | (2 * x_0) |\n            //     ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))\n            //     ≤ 2**(2*e-4) / (3 * 2**(e-1))\n            //     ≤ 2**(e-3) / 3\n            //     ≤ 2**(e-3-log2(3))\n            //     ≤ 2**(e-4.5)\n            //\n            // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:\n            // ε_{n+1} = ε_n² / | (2 * x_n) |\n            //         ≤ (2**(e-k))² / (2 * 2**(e-1))\n            //         ≤ 2**(2*e-2*k) / 2**e\n            //         ≤ 2**(e-2*k)\n            xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5)  -- special case, see above\n            xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9)    -- general case with k = 4.5\n            xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18)   -- general case with k = 9\n            xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36)   -- general case with k = 18\n            xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72)   -- general case with k = 36\n            xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144)  -- general case with k = 72\n\n            // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision\n            // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\n            // sqrt(a) or sqrt(a) + 1.\n            return xn - SafeCast.toUint(xn > a / xn);\n        }\n    }\n\n    /**\n     * @dev Calculates sqrt(a), following the selected rounding direction.\n     */\n    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = sqrt(a);\n            return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 2 of a positive value rounded towards zero.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        uint256 exp;\n        unchecked {\n            exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\n            value >>= exp;\n            result += exp;\n\n            exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\n            value >>= exp;\n            result += exp;\n\n            exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\n            value >>= exp;\n            result += exp;\n\n            exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\n            value >>= exp;\n            result += exp;\n\n            exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\n            value >>= exp;\n            result += exp;\n\n            exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\n            value >>= exp;\n            result += exp;\n\n            exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\n            value >>= exp;\n            result += exp;\n\n            result += SafeCast.toUint(value > 1);\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log2(value);\n            return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 10 of a positive value rounded towards zero.\n     * Returns 0 if given 0.\n     */\n    function log10(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >= 10 ** 64) {\n                value /= 10 ** 64;\n                result += 64;\n            }\n            if (value >= 10 ** 32) {\n                value /= 10 ** 32;\n                result += 32;\n            }\n            if (value >= 10 ** 16) {\n                value /= 10 ** 16;\n                result += 16;\n            }\n            if (value >= 10 ** 8) {\n                value /= 10 ** 8;\n                result += 8;\n            }\n            if (value >= 10 ** 4) {\n                value /= 10 ** 4;\n                result += 4;\n            }\n            if (value >= 10 ** 2) {\n                value /= 10 ** 2;\n                result += 2;\n            }\n            if (value >= 10 ** 1) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log10(value);\n            return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 256 of a positive value rounded towards zero.\n     * Returns 0 if given 0.\n     *\n     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n     */\n    function log256(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        uint256 isGt;\n        unchecked {\n            isGt = SafeCast.toUint(value > (1 << 128) - 1);\n            value >>= isGt * 128;\n            result += isGt * 16;\n\n            isGt = SafeCast.toUint(value > (1 << 64) - 1);\n            value >>= isGt * 64;\n            result += isGt * 8;\n\n            isGt = SafeCast.toUint(value > (1 << 32) - 1);\n            value >>= isGt * 32;\n            result += isGt * 4;\n\n            isGt = SafeCast.toUint(value > (1 << 16) - 1);\n            value >>= isGt * 16;\n            result += isGt * 2;\n\n            result += SafeCast.toUint(value > (1 << 8) - 1);\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log256(value);\n            return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\n        }\n    }\n\n    /**\n     * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\n     */\n    function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\n        return uint8(rounding) % 2 == 1;\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/utils/math/SafeCast.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeCast {\n    /**\n     * @dev Value doesn't fit in an uint of `bits` size.\n     */\n    error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\n\n    /**\n     * @dev An int value doesn't fit in an uint of `bits` size.\n     */\n    error SafeCastOverflowedIntToUint(int256 value);\n\n    /**\n     * @dev Value doesn't fit in an int of `bits` size.\n     */\n    error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\n\n    /**\n     * @dev An uint value doesn't fit in an int of `bits` size.\n     */\n    error SafeCastOverflowedUintToInt(uint256 value);\n\n    /**\n     * @dev Returns the downcasted uint248 from uint256, reverting on\n     * overflow (when the input is greater than largest uint248).\n     *\n     * Counterpart to Solidity's `uint248` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 248 bits\n     */\n    function toUint248(uint256 value) internal pure returns (uint248) {\n        if (value > type(uint248).max) {\n            revert SafeCastOverflowedUintDowncast(248, value);\n        }\n        return uint248(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint240 from uint256, reverting on\n     * overflow (when the input is greater than largest uint240).\n     *\n     * Counterpart to Solidity's `uint240` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 240 bits\n     */\n    function toUint240(uint256 value) internal pure returns (uint240) {\n        if (value > type(uint240).max) {\n            revert SafeCastOverflowedUintDowncast(240, value);\n        }\n        return uint240(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint232 from uint256, reverting on\n     * overflow (when the input is greater than largest uint232).\n     *\n     * Counterpart to Solidity's `uint232` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 232 bits\n     */\n    function toUint232(uint256 value) internal pure returns (uint232) {\n        if (value > type(uint232).max) {\n            revert SafeCastOverflowedUintDowncast(232, value);\n        }\n        return uint232(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint224 from uint256, reverting on\n     * overflow (when the input is greater than largest uint224).\n     *\n     * Counterpart to Solidity's `uint224` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 224 bits\n     */\n    function toUint224(uint256 value) internal pure returns (uint224) {\n        if (value > type(uint224).max) {\n            revert SafeCastOverflowedUintDowncast(224, value);\n        }\n        return uint224(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint216 from uint256, reverting on\n     * overflow (when the input is greater than largest uint216).\n     *\n     * Counterpart to Solidity's `uint216` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 216 bits\n     */\n    function toUint216(uint256 value) internal pure returns (uint216) {\n        if (value > type(uint216).max) {\n            revert SafeCastOverflowedUintDowncast(216, value);\n        }\n        return uint216(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint208 from uint256, reverting on\n     * overflow (when the input is greater than largest uint208).\n     *\n     * Counterpart to Solidity's `uint208` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 208 bits\n     */\n    function toUint208(uint256 value) internal pure returns (uint208) {\n        if (value > type(uint208).max) {\n            revert SafeCastOverflowedUintDowncast(208, value);\n        }\n        return uint208(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint200 from uint256, reverting on\n     * overflow (when the input is greater than largest uint200).\n     *\n     * Counterpart to Solidity's `uint200` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 200 bits\n     */\n    function toUint200(uint256 value) internal pure returns (uint200) {\n        if (value > type(uint200).max) {\n            revert SafeCastOverflowedUintDowncast(200, value);\n        }\n        return uint200(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint192 from uint256, reverting on\n     * overflow (when the input is greater than largest uint192).\n     *\n     * Counterpart to Solidity's `uint192` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 192 bits\n     */\n    function toUint192(uint256 value) internal pure returns (uint192) {\n        if (value > type(uint192).max) {\n            revert SafeCastOverflowedUintDowncast(192, value);\n        }\n        return uint192(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint184 from uint256, reverting on\n     * overflow (when the input is greater than largest uint184).\n     *\n     * Counterpart to Solidity's `uint184` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 184 bits\n     */\n    function toUint184(uint256 value) internal pure returns (uint184) {\n        if (value > type(uint184).max) {\n            revert SafeCastOverflowedUintDowncast(184, value);\n        }\n        return uint184(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint176 from uint256, reverting on\n     * overflow (when the input is greater than largest uint176).\n     *\n     * Counterpart to Solidity's `uint176` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 176 bits\n     */\n    function toUint176(uint256 value) internal pure returns (uint176) {\n        if (value > type(uint176).max) {\n            revert SafeCastOverflowedUintDowncast(176, value);\n        }\n        return uint176(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint168 from uint256, reverting on\n     * overflow (when the input is greater than largest uint168).\n     *\n     * Counterpart to Solidity's `uint168` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 168 bits\n     */\n    function toUint168(uint256 value) internal pure returns (uint168) {\n        if (value > type(uint168).max) {\n            revert SafeCastOverflowedUintDowncast(168, value);\n        }\n        return uint168(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint160 from uint256, reverting on\n     * overflow (when the input is greater than largest uint160).\n     *\n     * Counterpart to Solidity's `uint160` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 160 bits\n     */\n    function toUint160(uint256 value) internal pure returns (uint160) {\n        if (value > type(uint160).max) {\n            revert SafeCastOverflowedUintDowncast(160, value);\n        }\n        return uint160(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint152 from uint256, reverting on\n     * overflow (when the input is greater than largest uint152).\n     *\n     * Counterpart to Solidity's `uint152` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 152 bits\n     */\n    function toUint152(uint256 value) internal pure returns (uint152) {\n        if (value > type(uint152).max) {\n            revert SafeCastOverflowedUintDowncast(152, value);\n        }\n        return uint152(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint144 from uint256, reverting on\n     * overflow (when the input is greater than largest uint144).\n     *\n     * Counterpart to Solidity's `uint144` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 144 bits\n     */\n    function toUint144(uint256 value) internal pure returns (uint144) {\n        if (value > type(uint144).max) {\n            revert SafeCastOverflowedUintDowncast(144, value);\n        }\n        return uint144(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint136 from uint256, reverting on\n     * overflow (when the input is greater than largest uint136).\n     *\n     * Counterpart to Solidity's `uint136` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 136 bits\n     */\n    function toUint136(uint256 value) internal pure returns (uint136) {\n        if (value > type(uint136).max) {\n            revert SafeCastOverflowedUintDowncast(136, value);\n        }\n        return uint136(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint128 from uint256, reverting on\n     * overflow (when the input is greater than largest uint128).\n     *\n     * Counterpart to Solidity's `uint128` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 128 bits\n     */\n    function toUint128(uint256 value) internal pure returns (uint128) {\n        if (value > type(uint128).max) {\n            revert SafeCastOverflowedUintDowncast(128, value);\n        }\n        return uint128(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint120 from uint256, reverting on\n     * overflow (when the input is greater than largest uint120).\n     *\n     * Counterpart to Solidity's `uint120` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 120 bits\n     */\n    function toUint120(uint256 value) internal pure returns (uint120) {\n        if (value > type(uint120).max) {\n            revert SafeCastOverflowedUintDowncast(120, value);\n        }\n        return uint120(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint112 from uint256, reverting on\n     * overflow (when the input is greater than largest uint112).\n     *\n     * Counterpart to Solidity's `uint112` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 112 bits\n     */\n    function toUint112(uint256 value) internal pure returns (uint112) {\n        if (value > type(uint112).max) {\n            revert SafeCastOverflowedUintDowncast(112, value);\n        }\n        return uint112(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint104 from uint256, reverting on\n     * overflow (when the input is greater than largest uint104).\n     *\n     * Counterpart to Solidity's `uint104` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 104 bits\n     */\n    function toUint104(uint256 value) internal pure returns (uint104) {\n        if (value > type(uint104).max) {\n            revert SafeCastOverflowedUintDowncast(104, value);\n        }\n        return uint104(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint96 from uint256, reverting on\n     * overflow (when the input is greater than largest uint96).\n     *\n     * Counterpart to Solidity's `uint96` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 96 bits\n     */\n    function toUint96(uint256 value) internal pure returns (uint96) {\n        if (value > type(uint96).max) {\n            revert SafeCastOverflowedUintDowncast(96, value);\n        }\n        return uint96(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint88 from uint256, reverting on\n     * overflow (when the input is greater than largest uint88).\n     *\n     * Counterpart to Solidity's `uint88` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 88 bits\n     */\n    function toUint88(uint256 value) internal pure returns (uint88) {\n        if (value > type(uint88).max) {\n            revert SafeCastOverflowedUintDowncast(88, value);\n        }\n        return uint88(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint80 from uint256, reverting on\n     * overflow (when the input is greater than largest uint80).\n     *\n     * Counterpart to Solidity's `uint80` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 80 bits\n     */\n    function toUint80(uint256 value) internal pure returns (uint80) {\n        if (value > type(uint80).max) {\n            revert SafeCastOverflowedUintDowncast(80, value);\n        }\n        return uint80(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint72 from uint256, reverting on\n     * overflow (when the input is greater than largest uint72).\n     *\n     * Counterpart to Solidity's `uint72` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 72 bits\n     */\n    function toUint72(uint256 value) internal pure returns (uint72) {\n        if (value > type(uint72).max) {\n            revert SafeCastOverflowedUintDowncast(72, value);\n        }\n        return uint72(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint64 from uint256, reverting on\n     * overflow (when the input is greater than largest uint64).\n     *\n     * Counterpart to Solidity's `uint64` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 64 bits\n     */\n    function toUint64(uint256 value) internal pure returns (uint64) {\n        if (value > type(uint64).max) {\n            revert SafeCastOverflowedUintDowncast(64, value);\n        }\n        return uint64(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint56 from uint256, reverting on\n     * overflow (when the input is greater than largest uint56).\n     *\n     * Counterpart to Solidity's `uint56` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 56 bits\n     */\n    function toUint56(uint256 value) internal pure returns (uint56) {\n        if (value > type(uint56).max) {\n            revert SafeCastOverflowedUintDowncast(56, value);\n        }\n        return uint56(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint48 from uint256, reverting on\n     * overflow (when the input is greater than largest uint48).\n     *\n     * Counterpart to Solidity's `uint48` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 48 bits\n     */\n    function toUint48(uint256 value) internal pure returns (uint48) {\n        if (value > type(uint48).max) {\n            revert SafeCastOverflowedUintDowncast(48, value);\n        }\n        return uint48(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint40 from uint256, reverting on\n     * overflow (when the input is greater than largest uint40).\n     *\n     * Counterpart to Solidity's `uint40` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 40 bits\n     */\n    function toUint40(uint256 value) internal pure returns (uint40) {\n        if (value > type(uint40).max) {\n            revert SafeCastOverflowedUintDowncast(40, value);\n        }\n        return uint40(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint32 from uint256, reverting on\n     * overflow (when the input is greater than largest uint32).\n     *\n     * Counterpart to Solidity's `uint32` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 32 bits\n     */\n    function toUint32(uint256 value) internal pure returns (uint32) {\n        if (value > type(uint32).max) {\n            revert SafeCastOverflowedUintDowncast(32, value);\n        }\n        return uint32(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint24 from uint256, reverting on\n     * overflow (when the input is greater than largest uint24).\n     *\n     * Counterpart to Solidity's `uint24` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 24 bits\n     */\n    function toUint24(uint256 value) internal pure returns (uint24) {\n        if (value > type(uint24).max) {\n            revert SafeCastOverflowedUintDowncast(24, value);\n        }\n        return uint24(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint16 from uint256, reverting on\n     * overflow (when the input is greater than largest uint16).\n     *\n     * Counterpart to Solidity's `uint16` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 16 bits\n     */\n    function toUint16(uint256 value) internal pure returns (uint16) {\n        if (value > type(uint16).max) {\n            revert SafeCastOverflowedUintDowncast(16, value);\n        }\n        return uint16(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint8 from uint256, reverting on\n     * overflow (when the input is greater than largest uint8).\n     *\n     * Counterpart to Solidity's `uint8` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 8 bits\n     */\n    function toUint8(uint256 value) internal pure returns (uint8) {\n        if (value > type(uint8).max) {\n            revert SafeCastOverflowedUintDowncast(8, value);\n        }\n        return uint8(value);\n    }\n\n    /**\n     * @dev Converts a signed int256 into an unsigned uint256.\n     *\n     * Requirements:\n     *\n     * - input must be greater than or equal to 0.\n     */\n    function toUint256(int256 value) internal pure returns (uint256) {\n        if (value < 0) {\n            revert SafeCastOverflowedIntToUint(value);\n        }\n        return uint256(value);\n    }\n\n    /**\n     * @dev Returns the downcasted int248 from int256, reverting on\n     * overflow (when the input is less than smallest int248 or\n     * greater than largest int248).\n     *\n     * Counterpart to Solidity's `int248` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 248 bits\n     */\n    function toInt248(int256 value) internal pure returns (int248 downcasted) {\n        downcasted = int248(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(248, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int240 from int256, reverting on\n     * overflow (when the input is less than smallest int240 or\n     * greater than largest int240).\n     *\n     * Counterpart to Solidity's `int240` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 240 bits\n     */\n    function toInt240(int256 value) internal pure returns (int240 downcasted) {\n        downcasted = int240(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(240, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int232 from int256, reverting on\n     * overflow (when the input is less than smallest int232 or\n     * greater than largest int232).\n     *\n     * Counterpart to Solidity's `int232` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 232 bits\n     */\n    function toInt232(int256 value) internal pure returns (int232 downcasted) {\n        downcasted = int232(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(232, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int224 from int256, reverting on\n     * overflow (when the input is less than smallest int224 or\n     * greater than largest int224).\n     *\n     * Counterpart to Solidity's `int224` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 224 bits\n     */\n    function toInt224(int256 value) internal pure returns (int224 downcasted) {\n        downcasted = int224(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(224, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int216 from int256, reverting on\n     * overflow (when the input is less than smallest int216 or\n     * greater than largest int216).\n     *\n     * Counterpart to Solidity's `int216` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 216 bits\n     */\n    function toInt216(int256 value) internal pure returns (int216 downcasted) {\n        downcasted = int216(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(216, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int208 from int256, reverting on\n     * overflow (when the input is less than smallest int208 or\n     * greater than largest int208).\n     *\n     * Counterpart to Solidity's `int208` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 208 bits\n     */\n    function toInt208(int256 value) internal pure returns (int208 downcasted) {\n        downcasted = int208(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(208, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int200 from int256, reverting on\n     * overflow (when the input is less than smallest int200 or\n     * greater than largest int200).\n     *\n     * Counterpart to Solidity's `int200` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 200 bits\n     */\n    function toInt200(int256 value) internal pure returns (int200 downcasted) {\n        downcasted = int200(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(200, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int192 from int256, reverting on\n     * overflow (when the input is less than smallest int192 or\n     * greater than largest int192).\n     *\n     * Counterpart to Solidity's `int192` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 192 bits\n     */\n    function toInt192(int256 value) internal pure returns (int192 downcasted) {\n        downcasted = int192(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(192, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int184 from int256, reverting on\n     * overflow (when the input is less than smallest int184 or\n     * greater than largest int184).\n     *\n     * Counterpart to Solidity's `int184` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 184 bits\n     */\n    function toInt184(int256 value) internal pure returns (int184 downcasted) {\n        downcasted = int184(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(184, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int176 from int256, reverting on\n     * overflow (when the input is less than smallest int176 or\n     * greater than largest int176).\n     *\n     * Counterpart to Solidity's `int176` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 176 bits\n     */\n    function toInt176(int256 value) internal pure returns (int176 downcasted) {\n        downcasted = int176(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(176, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int168 from int256, reverting on\n     * overflow (when the input is less than smallest int168 or\n     * greater than largest int168).\n     *\n     * Counterpart to Solidity's `int168` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 168 bits\n     */\n    function toInt168(int256 value) internal pure returns (int168 downcasted) {\n        downcasted = int168(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(168, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int160 from int256, reverting on\n     * overflow (when the input is less than smallest int160 or\n     * greater than largest int160).\n     *\n     * Counterpart to Solidity's `int160` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 160 bits\n     */\n    function toInt160(int256 value) internal pure returns (int160 downcasted) {\n        downcasted = int160(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(160, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int152 from int256, reverting on\n     * overflow (when the input is less than smallest int152 or\n     * greater than largest int152).\n     *\n     * Counterpart to Solidity's `int152` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 152 bits\n     */\n    function toInt152(int256 value) internal pure returns (int152 downcasted) {\n        downcasted = int152(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(152, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int144 from int256, reverting on\n     * overflow (when the input is less than smallest int144 or\n     * greater than largest int144).\n     *\n     * Counterpart to Solidity's `int144` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 144 bits\n     */\n    function toInt144(int256 value) internal pure returns (int144 downcasted) {\n        downcasted = int144(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(144, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int136 from int256, reverting on\n     * overflow (when the input is less than smallest int136 or\n     * greater than largest int136).\n     *\n     * Counterpart to Solidity's `int136` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 136 bits\n     */\n    function toInt136(int256 value) internal pure returns (int136 downcasted) {\n        downcasted = int136(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(136, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int128 from int256, reverting on\n     * overflow (when the input is less than smallest int128 or\n     * greater than largest int128).\n     *\n     * Counterpart to Solidity's `int128` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 128 bits\n     */\n    function toInt128(int256 value) internal pure returns (int128 downcasted) {\n        downcasted = int128(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(128, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int120 from int256, reverting on\n     * overflow (when the input is less than smallest int120 or\n     * greater than largest int120).\n     *\n     * Counterpart to Solidity's `int120` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 120 bits\n     */\n    function toInt120(int256 value) internal pure returns (int120 downcasted) {\n        downcasted = int120(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(120, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int112 from int256, reverting on\n     * overflow (when the input is less than smallest int112 or\n     * greater than largest int112).\n     *\n     * Counterpart to Solidity's `int112` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 112 bits\n     */\n    function toInt112(int256 value) internal pure returns (int112 downcasted) {\n        downcasted = int112(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(112, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int104 from int256, reverting on\n     * overflow (when the input is less than smallest int104 or\n     * greater than largest int104).\n     *\n     * Counterpart to Solidity's `int104` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 104 bits\n     */\n    function toInt104(int256 value) internal pure returns (int104 downcasted) {\n        downcasted = int104(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(104, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int96 from int256, reverting on\n     * overflow (when the input is less than smallest int96 or\n     * greater than largest int96).\n     *\n     * Counterpart to Solidity's `int96` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 96 bits\n     */\n    function toInt96(int256 value) internal pure returns (int96 downcasted) {\n        downcasted = int96(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(96, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int88 from int256, reverting on\n     * overflow (when the input is less than smallest int88 or\n     * greater than largest int88).\n     *\n     * Counterpart to Solidity's `int88` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 88 bits\n     */\n    function toInt88(int256 value) internal pure returns (int88 downcasted) {\n        downcasted = int88(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(88, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int80 from int256, reverting on\n     * overflow (when the input is less than smallest int80 or\n     * greater than largest int80).\n     *\n     * Counterpart to Solidity's `int80` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 80 bits\n     */\n    function toInt80(int256 value) internal pure returns (int80 downcasted) {\n        downcasted = int80(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(80, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int72 from int256, reverting on\n     * overflow (when the input is less than smallest int72 or\n     * greater than largest int72).\n     *\n     * Counterpart to Solidity's `int72` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 72 bits\n     */\n    function toInt72(int256 value) internal pure returns (int72 downcasted) {\n        downcasted = int72(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(72, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int64 from int256, reverting on\n     * overflow (when the input is less than smallest int64 or\n     * greater than largest int64).\n     *\n     * Counterpart to Solidity's `int64` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 64 bits\n     */\n    function toInt64(int256 value) internal pure returns (int64 downcasted) {\n        downcasted = int64(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(64, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int56 from int256, reverting on\n     * overflow (when the input is less than smallest int56 or\n     * greater than largest int56).\n     *\n     * Counterpart to Solidity's `int56` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 56 bits\n     */\n    function toInt56(int256 value) internal pure returns (int56 downcasted) {\n        downcasted = int56(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(56, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int48 from int256, reverting on\n     * overflow (when the input is less than smallest int48 or\n     * greater than largest int48).\n     *\n     * Counterpart to Solidity's `int48` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 48 bits\n     */\n    function toInt48(int256 value) internal pure returns (int48 downcasted) {\n        downcasted = int48(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(48, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int40 from int256, reverting on\n     * overflow (when the input is less than smallest int40 or\n     * greater than largest int40).\n     *\n     * Counterpart to Solidity's `int40` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 40 bits\n     */\n    function toInt40(int256 value) internal pure returns (int40 downcasted) {\n        downcasted = int40(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(40, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int32 from int256, reverting on\n     * overflow (when the input is less than smallest int32 or\n     * greater than largest int32).\n     *\n     * Counterpart to Solidity's `int32` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 32 bits\n     */\n    function toInt32(int256 value) internal pure returns (int32 downcasted) {\n        downcasted = int32(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(32, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int24 from int256, reverting on\n     * overflow (when the input is less than smallest int24 or\n     * greater than largest int24).\n     *\n     * Counterpart to Solidity's `int24` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 24 bits\n     */\n    function toInt24(int256 value) internal pure returns (int24 downcasted) {\n        downcasted = int24(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(24, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int16 from int256, reverting on\n     * overflow (when the input is less than smallest int16 or\n     * greater than largest int16).\n     *\n     * Counterpart to Solidity's `int16` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 16 bits\n     */\n    function toInt16(int256 value) internal pure returns (int16 downcasted) {\n        downcasted = int16(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(16, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int8 from int256, reverting on\n     * overflow (when the input is less than smallest int8 or\n     * greater than largest int8).\n     *\n     * Counterpart to Solidity's `int8` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 8 bits\n     */\n    function toInt8(int256 value) internal pure returns (int8 downcasted) {\n        downcasted = int8(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(8, value);\n        }\n    }\n\n    /**\n     * @dev Converts an unsigned uint256 into a signed int256.\n     *\n     * Requirements:\n     *\n     * - input must be less than or equal to maxInt256.\n     */\n    function toInt256(uint256 value) internal pure returns (int256) {\n        // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n        if (value > uint256(type(int256).max)) {\n            revert SafeCastOverflowedUintToInt(value);\n        }\n        return int256(value);\n    }\n\n    /**\n     * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\n     */\n    function toUint(bool b) internal pure returns (uint256 u) {\n        assembly (\"memory-safe\") {\n            u := iszero(iszero(b))\n        }\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/utils/structs/Checkpoints.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/Checkpoints.sol)\n// This file was procedurally generated from scripts/generate/templates/Checkpoints.js.\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"../math/Math.sol\";\n\n/**\n * @dev This library defines the `Trace*` struct, for checkpointing values as they change at different points in\n * time, and later looking up past values by block number. See {Votes} as an example.\n *\n * To create a history of checkpoints define a variable type `Checkpoints.Trace*` in your contract, and store a new\n * checkpoint for the current transaction block using the {push} function.\n */\nlibrary Checkpoints {\n    /**\n     * @dev A value was attempted to be inserted on a past checkpoint.\n     */\n    error CheckpointUnorderedInsertion();\n\n    struct Trace224 {\n        Checkpoint224[] _checkpoints;\n    }\n\n    struct Checkpoint224 {\n        uint32 _key;\n        uint224 _value;\n    }\n\n    /**\n     * @dev Pushes a (`key`, `value`) pair into a Trace224 so that it is stored as the checkpoint.\n     *\n     * Returns previous value and new value.\n     *\n     * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint32).max` key set will disable the\n     * library.\n     */\n    function push(\n        Trace224 storage self,\n        uint32 key,\n        uint224 value\n    ) internal returns (uint224 oldValue, uint224 newValue) {\n        return _insert(self._checkpoints, key, value);\n    }\n\n    /**\n     * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n     * there is none.\n     */\n    function lowerLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\n        uint256 len = self._checkpoints.length;\n        uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n        return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n    }\n\n    /**\n     * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n     * if there is none.\n     */\n    function upperLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\n        uint256 len = self._checkpoints.length;\n        uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n        return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n    }\n\n    /**\n     * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n     * if there is none.\n     *\n     * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n     * keys).\n     */\n    function upperLookupRecent(Trace224 storage self, uint32 key) internal view returns (uint224) {\n        uint256 len = self._checkpoints.length;\n\n        uint256 low = 0;\n        uint256 high = len;\n\n        if (len > 5) {\n            uint256 mid = len - Math.sqrt(len);\n            if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n                high = mid;\n            } else {\n                low = mid + 1;\n            }\n        }\n\n        uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n        return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n    }\n\n    /**\n     * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n     */\n    function latest(Trace224 storage self) internal view returns (uint224) {\n        uint256 pos = self._checkpoints.length;\n        return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n    }\n\n    /**\n     * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n     * in the most recent checkpoint.\n     */\n    function latestCheckpoint(Trace224 storage self) internal view returns (bool exists, uint32 _key, uint224 _value) {\n        uint256 pos = self._checkpoints.length;\n        if (pos == 0) {\n            return (false, 0, 0);\n        } else {\n            Checkpoint224 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n            return (true, ckpt._key, ckpt._value);\n        }\n    }\n\n    /**\n     * @dev Returns the number of checkpoint.\n     */\n    function length(Trace224 storage self) internal view returns (uint256) {\n        return self._checkpoints.length;\n    }\n\n    /**\n     * @dev Returns checkpoint at given position.\n     */\n    function at(Trace224 storage self, uint32 pos) internal view returns (Checkpoint224 memory) {\n        return self._checkpoints[pos];\n    }\n\n    /**\n     * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n     * or by updating the last one.\n     */\n    function _insert(\n        Checkpoint224[] storage self,\n        uint32 key,\n        uint224 value\n    ) private returns (uint224 oldValue, uint224 newValue) {\n        uint256 pos = self.length;\n\n        if (pos > 0) {\n            Checkpoint224 storage last = _unsafeAccess(self, pos - 1);\n            uint32 lastKey = last._key;\n            uint224 lastValue = last._value;\n\n            // Checkpoint keys must be non-decreasing.\n            if (lastKey > key) {\n                revert CheckpointUnorderedInsertion();\n            }\n\n            // Update or push new checkpoint\n            if (lastKey == key) {\n                last._value = value;\n            } else {\n                self.push(Checkpoint224({_key: key, _value: value}));\n            }\n            return (lastValue, value);\n        } else {\n            self.push(Checkpoint224({_key: key, _value: value}));\n            return (0, value);\n        }\n    }\n\n    /**\n     * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n     * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n     * `high`.\n     *\n     * WARNING: `high` should not be greater than the array's length.\n     */\n    function _upperBinaryLookup(\n        Checkpoint224[] storage self,\n        uint32 key,\n        uint256 low,\n        uint256 high\n    ) private view returns (uint256) {\n        while (low < high) {\n            uint256 mid = Math.average(low, high);\n            if (_unsafeAccess(self, mid)._key > key) {\n                high = mid;\n            } else {\n                low = mid + 1;\n            }\n        }\n        return high;\n    }\n\n    /**\n     * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n     * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n     * `high`.\n     *\n     * WARNING: `high` should not be greater than the array's length.\n     */\n    function _lowerBinaryLookup(\n        Checkpoint224[] storage self,\n        uint32 key,\n        uint256 low,\n        uint256 high\n    ) private view returns (uint256) {\n        while (low < high) {\n            uint256 mid = Math.average(low, high);\n            if (_unsafeAccess(self, mid)._key < key) {\n                low = mid + 1;\n            } else {\n                high = mid;\n            }\n        }\n        return high;\n    }\n\n    /**\n     * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n     */\n    function _unsafeAccess(\n        Checkpoint224[] storage self,\n        uint256 pos\n    ) private pure returns (Checkpoint224 storage result) {\n        assembly {\n            mstore(0, self.slot)\n            result.slot := add(keccak256(0, 0x20), pos)\n        }\n    }\n\n    struct Trace208 {\n        Checkpoint208[] _checkpoints;\n    }\n\n    struct Checkpoint208 {\n        uint48 _key;\n        uint208 _value;\n    }\n\n    /**\n     * @dev Pushes a (`key`, `value`) pair into a Trace208 so that it is stored as the checkpoint.\n     *\n     * Returns previous value and new value.\n     *\n     * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint48).max` key set will disable the\n     * library.\n     */\n    function push(\n        Trace208 storage self,\n        uint48 key,\n        uint208 value\n    ) internal returns (uint208 oldValue, uint208 newValue) {\n        return _insert(self._checkpoints, key, value);\n    }\n\n    /**\n     * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n     * there is none.\n     */\n    function lowerLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\n        uint256 len = self._checkpoints.length;\n        uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n        return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n    }\n\n    /**\n     * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n     * if there is none.\n     */\n    function upperLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\n        uint256 len = self._checkpoints.length;\n        uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n        return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n    }\n\n    /**\n     * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n     * if there is none.\n     *\n     * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n     * keys).\n     */\n    function upperLookupRecent(Trace208 storage self, uint48 key) internal view returns (uint208) {\n        uint256 len = self._checkpoints.length;\n\n        uint256 low = 0;\n        uint256 high = len;\n\n        if (len > 5) {\n            uint256 mid = len - Math.sqrt(len);\n            if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n                high = mid;\n            } else {\n                low = mid + 1;\n            }\n        }\n\n        uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n        return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n    }\n\n    /**\n     * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n     */\n    function latest(Trace208 storage self) internal view returns (uint208) {\n        uint256 pos = self._checkpoints.length;\n        return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n    }\n\n    /**\n     * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n     * in the most recent checkpoint.\n     */\n    function latestCheckpoint(Trace208 storage self) internal view returns (bool exists, uint48 _key, uint208 _value) {\n        uint256 pos = self._checkpoints.length;\n        if (pos == 0) {\n            return (false, 0, 0);\n        } else {\n            Checkpoint208 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n            return (true, ckpt._key, ckpt._value);\n        }\n    }\n\n    /**\n     * @dev Returns the number of checkpoint.\n     */\n    function length(Trace208 storage self) internal view returns (uint256) {\n        return self._checkpoints.length;\n    }\n\n    /**\n     * @dev Returns checkpoint at given position.\n     */\n    function at(Trace208 storage self, uint32 pos) internal view returns (Checkpoint208 memory) {\n        return self._checkpoints[pos];\n    }\n\n    /**\n     * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n     * or by updating the last one.\n     */\n    function _insert(\n        Checkpoint208[] storage self,\n        uint48 key,\n        uint208 value\n    ) private returns (uint208 oldValue, uint208 newValue) {\n        uint256 pos = self.length;\n\n        if (pos > 0) {\n            Checkpoint208 storage last = _unsafeAccess(self, pos - 1);\n            uint48 lastKey = last._key;\n            uint208 lastValue = last._value;\n\n            // Checkpoint keys must be non-decreasing.\n            if (lastKey > key) {\n                revert CheckpointUnorderedInsertion();\n            }\n\n            // Update or push new checkpoint\n            if (lastKey == key) {\n                last._value = value;\n            } else {\n                self.push(Checkpoint208({_key: key, _value: value}));\n            }\n            return (lastValue, value);\n        } else {\n            self.push(Checkpoint208({_key: key, _value: value}));\n            return (0, value);\n        }\n    }\n\n    /**\n     * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n     * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n     * `high`.\n     *\n     * WARNING: `high` should not be greater than the array's length.\n     */\n    function _upperBinaryLookup(\n        Checkpoint208[] storage self,\n        uint48 key,\n        uint256 low,\n        uint256 high\n    ) private view returns (uint256) {\n        while (low < high) {\n            uint256 mid = Math.average(low, high);\n            if (_unsafeAccess(self, mid)._key > key) {\n                high = mid;\n            } else {\n                low = mid + 1;\n            }\n        }\n        return high;\n    }\n\n    /**\n     * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n     * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n     * `high`.\n     *\n     * WARNING: `high` should not be greater than the array's length.\n     */\n    function _lowerBinaryLookup(\n        Checkpoint208[] storage self,\n        uint48 key,\n        uint256 low,\n        uint256 high\n    ) private view returns (uint256) {\n        while (low < high) {\n            uint256 mid = Math.average(low, high);\n            if (_unsafeAccess(self, mid)._key < key) {\n                low = mid + 1;\n            } else {\n                high = mid;\n            }\n        }\n        return high;\n    }\n\n    /**\n     * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n     */\n    function _unsafeAccess(\n        Checkpoint208[] storage self,\n        uint256 pos\n    ) private pure returns (Checkpoint208 storage result) {\n        assembly {\n            mstore(0, self.slot)\n            result.slot := add(keccak256(0, 0x20), pos)\n        }\n    }\n\n    struct Trace160 {\n        Checkpoint160[] _checkpoints;\n    }\n\n    struct Checkpoint160 {\n        uint96 _key;\n        uint160 _value;\n    }\n\n    /**\n     * @dev Pushes a (`key`, `value`) pair into a Trace160 so that it is stored as the checkpoint.\n     *\n     * Returns previous value and new value.\n     *\n     * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint96).max` key set will disable the\n     * library.\n     */\n    function push(\n        Trace160 storage self,\n        uint96 key,\n        uint160 value\n    ) internal returns (uint160 oldValue, uint160 newValue) {\n        return _insert(self._checkpoints, key, value);\n    }\n\n    /**\n     * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n     * there is none.\n     */\n    function lowerLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\n        uint256 len = self._checkpoints.length;\n        uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n        return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n    }\n\n    /**\n     * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n     * if there is none.\n     */\n    function upperLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\n        uint256 len = self._checkpoints.length;\n        uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n        return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n    }\n\n    /**\n     * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n     * if there is none.\n     *\n     * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n     * keys).\n     */\n    function upperLookupRecent(Trace160 storage self, uint96 key) internal view returns (uint160) {\n        uint256 len = self._checkpoints.length;\n\n        uint256 low = 0;\n        uint256 high = len;\n\n        if (len > 5) {\n            uint256 mid = len - Math.sqrt(len);\n            if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n                high = mid;\n            } else {\n                low = mid + 1;\n            }\n        }\n\n        uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n        return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n    }\n\n    /**\n     * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n     */\n    function latest(Trace160 storage self) internal view returns (uint160) {\n        uint256 pos = self._checkpoints.length;\n        return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n    }\n\n    /**\n     * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n     * in the most recent checkpoint.\n     */\n    function latestCheckpoint(Trace160 storage self) internal view returns (bool exists, uint96 _key, uint160 _value) {\n        uint256 pos = self._checkpoints.length;\n        if (pos == 0) {\n            return (false, 0, 0);\n        } else {\n            Checkpoint160 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n            return (true, ckpt._key, ckpt._value);\n        }\n    }\n\n    /**\n     * @dev Returns the number of checkpoint.\n     */\n    function length(Trace160 storage self) internal view returns (uint256) {\n        return self._checkpoints.length;\n    }\n\n    /**\n     * @dev Returns checkpoint at given position.\n     */\n    function at(Trace160 storage self, uint32 pos) internal view returns (Checkpoint160 memory) {\n        return self._checkpoints[pos];\n    }\n\n    /**\n     * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n     * or by updating the last one.\n     */\n    function _insert(\n        Checkpoint160[] storage self,\n        uint96 key,\n        uint160 value\n    ) private returns (uint160 oldValue, uint160 newValue) {\n        uint256 pos = self.length;\n\n        if (pos > 0) {\n            Checkpoint160 storage last = _unsafeAccess(self, pos - 1);\n            uint96 lastKey = last._key;\n            uint160 lastValue = last._value;\n\n            // Checkpoint keys must be non-decreasing.\n            if (lastKey > key) {\n                revert CheckpointUnorderedInsertion();\n            }\n\n            // Update or push new checkpoint\n            if (lastKey == key) {\n                last._value = value;\n            } else {\n                self.push(Checkpoint160({_key: key, _value: value}));\n            }\n            return (lastValue, value);\n        } else {\n            self.push(Checkpoint160({_key: key, _value: value}));\n            return (0, value);\n        }\n    }\n\n    /**\n     * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n     * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n     * `high`.\n     *\n     * WARNING: `high` should not be greater than the array's length.\n     */\n    function _upperBinaryLookup(\n        Checkpoint160[] storage self,\n        uint96 key,\n        uint256 low,\n        uint256 high\n    ) private view returns (uint256) {\n        while (low < high) {\n            uint256 mid = Math.average(low, high);\n            if (_unsafeAccess(self, mid)._key > key) {\n                high = mid;\n            } else {\n                low = mid + 1;\n            }\n        }\n        return high;\n    }\n\n    /**\n     * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n     * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n     * `high`.\n     *\n     * WARNING: `high` should not be greater than the array's length.\n     */\n    function _lowerBinaryLookup(\n        Checkpoint160[] storage self,\n        uint96 key,\n        uint256 low,\n        uint256 high\n    ) private view returns (uint256) {\n        while (low < high) {\n            uint256 mid = Math.average(low, high);\n            if (_unsafeAccess(self, mid)._key < key) {\n                low = mid + 1;\n            } else {\n                high = mid;\n            }\n        }\n        return high;\n    }\n\n    /**\n     * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n     */\n    function _unsafeAccess(\n        Checkpoint160[] storage self,\n        uint256 pos\n    ) private pure returns (Checkpoint160 storage result) {\n        assembly {\n            mstore(0, self.slot)\n            result.slot := add(keccak256(0, 0x20), pos)\n        }\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/utils/types/Time.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"../math/Math.sol\";\nimport {SafeCast} from \"../math/SafeCast.sol\";\n\n/**\n * @dev This library provides helpers for manipulating time-related objects.\n *\n * It uses the following types:\n * - `uint48` for timepoints\n * - `uint32` for durations\n *\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\n * - additional helper functions\n */\nlibrary Time {\n    using Time for *;\n\n    /**\n     * @dev Get the block timestamp as a Timepoint.\n     */\n    function timestamp() internal view returns (uint48) {\n        return SafeCast.toUint48(block.timestamp);\n    }\n\n    /**\n     * @dev Get the block number as a Timepoint.\n     */\n    function blockNumber() internal view returns (uint48) {\n        return SafeCast.toUint48(block.number);\n    }\n\n    // ==================================================== Delay =====================================================\n    /**\n     * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\n     * future. The \"effect\" timepoint describes when the transitions happens from the \"old\" value to the \"new\" value.\n     * This allows updating the delay applied to some operation while keeping some guarantees.\n     *\n     * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\n     * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\n     * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\n     * still apply for some time.\n     *\n     *\n     * The `Delay` type is 112 bits long, and packs the following:\n     *\n     * ```\n     *   | [uint48]: effect date (timepoint)\n     *   |           | [uint32]: value before (duration)\n     *   ↓           ↓       ↓ [uint32]: value after (duration)\n     * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\n     * ```\n     *\n     * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\n     * supported.\n     */\n    type Delay is uint112;\n\n    /**\n     * @dev Wrap a duration into a Delay to add the one-step \"update in the future\" feature\n     */\n    function toDelay(uint32 duration) internal pure returns (Delay) {\n        return Delay.wrap(duration);\n    }\n\n    /**\n     * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\n     * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\n     */\n    function _getFullAt(\n        Delay self,\n        uint48 timepoint\n    ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n        (valueBefore, valueAfter, effect) = self.unpack();\n        return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\n    }\n\n    /**\n     * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\n     * effect timepoint is 0, then the pending value should not be considered.\n     */\n    function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n        return _getFullAt(self, timestamp());\n    }\n\n    /**\n     * @dev Get the current value.\n     */\n    function get(Delay self) internal view returns (uint32) {\n        (uint32 delay, , ) = self.getFull();\n        return delay;\n    }\n\n    /**\n     * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\n     * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\n     * new delay becomes effective.\n     */\n    function withUpdate(\n        Delay self,\n        uint32 newValue,\n        uint32 minSetback\n    ) internal view returns (Delay updatedDelay, uint48 effect) {\n        uint32 value = self.get();\n        uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\n        effect = timestamp() + setback;\n        return (pack(value, newValue, effect), effect);\n    }\n\n    /**\n     * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\n     */\n    function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n        uint112 raw = Delay.unwrap(self);\n\n        valueAfter = uint32(raw);\n        valueBefore = uint32(raw >> 32);\n        effect = uint48(raw >> 64);\n\n        return (valueBefore, valueAfter, effect);\n    }\n\n    /**\n     * @dev pack the components into a Delay object.\n     */\n    function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\n        return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\n    }\n}\n"},{"file_path":"contracts/core/FirelightVaultStorage.sol","source_code":"// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport {Checkpoints} from \"./lib/Checkpoints.sol\";\n\n/**\n * @title FirelightVaultStorage\n * @notice Storage layout for FirelightVault.\n * @custom:security-contact securityreport@firelight.finance\n */\nabstract contract FirelightVaultStorage {\n    /// @notice Role for updating deposit limits.\n    bytes32 public constant DEPOSIT_LIMIT_UPDATE_ROLE = keccak256(\"DEPOSIT_LIMIT_UPDATE_ROLE\");\n\n    /// @notice Role for rescuing funds from blocklisted addresses.\n    bytes32 public constant RESCUER_ROLE = keccak256(\"RESCUER_ROLE\");\n\n    /// @notice Role for managing the blocklist.\n    bytes32 public constant BLOCKLIST_ROLE = keccak256(\"BLOCKLIST_ROLE\");\n\n    /// @notice Role for pausing and unpausing contract operations.\n    bytes32 public constant PAUSE_ROLE = keccak256(\"PAUSE_ROLE\");\n\n    /// @notice Role for updating the period configurations.\n    bytes32 public constant PERIOD_CONFIGURATION_UPDATE_ROLE = keccak256(\"PERIOD_CONFIGURATION_UPDATE_ROLE\");\n\n    /// @notice Role for managing the payout allowlist.\n    bytes32 public constant PAYOUT_ALLOWLIST_ROLE = keccak256(\"PAYOUT_ALLOWLIST_ROLE\");\n\n    /// @notice Role for executing payout actions.\n    bytes32 public constant PAYOUT_ROLE = keccak256(\"PAYOUT_ROLE\");\n\n    /// @notice Role allowed to update active incident flags used by deposit checks.\n    bytes32 public constant INCIDENT_ROLE = keccak256(\"INCIDENT_ROLE\");\n\n    /// @notice Role allowed to record total-assets checkpoints outside deposit/withdraw flows.\n    bytes32 public constant CHECKPOINT_ROLE = keccak256(\"CHECKPOINT_ROLE\");\n\n    /// @notice Minimum period duration in seconds.\n    uint48 public constant SMALLEST_PERIOD_DURATION = 1 days;\n\n    /// @notice Maximum period duration in seconds.\n    uint48 public constant MAX_PERIOD_DURATION = 90 days;\n\n    /// @notice The maximum total amount of assets that can be deposited into the vault.\n    uint256 public depositLimit;\n\n    /// @notice The current version of the contract.\n    uint256 public contractVersion;\n\n    /// @notice The total amount of assets pending withdrawal across all periods.\n    uint256 public pendingWithdrawAssets;\n\n    struct PeriodConfiguration {\n        uint48 epoch;\n        uint48 duration;\n        uint256 startingPeriod;\n    }\n\n    // solhint-disable-next-line max-line-length\n    /// @notice Array of period configurations consisting of a starting timestamp (epoch), starting period number (startingPeriod) and period duration (duration).\n    PeriodConfiguration[] public periodConfigurations;\n\n    /// @notice Total shares allocated for withdrawals in a given period.\n    mapping(uint256 period => uint256 shares) public withdrawShares;\n\n    /// @notice Total assets allocated for withdrawals in a given period.\n    mapping(uint256 period => uint256 assets) public withdrawAssets;\n\n    /// @notice Total shares allocated for withdrawals in a given period and a given account.\n    mapping(uint256 period => mapping(address account => uint256 shares)) public withdrawSharesOf;\n\n    /// @notice Indicates whether an account has claimed their withdrawal for a given period.\n    mapping(uint256 period => mapping(address account => bool value)) public isWithdrawClaimed;\n\n    /// @notice Indicates whether an account is blocklisted.\n    mapping(address account => bool) public isBlocklisted;\n\n    /// @notice Checkpoints for assets and shares.\n    mapping(address account => Checkpoints.Trace256 shares) internal _traceBalanceOf;\n    Checkpoints.Trace256 internal _traceTotalSupply;\n    Checkpoints.Trace256 internal _traceTotalAssets;\n\n    /// @notice Indicates whether an account is payout allowlisted.\n    mapping(address account => bool) public isPayoutAllowlisted;\n\n    /// @notice Indicates whether deposits are blocked for a period due to an active incident.\n    mapping(uint256 period => bool) public hasActiveIncident;\n\n    uint256[48] private __gap;\n}\n"},{"file_path":"contracts/core/lib/Checkpoints.sol","source_code":"// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.28;\n\nimport {Checkpoints as OZCheckpoints} from \"@openzeppelin/contracts/utils/structs/Checkpoints.sol\";\nimport {Math} from \"@openzeppelin/contracts/utils/math/Math.sol\";\n\n/**\n * @title Checkpoints\n * @notice Checkpoints values as they change over time and looks up past values by key.\n * @dev Defines the `Trace208` and `Trace256` structs. `Trace256` stores 256-bit values by\n *      indexing into a side array from an underlying OpenZeppelin `Trace208`, so index 0 acts as\n *      a permanent zero sentinel (real values start at index 1).\n * @custom:security-contact securityreport@firelight.finance\n */\nlibrary Checkpoints {\n    using OZCheckpoints for OZCheckpoints.Trace208;\n\n    /// @notice Thrown when popping a `Trace256` that holds no real checkpoint (only the sentinel).\n    error SystemCheckpoint();\n\n    /// @notice Checkpoint trace storing 208-bit values keyed by a 48-bit key.\n    struct Trace208 {\n        OZCheckpoints.Trace208 _trace;\n    }\n\n    /// @notice A single (key, value) checkpoint for {Trace208}.\n    struct Checkpoint208 {\n        uint48 _key;\n        uint208 _value;\n    }\n\n    /// @notice Checkpoint trace storing 256-bit values; `_trace` holds indices into `_values`.\n    struct Trace256 {\n        OZCheckpoints.Trace208 _trace;\n        uint256[] _values;\n    }\n\n    /// @notice A single (key, value) checkpoint for {Trace256}.\n    struct Checkpoint256 {\n        uint48 _key;\n        uint256 _value;\n    }\n\n    /**\n     * @dev Pushes a (`key`, `value`) pair into a Trace208 so that it is stored as the checkpoint.\n     *\n     * Returns previous value and new value.\n     */\n    function push(Trace208 storage self, uint48 key, uint208 value) internal returns (uint208, uint208) {\n        return self._trace.push(key, value);\n    }\n\n    /**\n     * @dev Returns the value in the last (most recent) checkpoint with a key lower or equal than the search key, or \n     * zero if there is none.\n     */\n    function upperLookupRecent(Trace208 storage self, uint48 key) internal view returns (uint208) {\n        return self._trace.upperLookupRecent(key);\n    }\n\n    /**\n     * @dev Returns the value in the last (most recent) checkpoint with a key lower or equal than the search key, or \n     * zero if there is none.\n     *\n     * NOTE: This is a variant of {upperLookupRecent} that can be optimized by getting the hint\n     * (index of the checkpoint with a key lower or equal than the search key).\n     */\n    function upperLookupRecent(Trace208 storage self, uint48 key, bytes memory hint_) internal view returns (uint208) {\n        if (hint_.length == 0) {\n            return upperLookupRecent(self, key);\n        }\n\n        uint32 hint = abi.decode(hint_, (uint32));\n        Checkpoint208 memory checkpoint = at(self, hint);\n        if (checkpoint._key == key) {\n            return checkpoint._value;\n        }\n\n        if (checkpoint._key < key && (hint == length(self) - 1 || at(self, hint + 1)._key > key)) {\n            return checkpoint._value;\n        }\n\n        return upperLookupRecent(self, key);\n    }\n\n    /**\n     * @dev Returns whether there is a checkpoint with a key lower or equal than the search key in the structure \n     * (i.e. it is not empty), and if so the key and value in the checkpoint, and its position in the trace.\n     */\n    function upperLookupRecentCheckpoint(\n        Trace208 storage self,\n        uint48 key\n    ) internal view returns (bool, uint48, uint208, uint32) {\n        uint256 len = self._trace._checkpoints.length;\n\n        uint256 low = 0;\n        uint256 high = len;\n\n        if (len > 5) {\n            uint256 mid = len - Math.sqrt(len);\n            if (key < _unsafeAccess(self._trace._checkpoints, mid)._key) {\n                high = mid;\n            } else {\n                low = mid + 1;\n            }\n        }\n\n        uint256 pos = _upperBinaryLookup(self._trace._checkpoints, key, low, high);\n\n        if (pos == 0) {\n            return (false, 0, 0, 0);\n        }\n\n        OZCheckpoints.Checkpoint208 memory checkpoint = _unsafeAccess(self._trace._checkpoints, pos - 1);\n        return (true, checkpoint._key, checkpoint._value, uint32(pos - 1));\n    }\n\n    /**\n     * @dev Returns whether there is a checkpoint with a key lower or equal than the search key in the structure \n     * (i.e. it is not empty), and if so the key and value in the checkpoint, and its position in the trace.\n     *\n     * NOTE: This is a variant of {upperLookupRecentCheckpoint} that can be optimized by getting the hint\n     * (index of the checkpoint with a key lower or equal than the search key).\n     */\n    function upperLookupRecentCheckpoint(\n        Trace208 storage self,\n        uint48 key,\n        bytes memory hint_\n    ) internal view returns (bool, uint48, uint208, uint32) {\n        if (hint_.length == 0) {\n            return upperLookupRecentCheckpoint(self, key);\n        }\n\n        uint32 hint = abi.decode(hint_, (uint32));\n        Checkpoint208 memory checkpoint = at(self, hint);\n        if (checkpoint._key == key) {\n            return (true, checkpoint._key, checkpoint._value, hint);\n        }\n\n        if (checkpoint._key < key && (hint == length(self) - 1 || at(self, hint + 1)._key > key)) {\n            return (true, checkpoint._key, checkpoint._value, hint);\n        }\n\n        return upperLookupRecentCheckpoint(self, key);\n    }\n\n    /**\n     * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n     */\n    function latest(\n        Trace208 storage self\n    ) internal view returns (uint208) {\n        return self._trace.latest();\n    }\n\n    /**\n     * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n     * in the most recent checkpoint.\n     */\n    function latestCheckpoint(\n        Trace208 storage self\n    ) internal view returns (bool, uint48, uint208) {\n        return self._trace.latestCheckpoint();\n    }\n\n    /**\n     * @dev Returns a total number of checkpoints.\n     */\n    function length(\n        Trace208 storage self\n    ) internal view returns (uint256) {\n        return self._trace.length();\n    }\n\n    /**\n     * @dev Returns checkpoint at a given position.\n     */\n    function at(Trace208 storage self, uint32 pos) internal view returns (Checkpoint208 memory) {\n        OZCheckpoints.Checkpoint208 memory checkpoint = self._trace.at(pos);\n        return Checkpoint208({_key: checkpoint._key, _value: checkpoint._value});\n    }\n\n    /**\n     * @dev Pops the last (most recent) checkpoint.\n     */\n    function pop(\n        Trace208 storage self\n    ) internal returns (uint208 value) {\n        value = self._trace.latest();\n        self._trace._checkpoints.pop();\n    }\n\n    /**\n     * @dev Pushes a (`key`, `value`) pair into a Trace256 so that it is stored as the checkpoint.\n     *\n     * Returns previous value and new value.\n     */\n    function push(Trace256 storage self, uint48 key, uint256 value) internal returns (uint256, uint256) {\n        if (self._values.length == 0) {\n            self._values.push(0);\n        }\n\n        (bool exists, uint48 lastKey,) = self._trace.latestCheckpoint();\n\n        uint256 len = self._values.length;\n        uint256 lastValue = latest(self);\n        if (exists && key == lastKey) {\n            self._values[len - 1] = value;\n        } else {\n            self._trace.push(key, uint208(len));\n            self._values.push(value);\n        }\n\n        return (lastValue, value);\n    }\n\n    /**\n     * @dev Returns the value in the last (most recent) checkpoint with a key lower or equal than the search key, \n     * or zero if there is none.\n     */\n    function upperLookupRecent(Trace256 storage self, uint48 key) internal view returns (uint256) {\n        uint208 idx = self._trace.upperLookupRecent(key);\n        return idx > 0 ? self._values[idx] : 0;\n    }\n\n    /**\n     * @dev Returns the value in the last (most recent) checkpoint with a key lower or equal than the search key, \n     * or zero if there is none.\n     *\n     * NOTE: This is a variant of {upperLookupRecent} that can be optimized by getting the hint\n     * (index of the checkpoint with a key lower or equal than the search key).\n     */\n    function upperLookupRecent(Trace256 storage self, uint48 key, bytes memory hint_) internal view returns (uint256) {\n        if (hint_.length == 0) {\n            return upperLookupRecent(self, key);\n        }\n\n        uint32 hint = abi.decode(hint_, (uint32));\n        Checkpoint256 memory checkpoint = at(self, hint);\n        if (checkpoint._key == key) {\n            return checkpoint._value;\n        }\n\n        if (checkpoint._key < key && (hint == length(self) - 1 || at(self, hint + 1)._key > key)) {\n            return checkpoint._value;\n        }\n\n        return upperLookupRecent(self, key);\n    }\n\n    /**\n     * @dev Returns whether there is a checkpoint with a key lower or equal than the search key in the structure \n     * (i.e. it is not empty), and if so the key and value in the checkpoint, and its position in the trace.\n     */\n    function upperLookupRecentCheckpoint(\n        Trace256 storage self,\n        uint48 key\n    ) internal view returns (bool, uint48, uint256, uint32) {\n        uint256 len = self._trace._checkpoints.length;\n\n        uint256 low = 0;\n        uint256 high = len;\n\n        if (len > 5) {\n            uint256 mid = len - Math.sqrt(len);\n            if (key < _unsafeAccess(self._trace._checkpoints, mid)._key) {\n                high = mid;\n            } else {\n                low = mid + 1;\n            }\n        }\n\n        uint256 pos = _upperBinaryLookup(self._trace._checkpoints, key, low, high);\n\n        if (pos == 0) {\n            return (false, 0, 0, 0);\n        }\n\n        OZCheckpoints.Checkpoint208 memory checkpoint = _unsafeAccess(self._trace._checkpoints, pos - 1);\n        return (true, checkpoint._key, self._values[checkpoint._value], uint32(pos - 1));\n    }\n\n    /**\n     * @dev Returns whether there is a checkpoint with a key lower or equal than the search key in the structure \n     * (i.e. it is not empty), and if so the key and value in the checkpoint, and its position in the trace.\n     *\n     * NOTE: This is a variant of {upperLookupRecentCheckpoint} that can be optimized by getting the hint\n     * (index of the checkpoint with a key lower or equal than the search key).\n     */\n    function upperLookupRecentCheckpoint(\n        Trace256 storage self,\n        uint48 key,\n        bytes memory hint_\n    ) internal view returns (bool, uint48, uint256, uint32) {\n        if (hint_.length == 0) {\n            return upperLookupRecentCheckpoint(self, key);\n        }\n\n        uint32 hint = abi.decode(hint_, (uint32));\n        Checkpoint256 memory checkpoint = at(self, hint);\n        if (checkpoint._key == key) {\n            return (true, checkpoint._key, checkpoint._value, hint);\n        }\n\n        if (checkpoint._key < key && (hint == length(self) - 1 || at(self, hint + 1)._key > key)) {\n            return (true, checkpoint._key, checkpoint._value, hint);\n        }\n\n        return upperLookupRecentCheckpoint(self, key);\n    }\n\n    /**\n     * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n     */\n    function latest(\n        Trace256 storage self\n    ) internal view returns (uint256) {\n        uint208 idx = self._trace.latest();\n        return idx > 0 ? self._values[idx] : 0;\n    }\n\n    /**\n     * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n     * in the most recent checkpoint.\n     */\n    function latestCheckpoint(\n        Trace256 storage self\n    ) internal view returns (bool exists, uint48 _key, uint256 _value) {\n        uint256 idx;\n        (exists, _key, idx) = self._trace.latestCheckpoint();\n        _value = exists ? self._values[idx] : 0;\n    }\n\n    /**\n     * @dev Returns a total number of checkpoints.\n     */\n    function length(\n        Trace256 storage self\n    ) internal view returns (uint256) {\n        return self._trace.length();\n    }\n\n    /**\n     * @dev Returns checkpoint at a given position.\n     */\n    function at(Trace256 storage self, uint32 pos) internal view returns (Checkpoint256 memory) {\n        OZCheckpoints.Checkpoint208 memory checkpoint = self._trace.at(pos);\n        return Checkpoint256({_key: checkpoint._key, _value: self._values[checkpoint._value]});\n    }\n\n    /**\n     * @dev Pops the last (most recent) checkpoint.\n     */\n    function pop(\n        Trace256 storage self\n    ) internal returns (uint256 value) {\n        uint208 idx = self._trace.latest();\n        if (idx == 0) {\n            revert SystemCheckpoint();\n        }\n        value = self._values[idx];\n        self._trace._checkpoints.pop();\n        self._values.pop();\n    }\n\n    /**\n     * @dev Return the index of the last (most recent) checkpoint with a key lower or equal than the search key, or \n     * `high` if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and \n     * exclusive `high`.\n     *\n     * WARNING: `high` should not be greater than the array's length.\n     */\n    function _upperBinaryLookup(\n        OZCheckpoints.Checkpoint208[] storage self,\n        uint48 key,\n        uint256 low,\n        uint256 high\n    ) private view returns (uint256) {\n        while (low < high) {\n            uint256 mid = Math.average(low, high);\n            if (_unsafeAccess(self, mid)._key > key) {\n                high = mid;\n            } else {\n                low = mid + 1;\n            }\n        }\n        return high;\n    }\n\n    /**\n     * @dev Access an element of the array without performing a bounds check. The position is assumed to be within \n     * bounds.\n     */\n    function _unsafeAccess(\n        OZCheckpoints.Checkpoint208[] storage self,\n        uint256 pos\n    ) private pure returns (OZCheckpoints.Checkpoint208 storage result) {\n        // solhint-disable-next-line no-inline-assembly\n        assembly {\n            mstore(0, self.slot)\n            result.slot := add(keccak256(0, 0x20), pos)\n        }\n    }\n}"}],"certified":false,"conflicting_implementations":null,"abi":[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[],"name":"AccountNotAllowlisted","type":"error"},{"inputs":[{"internalType":"uint256","name":"period","type":"uint256"}],"name":"AlreadyClaimedPeriod","type":"error"},{"inputs":[],"name":"BlocklistedAddress","type":"error"},{"inputs":[],"name":"CheckpointUnorderedInsertion","type":"error"},{"inputs":[],"name":"CurrentPeriodConfigurationNotLast","type":"error"},{"inputs":[],"name":"CurrentPeriodHasActiveIncident","type":"error"},{"inputs":[],"name":"DepositLimitExceeded","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientAllowance","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC20InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC20InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC20InvalidSender","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"}],"name":"ERC20InvalidSpender","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"name":"ERC4626ExceededMaxDeposit","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"name":"ERC4626ExceededMaxMint","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"name":"ERC4626ExceededMaxRedeem","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"name":"ERC4626ExceededMaxWithdraw","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[],"name":"InsufficientShares","type":"error"},{"inputs":[],"name":"InvalidAddress","type":"error"},{"inputs":[],"name":"InvalidAdminAddress","type":"error"},{"inputs":[],"name":"InvalidAmount","type":"error"},{"inputs":[],"name":"InvalidArrayLength","type":"error"},{"inputs":[],"name":"InvalidAssetAddress","type":"error"},{"inputs":[],"name":"InvalidCapturePeriod","type":"error"},{"inputs":[],"name":"InvalidDepositLimit","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"InvalidPeriod","type":"error"},{"inputs":[],"name":"InvalidPeriodConfigurationDuration","type":"error"},{"inputs":[],"name":"InvalidPeriodConfigurationEpoch","type":"error"},{"inputs":[{"internalType":"uint256","name":"period","type":"uint256"}],"name":"NoWithdrawalAmount","type":"error"},{"inputs":[],"name":"NotBlocklistedAddress","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"uint8","name":"bits","type":"uint8"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"SafeCastOverflowedUintDowncast","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"period","type":"uint256"},{"indexed":false,"internalType":"bool","name":"active","type":"bool"}],"name":"ActiveIncidentUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"AddedToBlocklist","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"AddedToPayoutAllowlist","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"period","type":"uint256"}],"name":"CompleteWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"limit","type":"uint256"}],"name":"DepositLimitUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"requestedAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"paidAmount","type":"uint256"},{"indexed":false,"internalType":"uint48","name":"captureTimestamp","type":"uint48"}],"name":"PayoutExecuted","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint48","name":"epoch","type":"uint48"},{"internalType":"uint48","name":"duration","type":"uint48"},{"internalType":"uint256","name":"startingPeriod","type":"uint256"}],"indexed":false,"internalType":"struct FirelightVaultStorage.PeriodConfiguration","name":"periodConfiguration","type":"tuple"}],"name":"PeriodConfigurationAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"RemovedFromBlocklist","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"RemovedFromPayoutAllowlist","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"rescuedShares","type":"uint256"}],"name":"SharesRescuedFromBlocklisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"totalAssets","type":"uint256"}],"name":"TotalAssetsCheckpointed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Withdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"period","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"WithdrawRequest","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"periods","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"rescuedShares","type":"uint256[]"}],"name":"WithdrawRescuedFromBlocklisted","type":"event"},{"inputs":[],"name":"BLOCKLIST_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CHECKPOINT_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEPOSIT_LIMIT_UPDATE_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"INCIDENT_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_PERIOD_DURATION","outputs":[{"internalType":"uint48","name":"","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSE_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAYOUT_ALLOWLIST_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAYOUT_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERIOD_CONFIGURATION_UPDATE_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RESCUER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SMALLEST_PERIOD_DURATION","outputs":[{"internalType":"uint48","name":"","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint48","name":"epoch","type":"uint48"},{"internalType":"uint48","name":"duration","type":"uint48"}],"name":"addPeriodConfiguration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"addToBlocklist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"addToPayoutAllowlist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"asset","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint48","name":"timestamp","type":"uint48"}],"name":"balanceOfAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"checkpointTotalAssets","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"period","type":"uint256"}],"name":"claimWithdraw","outputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractVersion","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"convertToAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"convertToShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentPeriodConfiguration","outputs":[{"components":[{"internalType":"uint48","name":"epoch","type":"uint48"},{"internalType":"uint48","name":"duration","type":"uint48"},{"internalType":"uint256","name":"startingPeriod","type":"uint256"}],"internalType":"struct FirelightVaultStorage.PeriodConfiguration","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentPeriodEnd","outputs":[{"internalType":"uint48","name":"","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentPeriodStart","outputs":[{"internalType":"uint48","name":"","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"deposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"period","type":"uint256"}],"name":"hasActiveIncident","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_asset","type":"address"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"bytes","name":"_initParams","type":"bytes"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"initializeV2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isBlocklisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isPayoutAllowlisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"period","type":"uint256"}],"name":"isPeriodInPayoutWindow","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"period","type":"uint256"},{"internalType":"address","name":"account","type":"address"}],"name":"isWithdrawClaimed","outputs":[{"internalType":"bool","name":"value","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"maxDeposit","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"maxMint","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"maxRedeem","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"maxWithdraw","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"mint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextPeriodEnd","outputs":[{"internalType":"uint48","name":"","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint48","name":"captureTimestamp","type":"uint48"}],"name":"payout","outputs":[{"internalType":"uint256","name":"paidAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pendingWithdrawAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint48","name":"timestamp","type":"uint48"}],"name":"periodAtTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"periodNumber","type":"uint256"}],"name":"periodConfigurationAtNumber","outputs":[{"components":[{"internalType":"uint48","name":"epoch","type":"uint48"},{"internalType":"uint48","name":"duration","type":"uint48"},{"internalType":"uint256","name":"startingPeriod","type":"uint256"}],"internalType":"struct FirelightVaultStorage.PeriodConfiguration","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint48","name":"timestamp","type":"uint48"}],"name":"periodConfigurationAtTimestamp","outputs":[{"components":[{"internalType":"uint48","name":"epoch","type":"uint48"},{"internalType":"uint48","name":"duration","type":"uint48"},{"internalType":"uint256","name":"startingPeriod","type":"uint256"}],"internalType":"struct FirelightVaultStorage.PeriodConfiguration","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"periodConfigurations","outputs":[{"internalType":"uint48","name":"epoch","type":"uint48"},{"internalType":"uint48","name":"duration","type":"uint48"},{"internalType":"uint256","name":"startingPeriod","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodConfigurationsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"previewDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"previewMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"previewRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"previewWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"redeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"removeFromBlocklist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"removeFromPayoutAllowlist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"rescueSharesFromBlocklisted","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"periods","type":"uint256[]"}],"name":"rescueWithdrawFromBlocklisted","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"period","type":"uint256"},{"internalType":"bool","name":"active","type":"bool"}],"name":"setActiveIncident","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint48","name":"timestamp","type":"uint48"}],"name":"totalAssetsAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint48","name":"timestamp","type":"uint48"}],"name":"totalSupplyAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newLimit","type":"uint256"}],"name":"updateDepositLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"withdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"period","type":"uint256"}],"name":"withdrawAssets","outputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"period","type":"uint256"}],"name":"withdrawShares","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"period","type":"uint256"},{"internalType":"address","name":"account","type":"address"}],"name":"withdrawSharesOf","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"period","type":"uint256"},{"internalType":"address","name":"account","type":"address"}],"name":"withdrawalsOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}],"is_changed_bytecode":false,"is_partially_verified":false,"constructor_args":null}