{"file_path":"src/v2/StakedUSDx.sol","creation_status":"success","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.30;\n\nimport {AccessControlUpgradeable} from \"@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol\";\nimport {Initializable} from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport {ERC20Upgradeable} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\nimport {ERC4626Upgradeable} from \"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC4626Upgradeable.sol\";\nimport {IERC4626} from \"@openzeppelin/contracts/interfaces/IERC4626.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {SafeERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {IERC165} from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport {Math} from \"@openzeppelin/contracts/utils/math/Math.sol\";\n\nimport {IERC7540Operator, IERC7540Redeem} from \"./interfaces/IERC7540Redeem.sol\";\nimport {IRedemptionManager} from \"./interfaces/IRedemptionManager.sol\";\nimport {IRewardManager} from \"./interfaces/IRewardManager.sol\";\nimport {IStakedUSDx} from \"./interfaces/IStakedUSDx.sol\";\nimport {IVaultShareToken} from \"./interfaces/IVaultShareToken.sol\";\n\n/// @notice ERC-4626 staking vault with vested rewards, async redemptions, and restriction controls.\n/// @dev Redemption accounting separates pending and claimable liabilities so servicing and claims cannot spend rewards or principal twice.\ncontract StakedUSDx is Initializable, ERC4626Upgradeable, AccessControlUpgradeable, IStakedUSDx {\n    using Math for uint256;\n    using SafeERC20 for IERC20;\n\n    uint256 private constant WAD = 1e18;\n    bytes32 private constant STATUS_CLEAR = bytes32(\"CLEAR\");\n    bytes32 private constant STATUS_RESTRICTED = bytes32(\"RESTRICTED\");\n    bytes32 private constant STATUS_FULL_RESTRICTION = bytes32(\"FULL_RESTRICTION\");\n    bytes32 private constant BLOCKED_NONE = bytes32(0);\n    bytes32 private constant BLOCKED_NON_EXIT = bytes32(\"NON_EXIT\");\n    bytes32 private constant BLOCKED_ALL = bytes32(\"ALL\");\n    bytes32 private constant BASIS_AUTHORITY = bytes32(\"AUTHORITY\");\n    bytes32 private constant PAUSE_REQUESTS = bytes32(\"REQUESTS\");\n    bytes32 private constant PAUSE_CLAIMS = bytes32(\"CLAIMS\");\n    bytes32 private constant PAUSE_SERVICING = bytes32(\"SERVICING\");\n    bytes32 private constant PAUSE_CANCELLATIONS = bytes32(\"CANCELLATIONS\");\n    bytes4 private constant ERC7575_VAULT_INTERFACE_ID = 0x2f0a18c5;\n    bytes32 public constant DEFAULT_REDEMPTION_POLICY_ID = bytes32(\"DEFAULT\");\n    uint256 public constant MAX_COOLDOWN_DURATION = 90 days;\n\n    bytes32 public constant override REWARD_MANAGER_ROLE = keccak256(\"REWARD_MANAGER_ROLE\");\n    bytes32 public constant override PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n    bytes32 public constant override RESTRICTION_ROLE = keccak256(\"RESTRICTION_ROLE\");\n    bytes32 public constant override REDEMPTION_SERVICER_ROLE = keccak256(\"REDEMPTION_SERVICER_ROLE\");\n\n    uint256 public override REQUEST_ID = 1;\n\n    uint256 private _accountedAssets;\n    uint256 private _pendingRedeemAssets;\n    uint256 private _claimableRedeemAssets;\n\n    uint256 private _unvestedRewards;\n    uint256 private _rewardRate;\n    uint256 private _periodFinish;\n    uint256 private _lastUpdated;\n    uint256 private _rewardDuration;\n    uint256 private _maxRewardRate;\n    bool private _rewardPaused;\n    address private _rewardAuthority;\n\n    uint256 private _cooldownDuration;\n    uint256 private _maxServiceBatchShares;\n    bool private _requestPaused;\n    bool private _claimPaused;\n    bool private _servicePaused;\n    bool private _cancelPaused;\n    address private _serviceAuthority;\n    uint256 private _redemptionControlsUpdatedAt;\n    uint256 private _nextServiceRequestId = 1;\n    uint256 private _nextServiceId = 1;\n\n    bool private _depositPaused;\n\n    mapping(address controller => mapping(address operator => bool approved)) private _operators;\n    mapping(address controller => RedeemRequestState state) private _redeemRequests;\n    mapping(uint256 requestId => mapping(address controller => RedemptionState state)) private _redemptions;\n    mapping(uint256 requestId => address controller) private _requestController;\n    mapping(address controller => uint256[] requestIds) private _controllerRequests;\n    mapping(address controller => uint256 claimIndex) private _claimIndex;\n    mapping(address account => bool restricted) private _restricted;\n    mapping(address account => bool fullRestriction) private _fullRestriction;\n    mapping(bytes32 policyId => RedemptionPolicy policy) private _redemptionPolicies;\n    mapping(address account => bytes32 policyId) private _accountRedemptionPolicy;\n\n    uint256 private constant MAX_SERVICE_SCAN_REQUESTS = 256;\n\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    /// @notice Initializes share metadata, access roles, reward schedule, and the default redemption policy.\n    function initialize(IERC20 asset_, address admin, uint256 rewardDuration_) external initializer {\n        if (address(asset_) == address(0) || admin == address(0)) {\n            revert InvalidZeroAddress();\n        }\n\n        __ERC20_init(\"Staked USDx\", \"sUSDx\");\n        __ERC4626_init(asset_);\n        __AccessControl_init();\n\n        _grantRole(DEFAULT_ADMIN_ROLE, admin);\n        _grantRole(REWARD_MANAGER_ROLE, admin);\n        _grantRole(PAUSER_ROLE, admin);\n        _grantRole(RESTRICTION_ROLE, admin);\n        _grantRole(REDEMPTION_SERVICER_ROLE, admin);\n\n        _rewardAuthority = admin;\n        _serviceAuthority = admin;\n        _rewardDuration = rewardDuration_;\n        _lastUpdated = block.timestamp;\n        _redemptionControlsUpdatedAt = block.timestamp;\n        _redemptionPolicies[DEFAULT_REDEMPTION_POLICY_ID].enabled = true;\n        REQUEST_ID = 1;\n        _nextServiceRequestId = 1;\n        _nextServiceId = 1;\n    }\n\n    function totalAssets() public view override(ERC4626Upgradeable, IERC4626) returns (uint256) {\n        return _currentAccountedAssets();\n    }\n\n    function accountedAssets() external view override returns (uint256) {\n        return _currentAccountedAssets();\n    }\n\n    function pendingRedeemAssets() external view override returns (uint256) {\n        return _pendingRedeemAssets;\n    }\n\n    function claimableRedeemAssets() external view override returns (uint256) {\n        return _claimableRedeemAssets;\n    }\n\n    function cooldownDuration() external view override returns (uint256) {\n        return _cooldownDuration;\n    }\n\n    function depositPaused() external view override returns (bool) {\n        return _depositPaused;\n    }\n\n    function exchangeRate() external view override returns (uint256) {\n        uint256 supply = totalSupply();\n        if (supply == 0) {\n            return WAD;\n        }\n        return totalAssets().mulDiv(WAD, supply, Math.Rounding.Floor);\n    }\n\n    function getVaultState() external view override returns (VaultState memory state) {\n        uint256 accounted = _currentAccountedAssets();\n        uint256 required = _requiredAssets();\n        uint256 balance = _assetBalance();\n        uint256 supply = totalSupply();\n\n        state = VaultState({\n            totalSupply: supply,\n            totalAssets: accounted,\n            accountedAssets: accounted,\n            pendingRedeemAssets: _pendingRedeemAssets,\n            claimableRedeemAssets: _claimableRedeemAssets,\n            redeemLiabilities: _pendingRedeemAssets + _claimableRedeemAssets,\n            requiredAssets: required,\n            assetBalance: balance,\n            exchangeRate: supply == 0 ? WAD : accounted.mulDiv(WAD, supply, Math.Rounding.Floor),\n            cooldown: _cooldownDuration,\n            solvent: balance >= required\n        });\n    }\n\n    function maxDeposit(address receiver) public view override(ERC4626Upgradeable, IERC4626) returns (uint256) {\n        return _depositPaused || _restricted[receiver] ? 0 : type(uint256).max;\n    }\n\n    function maxMint(address receiver) public view override(ERC4626Upgradeable, IERC4626) returns (uint256) {\n        return _depositPaused || _restricted[receiver] ? 0 : type(uint256).max;\n    }\n\n    /// @notice Maximum assets claimable via `withdraw`, i.e. the controller's total claimable assets.\n    /// @dev `withdraw(maxWithdraw(controller))` never reverts: consuming every lot in full uses each lot's exact\n    /// share count with no rounding. Intermediate asset amounts below the maximum may still revert on per-lot\n    /// share rounding (see `withdraw`); use `redeem` for share-exact partial claims.\n    function maxWithdraw(address controller) public view override(ERC4626Upgradeable, IERC4626) returns (uint256) {\n        if (_claimPaused || _fullRestriction[controller]) {\n            return 0;\n        }\n        return _redeemRequests[controller].claimableAssets;\n    }\n\n    function maxRedeem(address controller) public view override(ERC4626Upgradeable, IERC4626) returns (uint256) {\n        if (_claimPaused || _fullRestriction[controller]) {\n            return 0;\n        }\n        return _redeemRequests[controller].claimableShares;\n    }\n\n    function previewWithdraw(uint256) public pure override(ERC4626Upgradeable, IERC4626) returns (uint256) {\n        revert OperationNotAllowed();\n    }\n\n    function previewRedeem(uint256) public pure override(ERC4626Upgradeable, IERC4626) returns (uint256) {\n        revert OperationNotAllowed();\n    }\n\n    /// @notice Claims previously serviced redemption assets by asset amount.\n    /// @dev Withdraw is claim-only in this async vault; requests must be serviced before assets become claimable.\n    /// Claims draw down per-request lots in order: a fully-consumed lot uses its exact share count, but a lot\n    /// consumed only partially converts assets->shares with ceil rounding and reverts if that would round up to\n    /// the whole lot. Consequently `withdraw(maxWithdraw(controller))` (all lots consumed in full) always\n    /// succeeds, while some intermediate asset amounts below it may revert. Use `redeem` (share-denominated,\n    /// floor rounding) for share-exact partial claims.\n    function withdraw(uint256 assets, address receiver, address controller)\n        public\n        override(ERC4626Upgradeable, IERC4626)\n        returns (uint256 shares)\n    {\n        _requireClaimOpen();\n        if (assets == 0 || receiver == address(0) || controller == address(0)) {\n            revert InvalidAmount();\n        }\n        if (!_isSelfOrOperator(controller, msg.sender)) {\n            revert OperationNotAllowed();\n        }\n        _requireClaimAllowed(controller, receiver);\n\n        RedeemRequestState storage aggregate = _redeemRequests[controller];\n        if (assets > aggregate.claimableAssets) {\n            revert InsufficientClaimable();\n        }\n\n        shares = _claimRedeemByAssets(controller, receiver, assets);\n    }\n\n    /// @notice Claims previously serviced redemption assets by share amount.\n    /// @dev Shares were burned when the async request was created, so this only releases reserved assets.\n    function redeem(uint256 shares, address receiver, address controller)\n        public\n        override(ERC4626Upgradeable, IERC4626)\n        returns (uint256 assets)\n    {\n        _requireClaimOpen();\n        if (shares == 0 || receiver == address(0) || controller == address(0)) {\n            revert InvalidAmount();\n        }\n        if (!_isSelfOrOperator(controller, msg.sender)) {\n            revert OperationNotAllowed();\n        }\n        _requireClaimAllowed(controller, receiver);\n\n        RedeemRequestState storage aggregate = _redeemRequests[controller];\n        if (shares > aggregate.claimableShares) {\n            revert InsufficientClaimable();\n        }\n\n        assets = _claimRedeemByShares(controller, receiver, shares);\n    }\n\n    /// @notice Allows or removes an operator for the caller's redemption actions.\n    function setOperator(address operator, bool approved) external override returns (bool success) {\n        if (operator == address(0)) {\n            revert InvalidZeroAddress();\n        }\n        _operators[msg.sender][operator] = approved;\n        emit OperatorSet(msg.sender, operator, approved);\n        return true;\n    }\n\n    function isOperator(address controller, address operator) public view override returns (bool status) {\n        return _operators[controller][operator];\n    }\n\n    /// @notice Burns shares and creates an async redemption request for later servicing.\n    /// @dev Full restrictions block new requests; soft restrictions may still exit to their own controller.\n    function requestRedeem(uint256 shares, address controller, address owner)\n        external\n        override\n        returns (uint256 requestId)\n    {\n        if (_requestPaused) {\n            revert OperationNotAllowed();\n        }\n        if (shares == 0 || controller == address(0) || owner == address(0)) {\n            revert InvalidAmount();\n        }\n        if (!_isSelfOrOperator(owner, msg.sender) || !_isSelfOrOperator(controller, msg.sender)) {\n            revert OperationNotAllowed();\n        }\n        // Freeze integrity: shares are burned from `owner` below, so a fully restricted owner (or controller)\n        // cannot open a request and move value out from under a freeze. Value already in-flight for a\n        // subsequently-restricted account is recoverable by RESTRICTION_ROLE via redistributeRedeemRequest.\n        if (_fullRestriction[controller] || _fullRestriction[owner]) {\n            revert OperationNotAllowed();\n        }\n        if (_restricted[owner] && controller != owner) {\n            revert OperationNotAllowed();\n        }\n        if (balanceOf(owner) < shares) {\n            revert MinSharesViolation();\n        }\n\n        _checkpointRewards();\n        (bytes32 policyId, RedemptionPolicy memory policy) = _redemptionPolicyFor(controller);\n        if (policy.maxRequestShares != 0 && shares > policy.maxRequestShares) {\n            revert InvalidAmount();\n        }\n        uint256 assets = _convertToAssets(shares, Math.Rounding.Floor);\n\n        _burn(owner, shares);\n        _accountedAssets -= assets;\n        _pendingRedeemAssets += assets;\n\n        requestId = REQUEST_ID++;\n        _requestController[requestId] = controller;\n        _controllerRequests[controller].push(requestId);\n\n        _redeemRequests[controller].pendingShares += shares;\n        _redeemRequests[controller].pendingAssets += assets;\n        _redemptions[requestId][controller] = RedemptionState({\n            requestId: requestId,\n            controller: controller,\n            owner: owner,\n            shares: shares,\n            assetsReserved: assets,\n            requestedAt: block.timestamp,\n            eligibleAt: block.timestamp + policy.cooldown,\n            policyId: policyId,\n            status: RedemptionStatus.PENDING\n        });\n\n        emit RedeemRequest(controller, owner, requestId, msg.sender, shares);\n    }\n\n    function pendingRedeemRequest(uint256 requestId, address controller)\n        external\n        view\n        override\n        returns (uint256 shares)\n    {\n        RedemptionState storage state = _redemptions[requestId][controller];\n        return state.status == RedemptionStatus.PENDING ? state.shares : 0;\n    }\n\n    function claimableRedeemRequest(uint256 requestId, address controller)\n        external\n        view\n        override\n        returns (uint256 shares)\n    {\n        RedemptionState storage state = _redemptions[requestId][controller];\n        return state.status == RedemptionStatus.CLAIMABLE ? state.shares : 0;\n    }\n\n    function getRedeemRequest(address controller) external view override returns (RedeemRequestState memory) {\n        return _redeemRequests[controller];\n    }\n\n    function redemptionState(uint256 requestId, address controller)\n        external\n        view\n        override\n        returns (RedemptionState memory)\n    {\n        return _redemptions[requestId][controller];\n    }\n\n    function redemptionControls() external view override returns (RedemptionControls memory) {\n        return RedemptionControls({\n            cooldown: _cooldownDuration,\n            maxServiceBatchShares: _maxServiceBatchShares,\n            requestPaused: _requestPaused,\n            claimPaused: _claimPaused,\n            servicePaused: _servicePaused,\n            cancelPaused: _cancelPaused,\n            serviceAuthority: _serviceAuthority,\n            updatedAt: _redemptionControlsUpdatedAt\n        });\n    }\n\n    function redemptionPolicy(bytes32 policyId) external view override returns (RedemptionPolicy memory) {\n        return _redemptionPolicies[policyId];\n    }\n\n    function accountRedemptionPolicy(address account) external view override returns (bytes32) {\n        return _accountRedemptionPolicy[account];\n    }\n\n    /// @notice Services eligible redemption requests in request-id order up to scan and share limits.\n    /// @dev Ineligible pending requests are skipped until the scan bound is reached, so later eligible requests can advance.\n    function serviceRedemptions(uint256 maxShares)\n        external\n        override\n        onlyRole(REDEMPTION_SERVICER_ROLE)\n        returns (RedemptionServiceResult memory result)\n    {\n        if (_servicePaused) {\n            revert OperationNotAllowed();\n        }\n        uint256 serviceLimit = maxShares;\n        if (_maxServiceBatchShares != 0 && (serviceLimit == 0 || serviceLimit > _maxServiceBatchShares)) {\n            serviceLimit = _maxServiceBatchShares;\n        }\n\n        result.serviceId = _nextServiceId++;\n        uint256 requestId = _nextServiceRequestId;\n        uint256 firstSkippedPendingRequestId;\n        uint256 requestsScanned;\n        while (\n            requestId < REQUEST_ID && requestsScanned < MAX_SERVICE_SCAN_REQUESTS\n                && (serviceLimit == 0 || result.sharesMadeClaimable < serviceLimit)\n        ) {\n            requestsScanned++;\n            address controller = _requestController[requestId];\n            RedemptionState storage state = _redemptions[requestId][controller];\n            if (state.status == RedemptionStatus.PENDING) {\n                if (block.timestamp < state.eligibleAt) {\n                    if (firstSkippedPendingRequestId == 0) {\n                        firstSkippedPendingRequestId = requestId;\n                    }\n                    requestId++;\n                    continue;\n                }\n                // Forward-progress guarantee: the first eligible request in a batch is always serviced\n                // (result.requestsServiced == 0 here), so a request whose size alone exceeds serviceLimit\n                // can never permanently stall the queue. serviceLimit is a soft batch cap, not a per-request\n                // maximum (per-request size is bounded separately by policy.maxRequestShares).\n                if (\n                    serviceLimit != 0 && result.requestsServiced != 0\n                        && result.sharesMadeClaimable + state.shares > serviceLimit\n                ) {\n                    break;\n                }\n\n                (uint256 sharesMadeClaimable, uint256 assetsReserved) =\n                    _servicePendingRedeemRequest(requestId, controller);\n                result.requestsServiced += 1;\n                result.sharesMadeClaimable += sharesMadeClaimable;\n                result.assetsReserved += assetsReserved;\n            }\n            requestId++;\n        }\n        _nextServiceRequestId =\n            requestId == REQUEST_ID && firstSkippedPendingRequestId != 0 ? firstSkippedPendingRequestId : requestId;\n\n        emit RedemptionsServiced(\n            result.serviceId, result.requestsServiced, result.sharesMadeClaimable, result.assetsReserved\n        );\n    }\n\n    /// @notice Services one eligible redemption request by exact id and controller.\n    function serviceRedeemRequest(uint256 requestId, address controller)\n        external\n        override\n        onlyRole(REDEMPTION_SERVICER_ROLE)\n        returns (RedemptionServiceResult memory result)\n    {\n        if (_servicePaused) {\n            revert OperationNotAllowed();\n        }\n        _requireServiceableRedeemRequest(requestId, controller);\n\n        result.serviceId = _nextServiceId++;\n        result.requestsServiced = 1;\n        (result.sharesMadeClaimable, result.assetsReserved) = _servicePendingRedeemRequest(requestId, controller);\n\n        emit RedemptionsServiced(\n            result.serviceId, result.requestsServiced, result.sharesMadeClaimable, result.assetsReserved\n        );\n    }\n\n    /// @notice Cancels a pending redemption request and restores the burned shares.\n    /// @dev Full restrictions cannot cancel because shares would be restored to a blocked account.\n    function cancelRedeemRequest(uint256 requestId, address controller)\n        external\n        override\n        returns (uint256 sharesReturned)\n    {\n        if (_cancelPaused) {\n            revert OperationNotAllowed();\n        }\n        if (!_isSelfOrOperator(controller, msg.sender)) {\n            revert OperationNotAllowed();\n        }\n\n        RedemptionState storage state = _redemptions[requestId][controller];\n        if (state.status != RedemptionStatus.PENDING) {\n            revert OperationNotAllowed();\n        }\n        if (_fullRestriction[controller] || _fullRestriction[state.owner]) {\n            revert OperationNotAllowed();\n        }\n\n        sharesReturned = state.shares;\n        uint256 assetsReleased = state.assetsReserved;\n        state.status = RedemptionStatus.CANCELLED;\n        state.shares = 0;\n        state.assetsReserved = 0;\n\n        RedeemRequestState storage aggregate = _redeemRequests[controller];\n        aggregate.pendingShares -= sharesReturned;\n        aggregate.pendingAssets -= assetsReleased;\n\n        _pendingRedeemAssets -= assetsReleased;\n        _accountedAssets += assetsReleased;\n        _restoreCancelledShares(state.owner, sharesReturned);\n\n        emit RedeemRequestCancelled(requestId, controller, state.owner, sharesReturned, assetsReleased);\n    }\n\n    /// @notice Adds rewards to the vesting schedule after checkpointing already vested rewards.\n    function fundRewards(uint256 assets, bytes32 sourceRef) external override onlyRole(REWARD_MANAGER_ROLE) {\n        if (_rewardPaused) {\n            revert OperationNotAllowed();\n        }\n        if (assets == 0 || _rewardDuration == 0) {\n            revert InvalidAmount();\n        }\n        if (totalSupply() == 0) {\n            revert OperationNotAllowed();\n        }\n\n        _checkpointRewards();\n        uint256 vestingDuration = _activeRewardDuration();\n        uint256 nextUnvested = _unvestedRewards + assets;\n        uint256 nextRewardRate = nextUnvested / vestingDuration;\n        if (nextRewardRate == 0) {\n            revert InvalidAmount();\n        }\n        if (_maxRewardRate != 0 && nextRewardRate > _maxRewardRate) {\n            revert OperationNotAllowed();\n        }\n\n        _assetToken().safeTransferFrom(msg.sender, address(this), assets);\n\n        _unvestedRewards = nextUnvested;\n        _rewardRate = nextRewardRate;\n        _periodFinish = block.timestamp + vestingDuration;\n        _lastUpdated = block.timestamp;\n\n        emit RewardsFunded(msg.sender, assets, sourceRef, _rewardRate, _periodFinish);\n    }\n\n    function rewardConfig() external view override returns (RewardConfig memory) {\n        return RewardConfig({\n            authority: _rewardAuthority, duration: _rewardDuration, maxRate: _maxRewardRate, paused: _rewardPaused\n        });\n    }\n\n    function rewardState() external view override returns (RewardState memory) {\n        uint256 vested = _vestedRewards();\n        return RewardState({\n            accountedAssets: _accountedAssets + vested,\n            unvestedRewards: _unvestedRewards - vested,\n            rewardRate: _rewardRate,\n            periodFinish: _periodFinish,\n            lastUpdated: _currentRewardTimestamp()\n        });\n    }\n\n    function setRewardConfig(uint256 duration, uint256 maxRate, bool paused) external onlyRole(DEFAULT_ADMIN_ROLE) {\n        _checkpointRewards();\n        _rewardDuration = duration;\n        _maxRewardRate = maxRate;\n        _rewardPaused = paused;\n        _rewardAuthority = msg.sender;\n        _rescheduleActiveRewards(duration, maxRate, paused);\n\n        emit RewardConfigUpdated(_rewardAuthority, duration, maxRate, paused);\n    }\n\n    function pauseRewardFunding() external onlyRole(PAUSER_ROLE) {\n        _checkpointRewards();\n        _rewardPaused = true;\n        _rescheduleActiveRewards(_rewardDuration, _maxRewardRate, true);\n        emit RewardConfigUpdated(_rewardAuthority, _rewardDuration, _maxRewardRate, true);\n    }\n\n    function setDepositPause(bool paused) external override onlyRole(DEFAULT_ADMIN_ROLE) {\n        _depositPaused = paused;\n        emit DepositPauseUpdated(paused);\n    }\n\n    function pauseDeposits() external override onlyRole(PAUSER_ROLE) {\n        _depositPaused = true;\n        emit DepositPauseUpdated(true);\n    }\n\n    /// @notice Updates global redemption cooldown, servicing bounds, pause flags, and service authority metadata.\n    function setRedemptionControls(\n        uint256 cooldown,\n        uint256 maxServiceBatchShares,\n        bool requestPaused,\n        bool claimPaused,\n        bool servicePaused,\n        bool cancelPaused,\n        address serviceAuthority\n    ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n        if (serviceAuthority == address(0)) {\n            revert InvalidZeroAddress();\n        }\n        _requireValidCooldown(cooldown);\n        _cooldownDuration = cooldown;\n        _redemptionPolicies[DEFAULT_REDEMPTION_POLICY_ID].cooldown = cooldown;\n        _maxServiceBatchShares = maxServiceBatchShares;\n        _requestPaused = requestPaused;\n        _claimPaused = claimPaused;\n        _servicePaused = servicePaused;\n        _cancelPaused = cancelPaused;\n        _serviceAuthority = serviceAuthority;\n        _redemptionControlsUpdatedAt = block.timestamp;\n        RedemptionPolicy memory defaultPolicy = _redemptionPolicies[DEFAULT_REDEMPTION_POLICY_ID];\n        emit RedemptionControlsUpdated(\n            cooldown, maxServiceBatchShares, requestPaused, claimPaused, servicePaused, cancelPaused, serviceAuthority\n        );\n        emit RedemptionPolicyUpdated(\n            DEFAULT_REDEMPTION_POLICY_ID, defaultPolicy.cooldown, defaultPolicy.maxRequestShares, defaultPolicy.enabled\n        );\n    }\n\n    function pauseRedeemRequests() external onlyRole(PAUSER_ROLE) {\n        _requestPaused = true;\n        _redemptionControlsUpdatedAt = block.timestamp;\n        emit RedemptionPauseUpdated(PAUSE_REQUESTS, true);\n    }\n\n    function pauseRedeemClaims() external onlyRole(PAUSER_ROLE) {\n        _claimPaused = true;\n        _redemptionControlsUpdatedAt = block.timestamp;\n        emit RedemptionPauseUpdated(PAUSE_CLAIMS, true);\n    }\n\n    function pauseRedemptionServicing() external onlyRole(PAUSER_ROLE) {\n        _servicePaused = true;\n        _redemptionControlsUpdatedAt = block.timestamp;\n        emit RedemptionPauseUpdated(PAUSE_SERVICING, true);\n    }\n\n    function pauseRedeemCancellations() external onlyRole(PAUSER_ROLE) {\n        _cancelPaused = true;\n        _redemptionControlsUpdatedAt = block.timestamp;\n        emit RedemptionPauseUpdated(PAUSE_CANCELLATIONS, true);\n    }\n\n    /// @notice Updates the default redemption cooldown while preserving other controls.\n    function setCooldownDuration(uint256 duration) external override onlyRole(DEFAULT_ADMIN_ROLE) {\n        _requireValidCooldown(duration);\n        uint256 previous = _cooldownDuration;\n        _cooldownDuration = duration;\n        _redemptionPolicies[DEFAULT_REDEMPTION_POLICY_ID].cooldown = duration;\n        _redemptionControlsUpdatedAt = block.timestamp;\n        RedemptionPolicy memory defaultPolicy = _redemptionPolicies[DEFAULT_REDEMPTION_POLICY_ID];\n        emit CooldownDurationUpdated(previous, duration);\n        emit RedemptionControlsUpdated(\n            _cooldownDuration,\n            _maxServiceBatchShares,\n            _requestPaused,\n            _claimPaused,\n            _servicePaused,\n            _cancelPaused,\n            _serviceAuthority\n        );\n        emit RedemptionPolicyUpdated(\n            DEFAULT_REDEMPTION_POLICY_ID, defaultPolicy.cooldown, defaultPolicy.maxRequestShares, defaultPolicy.enabled\n        );\n    }\n\n    /// @notice Creates or updates a named redemption policy for account-specific limits.\n    function setRedemptionPolicy(bytes32 policyId, RedemptionPolicy calldata policy)\n        external\n        override\n        onlyRole(DEFAULT_ADMIN_ROLE)\n    {\n        if (policyId == bytes32(0)) {\n            revert OperationNotAllowed();\n        }\n        if (policyId == DEFAULT_REDEMPTION_POLICY_ID && !policy.enabled) {\n            revert OperationNotAllowed();\n        }\n        _requireValidCooldown(policy.cooldown);\n        _redemptionPolicies[policyId] = policy;\n        if (policyId == DEFAULT_REDEMPTION_POLICY_ID) {\n            uint256 previous = _cooldownDuration;\n            _cooldownDuration = policy.cooldown;\n            emit CooldownDurationUpdated(previous, policy.cooldown);\n        }\n        _redemptionControlsUpdatedAt = block.timestamp;\n        emit RedemptionPolicyUpdated(policyId, policy.cooldown, policy.maxRequestShares, policy.enabled);\n    }\n\n    /// @notice Assigns an enabled redemption policy to an account or clears back to default.\n    function setAccountRedemptionPolicy(address account, bytes32 policyId)\n        external\n        override\n        onlyRole(DEFAULT_ADMIN_ROLE)\n    {\n        if (account == address(0)) {\n            revert InvalidZeroAddress();\n        }\n        if (policyId != bytes32(0) && !_redemptionPolicies[policyId].enabled) {\n            revert OperationNotAllowed();\n        }\n        _accountRedemptionPolicy[account] = policyId;\n        _redemptionControlsUpdatedAt = block.timestamp;\n        emit AccountRedemptionPolicyUpdated(account, policyId);\n    }\n\n    /// @notice Applies soft or full restrictions to a vault account.\n    function addToBlacklist(address target, bool isFullRestriction) external override onlyRole(RESTRICTION_ROLE) {\n        if (target == address(0)) {\n            revert InvalidZeroAddress();\n        }\n        _restricted[target] = true;\n        _fullRestriction[target] = isFullRestriction;\n        emit RestrictionUpdated(\n            target,\n            isFullRestriction ? STATUS_FULL_RESTRICTION : STATUS_RESTRICTED,\n            BASIS_AUTHORITY,\n            _authorityRef(msg.sender)\n        );\n    }\n\n    /// @notice Clears all restriction flags for a vault account.\n    function removeFromBlacklist(address target, bool) external override onlyRole(RESTRICTION_ROLE) {\n        if (target == address(0)) {\n            revert InvalidZeroAddress();\n        }\n        _restricted[target] = false;\n        _fullRestriction[target] = false;\n        emit RestrictionUpdated(target, STATUS_CLEAR, BASIS_AUTHORITY, _authorityRef(msg.sender));\n    }\n\n    /// @notice Moves all liquid shares from a fully restricted account to an unrestricted recipient.\n    function redistributeLockedAmount(address from, address to) external override onlyRole(RESTRICTION_ROLE) {\n        if (from == address(0) || to == address(0)) {\n            revert InvalidZeroAddress();\n        }\n        if (!_fullRestriction[from] || _restricted[to]) {\n            revert OperationNotAllowed();\n        }\n        uint256 shares = balanceOf(from);\n        super._update(from, to, shares);\n        emit LockedAmountRedistributed(from, to, shares);\n    }\n\n    /// @notice Moves a pending or claimable redemption request away from a fully restricted account.\n    function redistributeRedeemRequest(uint256 requestId, address controller, address to)\n        external\n        override\n        onlyRole(RESTRICTION_ROLE)\n        returns (uint256 shares, uint256 assets)\n    {\n        if (controller == address(0) || to == address(0)) {\n            revert InvalidZeroAddress();\n        }\n        if (controller == to || _restricted[to]) {\n            revert OperationNotAllowed();\n        }\n\n        RedemptionState memory moved = _redemptions[requestId][controller];\n        if (moved.status != RedemptionStatus.PENDING && moved.status != RedemptionStatus.CLAIMABLE) {\n            revert OperationNotAllowed();\n        }\n        if (!_fullRestriction[controller] && !_fullRestriction[moved.owner]) {\n            revert OperationNotAllowed();\n        }\n\n        shares = moved.shares;\n        assets = moved.assetsReserved;\n        _moveRedeemRequestAggregate(controller, to, moved.status, shares, assets);\n\n        // The old controller's request list is append-only; deleting the state makes future scans skip this request.\n        delete _redemptions[requestId][controller];\n        moved.controller = to;\n        moved.owner = to;\n        _redemptions[requestId][to] = moved;\n        _requestController[requestId] = to;\n        _controllerRequests[to].push(requestId);\n\n        emit RedeemRequestRedistributed(requestId, controller, to, shares, assets, uint8(moved.status));\n    }\n\n    /// @notice Rescues unrelated tokens and surplus underlying assets without touching reserved vault liabilities.\n    function rescueTokens(address token, uint256 amount, address to) external override onlyRole(DEFAULT_ADMIN_ROLE) {\n        if (token == address(this)) {\n            revert InvalidToken();\n        }\n        if (to == address(0)) {\n            revert InvalidZeroAddress();\n        }\n        if (token == address(asset()) && amount > _surplusAssets()) {\n            revert InvalidAmount();\n        }\n        IERC20(token).safeTransfer(to, amount);\n        emit Rescue(token, to, amount);\n    }\n\n    function getAccountState(address account) external view override returns (AccountState memory state) {\n        RedeemRequestState storage redeemRequest = _redeemRequests[account];\n        state = AccountState({\n            shareBalance: balanceOf(account),\n            assetsValue: convertToAssets(balanceOf(account)),\n            pendingRedeemAssets: redeemRequest.pendingAssets,\n            claimableRedeemAssets: redeemRequest.claimableAssets,\n            restrictionStatus: _restrictionStatus(account),\n            blockedActions: _blockedActions(account),\n            restrictionBasis: _restricted[account] ? BASIS_AUTHORITY : bytes32(0)\n        });\n    }\n\n    function supportsInterface(bytes4 interfaceId)\n        public\n        view\n        override(AccessControlUpgradeable, IERC165)\n        returns (bool)\n    {\n        return interfaceId == type(IERC7540Operator).interfaceId || interfaceId == type(IERC7540Redeem).interfaceId\n            || interfaceId == ERC7575_VAULT_INTERFACE_ID || interfaceId == type(IRedemptionManager).interfaceId\n            || interfaceId == type(IRewardManager).interfaceId || interfaceId == type(IVaultShareToken).interfaceId\n            || interfaceId == type(IStakedUSDx).interfaceId || super.supportsInterface(interfaceId);\n    }\n\n    function share() external view override returns (address shareTokenAddress) {\n        return address(this);\n    }\n\n    function _deposit(address caller, address receiver, uint256 assets, uint256 shares)\n        internal\n        override(ERC4626Upgradeable)\n    {\n        if (_depositPaused) {\n            revert OperationNotAllowed();\n        }\n        if (assets == 0 || shares == 0) {\n            revert InvalidAmount();\n        }\n        _requireCanInitiateDeposit(caller);\n        _requireCanReceiveShares(receiver);\n        _checkpointRewards();\n        _assetToken().safeTransferFrom(caller, address(this), assets);\n        _accountedAssets += assets;\n        _mint(receiver, shares);\n\n        emit Deposit(caller, receiver, assets, shares);\n    }\n\n    function _convertToShares(uint256 assets, Math.Rounding rounding)\n        internal\n        view\n        override(ERC4626Upgradeable)\n        returns (uint256)\n    {\n        uint256 supply = totalSupply();\n        uint256 accounted = _currentAccountedAssets();\n        if (supply == 0 || accounted == 0) {\n            return assets;\n        }\n        return assets.mulDiv(supply, accounted, rounding);\n    }\n\n    function _convertToAssets(uint256 shares, Math.Rounding rounding)\n        internal\n        view\n        override(ERC4626Upgradeable)\n        returns (uint256)\n    {\n        uint256 supply = totalSupply();\n        uint256 accounted = _currentAccountedAssets();\n        if (supply == 0) {\n            return shares;\n        }\n        return shares.mulDiv(accounted, supply, rounding);\n    }\n\n    /// @dev Central share-transfer restriction guard for mints, burns, transfers, and redistribution.\n    function _update(address from, address to, uint256 value) internal override(ERC20Upgradeable) {\n        if (to == address(0)) {\n            if (from != address(0) && _fullRestriction[from]) {\n                revert OperationNotAllowed();\n            }\n        } else if (from == address(0)) {\n            _requireCanReceiveShares(to);\n        } else if (_restricted[from] || _restricted[to]) {\n            revert OperationNotAllowed();\n        }\n        super._update(from, to, value);\n    }\n\n    /// @dev Confirms a request exists, is still pending, and has reached its cooldown.\n    function _requireServiceableRedeemRequest(uint256 requestId, address controller) private view {\n        if (controller == address(0) || _requestController[requestId] != controller) {\n            revert OperationNotAllowed();\n        }\n\n        RedemptionState storage state = _redemptions[requestId][controller];\n        if (state.status != RedemptionStatus.PENDING || block.timestamp < state.eligibleAt) {\n            revert OperationNotAllowed();\n        }\n    }\n\n    /// @dev Moves one pending request into claimable accounting.\n    function _servicePendingRedeemRequest(uint256 requestId, address controller)\n        private\n        returns (uint256 sharesMadeClaimable, uint256 assetsReserved)\n    {\n        RedemptionState storage state = _redemptions[requestId][controller];\n        sharesMadeClaimable = state.shares;\n        assetsReserved = state.assetsReserved;\n\n        state.status = RedemptionStatus.CLAIMABLE;\n        _restoreClaimIndexForServicedRequest(requestId, controller);\n\n        RedeemRequestState storage aggregate = _redeemRequests[controller];\n        aggregate.pendingShares -= sharesMadeClaimable;\n        aggregate.pendingAssets -= assetsReserved;\n        aggregate.claimableShares += sharesMadeClaimable;\n        aggregate.claimableAssets += assetsReserved;\n\n        _pendingRedeemAssets -= assetsReserved;\n        _claimableRedeemAssets += assetsReserved;\n    }\n\n    /// @dev Claims across serviced requests by shares while preserving per-request residual accounting.\n    function _claimRedeemByShares(address controller, address receiver, uint256 shares)\n        private\n        returns (uint256 assets)\n    {\n        uint256 remainingShares = shares;\n        uint256[] storage requestIds = _controllerRequests[controller];\n        uint256 index = _claimIndex[controller];\n\n        while (remainingShares != 0 && index < requestIds.length) {\n            RedemptionState storage state = _redemptions[requestIds[index]][controller];\n            if (state.status != RedemptionStatus.CLAIMABLE || state.shares == 0) {\n                index++;\n                continue;\n            }\n            _requireRequestClaimAllowed(state, controller, receiver);\n\n            uint256 sharesToClaim = remainingShares < state.shares ? remainingShares : state.shares;\n            uint256 assetsToClaim = sharesToClaim == state.shares\n                ? state.assetsReserved\n                : sharesToClaim.mulDiv(state.assetsReserved, state.shares, Math.Rounding.Floor);\n\n            state.shares -= sharesToClaim;\n            state.assetsReserved -= assetsToClaim;\n            remainingShares -= sharesToClaim;\n            assets += assetsToClaim;\n\n            if (state.shares == 0) {\n                state.status = RedemptionStatus.CLAIMED;\n                index++;\n            }\n        }\n\n        _claimIndex[controller] = index;\n        if (remainingShares != 0) {\n            revert InsufficientClaimable();\n        }\n\n        _recordClaim(controller, shares, assets);\n        _assetToken().safeTransfer(receiver, assets);\n        emit Withdraw(msg.sender, receiver, controller, assets, shares);\n    }\n\n    /// @dev Claims across serviced requests by assets while rounding shares up for partial claims.\n    function _claimRedeemByAssets(address controller, address receiver, uint256 assets)\n        private\n        returns (uint256 shares)\n    {\n        uint256 remainingAssets = assets;\n        uint256[] storage requestIds = _controllerRequests[controller];\n        uint256 index = _claimIndex[controller];\n\n        while (remainingAssets != 0 && index < requestIds.length) {\n            RedemptionState storage state = _redemptions[requestIds[index]][controller];\n            if (state.status != RedemptionStatus.CLAIMABLE || state.assetsReserved == 0) {\n                index++;\n                continue;\n            }\n            _requireRequestClaimAllowed(state, controller, receiver);\n\n            uint256 assetsToClaim = remainingAssets < state.assetsReserved ? remainingAssets : state.assetsReserved;\n            uint256 sharesToClaim = assetsToClaim == state.assetsReserved\n                ? state.shares\n                : assetsToClaim.mulDiv(state.shares, state.assetsReserved, Math.Rounding.Ceil);\n\n            if (sharesToClaim == 0 || sharesToClaim >= state.shares && assetsToClaim != state.assetsReserved) {\n                revert InsufficientClaimable();\n            }\n\n            state.shares -= sharesToClaim;\n            state.assetsReserved -= assetsToClaim;\n            remainingAssets -= assetsToClaim;\n            shares += sharesToClaim;\n\n            if (state.shares == 0) {\n                state.status = RedemptionStatus.CLAIMED;\n                index++;\n            }\n        }\n\n        _claimIndex[controller] = index;\n        if (remainingAssets != 0) {\n            revert InsufficientClaimable();\n        }\n\n        _recordClaim(controller, shares, assets);\n        _assetToken().safeTransfer(receiver, assets);\n        emit Withdraw(msg.sender, receiver, controller, assets, shares);\n    }\n\n    function _restoreClaimIndexForServicedRequest(uint256 requestId, address controller) private {\n        uint256 index = _claimIndex[controller];\n        if (index == 0) {\n            return;\n        }\n\n        uint256[] storage requestIds = _controllerRequests[controller];\n        if (requestIds[index - 1] < requestId) {\n            return;\n        }\n\n        while (index != 0) {\n            index--;\n            if (requestIds[index] == requestId) {\n                _claimIndex[controller] = index;\n                return;\n            }\n        }\n    }\n\n    function _recordClaim(address controller, uint256 shares, uint256 assets) private {\n        RedeemRequestState storage aggregate = _redeemRequests[controller];\n        aggregate.claimableShares -= shares;\n        aggregate.claimableAssets -= assets;\n        _claimableRedeemAssets -= assets;\n    }\n\n    /// @dev Materializes vested rewards into accounted assets and stops vesting when the schedule is complete.\n    function _checkpointRewards() private {\n        uint256 vested = _vestedRewards();\n        if (vested != 0) {\n            _accountedAssets += vested;\n            _unvestedRewards -= vested;\n        }\n        _lastUpdated = _currentRewardTimestamp();\n        if (block.timestamp >= _periodFinish || _unvestedRewards == 0) {\n            _rewardRate = 0;\n        }\n    }\n\n    function _rescheduleActiveRewards(uint256 duration, uint256 maxRate, bool paused) private {\n        if (_unvestedRewards == 0) {\n            _rewardRate = 0;\n            _periodFinish = 0;\n            _lastUpdated = block.timestamp;\n            return;\n        }\n\n        // Active rewards keep their funded backing but vest only while an explicit schedule is running.\n        if (paused) {\n            _rewardRate = 0;\n            _periodFinish = block.timestamp;\n            _lastUpdated = block.timestamp;\n            return;\n        }\n\n        if (duration == 0) {\n            revert InvalidAmount();\n        }\n\n        uint256 nextRewardRate = _unvestedRewards / duration;\n        if (nextRewardRate == 0) {\n            revert InvalidAmount();\n        }\n        if (maxRate != 0 && nextRewardRate > maxRate) {\n            revert OperationNotAllowed();\n        }\n\n        _rewardRate = nextRewardRate;\n        _periodFinish = block.timestamp + duration;\n        _lastUpdated = block.timestamp;\n    }\n\n    function _activeRewardDuration() private view returns (uint256) {\n        // Top-ups add rewards to the active window; extending vesting must be explicit configuration.\n        if (_unvestedRewards != 0 && _rewardRate != 0 && block.timestamp < _periodFinish) {\n            return _periodFinish - block.timestamp;\n        }\n        return _rewardDuration;\n    }\n\n    function _vestedRewards() private view returns (uint256) {\n        if (_unvestedRewards == 0 || _rewardRate == 0) {\n            return 0;\n        }\n        if (block.timestamp >= _periodFinish) {\n            return _unvestedRewards;\n        }\n        uint256 elapsed = _currentRewardTimestamp() - _lastUpdated;\n        uint256 vested = elapsed * _rewardRate;\n        return vested > _unvestedRewards ? _unvestedRewards : vested;\n    }\n\n    function _currentAccountedAssets() private view returns (uint256) {\n        return _accountedAssets + _vestedRewards();\n    }\n\n    function _requiredAssets() private view returns (uint256) {\n        return _accountedAssets + _pendingRedeemAssets + _claimableRedeemAssets + _unvestedRewards;\n    }\n\n    function _surplusAssets() private view returns (uint256) {\n        uint256 balance = _assetBalance();\n        uint256 required = _requiredAssets();\n        return balance > required ? balance - required : 0;\n    }\n\n    function _currentRewardTimestamp() private view returns (uint256) {\n        if (_periodFinish != 0 && block.timestamp > _periodFinish) {\n            return _periodFinish;\n        }\n        return block.timestamp;\n    }\n\n    function _assetBalance() private view returns (uint256) {\n        return _assetToken().balanceOf(address(this));\n    }\n\n    function _isSelfOrOperator(address account, address caller) private view returns (bool) {\n        return caller == account || _operators[account][caller];\n    }\n\n    function _requireCanReceiveShares(address account) private view {\n        if (_restricted[account]) {\n            revert OperationNotAllowed();\n        }\n    }\n\n    function _requireCanInitiateDeposit(address account) private view {\n        if (_restricted[account]) {\n            revert OperationNotAllowed();\n        }\n    }\n\n    /// @dev Restores cancelled request shares without applying the normal receive restriction.\n    function _restoreCancelledShares(address account, uint256 shares) private {\n        // Cancellation restores shares burned for the request, so soft-restricted accounts may receive them.\n        super._update(address(0), account, shares);\n    }\n\n    function _moveRedeemRequestAggregate(\n        address from,\n        address to,\n        RedemptionStatus status,\n        uint256 shares,\n        uint256 assets\n    ) private {\n        RedeemRequestState storage fromAggregate = _redeemRequests[from];\n        RedeemRequestState storage toAggregate = _redeemRequests[to];\n        if (status == RedemptionStatus.PENDING) {\n            fromAggregate.pendingShares -= shares;\n            fromAggregate.pendingAssets -= assets;\n            toAggregate.pendingShares += shares;\n            toAggregate.pendingAssets += assets;\n            return;\n        }\n\n        fromAggregate.claimableShares -= shares;\n        fromAggregate.claimableAssets -= assets;\n        toAggregate.claimableShares += shares;\n        toAggregate.claimableAssets += assets;\n    }\n\n    /// @dev Allows soft-restricted owners to exit only to themselves and blocks full restrictions.\n    function _requireClaimAllowed(address controller, address receiver) private view {\n        if (_fullRestriction[controller] || _fullRestriction[receiver]) {\n            revert OperationNotAllowed();\n        }\n        if (_restricted[controller] && receiver != controller) {\n            revert OperationNotAllowed();\n        }\n        if (_restricted[receiver] && receiver != controller) {\n            revert OperationNotAllowed();\n        }\n    }\n\n    /// @dev Re-checks the stored request owner because restrictions may change after request creation.\n    function _requireRequestClaimAllowed(RedemptionState storage state, address controller, address receiver)\n        private\n        view\n    {\n        _requireClaimAllowed(controller, receiver);\n        // Claim stays gated on the original `state.owner`: freezing an owner also freezes their in-flight\n        // redemption even though bookkeeping possession sits with the controller. RESTRICTION_ROLE relocates\n        // such value via redistributeRedeemRequest.\n        if (_fullRestriction[state.owner]) {\n            revert OperationNotAllowed();\n        }\n        if (_restricted[state.owner] && (controller != state.owner || receiver != state.owner)) {\n            revert OperationNotAllowed();\n        }\n    }\n\n    function _restrictionStatus(address account) private view returns (bytes32) {\n        if (_fullRestriction[account]) {\n            return STATUS_FULL_RESTRICTION;\n        }\n        return _restricted[account] ? STATUS_RESTRICTED : STATUS_CLEAR;\n    }\n\n    function _blockedActions(address account) private view returns (bytes32) {\n        if (_fullRestriction[account]) {\n            return BLOCKED_ALL;\n        }\n        return _restricted[account] ? BLOCKED_NON_EXIT : BLOCKED_NONE;\n    }\n\n    function _authorityRef(address account) private pure returns (bytes32) {\n        return bytes32(uint256(uint160(account)));\n    }\n\n    function _assetToken() private view returns (IERC20) {\n        return IERC20(asset());\n    }\n\n    function _requireClaimOpen() private view {\n        if (_claimPaused) {\n            revert OperationNotAllowed();\n        }\n    }\n\n    /// @dev Resolves an account override or falls back to the default enabled redemption policy.\n    function _redemptionPolicyFor(address controller)\n        private\n        view\n        returns (bytes32 policyId, RedemptionPolicy memory policy)\n    {\n        policyId = _accountRedemptionPolicy[controller];\n        if (policyId == bytes32(0)) {\n            policyId = DEFAULT_REDEMPTION_POLICY_ID;\n        }\n        policy = _redemptionPolicies[policyId];\n        if (!policy.enabled) {\n            revert OperationNotAllowed();\n        }\n    }\n\n    function _requireValidCooldown(uint256 cooldown) private pure {\n        if (cooldown > MAX_COOLDOWN_DURATION) {\n            revert InvalidCooldown();\n        }\n    }\n\n    uint256[45] private __gap;\n}\n","deployed_bytecode":"0x608060405234801561000f575f5ffd5b5060043610610485575f3560e01c80637d41c86e11610258578063c336a0841161014b578063e20bb1e5116100ca578063ef8b30f71161008f578063ef8b30f714610b15578063f0aa2ffc14610bf9578063f298f42c14610c0c578063f2d25b2d14610c1f578063f32774b314610c27578063f5a23d8d14610c3b575f5ffd5b8063e20bb1e514610baf578063e63ab1e914610bc2578063e81640d214610bd6578063eaed1d0714610bde578063ec67bdd514610bf1575f5ffd5b8063d547741f11610110578063d547741f14610b3b578063d86b798014610b4e578063d905777e14610b76578063db6e16e014610b89578063dd62ed3e14610b9c575f5ffd5b8063c336a08414610b02578063c63d75b61461065f578063c6e6f59214610b15578063ce96cb7714610b28578063d4347f2514610489575f5ffd5b8063a217fddf116101d7578063b460af941161019c578063b460af9414610a7b578063b5c6f7ea14610a8e578063b6363cf214610aa1578063b6a758f714610adc578063ba08765214610aef575f5ffd5b8063a217fddf14610a35578063a8d5fd6514610a3c578063a9059cbb14610a42578063b37fd19014610a55578063b3d7f6b914610a68575f5ffd5b806395b2197e1161021d57806395b2197e146108d657806395d89b411461099f578063966be075146109a75780639ee2735b146109ba578063a0776b8214610a22575f5ffd5b80637d41c86e146108765780637fbf11791461088957806386d192e51461089d57806391d14854146108b057806394bf804d146108c3575f5ffd5b806338d52e0f1161037b578063582c7928116102fa57806370a08231116102bf57806370a082311461082757806374b9f3531461083a578063762f08241461084b57806376fe916814610853578063792c23481461085b5780637c9e96db14610863575f5ffd5b8063582c7928146107655780636682aec6146107ae5780636973f4b5146107b65780636d750d80146107ed5780636e553f6514610814575f5ffd5b80634a8c110a116103405780634a8c110a146106925780634cdad506146105175780634e94c285146106a757806351dbce7e1461074a578063558a729714610752575f5ffd5b806338d52e0f146106175780633ba0b9a9146106375780633c05e18f1461063f578063402d267d1461065f578063460f1c9114610672575f5ffd5b80631ba01f07116104075780632b9d9c1f116103cc5780632b9d9c1f146105bc5780632f2ff15d146105cf578063313ce567146105e257806335269315146105fc57806336568abe14610604575f5ffd5b80631ba01f07146105515780631e9049cf1461057957806323b872dd14610583578063248a9ca314610596578063288f0ebd146105a9575f5ffd5b806307a2d13a1161044d57806307a2d13a146104f1578063095ea7b3146105045780630a28a477146105175780631794bb3c1461052a57806318160ddd1461053d575f5ffd5b806301e1d1141461048957806301ffc9a7146104a457806302191980146104c757806302befd24146104d157806306fdde03146104dc575b5f5ffd5b610491610c4e565b6040519081526020015b60405180910390f35b6104b76104b236600461544f565b610c5c565b604051901515815260200161049b565b6104cf610d27565b005b60115460ff166104b7565b6104e4610d84565b60405161049b9190615476565b6104916104ff3660046154ab565b610e44565b6104b76105123660046154d6565b610e4f565b6104916105253660046154ab565b610e66565b6104cf610538366004615500565b610e80565b5f516020615c645f395f51905f5254610491565b61056461055f36600461553e565b61112a565b6040805192835260208301919091520161049b565b6104916276a70081565b6104b7610591366004615500565b6115f5565b6104916105a43660046154ab565b61161a565b6104cf6105b736600461558a565b61163a565b6104916105ca3660046155b5565b6116e5565b6104cf6105dd3660046155b5565b611903565b6105ea611925565b60405160ff909116815260200161049b565b600b54610491565b6104cf6106123660046155b5565b611967565b61061f61199f565b6040516001600160a01b03909116815260200161049b565b6104916119cd565b61065261064d3660046155e3565b611a1a565b60405161049b91906155fe565b61049161066d3660046155e3565b611a8e565b6106856106803660046155b5565b611aca565b60405161049b919061565d565b61069a611b8e565b60405161049b91906156d3565b61070c604080516080810182525f8082526020820181905291810182905260608101919091525060408051608081018252600a546001600160a01b03610100820416825260085460208301526009549282019290925260ff9091161515606082015290565b60405161049b919081516001600160a01b03168152602080830151908201526040808301519082015260609182015115159181019190915260800190565b6104cf611cb3565b6104b7610760366004615752565b611d0f565b61076d611da7565b60405161049b91905f60a082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015292915050565b6104cf611e30565b6107c96107c43660046154ab565b611e8e565b6040805182518152602080840151908201529181015115159082015260600161049b565b6104917f0f51adb3f49e4a9bbb17b3783f025995eaf8c24be2c8eefff214bdfda05ef94d81565b6104916108223660046155b5565b611eee565b6104916108353660046155e3565b611f4b565b610491661111519055531560ca1b81565b6104cf611f71565b6104cf612007565b6104915f5481565b6104cf61087136600461577e565b61205f565b61049161088436600461553e565b6121b0565b6104915f516020615ca45f395f51905f5281565b6104cf6108ab3660046157b3565b6125e7565b6104b76108be3660046155b5565b612639565b6104916108d13660046155b5565b61266f565b61099260408051610100810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081019190915250604080516101008082018352600b548252600c546020830152600d5460ff80821615159484019490945290810483161515606083015262010000810483161515608083015263010000008104909216151560a08201526401000000009091046001600160a01b031660c0820152600e5460e082015290565b60405161049b91906157ce565b6104e46126bb565b6104cf6109b53660046154ab565b6126f9565b6109cd6109c83660046155e3565b6128b1565b60405161049b91905f60e082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015292915050565b6104cf610a30366004615845565b61299c565b6104915f81565b3061061f565b6104b7610a503660046154d6565b612ab4565b6104cf610a63366004615871565b612ac1565b610491610a763660046154ab565b612bc0565b610491610a8936600461553e565b612bcc565b6104cf610a9c3660046158a5565b612c9a565b6104b7610aaf366004615845565b6001600160a01b039182165f90815260126020908152604080832093909416825291909152205460ff1690565b6104cf610aea3660046154d6565b612e4e565b610491610afd36600461553e565b612f08565b6104cf610b10366004615752565b612fcd565b610491610b233660046154ab565b613096565b610491610b363660046155e3565b6130a1565b6104cf610b493660046155b5565b6130fa565b610491610b5c3660046155e3565b6001600160a01b03165f908152601b602052604090205490565b610491610b843660046155e3565b613116565b6104cf610b973660046158c5565b61316f565b610491610baa366004615845565b613354565b610652610bbd3660046155b5565b61339d565b6104915f516020615c845f395f51905f5281565b6104cf613499565b610491610bec3660046155b5565b6134ec565b600354610491565b610652610c073660046154ab565b61353f565b6104cf610c1a366004615752565b6137b0565b600254610491565b6104915f516020615cc45f395f51905f5281565b610491610c493660046155b5565b613894565b5f610c576138bc565b905090565b5f6001600160e01b0319821663e3bc4e6560e01b1480610c8c57506001600160e01b03198216631883ba3960e21b145b80610ca757506001600160e01b03198216632f0a18c560e01b145b80610cc257506001600160e01b0319821663ada5a57f60e01b145b80610cdd57506001600160e01b0319821663a37e4c4760e01b145b80610cf857506001600160e01b03198216638e8ba26b60e01b145b80610d1257506001600160e01b03198216622ffaa760e61b145b80610d215750610d21826138d2565b92915050565b5f516020615c845f395f51905f52610d3e81613906565b6011805460ff191660019081179091556040519081527fe89bebe4218a63255dca3e5553791b2ed43fa3578720bc6f7b38abef9b117de79060200160405180910390a150565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0380546060915f516020615c445f395f51905f5291610dc290615944565b80601f0160208091040260200160405190810160405280929190818152602001828054610dee90615944565b8015610e395780601f10610e1057610100808354040283529160200191610e39565b820191905f5260205f20905b815481529060010190602001808311610e1c57829003601f168201915b505050505091505090565b5f610d21825f613913565b5f33610e5c818585613954565b5060019392505050565b5f604051637a851da960e11b815260040160405180910390fd5b5f610e89613961565b805490915060ff600160401b820416159067ffffffffffffffff165f81158015610eb05750825b90505f8267ffffffffffffffff166001148015610ecc5750303b155b905081158015610eda575080155b15610ef85760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610f2257845460ff60401b1916600160401b1785555b6001600160a01b0388161580610f3f57506001600160a01b038716155b15610f5d5760405163f6b2911f60e01b815260040160405180910390fd5b610fa76040518060400160405280600b81526020016a0a6e8c2d6cac840aaa688f60ab1b815250604051806040016040528060058152602001640e6aaa688f60db1b815250613989565b610fb08861399f565b610fb86139b0565b610fc25f886139ba565b50610fed7f0f51adb3f49e4a9bbb17b3783f025995eaf8c24be2c8eefff214bdfda05ef94d886139ba565b506110055f516020615c845f395f51905f52886139ba565b5061101d5f516020615ca45f395f51905f52886139ba565b506110355f516020615cc45f395f51905f52886139ba565b50600a8054610100600160a81b0319166101006001600160a01b038a1690810291909117909155600d8054640100000000600160c01b0319166401000000009092029190911790556008869055426007819055600e55661111519055531560ca1b5f908152601a6020527f2e797767a1a64fae95a2e0af168826a71dd7a6398aaef5297b241ac94d864eb3805460ff1916600190811790915590819055600f819055601055831561112057845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050505050565b5f5f5f516020615ca45f395f51905f5261114381613906565b6001600160a01b038516158061116057506001600160a01b038416155b1561117e5760405163f6b2911f60e01b815260040160405180910390fd5b836001600160a01b0316856001600160a01b031614806111b557506001600160a01b0384165f9081526018602052604090205460ff165b156111d357604051637a851da960e11b815260040160405180910390fd5b5f8681526014602090815260408083206001600160a01b03808a168552908352818420825161012081018452815481526001820154831694810194909452600281015490911691830191909152600381015460608301526004808201546080840152600582015460a0840152600682015460c0840152600782015460e0840152600882015461010084019160ff9091169081111561127357611273615629565b600481111561128457611284615629565b9052509050600181610100015160048111156112a2576112a2615629565b141580156112c75750600281610100015160048111156112c4576112c4615629565b14155b156112e557604051637a851da960e11b815260040160405180910390fd5b6001600160a01b0386165f9081526019602052604090205460ff1615801561132757506040808201516001600160a01b03165f9081526019602052205460ff16155b1561134557604051637a851da960e11b815260040160405180910390fd5b806060015193508060800151925061136586868361010001518787613a62565b60145f8881526020019081526020015f205f876001600160a01b03166001600160a01b031681526020019081526020015f205f5f82015f9055600182015f6101000a8154906001600160a01b030219169055600282015f6101000a8154906001600160a01b030219169055600382015f9055600482015f9055600582015f9055600682015f9055600782015f9055600882015f6101000a81549060ff021916905550508481602001906001600160a01b031690816001600160a01b0316815250508481604001906001600160a01b031690816001600160a01b0316815250508060145f8981526020019081526020015f205f876001600160a01b03166001600160a01b031681526020019081526020015f205f820151815f01556020820151816001015f6101000a8154816001600160a01b0302191690836001600160a01b031602179055506040820151816002015f6101000a8154816001600160a01b0302191690836001600160a01b03160217905550606082015181600301556080820151816004015560a0820151816005015560c0820151816006015560e08201518160070155610100820151816008015f6101000a81548160ff0219169083600481111561153357611533615629565b021790555050505f87815260156020908152604080832080546001600160a01b0319166001600160a01b038a811691821790925580855260168452918420805460018101825590855292909320909101899055610100830151909188169089907f0585b9e8cfad96bfecd02b884ced1f9b546e5c6adb258094a29671336814f56c908890889060048111156115ca576115ca615629565b60408051938452602084019290925260ff169082015260600160405180910390a45050935093915050565b5f33611602858285613b76565b61160d858585613bc1565b60019150505b9392505050565b5f9081525f516020615ce45f395f51905f52602052604090206001015490565b5f61164481613906565b61164c613c1e565b60088490556009839055600a80546001600160a81b031916831515610100600160a81b031916176101003302179055611686848484613c86565b600a546040805186815260208101869052841515918101919091526101009091046001600160a01b0316907f8c523465b861c8f308898f5974e354c37b1fe7bebd061eb4aeac49afe84f3fa9906060015b60405180910390a250505050565b600d545f906301000000900460ff161561171257604051637a851da960e11b815260040160405180910390fd5b61171c8233613d52565b61173957604051637a851da960e11b815260040160405180910390fd5b5f8381526014602090815260408083206001600160a01b038616845290915290206001600882015460ff16600481111561177557611775615629565b1461179357604051637a851da960e11b815260040160405180910390fd5b6001600160a01b0383165f9081526019602052604090205460ff16806117d4575060028101546001600160a01b03165f9081526019602052604090205460ff165b156117f257604051637a851da960e11b815260040160405180910390fd5b6003810180546004808401805460088601805460ff19169093179092555f938490558390556001600160a01b038616835260136020526040832080549295509092909185918391611844908490615990565b9250508190555081816001015f82825461185e9190615990565b925050819055508160025f8282546118769190615990565b925050819055508160015f82825461188e91906159a3565b909155505060028301546118ab906001600160a01b031685613d9c565b600283015460408051868152602081018590526001600160a01b039283169288169189917f6222ad3366b89f31bbbc304a4db3a8dd8e48fd0b6c9da30b33fc71fc820cc8f0910160405180910390a450505092915050565b61190c8261161a565b61191581613906565b61191f83836139ba565b50505050565b5f807f0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e0090505f81546119619190600160a01b900460ff166159b6565b91505090565b6001600160a01b03811633146119905760405163334bd91960e11b815260040160405180910390fd5b61199a8282613da7565b505050565b7f0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e00546001600160a01b031690565b5f5f6119e45f516020615c645f395f51905f525490565b9050805f036119fc57670de0b6b3a764000091505090565b611961670de0b6b3a7640000825f611a12610c4e565b929190613e20565b611a4160405180608001604052805f81526020015f81526020015f81526020015f81525090565b506001600160a01b03165f90815260136020908152604091829020825160808101845281548152600182015492810192909252600281015492820192909252600390910154606082015290565b6011545f9060ff1680611ab857506001600160a01b0382165f9081526018602052604090205460ff165b611ac3575f19610d21565b5f92915050565b611ad26153ea565b5f8381526014602090815260408083206001600160a01b03808716855290835292819020815161012081018352815481526001820154851693810193909352600281015490931690820152600382015460608201526004808301546080830152600583015460a0830152600683015460c0830152600783015460e0830152600883015491929161010084019160ff90911690811115611b7357611b73615629565b6004811115611b8457611b84615629565b9052509392505050565b611be26040518061016001604052805f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f151581525090565b5f611beb6138bc565b90505f611bf6613e62565b90505f611c01613e8d565b90505f611c195f516020615c645f395f51905f525490565b905060405180610160016040528082815260200185815260200185815260200160025481526020016003548152602001600354600254611c5991906159a3565b8152602001848152602001838152602001825f14611c8a57611c8586670de0b6b3a7640000855f613e20565b611c94565b670de0b6b3a76400005b8152602001600b54815260200184841015151581525094505050505090565b5f516020615c845f395f51905f52611cca81613906565b600d805460ff1916600190811790915542600e5560405190815267524551554553545360c01b905f516020615d045f395f51905f52906020015b60405180910390a250565b5f6001600160a01b038316611d375760405163f6b2911f60e01b815260040160405180910390fd5b335f8181526012602090815260408083206001600160a01b03881680855290835292819020805460ff191687151590811790915590519081529192917fceb576d9f15e4e200fdb5096d64d5dfd667e16def20c1eefd14256d8e3faa267910160405180910390a350600192915050565b611dd46040518060a001604052805f81526020015f81526020015f81526020015f81526020015f81525090565b5f611ddd613efe565b90506040518060a0016040528082600154611df891906159a3565b815260200182600454611e0b9190615990565b815260200160055481526020016006548152602001611e28613f6c565b905292915050565b5f516020615c845f395f51905f52611e4781613906565b600d805463ff0000001916630100000017905542600e55604051600181526c43414e43454c4c4154494f4e5360981b905f516020615d045f395f51905f5290602001611d04565b611eb160405180606001604052805f81526020015f81526020015f151581525090565b505f908152601a60209081526040918290208251606081018452815481526001820154928101929092526002015460ff1615159181019190915290565b5f5f611ef983611a8e565b905080841115611f2b57828482604051633c8097d960e11b8152600401611f22939291906159cf565b60405180910390fd5b5f611f3585613096565b9050611f4333858784613f91565b949350505050565b6001600160a01b03165f9081525f516020615c445f395f51905f52602052604090205490565b5f516020615c845f395f51905f52611f8881613906565b611f90613c1e565b600a805460ff19166001908117909155600854600954611faf92613c86565b600a546008546009546040805192835260208301919091526001908201526101009091046001600160a01b0316907f8c523465b861c8f308898f5974e354c37b1fe7bebd061eb4aeac49afe84f3fa990606001611d04565b5f516020615c845f395f51905f5261201e81613906565b600d805462ff000019166201000017905542600e556040516001815268534552564943494e4760b81b905f516020615d045f395f51905f5290602001611d04565b5f61206981613906565b8261208757604051637a851da960e11b815260040160405180910390fd5b661111519055531560ca1b831480156120ad57506120ab60608301604084016157b3565b155b156120cb57604051637a851da960e11b815260040160405180910390fd5b6120d58235614075565b5f838152601a6020526040902082906120ee82826159f0565b5050662eeeae6faaaceb60ca1b830161214e57600b805483359182905560405190917f8f6ceadd6e9845ce194f7cd50e5a1ef4aec5b40c31652db44ea043bbbf27b92b9161214491848252602082015260400190565b60405180910390a1505b42600e55827fab58f97f9e52f1f548d1471adfc7020125d8ab45cb4c0c6e4f372ff66942a3fe8335602085013561218b60608701604088016157b3565b60408051938452602084019290925215159082015260600160405180910390a2505050565b600d545f9060ff16156121d657604051637a851da960e11b815260040160405180910390fd5b8315806121ea57506001600160a01b038316155b806121fc57506001600160a01b038216155b1561221a5760405163162908e360e11b815260040160405180910390fd5b6122248233613d52565b158061223757506122358333613d52565b155b1561225557604051637a851da960e11b815260040160405180910390fd5b6001600160a01b0383165f9081526019602052604090205460ff168061229257506001600160a01b0382165f9081526019602052604090205460ff165b156122b057604051637a851da960e11b815260040160405180910390fd5b6001600160a01b0382165f9081526018602052604090205460ff1680156122e95750816001600160a01b0316836001600160a01b031614155b1561230757604051637a851da960e11b815260040160405180910390fd5b8361231183611f4b565b101561233057604051635a5c1b5560e11b815260040160405180910390fd5b612338613c1e565b5f5f61234385614099565b9150915080602001515f1415801561235e5750806020015186115b1561237c5760405163162908e360e11b815260040160405180910390fd5b5f612387875f613913565b9050612393858861413a565b8060015f8282546123a49190615990565b925050819055508060025f8282546123bc91906159a3565b90915550505f805490806123cf83615a26565b909155505f81815260156020908152604080832080546001600160a01b0319166001600160a01b038c1690811790915580845260168352818420805460018101825590855283852001859055835260139091528120805492965089929091906124399084906159a3565b90915550506001600160a01b0386165f90815260136020526040812060010180548392906124689084906159a3565b92505081905550604051806101200160405280858152602001876001600160a01b03168152602001866001600160a01b03168152602001888152602001828152602001428152602001835f0151426124c091906159a3565b815260208101859052604001600190525f8581526014602090815260408083206001600160a01b03808c168552908352928190208451815591840151600180840180549286166001600160a01b0319938416179055918501516002840180549190951691161790925560608301516003820155608083015160048083019190915560a0840151600583015560c0840151600683015560e0840151600783015561010084015160088301805493949193909260ff199091169190849081111561258a5761258a615629565b02179055505060408051338152602081018a90528692506001600160a01b0380891692908a16917f1fdc681a13d8c5da54e301c7ce6542dcde4581e4725043fdab2db12ddc57450691015b60405180910390a45050509392505050565b5f6125f181613906565b6011805460ff19168315159081179091556040519081527fe89bebe4218a63255dca3e5553791b2ed43fa3578720bc6f7b38abef9b117de79060200160405180910390a15050565b5f9182525f516020615ce45f395f51905f52602090815260408084206001600160a01b0393909316845291905290205460ff1690565b5f5f61267a83611a8e565b9050808411156126a35782848260405163284ff66760e01b8152600401611f22939291906159cf565b5f6126ad85612bc0565b9050611f4333858388613f91565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0480546060915f516020615c445f395f51905f5291610dc290615944565b5f61270381613906565b61270c82614075565b600b805490839055661111519055531560ca1b5f52601a60209081527f2e797767a1a64fae95a2e0af168826a71dd7a6398aaef5297b241ac94d864eb184905542600e55604080516060810182528581527f2e797767a1a64fae95a2e0af168826a71dd7a6398aaef5297b241ac94d864eb254818401527f2e797767a1a64fae95a2e0af168826a71dd7a6398aaef5297b241ac94d864eb35460ff161515818301528151848152928301869052917f8f6ceadd6e9845ce194f7cd50e5a1ef4aec5b40c31652db44ea043bbbf27b92b910160405180910390a1600b54600c54600d546040517f7411763df8b85a361debd9482957b1f2ab21d1ed68b95a5aeaaa7f16613edd0893612852939092909160ff80831692610100810482169262010000820483169263010000008304169164010000000090046001600160a01b031690615a3e565b60405180910390a1805160208083015160408085015181519485529284019190915290151590820152661111519055531560ca1b907fab58f97f9e52f1f548d1471adfc7020125d8ab45cb4c0c6e4f372ff66942a3fe906060016116d7565b6128ea6040518060e001604052805f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81525090565b6001600160a01b0382165f9081526013602052604090819020815160e08101909252908061291785611f4b565b81526020016129286104ff86611f4b565b8152602001826001015481526020018260030154815260200161294a8561416e565b8152602001612958856141e9565b81526001600160a01b0385165f9081526018602090815260409091205491019060ff16612985575f612993565b68415554484f5249545960b81b5b90529392505050565b5f516020615ca45f395f51905f526129b381613906565b6001600160a01b03831615806129d057506001600160a01b038216155b156129ee5760405163f6b2911f60e01b815260040160405180910390fd5b6001600160a01b0383165f9081526019602052604090205460ff161580612a2c57506001600160a01b0382165f9081526018602052604090205460ff165b15612a4a57604051637a851da960e11b815260040160405180910390fd5b5f612a5484611f4b565b9050612a6184848361424d565b826001600160a01b0316846001600160a01b03167fb8ef21f2b52f8ca740012254a6b10f17d2fd6e589f97ebf401fde0e8b921893783604051612aa691815260200190565b60405180910390a350505050565b5f33610e5c818585613bc1565b5f612acb81613906565b306001600160a01b03851603612af45760405163c1ab6dc160e01b815260040160405180910390fd5b6001600160a01b038216612b1b5760405163f6b2911f60e01b815260040160405180910390fd5b612b2361199f565b6001600160a01b0316846001600160a01b0316148015612b495750612b46614365565b83115b15612b675760405163162908e360e11b815260040160405180910390fd5b612b7b6001600160a01b0385168385614393565b816001600160a01b0316846001600160a01b03167fe01920728668d89f092ef9cb92036bad90964bb622eec508d2c3ffe1d582efb285604051612aa691815260200190565b5f610d21826001613913565b5f612bd56143f2565b831580612be957506001600160a01b038316155b80612bfb57506001600160a01b038216155b15612c195760405163162908e360e11b815260040160405180910390fd5b612c238233613d52565b612c4057604051637a851da960e11b815260040160405180910390fd5b612c4a828461441b565b6001600160a01b0382165f9081526013602052604090206003810154851115612c865760405163eb6def5160e01b815260040160405180910390fd5b612c91838587614524565b95945050505050565b7f0f51adb3f49e4a9bbb17b3783f025995eaf8c24be2c8eefff214bdfda05ef94d612cc481613906565b600a5460ff1615612ce857604051637a851da960e11b815260040160405180910390fd5b821580612cf55750600854155b15612d135760405163162908e360e11b815260040160405180910390fd5b5f516020615c645f395f51905f52545f03612d4157604051637a851da960e11b815260040160405180910390fd5b612d49613c1e565b5f612d5261479d565b90505f84600454612d6391906159a3565b90505f612d708383615a8f565b9050805f03612d925760405163162908e360e11b815260040160405180910390fd5b60095415801590612da4575060095481115b15612dc257604051637a851da960e11b815260040160405180910390fd5b612de1333088612dd06147d8565b6001600160a01b03169291906147e1565b60048290556005819055612df583426159a3565b600681905542600755600554604080518981526020810192909252810191909152859033907e0a26a94b8f11d089d8815925dda7b3503d200f3828ffa7a2f9a0a5dd924c229060600160405180910390a3505050505050565b5f612e5881613906565b6001600160a01b038316612e7f5760405163f6b2911f60e01b815260040160405180910390fd5b8115801590612e9f57505f828152601a602052604090206002015460ff16155b15612ebd57604051637a851da960e11b815260040160405180910390fd5b6001600160a01b0383165f818152601b602052604080822085905542600e55518492917f0855302758d72ba1c33edb852bb68ca2d8083d8e95cbd399ff546f0aa5f1d76291a3505050565b5f612f116143f2565b831580612f2557506001600160a01b038316155b80612f3757506001600160a01b038216155b15612f555760405163162908e360e11b815260040160405180910390fd5b612f5f8233613d52565b612f7c57604051637a851da960e11b815260040160405180910390fd5b612f86828461441b565b6001600160a01b0382165f9081526013602052604090206002810154851115612fc25760405163eb6def5160e01b815260040160405180910390fd5b612c9183858761481a565b5f516020615ca45f395f51905f52612fe481613906565b6001600160a01b03831661300b5760405163f6b2911f60e01b815260040160405180910390fd5b6001600160a01b0383165f818152601860209081526040808320805460ff199081169091556019909252909120805490911690556421a622a0a960d91b907fbfb44373b56a8b33a2f3e28fc5b0b8842385af64fc253b88290e4eba8b2a3c7b68415554484f5249545960b81b335b6040805192835260208301919091520160405180910390a3505050565b5f610d21825f614a44565b600d545f90610100900460ff16806130d057506001600160a01b0382165f9081526019602052604090205460ff165b156130dc57505f919050565b506001600160a01b03165f9081526013602052604090206003015490565b6131038261161a565b61310c81613906565b61191f8383613da7565b600d545f90610100900460ff168061314557506001600160a01b0382165f9081526019602052604090205460ff165b1561315157505f919050565b506001600160a01b03165f9081526013602052604090206002015490565b5f61317981613906565b6001600160a01b0382166131a05760405163f6b2911f60e01b815260040160405180910390fd5b6131a988614075565b600b889055661111519055531560ca1b5f52601a60209081527f2e797767a1a64fae95a2e0af168826a71dd7a6398aaef5297b241ac94d864eb1899055600c889055600d805461ffff191688151561ff00191617610100881515021763ffff00001916620100008715150263ff00000019161763010000008615150217640100000000600160c01b0319166401000000006001600160a01b0386160217905542600e55604080516060810182528a81527f2e797767a1a64fae95a2e0af168826a71dd7a6398aaef5297b241ac94d864eb254928101929092527f2e797767a1a64fae95a2e0af168826a71dd7a6398aaef5297b241ac94d864eb35460ff16151582820152517f7411763df8b85a361debd9482957b1f2ab21d1ed68b95a5aeaaa7f16613edd08906132e7908b908b908b908b908b908b908b90615a3e565b60405180910390a1805160208083015160408085015181519485529284019190915290151590820152661111519055531560ca1b907fab58f97f9e52f1f548d1471adfc7020125d8ab45cb4c0c6e4f372ff66942a3fe9060600160405180910390a2505050505050505050565b6001600160a01b039182165f9081527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace016020908152604080832093909416825291909152205490565b6133c460405180608001604052805f81526020015f81526020015f81526020015f81525090565b5f516020615cc45f395f51905f526133db81613906565b600d5462010000900460ff161561340557604051637a851da960e11b815260040160405180910390fd5b61340f8484614a8e565b60108054905f61341e83615a26565b909155508252600160208301526134358484614b45565b60608401819052604080850183905284516020860151915190937f8e93f3f6c2a255277c60675d0667f9d90100ff94a8867af48b91732c8b74b9259361348a9383526020830191909152604082015260600190565b60405180910390a25092915050565b5f516020615c845f395f51905f526134b081613906565b600d805461ff00191661010017905542600e556040516001815265434c41494d5360d01b905f516020615d045f395f51905f5290602001611d04565b5f8281526014602090815260408083206001600160a01b0385168452909152812060025b600882015460ff16600481111561352957613529615629565b14613534575f611f43565b600301549392505050565b61356660405180608001604052805f81526020015f81526020015f81526020015f81525090565b5f516020615cc45f395f51905f5261357d81613906565b600d5462010000900460ff16156135a757604051637a851da960e11b815260040160405180910390fd5b600c548390158015906135c357508015806135c35750600c5481115b156135cd5750600c545b60108054905f6135dc83615a26565b909155508352600f545f805b5f54831080156135f9575061010081105b801561361057508315806136105750838660400151105b15613736578061361f81615a26565b5f85815260156020908152604080832054601483528184206001600160a01b03909116808552925290912091935091506001600882015460ff16600481111561366a5761366a615629565b0361368657806006015442101561369a57835f03613686578493505b8461369081615a26565b95505050506135e8565b85158015906136ac5750602088015115155b80156136ca575085816003015489604001516136c891906159a3565b115b156136d6575050613736565b5f5f6136e28785614b45565b9150915060018a6020018181516136f991906159a3565b90525060408a0180518391906137109083906159a3565b90525060608a0180518291906137279083906159a3565b90525050508461369081615a26565b5f548314801561374557508115155b61374f5782613751565b815b600f5585516020808801516040808a01516060808c0151835194855294840191909152908201929092527f8e93f3f6c2a255277c60675d0667f9d90100ff94a8867af48b91732c8b74b925910160405180910390a25050505050919050565b5f516020615ca45f395f51905f526137c781613906565b6001600160a01b0383166137ee5760405163f6b2911f60e01b815260040160405180910390fd5b6001600160a01b0383165f9081526018602090815260408083208054600160ff199182161790915560199092529091208054909116831515179055816138415769149154d5149250d5115160b21b613856565b6f232aa6262fa922a9aa2924a1aa24a7a760811b5b6001600160a01b0384167fbfb44373b56a8b33a2f3e28fc5b0b8842385af64fc253b88290e4eba8b2a3c7b68415554484f5249545960b81b33613079565b5f8281526014602090815260408083206001600160a01b038516845290915281206001613510565b5f6138c5613efe565b600154610c5791906159a3565b5f6001600160e01b03198216637965db0b60e01b1480610d2157506301ffc9a760e01b6001600160e01b0319831614610d21565b6139108133614c44565b50565b5f5f61392a5f516020615c645f395f51905f525490565b90505f6139356138bc565b9050815f03613948578492505050610d21565b612c9185828487613e20565b61199a8383836001614c7d565b5f807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00610d21565b613991614d60565b61399b8282614d85565b5050565b6139a7614d60565b61391081614dd5565b6139b8614d60565b565b5f5f516020615ce45f395f51905f526139d38484612639565b613a52575f848152602082815260408083206001600160a01b03871684529091529020805460ff19166001179055613a083390565b6001600160a01b0316836001600160a01b0316857f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a46001915050610d21565b5f915050610d21565b5092915050565b6001600160a01b038086165f90815260136020526040808220928716825290206001856004811115613a9657613a96615629565b03613b065783825f015f828254613aad9190615990565b9250508190555082826001015f828254613ac79190615990565b90915550508054849082905f90613adf9084906159a3565b9250508190555082816001015f828254613af991906159a3565b90915550613b6f92505050565b83826002015f828254613b199190615990565b9250508190555082826003015f828254613b339190615990565b9250508190555083816002015f828254613b4d91906159a3565b9250508190555082816003015f828254613b6791906159a3565b909155505050505b5050505050565b5f613b818484613354565b90505f1981101561191f5781811015613bb357828183604051637dc7a0d960e11b8152600401611f22939291906159cf565b61191f84848484035f614c7d565b6001600160a01b038316613bea57604051634b637e8f60e11b81525f6004820152602401611f22565b6001600160a01b038216613c135760405163ec442f0560e01b81525f6004820152602401611f22565b61199a838383614e58565b5f613c27613efe565b90508015613c5e578060015f828254613c4091906159a3565b925050819055508060045f828254613c589190615990565b90915550505b613c66613f6c565b60075560065442101580613c7a5750600454155b15613910575f60055550565b6004545f03613ca15750505f60058190556006555042600755565b8015613cb95750505f60055550426006819055600755565b825f03613cd95760405163162908e360e11b815260040160405180910390fd5b5f83600454613ce89190615a8f565b9050805f03613d0a5760405163162908e360e11b815260040160405180910390fd5b8215801590613d1857508281115b15613d3657604051637a851da960e11b815260040160405180910390fd5b6005819055613d4584426159a3565b6006555050426007555050565b5f826001600160a01b0316826001600160a01b031614806116135750506001600160a01b039182165f90815260126020908152604080832093909416825291909152205460ff1690565b61399b5f838361424d565b5f5f516020615ce45f395f51905f52613dc08484612639565b15613a52575f848152602082815260408083206001600160a01b0387168085529252808320805460ff1916905551339287917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a46001915050610d21565b5f613e4d613e2d83614f35565b8015613e4857505f8480613e4357613e43615a7b565b868809115b151590565b613e58868686614f61565b612c9191906159a3565b5f600454600354600254600154613e7991906159a3565b613e8391906159a3565b610c5791906159a3565b5f613e966147d8565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa158015613eda573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c579190615aa2565b5f6004545f1480613f0f5750600554155b15613f1957505f90565b6006544210613f29575060045490565b5f600754613f35613f6c565b613f3f9190615990565b90505f60055482613f509190615ab9565b90506004548111613f615780613f65565b6004545b9250505090565b5f6006545f14158015613f80575060065442115b15613f8c575060065490565b504290565b60115460ff1615613fb557604051637a851da960e11b815260040160405180910390fd5b811580613fc0575080155b15613fde5760405163162908e360e11b815260040160405180910390fd5b613fe784615011565b613ff083615011565b613ff8613c1e565b614006843084612dd06147d8565b8160015f82825461401791906159a3565b909155506140279050838261504a565b826001600160a01b0316846001600160a01b03167fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d78484604051612aa6929190918252602082015260400190565b6276a70081111561391057604051637475d84d60e11b815260040160405180910390fd5b604080516060810182525f80825260208083018290528284018290526001600160a01b0385168252601b9052919091205490816140de57661111519055531560ca1b91505b505f818152601a60209081526040918290208251606081018452815481526001820154928101929092526002015460ff1615159181018290529061413557604051637a851da960e11b815260040160405180910390fd5b915091565b6001600160a01b03821661416357604051634b637e8f60e11b81525f6004820152602401611f22565b61399b825f83614e58565b6001600160a01b0381165f9081526019602052604081205460ff16156141a857506f232aa6262fa922a9aa2924a1aa24a7a760811b919050565b6001600160a01b0382165f9081526018602052604090205460ff166141d5576421a622a0a960d91b610d21565b69149154d5149250d5115160b21b92915050565b6001600160a01b0381165f9081526019602052604081205460ff161561421657506210531360ea1b919050565b6001600160a01b0382165f9081526018602052604090205460ff1661423b575f610d21565b671393d397d156125560c21b92915050565b5f516020615c445f395f51905f526001600160a01b0384166142875781816002015f82825461427c91906159a3565b909155506142e49050565b6001600160a01b0384165f90815260208290526040902054828110156142c65784818460405163391434e360e21b8152600401611f22939291906159cf565b6001600160a01b0385165f9081526020839052604090209083900390555b6001600160a01b038316614302576002810180548390039055614320565b6001600160a01b0383165f9081526020829052604090208054830190555b826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051612aa691815260200190565b5f5f61436f613e8d565b90505f61437a613e62565b9050808211614389575f613f65565b613f658183615990565b6040516001600160a01b0383811660248301526044820183905261199a91859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b03838183161783525050505061507e565b600d54610100900460ff16156139b857604051637a851da960e11b815260040160405180910390fd5b6001600160a01b0382165f9081526019602052604090205460ff168061445857506001600160a01b0381165f9081526019602052604090205460ff165b1561447657604051637a851da960e11b815260040160405180910390fd5b6001600160a01b0382165f9081526018602052604090205460ff1680156144af5750816001600160a01b0316816001600160a01b031614155b156144cd57604051637a851da960e11b815260040160405180910390fd5b6001600160a01b0381165f9081526018602052604090205460ff1680156145065750816001600160a01b0316816001600160a01b031614155b1561399b57604051637a851da960e11b815260040160405180910390fd5b6001600160a01b0383165f90815260166020908152604080832060179092528220548391905b82158015906145595750815481105b156146f4575f60145f84848154811061457457614574615ad0565b5f918252602080832090910154835282810193909352604091820181206001600160a01b038c168252909252902090506002600882015460ff1660048111156145bf576145bf615629565b1415806145ce57506004810154155b156145e657816145dd81615a26565b9250505061454a565b6145f18189896150ea565b5f81600401548510614607578160040154614609565b845b90505f82600401548214614633576003830154600484015461462e9184916001613e20565b614639565b82600301545b905080158061465b57508260030154811015801561465b575082600401548214155b156146795760405163eb6def5160e01b815260040160405180910390fd5b80836003015f82825461468c9190615990565b9250508190555081836004015f8282546146a69190615990565b909155506146b690508287615990565b95506146c281886159a3565b965082600301545f036146ec5760088301805460ff19166003179055836146e881615a26565b9450505b50505061454a565b6001600160a01b0387165f908152601760205260409020819055821561472d5760405163eb6def5160e01b815260040160405180910390fd5b6147388785876151a1565b61475586866147456147d8565b6001600160a01b03169190614393565b60408051868152602081018690526001600160a01b03808a16929089169133917ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db91016125d5565b5f6004545f141580156147b1575060055415155b80156147be575060065442105b156147d15742600654610c579190615990565b5060085490565b5f610c5761199f565b6040516001600160a01b03848116602483015283811660448301526064820183905261191f9186918216906323b872dd906084016143c0565b6001600160a01b0383165f90815260166020908152604080832060179092528220548391905b821580159061484f5750815481105b156149ab575f60145f84848154811061486a5761486a615ad0565b5f918252602080832090910154835282810193909352604091820181206001600160a01b038c168252909252902090506002600882015460ff1660048111156148b5576148b5615629565b1415806148c457506003810154155b156148dc57816148d381615a26565b92505050614840565b6148e78189896150ea565b5f816003015485106148fd5781600301546148ff565b845b90505f8260030154821461492857600483015460038401546149239184915f613e20565b61492e565b82600401545b905081836003015f8282546149439190615990565b9250508190555080836004015f82825461495d9190615990565b9091555061496d90508287615990565b955061497981886159a3565b965082600301545f036149a35760088301805460ff191660031790558361499f81615a26565b9450505b505050614840565b6001600160a01b0387165f90815260176020526040902081905582156149e45760405163eb6def5160e01b815260040160405180910390fd5b6149ef8786866151a1565b6149fc86856147456147d8565b60408051858152602081018790526001600160a01b03808a16929089169133917ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db91016125d5565b5f5f614a5b5f516020615c645f395f51905f525490565b90505f614a666138bc565b9050811580614a73575080155b15614a82578492505050610d21565b612c9185838387613e20565b6001600160a01b0381161580614abd57505f828152601560205260409020546001600160a01b03828116911614155b15614adb57604051637a851da960e11b815260040160405180910390fd5b5f8281526014602090815260408083206001600160a01b038516845290915290206001600882015460ff166004811115614b1757614b17615629565b141580614b275750806006015442105b1561199a57604051637a851da960e11b815260040160405180910390fd5b5f8281526014602090815260408083206001600160a01b038516845290915290206003810154600482015460088301805460ff191660021790559091614b8b858561520a565b6001600160a01b0384165f908152601360205260408120805490918591839190614bb6908490615990565b9250508190555082816001015f828254614bd09190615990565b9250508190555083816002015f828254614bea91906159a3565b9250508190555082816003015f828254614c0491906159a3565b925050819055508260025f828254614c1c9190615990565b925050819055508260035f828254614c3491906159a3565b9250508190555050509250929050565b614c4e8282612639565b61399b5760405163e2517d3f60e01b81526001600160a01b038216600482015260248101839052604401611f22565b5f516020615c445f395f51905f526001600160a01b038516614cb45760405163e602df0560e01b81525f6004820152602401611f22565b6001600160a01b038416614cdd57604051634a1406b160e11b81525f6004820152602401611f22565b6001600160a01b038086165f90815260018301602090815260408083209388168352929052208390558115613b6f57836001600160a01b0316856001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92585604051614d5191815260200190565b60405180910390a35050505050565b614d686152ce565b6139b857604051631afcd79f60e31b815260040160405180910390fd5b614d8d614d60565b5f516020615c445f395f51905f527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace03614dc68482615b3c565b506004810161191f8382615b3c565b614ddd614d60565b7f0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e005f80614e09846152e7565b9150915081614e19576012614e1b565b805b83546001600160a81b031916600160a01b60ff92909216919091026001600160a01b031916176001600160a01b0394909416939093179091555050565b6001600160a01b038216614eb8576001600160a01b03831615801590614e9557506001600160a01b0383165f9081526019602052604090205460ff165b15614eb357604051637a851da960e11b815260040160405180910390fd5b614f2a565b6001600160a01b038316614ecf57614eb382615011565b6001600160a01b0383165f9081526018602052604090205460ff1680614f0c57506001600160a01b0382165f9081526018602052604090205460ff165b15614f2a57604051637a851da960e11b815260040160405180910390fd5b61199a83838361424d565b5f6002826003811115614f4a57614f4a615629565b614f549190615bf7565b60ff166001149050919050565b5f5f5f614f6e86866153bd565b91509150815f03614f9257838181614f8857614f88615a7b565b0492505050611613565b818411614fa957614fa960038515026011186153d9565b5f848688095f868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010185841190960395909502919093039390930492909217029150509392505050565b6001600160a01b0381165f9081526018602052604090205460ff161561391057604051637a851da960e11b815260040160405180910390fd5b6001600160a01b0382166150735760405163ec442f0560e01b81525f6004820152602401611f22565b61399b5f8383614e58565b5f5f60205f8451602086015f885af18061509d576040513d5f823e3d81fd5b50505f513d915081156150b45780600114156150c1565b6001600160a01b0384163b155b1561191f57604051635274afe760e01b81526001600160a01b0385166004820152602401611f22565b6150f4828261441b565b60028301546001600160a01b03165f9081526019602052604090205460ff161561513157604051637a851da960e11b815260040160405180910390fd5b60028301546001600160a01b03165f9081526018602052604090205460ff168015614b27575060028301546001600160a01b038381169116141580614b27575060028301546001600160a01b0382811691161461199a57604051637a851da960e11b815260040160405180910390fd5b6001600160a01b0383165f908152601360205260408120600281018054919285926151cd908490615990565b9250508190555081816003015f8282546151e79190615990565b925050819055508160035f8282546151ff9190615990565b909155505050505050565b6001600160a01b0381165f908152601760205260408120549081900361522f57505050565b6001600160a01b0382165f9081526016602052604090208381615253600185615990565b8154811061526357615263615ad0565b905f5260205f20015410156152785750505050565b811561191f578161528881615c18565b9250508381838154811061529e5761529e615ad0565b905f5260205f200154036152c957506001600160a01b039091165f9081526017602052604090205550565b615278565b5f6152d7613961565b54600160401b900460ff16919050565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b17905290515f918291829182916001600160a01b0387169161532d91615c2d565b5f60405180830381855afa9150503d805f8114615365576040519150601f19603f3d011682016040523d82523d5f602084013e61536a565b606091505b509150915081801561537e57506020815110155b156153b1575f818060200190518101906153989190615aa2565b905060ff81116153af576001969095509350505050565b505b505f9485945092505050565b5f805f1983850993909202808410938190039390930393915050565b634e487b715f52806020526024601cfd5b6040518061012001604052805f81526020015f6001600160a01b031681526020015f6001600160a01b031681526020015f81526020015f81526020015f81526020015f81526020015f81526020015f600481111561544a5761544a615629565b905290565b5f6020828403121561545f575f5ffd5b81356001600160e01b031981168114611613575f5ffd5b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b5f602082840312156154bb575f5ffd5b5035919050565b6001600160a01b0381168114613910575f5ffd5b5f5f604083850312156154e7575f5ffd5b82356154f2816154c2565b946020939093013593505050565b5f5f5f60608486031215615512575f5ffd5b833561551d816154c2565b9250602084013561552d816154c2565b929592945050506040919091013590565b5f5f5f60608486031215615550575f5ffd5b833592506020840135615562816154c2565b91506040840135615572816154c2565b809150509250925092565b8015158114613910575f5ffd5b5f5f5f6060848603121561559c575f5ffd5b833592506020840135915060408401356155728161557d565b5f5f604083850312156155c6575f5ffd5b8235915060208301356155d8816154c2565b809150509250929050565b5f602082840312156155f3575f5ffd5b8135611613816154c2565b8151815260208083015190820152604080830151908201526060808301519082015260808101610d21565b634e487b7160e01b5f52602160045260245ffd5b6005811061565957634e487b7160e01b5f52602160045260245ffd5b9052565b5f610120820190508251825260018060a01b03602084015116602083015260018060a01b036040840151166040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e0830152610100830151613a5b61010084018261563d565b5f61016082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e0830152610100830151610100830152610120830151610120830152610140830151613a5b61014084018215159052565b5f5f60408385031215615763575f5ffd5b823561576e816154c2565b915060208301356155d88161557d565b5f5f8284036080811215615790575f5ffd5b833592506060601f19820112156157a5575f5ffd5b506020830190509250929050565b5f602082840312156157c3575f5ffd5b81356116138161557d565b5f61010082019050825182526020830151602083015260408301511515604083015260608301511515606083015260808301511515608083015260a083015161581b60a084018215159052565b5060c083015161583660c08401826001600160a01b03169052565b5060e092830151919092015290565b5f5f60408385031215615856575f5ffd5b8235615861816154c2565b915060208301356155d8816154c2565b5f5f5f60608486031215615883575f5ffd5b833561588e816154c2565b9250602084013591506040840135615572816154c2565b5f5f604083850312156158b6575f5ffd5b50508035926020909101359150565b5f5f5f5f5f5f5f60e0888a0312156158db575f5ffd5b873596506020880135955060408801356158f48161557d565b945060608801356159048161557d565b935060808801356159148161557d565b925060a08801356159248161557d565b915060c0880135615934816154c2565b8091505092959891949750929550565b600181811c9082168061595857607f821691505b60208210810361597657634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b81810381811115610d2157610d2161597c565b80820180821115610d2157610d2161597c565b60ff8181168382160190811115610d2157610d2161597c565b6001600160a01b039390931683526020830191909152604082015260600190565b8135815560208201356001820155600281016040830135615a108161557d565b815490151560ff1660ff19919091161790555050565b5f60018201615a3757615a3761597c565b5060010190565b96875260208701959095529215156040860152901515606085015215156080840152151560a08301526001600160a01b031660c082015260e00190565b634e487b7160e01b5f52601260045260245ffd5b5f82615a9d57615a9d615a7b565b500490565b5f60208284031215615ab2575f5ffd5b5051919050565b8082028115828204841417610d2157610d2161597c565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52604160045260245ffd5b601f82111561199a57805f5260205f20601f840160051c81016020851015615b1d5750805b601f840160051c820191505b81811015613b6f575f8155600101615b29565b815167ffffffffffffffff811115615b5657615b56615ae4565b615b6a81615b648454615944565b84615af8565b6020601f821160018114615b9c575f8315615b855750848201515b5f19600385901b1c1916600184901b178455613b6f565b5f84815260208120601f198516915b82811015615bcb5787850151825560209485019460019092019101615bab565b5084821015615be857868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b5f60ff831680615c0957615c09615a7b565b8060ff84160691505092915050565b5f81615c2657615c2661597c565b505f190190565b5f82518060208501845e5f92019182525091905056fe52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0052c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0265d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a805c6c8176a314009a89154ee315bc4a18d0cf3277d5a02e51a377ea16566483841adcd1e63b365b720fa3914e607573de5a364c3db334a0e00a5e5475c0be6502dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b6268001126a95f637665b1984368fd54018e81678bdeec710c7ef34ff2ccef87c37e9ba2646970667358221220282d3d52ca4139dfe6ca5a6ed56a29b355e6f6d8042e044fe55d6db56f68187064736f6c634300081e0033","optimization_enabled":true,"verified_twin_address_hash":null,"is_verified":true,"compiler_settings":{"evmVersion":"osaka","libraries":{},"metadata":{"appendCBOR":true,"bytecodeHash":"ipfs","useLiteralContent":false},"optimizer":{"enabled":true,"runs":200},"outputSelection":{"*":{"":["*"],"*":["*"]}},"remappings":["forge-std/=lib/forge-std/src/","@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/","@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/","erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/","halmos-cheatcodes/=lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/","openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/","openzeppelin-contracts/=lib/openzeppelin-contracts/"],"viaIR":false},"optimization_runs":200,"sourcify_repo_url":null,"decoded_constructor_args":null,"compiler_version":"v0.8.30+commit.73712a01","is_verified_via_verifier_alliance":false,"verified_at":"2026-07-28T16:44:13.596603Z","implementations":[],"proxy_type":null,"external_libraries":[],"creation_bytecode":"0x608060405260015f556001600f556001601055348015601c575f5ffd5b5060236027565b60d7565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff161560765760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b039081161460d45780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b615d59806100e45f395ff3fe608060405234801561000f575f5ffd5b5060043610610485575f3560e01c80637d41c86e11610258578063c336a0841161014b578063e20bb1e5116100ca578063ef8b30f71161008f578063ef8b30f714610b15578063f0aa2ffc14610bf9578063f298f42c14610c0c578063f2d25b2d14610c1f578063f32774b314610c27578063f5a23d8d14610c3b575f5ffd5b8063e20bb1e514610baf578063e63ab1e914610bc2578063e81640d214610bd6578063eaed1d0714610bde578063ec67bdd514610bf1575f5ffd5b8063d547741f11610110578063d547741f14610b3b578063d86b798014610b4e578063d905777e14610b76578063db6e16e014610b89578063dd62ed3e14610b9c575f5ffd5b8063c336a08414610b02578063c63d75b61461065f578063c6e6f59214610b15578063ce96cb7714610b28578063d4347f2514610489575f5ffd5b8063a217fddf116101d7578063b460af941161019c578063b460af9414610a7b578063b5c6f7ea14610a8e578063b6363cf214610aa1578063b6a758f714610adc578063ba08765214610aef575f5ffd5b8063a217fddf14610a35578063a8d5fd6514610a3c578063a9059cbb14610a42578063b37fd19014610a55578063b3d7f6b914610a68575f5ffd5b806395b2197e1161021d57806395b2197e146108d657806395d89b411461099f578063966be075146109a75780639ee2735b146109ba578063a0776b8214610a22575f5ffd5b80637d41c86e146108765780637fbf11791461088957806386d192e51461089d57806391d14854146108b057806394bf804d146108c3575f5ffd5b806338d52e0f1161037b578063582c7928116102fa57806370a08231116102bf57806370a082311461082757806374b9f3531461083a578063762f08241461084b57806376fe916814610853578063792c23481461085b5780637c9e96db14610863575f5ffd5b8063582c7928146107655780636682aec6146107ae5780636973f4b5146107b65780636d750d80146107ed5780636e553f6514610814575f5ffd5b80634a8c110a116103405780634a8c110a146106925780634cdad506146105175780634e94c285146106a757806351dbce7e1461074a578063558a729714610752575f5ffd5b806338d52e0f146106175780633ba0b9a9146106375780633c05e18f1461063f578063402d267d1461065f578063460f1c9114610672575f5ffd5b80631ba01f07116104075780632b9d9c1f116103cc5780632b9d9c1f146105bc5780632f2ff15d146105cf578063313ce567146105e257806335269315146105fc57806336568abe14610604575f5ffd5b80631ba01f07146105515780631e9049cf1461057957806323b872dd14610583578063248a9ca314610596578063288f0ebd146105a9575f5ffd5b806307a2d13a1161044d57806307a2d13a146104f1578063095ea7b3146105045780630a28a477146105175780631794bb3c1461052a57806318160ddd1461053d575f5ffd5b806301e1d1141461048957806301ffc9a7146104a457806302191980146104c757806302befd24146104d157806306fdde03146104dc575b5f5ffd5b610491610c4e565b6040519081526020015b60405180910390f35b6104b76104b236600461544f565b610c5c565b604051901515815260200161049b565b6104cf610d27565b005b60115460ff166104b7565b6104e4610d84565b60405161049b9190615476565b6104916104ff3660046154ab565b610e44565b6104b76105123660046154d6565b610e4f565b6104916105253660046154ab565b610e66565b6104cf610538366004615500565b610e80565b5f516020615c645f395f51905f5254610491565b61056461055f36600461553e565b61112a565b6040805192835260208301919091520161049b565b6104916276a70081565b6104b7610591366004615500565b6115f5565b6104916105a43660046154ab565b61161a565b6104cf6105b736600461558a565b61163a565b6104916105ca3660046155b5565b6116e5565b6104cf6105dd3660046155b5565b611903565b6105ea611925565b60405160ff909116815260200161049b565b600b54610491565b6104cf6106123660046155b5565b611967565b61061f61199f565b6040516001600160a01b03909116815260200161049b565b6104916119cd565b61065261064d3660046155e3565b611a1a565b60405161049b91906155fe565b61049161066d3660046155e3565b611a8e565b6106856106803660046155b5565b611aca565b60405161049b919061565d565b61069a611b8e565b60405161049b91906156d3565b61070c604080516080810182525f8082526020820181905291810182905260608101919091525060408051608081018252600a546001600160a01b03610100820416825260085460208301526009549282019290925260ff9091161515606082015290565b60405161049b919081516001600160a01b03168152602080830151908201526040808301519082015260609182015115159181019190915260800190565b6104cf611cb3565b6104b7610760366004615752565b611d0f565b61076d611da7565b60405161049b91905f60a082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015292915050565b6104cf611e30565b6107c96107c43660046154ab565b611e8e565b6040805182518152602080840151908201529181015115159082015260600161049b565b6104917f0f51adb3f49e4a9bbb17b3783f025995eaf8c24be2c8eefff214bdfda05ef94d81565b6104916108223660046155b5565b611eee565b6104916108353660046155e3565b611f4b565b610491661111519055531560ca1b81565b6104cf611f71565b6104cf612007565b6104915f5481565b6104cf61087136600461577e565b61205f565b61049161088436600461553e565b6121b0565b6104915f516020615ca45f395f51905f5281565b6104cf6108ab3660046157b3565b6125e7565b6104b76108be3660046155b5565b612639565b6104916108d13660046155b5565b61266f565b61099260408051610100810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081019190915250604080516101008082018352600b548252600c546020830152600d5460ff80821615159484019490945290810483161515606083015262010000810483161515608083015263010000008104909216151560a08201526401000000009091046001600160a01b031660c0820152600e5460e082015290565b60405161049b91906157ce565b6104e46126bb565b6104cf6109b53660046154ab565b6126f9565b6109cd6109c83660046155e3565b6128b1565b60405161049b91905f60e082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015292915050565b6104cf610a30366004615845565b61299c565b6104915f81565b3061061f565b6104b7610a503660046154d6565b612ab4565b6104cf610a63366004615871565b612ac1565b610491610a763660046154ab565b612bc0565b610491610a8936600461553e565b612bcc565b6104cf610a9c3660046158a5565b612c9a565b6104b7610aaf366004615845565b6001600160a01b039182165f90815260126020908152604080832093909416825291909152205460ff1690565b6104cf610aea3660046154d6565b612e4e565b610491610afd36600461553e565b612f08565b6104cf610b10366004615752565b612fcd565b610491610b233660046154ab565b613096565b610491610b363660046155e3565b6130a1565b6104cf610b493660046155b5565b6130fa565b610491610b5c3660046155e3565b6001600160a01b03165f908152601b602052604090205490565b610491610b843660046155e3565b613116565b6104cf610b973660046158c5565b61316f565b610491610baa366004615845565b613354565b610652610bbd3660046155b5565b61339d565b6104915f516020615c845f395f51905f5281565b6104cf613499565b610491610bec3660046155b5565b6134ec565b600354610491565b610652610c073660046154ab565b61353f565b6104cf610c1a366004615752565b6137b0565b600254610491565b6104915f516020615cc45f395f51905f5281565b610491610c493660046155b5565b613894565b5f610c576138bc565b905090565b5f6001600160e01b0319821663e3bc4e6560e01b1480610c8c57506001600160e01b03198216631883ba3960e21b145b80610ca757506001600160e01b03198216632f0a18c560e01b145b80610cc257506001600160e01b0319821663ada5a57f60e01b145b80610cdd57506001600160e01b0319821663a37e4c4760e01b145b80610cf857506001600160e01b03198216638e8ba26b60e01b145b80610d1257506001600160e01b03198216622ffaa760e61b145b80610d215750610d21826138d2565b92915050565b5f516020615c845f395f51905f52610d3e81613906565b6011805460ff191660019081179091556040519081527fe89bebe4218a63255dca3e5553791b2ed43fa3578720bc6f7b38abef9b117de79060200160405180910390a150565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0380546060915f516020615c445f395f51905f5291610dc290615944565b80601f0160208091040260200160405190810160405280929190818152602001828054610dee90615944565b8015610e395780601f10610e1057610100808354040283529160200191610e39565b820191905f5260205f20905b815481529060010190602001808311610e1c57829003601f168201915b505050505091505090565b5f610d21825f613913565b5f33610e5c818585613954565b5060019392505050565b5f604051637a851da960e11b815260040160405180910390fd5b5f610e89613961565b805490915060ff600160401b820416159067ffffffffffffffff165f81158015610eb05750825b90505f8267ffffffffffffffff166001148015610ecc5750303b155b905081158015610eda575080155b15610ef85760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610f2257845460ff60401b1916600160401b1785555b6001600160a01b0388161580610f3f57506001600160a01b038716155b15610f5d5760405163f6b2911f60e01b815260040160405180910390fd5b610fa76040518060400160405280600b81526020016a0a6e8c2d6cac840aaa688f60ab1b815250604051806040016040528060058152602001640e6aaa688f60db1b815250613989565b610fb08861399f565b610fb86139b0565b610fc25f886139ba565b50610fed7f0f51adb3f49e4a9bbb17b3783f025995eaf8c24be2c8eefff214bdfda05ef94d886139ba565b506110055f516020615c845f395f51905f52886139ba565b5061101d5f516020615ca45f395f51905f52886139ba565b506110355f516020615cc45f395f51905f52886139ba565b50600a8054610100600160a81b0319166101006001600160a01b038a1690810291909117909155600d8054640100000000600160c01b0319166401000000009092029190911790556008869055426007819055600e55661111519055531560ca1b5f908152601a6020527f2e797767a1a64fae95a2e0af168826a71dd7a6398aaef5297b241ac94d864eb3805460ff1916600190811790915590819055600f819055601055831561112057845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050505050565b5f5f5f516020615ca45f395f51905f5261114381613906565b6001600160a01b038516158061116057506001600160a01b038416155b1561117e5760405163f6b2911f60e01b815260040160405180910390fd5b836001600160a01b0316856001600160a01b031614806111b557506001600160a01b0384165f9081526018602052604090205460ff165b156111d357604051637a851da960e11b815260040160405180910390fd5b5f8681526014602090815260408083206001600160a01b03808a168552908352818420825161012081018452815481526001820154831694810194909452600281015490911691830191909152600381015460608301526004808201546080840152600582015460a0840152600682015460c0840152600782015460e0840152600882015461010084019160ff9091169081111561127357611273615629565b600481111561128457611284615629565b9052509050600181610100015160048111156112a2576112a2615629565b141580156112c75750600281610100015160048111156112c4576112c4615629565b14155b156112e557604051637a851da960e11b815260040160405180910390fd5b6001600160a01b0386165f9081526019602052604090205460ff1615801561132757506040808201516001600160a01b03165f9081526019602052205460ff16155b1561134557604051637a851da960e11b815260040160405180910390fd5b806060015193508060800151925061136586868361010001518787613a62565b60145f8881526020019081526020015f205f876001600160a01b03166001600160a01b031681526020019081526020015f205f5f82015f9055600182015f6101000a8154906001600160a01b030219169055600282015f6101000a8154906001600160a01b030219169055600382015f9055600482015f9055600582015f9055600682015f9055600782015f9055600882015f6101000a81549060ff021916905550508481602001906001600160a01b031690816001600160a01b0316815250508481604001906001600160a01b031690816001600160a01b0316815250508060145f8981526020019081526020015f205f876001600160a01b03166001600160a01b031681526020019081526020015f205f820151815f01556020820151816001015f6101000a8154816001600160a01b0302191690836001600160a01b031602179055506040820151816002015f6101000a8154816001600160a01b0302191690836001600160a01b03160217905550606082015181600301556080820151816004015560a0820151816005015560c0820151816006015560e08201518160070155610100820151816008015f6101000a81548160ff0219169083600481111561153357611533615629565b021790555050505f87815260156020908152604080832080546001600160a01b0319166001600160a01b038a811691821790925580855260168452918420805460018101825590855292909320909101899055610100830151909188169089907f0585b9e8cfad96bfecd02b884ced1f9b546e5c6adb258094a29671336814f56c908890889060048111156115ca576115ca615629565b60408051938452602084019290925260ff169082015260600160405180910390a45050935093915050565b5f33611602858285613b76565b61160d858585613bc1565b60019150505b9392505050565b5f9081525f516020615ce45f395f51905f52602052604090206001015490565b5f61164481613906565b61164c613c1e565b60088490556009839055600a80546001600160a81b031916831515610100600160a81b031916176101003302179055611686848484613c86565b600a546040805186815260208101869052841515918101919091526101009091046001600160a01b0316907f8c523465b861c8f308898f5974e354c37b1fe7bebd061eb4aeac49afe84f3fa9906060015b60405180910390a250505050565b600d545f906301000000900460ff161561171257604051637a851da960e11b815260040160405180910390fd5b61171c8233613d52565b61173957604051637a851da960e11b815260040160405180910390fd5b5f8381526014602090815260408083206001600160a01b038616845290915290206001600882015460ff16600481111561177557611775615629565b1461179357604051637a851da960e11b815260040160405180910390fd5b6001600160a01b0383165f9081526019602052604090205460ff16806117d4575060028101546001600160a01b03165f9081526019602052604090205460ff165b156117f257604051637a851da960e11b815260040160405180910390fd5b6003810180546004808401805460088601805460ff19169093179092555f938490558390556001600160a01b038616835260136020526040832080549295509092909185918391611844908490615990565b9250508190555081816001015f82825461185e9190615990565b925050819055508160025f8282546118769190615990565b925050819055508160015f82825461188e91906159a3565b909155505060028301546118ab906001600160a01b031685613d9c565b600283015460408051868152602081018590526001600160a01b039283169288169189917f6222ad3366b89f31bbbc304a4db3a8dd8e48fd0b6c9da30b33fc71fc820cc8f0910160405180910390a450505092915050565b61190c8261161a565b61191581613906565b61191f83836139ba565b50505050565b5f807f0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e0090505f81546119619190600160a01b900460ff166159b6565b91505090565b6001600160a01b03811633146119905760405163334bd91960e11b815260040160405180910390fd5b61199a8282613da7565b505050565b7f0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e00546001600160a01b031690565b5f5f6119e45f516020615c645f395f51905f525490565b9050805f036119fc57670de0b6b3a764000091505090565b611961670de0b6b3a7640000825f611a12610c4e565b929190613e20565b611a4160405180608001604052805f81526020015f81526020015f81526020015f81525090565b506001600160a01b03165f90815260136020908152604091829020825160808101845281548152600182015492810192909252600281015492820192909252600390910154606082015290565b6011545f9060ff1680611ab857506001600160a01b0382165f9081526018602052604090205460ff165b611ac3575f19610d21565b5f92915050565b611ad26153ea565b5f8381526014602090815260408083206001600160a01b03808716855290835292819020815161012081018352815481526001820154851693810193909352600281015490931690820152600382015460608201526004808301546080830152600583015460a0830152600683015460c0830152600783015460e0830152600883015491929161010084019160ff90911690811115611b7357611b73615629565b6004811115611b8457611b84615629565b9052509392505050565b611be26040518061016001604052805f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f151581525090565b5f611beb6138bc565b90505f611bf6613e62565b90505f611c01613e8d565b90505f611c195f516020615c645f395f51905f525490565b905060405180610160016040528082815260200185815260200185815260200160025481526020016003548152602001600354600254611c5991906159a3565b8152602001848152602001838152602001825f14611c8a57611c8586670de0b6b3a7640000855f613e20565b611c94565b670de0b6b3a76400005b8152602001600b54815260200184841015151581525094505050505090565b5f516020615c845f395f51905f52611cca81613906565b600d805460ff1916600190811790915542600e5560405190815267524551554553545360c01b905f516020615d045f395f51905f52906020015b60405180910390a250565b5f6001600160a01b038316611d375760405163f6b2911f60e01b815260040160405180910390fd5b335f8181526012602090815260408083206001600160a01b03881680855290835292819020805460ff191687151590811790915590519081529192917fceb576d9f15e4e200fdb5096d64d5dfd667e16def20c1eefd14256d8e3faa267910160405180910390a350600192915050565b611dd46040518060a001604052805f81526020015f81526020015f81526020015f81526020015f81525090565b5f611ddd613efe565b90506040518060a0016040528082600154611df891906159a3565b815260200182600454611e0b9190615990565b815260200160055481526020016006548152602001611e28613f6c565b905292915050565b5f516020615c845f395f51905f52611e4781613906565b600d805463ff0000001916630100000017905542600e55604051600181526c43414e43454c4c4154494f4e5360981b905f516020615d045f395f51905f5290602001611d04565b611eb160405180606001604052805f81526020015f81526020015f151581525090565b505f908152601a60209081526040918290208251606081018452815481526001820154928101929092526002015460ff1615159181019190915290565b5f5f611ef983611a8e565b905080841115611f2b57828482604051633c8097d960e11b8152600401611f22939291906159cf565b60405180910390fd5b5f611f3585613096565b9050611f4333858784613f91565b949350505050565b6001600160a01b03165f9081525f516020615c445f395f51905f52602052604090205490565b5f516020615c845f395f51905f52611f8881613906565b611f90613c1e565b600a805460ff19166001908117909155600854600954611faf92613c86565b600a546008546009546040805192835260208301919091526001908201526101009091046001600160a01b0316907f8c523465b861c8f308898f5974e354c37b1fe7bebd061eb4aeac49afe84f3fa990606001611d04565b5f516020615c845f395f51905f5261201e81613906565b600d805462ff000019166201000017905542600e556040516001815268534552564943494e4760b81b905f516020615d045f395f51905f5290602001611d04565b5f61206981613906565b8261208757604051637a851da960e11b815260040160405180910390fd5b661111519055531560ca1b831480156120ad57506120ab60608301604084016157b3565b155b156120cb57604051637a851da960e11b815260040160405180910390fd5b6120d58235614075565b5f838152601a6020526040902082906120ee82826159f0565b5050662eeeae6faaaceb60ca1b830161214e57600b805483359182905560405190917f8f6ceadd6e9845ce194f7cd50e5a1ef4aec5b40c31652db44ea043bbbf27b92b9161214491848252602082015260400190565b60405180910390a1505b42600e55827fab58f97f9e52f1f548d1471adfc7020125d8ab45cb4c0c6e4f372ff66942a3fe8335602085013561218b60608701604088016157b3565b60408051938452602084019290925215159082015260600160405180910390a2505050565b600d545f9060ff16156121d657604051637a851da960e11b815260040160405180910390fd5b8315806121ea57506001600160a01b038316155b806121fc57506001600160a01b038216155b1561221a5760405163162908e360e11b815260040160405180910390fd5b6122248233613d52565b158061223757506122358333613d52565b155b1561225557604051637a851da960e11b815260040160405180910390fd5b6001600160a01b0383165f9081526019602052604090205460ff168061229257506001600160a01b0382165f9081526019602052604090205460ff165b156122b057604051637a851da960e11b815260040160405180910390fd5b6001600160a01b0382165f9081526018602052604090205460ff1680156122e95750816001600160a01b0316836001600160a01b031614155b1561230757604051637a851da960e11b815260040160405180910390fd5b8361231183611f4b565b101561233057604051635a5c1b5560e11b815260040160405180910390fd5b612338613c1e565b5f5f61234385614099565b9150915080602001515f1415801561235e5750806020015186115b1561237c5760405163162908e360e11b815260040160405180910390fd5b5f612387875f613913565b9050612393858861413a565b8060015f8282546123a49190615990565b925050819055508060025f8282546123bc91906159a3565b90915550505f805490806123cf83615a26565b909155505f81815260156020908152604080832080546001600160a01b0319166001600160a01b038c1690811790915580845260168352818420805460018101825590855283852001859055835260139091528120805492965089929091906124399084906159a3565b90915550506001600160a01b0386165f90815260136020526040812060010180548392906124689084906159a3565b92505081905550604051806101200160405280858152602001876001600160a01b03168152602001866001600160a01b03168152602001888152602001828152602001428152602001835f0151426124c091906159a3565b815260208101859052604001600190525f8581526014602090815260408083206001600160a01b03808c168552908352928190208451815591840151600180840180549286166001600160a01b0319938416179055918501516002840180549190951691161790925560608301516003820155608083015160048083019190915560a0840151600583015560c0840151600683015560e0840151600783015561010084015160088301805493949193909260ff199091169190849081111561258a5761258a615629565b02179055505060408051338152602081018a90528692506001600160a01b0380891692908a16917f1fdc681a13d8c5da54e301c7ce6542dcde4581e4725043fdab2db12ddc57450691015b60405180910390a45050509392505050565b5f6125f181613906565b6011805460ff19168315159081179091556040519081527fe89bebe4218a63255dca3e5553791b2ed43fa3578720bc6f7b38abef9b117de79060200160405180910390a15050565b5f9182525f516020615ce45f395f51905f52602090815260408084206001600160a01b0393909316845291905290205460ff1690565b5f5f61267a83611a8e565b9050808411156126a35782848260405163284ff66760e01b8152600401611f22939291906159cf565b5f6126ad85612bc0565b9050611f4333858388613f91565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0480546060915f516020615c445f395f51905f5291610dc290615944565b5f61270381613906565b61270c82614075565b600b805490839055661111519055531560ca1b5f52601a60209081527f2e797767a1a64fae95a2e0af168826a71dd7a6398aaef5297b241ac94d864eb184905542600e55604080516060810182528581527f2e797767a1a64fae95a2e0af168826a71dd7a6398aaef5297b241ac94d864eb254818401527f2e797767a1a64fae95a2e0af168826a71dd7a6398aaef5297b241ac94d864eb35460ff161515818301528151848152928301869052917f8f6ceadd6e9845ce194f7cd50e5a1ef4aec5b40c31652db44ea043bbbf27b92b910160405180910390a1600b54600c54600d546040517f7411763df8b85a361debd9482957b1f2ab21d1ed68b95a5aeaaa7f16613edd0893612852939092909160ff80831692610100810482169262010000820483169263010000008304169164010000000090046001600160a01b031690615a3e565b60405180910390a1805160208083015160408085015181519485529284019190915290151590820152661111519055531560ca1b907fab58f97f9e52f1f548d1471adfc7020125d8ab45cb4c0c6e4f372ff66942a3fe906060016116d7565b6128ea6040518060e001604052805f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81525090565b6001600160a01b0382165f9081526013602052604090819020815160e08101909252908061291785611f4b565b81526020016129286104ff86611f4b565b8152602001826001015481526020018260030154815260200161294a8561416e565b8152602001612958856141e9565b81526001600160a01b0385165f9081526018602090815260409091205491019060ff16612985575f612993565b68415554484f5249545960b81b5b90529392505050565b5f516020615ca45f395f51905f526129b381613906565b6001600160a01b03831615806129d057506001600160a01b038216155b156129ee5760405163f6b2911f60e01b815260040160405180910390fd5b6001600160a01b0383165f9081526019602052604090205460ff161580612a2c57506001600160a01b0382165f9081526018602052604090205460ff165b15612a4a57604051637a851da960e11b815260040160405180910390fd5b5f612a5484611f4b565b9050612a6184848361424d565b826001600160a01b0316846001600160a01b03167fb8ef21f2b52f8ca740012254a6b10f17d2fd6e589f97ebf401fde0e8b921893783604051612aa691815260200190565b60405180910390a350505050565b5f33610e5c818585613bc1565b5f612acb81613906565b306001600160a01b03851603612af45760405163c1ab6dc160e01b815260040160405180910390fd5b6001600160a01b038216612b1b5760405163f6b2911f60e01b815260040160405180910390fd5b612b2361199f565b6001600160a01b0316846001600160a01b0316148015612b495750612b46614365565b83115b15612b675760405163162908e360e11b815260040160405180910390fd5b612b7b6001600160a01b0385168385614393565b816001600160a01b0316846001600160a01b03167fe01920728668d89f092ef9cb92036bad90964bb622eec508d2c3ffe1d582efb285604051612aa691815260200190565b5f610d21826001613913565b5f612bd56143f2565b831580612be957506001600160a01b038316155b80612bfb57506001600160a01b038216155b15612c195760405163162908e360e11b815260040160405180910390fd5b612c238233613d52565b612c4057604051637a851da960e11b815260040160405180910390fd5b612c4a828461441b565b6001600160a01b0382165f9081526013602052604090206003810154851115612c865760405163eb6def5160e01b815260040160405180910390fd5b612c91838587614524565b95945050505050565b7f0f51adb3f49e4a9bbb17b3783f025995eaf8c24be2c8eefff214bdfda05ef94d612cc481613906565b600a5460ff1615612ce857604051637a851da960e11b815260040160405180910390fd5b821580612cf55750600854155b15612d135760405163162908e360e11b815260040160405180910390fd5b5f516020615c645f395f51905f52545f03612d4157604051637a851da960e11b815260040160405180910390fd5b612d49613c1e565b5f612d5261479d565b90505f84600454612d6391906159a3565b90505f612d708383615a8f565b9050805f03612d925760405163162908e360e11b815260040160405180910390fd5b60095415801590612da4575060095481115b15612dc257604051637a851da960e11b815260040160405180910390fd5b612de1333088612dd06147d8565b6001600160a01b03169291906147e1565b60048290556005819055612df583426159a3565b600681905542600755600554604080518981526020810192909252810191909152859033907e0a26a94b8f11d089d8815925dda7b3503d200f3828ffa7a2f9a0a5dd924c229060600160405180910390a3505050505050565b5f612e5881613906565b6001600160a01b038316612e7f5760405163f6b2911f60e01b815260040160405180910390fd5b8115801590612e9f57505f828152601a602052604090206002015460ff16155b15612ebd57604051637a851da960e11b815260040160405180910390fd5b6001600160a01b0383165f818152601b602052604080822085905542600e55518492917f0855302758d72ba1c33edb852bb68ca2d8083d8e95cbd399ff546f0aa5f1d76291a3505050565b5f612f116143f2565b831580612f2557506001600160a01b038316155b80612f3757506001600160a01b038216155b15612f555760405163162908e360e11b815260040160405180910390fd5b612f5f8233613d52565b612f7c57604051637a851da960e11b815260040160405180910390fd5b612f86828461441b565b6001600160a01b0382165f9081526013602052604090206002810154851115612fc25760405163eb6def5160e01b815260040160405180910390fd5b612c9183858761481a565b5f516020615ca45f395f51905f52612fe481613906565b6001600160a01b03831661300b5760405163f6b2911f60e01b815260040160405180910390fd5b6001600160a01b0383165f818152601860209081526040808320805460ff199081169091556019909252909120805490911690556421a622a0a960d91b907fbfb44373b56a8b33a2f3e28fc5b0b8842385af64fc253b88290e4eba8b2a3c7b68415554484f5249545960b81b335b6040805192835260208301919091520160405180910390a3505050565b5f610d21825f614a44565b600d545f90610100900460ff16806130d057506001600160a01b0382165f9081526019602052604090205460ff165b156130dc57505f919050565b506001600160a01b03165f9081526013602052604090206003015490565b6131038261161a565b61310c81613906565b61191f8383613da7565b600d545f90610100900460ff168061314557506001600160a01b0382165f9081526019602052604090205460ff165b1561315157505f919050565b506001600160a01b03165f9081526013602052604090206002015490565b5f61317981613906565b6001600160a01b0382166131a05760405163f6b2911f60e01b815260040160405180910390fd5b6131a988614075565b600b889055661111519055531560ca1b5f52601a60209081527f2e797767a1a64fae95a2e0af168826a71dd7a6398aaef5297b241ac94d864eb1899055600c889055600d805461ffff191688151561ff00191617610100881515021763ffff00001916620100008715150263ff00000019161763010000008615150217640100000000600160c01b0319166401000000006001600160a01b0386160217905542600e55604080516060810182528a81527f2e797767a1a64fae95a2e0af168826a71dd7a6398aaef5297b241ac94d864eb254928101929092527f2e797767a1a64fae95a2e0af168826a71dd7a6398aaef5297b241ac94d864eb35460ff16151582820152517f7411763df8b85a361debd9482957b1f2ab21d1ed68b95a5aeaaa7f16613edd08906132e7908b908b908b908b908b908b908b90615a3e565b60405180910390a1805160208083015160408085015181519485529284019190915290151590820152661111519055531560ca1b907fab58f97f9e52f1f548d1471adfc7020125d8ab45cb4c0c6e4f372ff66942a3fe9060600160405180910390a2505050505050505050565b6001600160a01b039182165f9081527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace016020908152604080832093909416825291909152205490565b6133c460405180608001604052805f81526020015f81526020015f81526020015f81525090565b5f516020615cc45f395f51905f526133db81613906565b600d5462010000900460ff161561340557604051637a851da960e11b815260040160405180910390fd5b61340f8484614a8e565b60108054905f61341e83615a26565b909155508252600160208301526134358484614b45565b60608401819052604080850183905284516020860151915190937f8e93f3f6c2a255277c60675d0667f9d90100ff94a8867af48b91732c8b74b9259361348a9383526020830191909152604082015260600190565b60405180910390a25092915050565b5f516020615c845f395f51905f526134b081613906565b600d805461ff00191661010017905542600e556040516001815265434c41494d5360d01b905f516020615d045f395f51905f5290602001611d04565b5f8281526014602090815260408083206001600160a01b0385168452909152812060025b600882015460ff16600481111561352957613529615629565b14613534575f611f43565b600301549392505050565b61356660405180608001604052805f81526020015f81526020015f81526020015f81525090565b5f516020615cc45f395f51905f5261357d81613906565b600d5462010000900460ff16156135a757604051637a851da960e11b815260040160405180910390fd5b600c548390158015906135c357508015806135c35750600c5481115b156135cd5750600c545b60108054905f6135dc83615a26565b909155508352600f545f805b5f54831080156135f9575061010081105b801561361057508315806136105750838660400151105b15613736578061361f81615a26565b5f85815260156020908152604080832054601483528184206001600160a01b03909116808552925290912091935091506001600882015460ff16600481111561366a5761366a615629565b0361368657806006015442101561369a57835f03613686578493505b8461369081615a26565b95505050506135e8565b85158015906136ac5750602088015115155b80156136ca575085816003015489604001516136c891906159a3565b115b156136d6575050613736565b5f5f6136e28785614b45565b9150915060018a6020018181516136f991906159a3565b90525060408a0180518391906137109083906159a3565b90525060608a0180518291906137279083906159a3565b90525050508461369081615a26565b5f548314801561374557508115155b61374f5782613751565b815b600f5585516020808801516040808a01516060808c0151835194855294840191909152908201929092527f8e93f3f6c2a255277c60675d0667f9d90100ff94a8867af48b91732c8b74b925910160405180910390a25050505050919050565b5f516020615ca45f395f51905f526137c781613906565b6001600160a01b0383166137ee5760405163f6b2911f60e01b815260040160405180910390fd5b6001600160a01b0383165f9081526018602090815260408083208054600160ff199182161790915560199092529091208054909116831515179055816138415769149154d5149250d5115160b21b613856565b6f232aa6262fa922a9aa2924a1aa24a7a760811b5b6001600160a01b0384167fbfb44373b56a8b33a2f3e28fc5b0b8842385af64fc253b88290e4eba8b2a3c7b68415554484f5249545960b81b33613079565b5f8281526014602090815260408083206001600160a01b038516845290915281206001613510565b5f6138c5613efe565b600154610c5791906159a3565b5f6001600160e01b03198216637965db0b60e01b1480610d2157506301ffc9a760e01b6001600160e01b0319831614610d21565b6139108133614c44565b50565b5f5f61392a5f516020615c645f395f51905f525490565b90505f6139356138bc565b9050815f03613948578492505050610d21565b612c9185828487613e20565b61199a8383836001614c7d565b5f807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00610d21565b613991614d60565b61399b8282614d85565b5050565b6139a7614d60565b61391081614dd5565b6139b8614d60565b565b5f5f516020615ce45f395f51905f526139d38484612639565b613a52575f848152602082815260408083206001600160a01b03871684529091529020805460ff19166001179055613a083390565b6001600160a01b0316836001600160a01b0316857f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a46001915050610d21565b5f915050610d21565b5092915050565b6001600160a01b038086165f90815260136020526040808220928716825290206001856004811115613a9657613a96615629565b03613b065783825f015f828254613aad9190615990565b9250508190555082826001015f828254613ac79190615990565b90915550508054849082905f90613adf9084906159a3565b9250508190555082816001015f828254613af991906159a3565b90915550613b6f92505050565b83826002015f828254613b199190615990565b9250508190555082826003015f828254613b339190615990565b9250508190555083816002015f828254613b4d91906159a3565b9250508190555082816003015f828254613b6791906159a3565b909155505050505b5050505050565b5f613b818484613354565b90505f1981101561191f5781811015613bb357828183604051637dc7a0d960e11b8152600401611f22939291906159cf565b61191f84848484035f614c7d565b6001600160a01b038316613bea57604051634b637e8f60e11b81525f6004820152602401611f22565b6001600160a01b038216613c135760405163ec442f0560e01b81525f6004820152602401611f22565b61199a838383614e58565b5f613c27613efe565b90508015613c5e578060015f828254613c4091906159a3565b925050819055508060045f828254613c589190615990565b90915550505b613c66613f6c565b60075560065442101580613c7a5750600454155b15613910575f60055550565b6004545f03613ca15750505f60058190556006555042600755565b8015613cb95750505f60055550426006819055600755565b825f03613cd95760405163162908e360e11b815260040160405180910390fd5b5f83600454613ce89190615a8f565b9050805f03613d0a5760405163162908e360e11b815260040160405180910390fd5b8215801590613d1857508281115b15613d3657604051637a851da960e11b815260040160405180910390fd5b6005819055613d4584426159a3565b6006555050426007555050565b5f826001600160a01b0316826001600160a01b031614806116135750506001600160a01b039182165f90815260126020908152604080832093909416825291909152205460ff1690565b61399b5f838361424d565b5f5f516020615ce45f395f51905f52613dc08484612639565b15613a52575f848152602082815260408083206001600160a01b0387168085529252808320805460ff1916905551339287917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a46001915050610d21565b5f613e4d613e2d83614f35565b8015613e4857505f8480613e4357613e43615a7b565b868809115b151590565b613e58868686614f61565b612c9191906159a3565b5f600454600354600254600154613e7991906159a3565b613e8391906159a3565b610c5791906159a3565b5f613e966147d8565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa158015613eda573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c579190615aa2565b5f6004545f1480613f0f5750600554155b15613f1957505f90565b6006544210613f29575060045490565b5f600754613f35613f6c565b613f3f9190615990565b90505f60055482613f509190615ab9565b90506004548111613f615780613f65565b6004545b9250505090565b5f6006545f14158015613f80575060065442115b15613f8c575060065490565b504290565b60115460ff1615613fb557604051637a851da960e11b815260040160405180910390fd5b811580613fc0575080155b15613fde5760405163162908e360e11b815260040160405180910390fd5b613fe784615011565b613ff083615011565b613ff8613c1e565b614006843084612dd06147d8565b8160015f82825461401791906159a3565b909155506140279050838261504a565b826001600160a01b0316846001600160a01b03167fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d78484604051612aa6929190918252602082015260400190565b6276a70081111561391057604051637475d84d60e11b815260040160405180910390fd5b604080516060810182525f80825260208083018290528284018290526001600160a01b0385168252601b9052919091205490816140de57661111519055531560ca1b91505b505f818152601a60209081526040918290208251606081018452815481526001820154928101929092526002015460ff1615159181018290529061413557604051637a851da960e11b815260040160405180910390fd5b915091565b6001600160a01b03821661416357604051634b637e8f60e11b81525f6004820152602401611f22565b61399b825f83614e58565b6001600160a01b0381165f9081526019602052604081205460ff16156141a857506f232aa6262fa922a9aa2924a1aa24a7a760811b919050565b6001600160a01b0382165f9081526018602052604090205460ff166141d5576421a622a0a960d91b610d21565b69149154d5149250d5115160b21b92915050565b6001600160a01b0381165f9081526019602052604081205460ff161561421657506210531360ea1b919050565b6001600160a01b0382165f9081526018602052604090205460ff1661423b575f610d21565b671393d397d156125560c21b92915050565b5f516020615c445f395f51905f526001600160a01b0384166142875781816002015f82825461427c91906159a3565b909155506142e49050565b6001600160a01b0384165f90815260208290526040902054828110156142c65784818460405163391434e360e21b8152600401611f22939291906159cf565b6001600160a01b0385165f9081526020839052604090209083900390555b6001600160a01b038316614302576002810180548390039055614320565b6001600160a01b0383165f9081526020829052604090208054830190555b826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051612aa691815260200190565b5f5f61436f613e8d565b90505f61437a613e62565b9050808211614389575f613f65565b613f658183615990565b6040516001600160a01b0383811660248301526044820183905261199a91859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b03838183161783525050505061507e565b600d54610100900460ff16156139b857604051637a851da960e11b815260040160405180910390fd5b6001600160a01b0382165f9081526019602052604090205460ff168061445857506001600160a01b0381165f9081526019602052604090205460ff165b1561447657604051637a851da960e11b815260040160405180910390fd5b6001600160a01b0382165f9081526018602052604090205460ff1680156144af5750816001600160a01b0316816001600160a01b031614155b156144cd57604051637a851da960e11b815260040160405180910390fd5b6001600160a01b0381165f9081526018602052604090205460ff1680156145065750816001600160a01b0316816001600160a01b031614155b1561399b57604051637a851da960e11b815260040160405180910390fd5b6001600160a01b0383165f90815260166020908152604080832060179092528220548391905b82158015906145595750815481105b156146f4575f60145f84848154811061457457614574615ad0565b5f918252602080832090910154835282810193909352604091820181206001600160a01b038c168252909252902090506002600882015460ff1660048111156145bf576145bf615629565b1415806145ce57506004810154155b156145e657816145dd81615a26565b9250505061454a565b6145f18189896150ea565b5f81600401548510614607578160040154614609565b845b90505f82600401548214614633576003830154600484015461462e9184916001613e20565b614639565b82600301545b905080158061465b57508260030154811015801561465b575082600401548214155b156146795760405163eb6def5160e01b815260040160405180910390fd5b80836003015f82825461468c9190615990565b9250508190555081836004015f8282546146a69190615990565b909155506146b690508287615990565b95506146c281886159a3565b965082600301545f036146ec5760088301805460ff19166003179055836146e881615a26565b9450505b50505061454a565b6001600160a01b0387165f908152601760205260409020819055821561472d5760405163eb6def5160e01b815260040160405180910390fd5b6147388785876151a1565b61475586866147456147d8565b6001600160a01b03169190614393565b60408051868152602081018690526001600160a01b03808a16929089169133917ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db91016125d5565b5f6004545f141580156147b1575060055415155b80156147be575060065442105b156147d15742600654610c579190615990565b5060085490565b5f610c5761199f565b6040516001600160a01b03848116602483015283811660448301526064820183905261191f9186918216906323b872dd906084016143c0565b6001600160a01b0383165f90815260166020908152604080832060179092528220548391905b821580159061484f5750815481105b156149ab575f60145f84848154811061486a5761486a615ad0565b5f918252602080832090910154835282810193909352604091820181206001600160a01b038c168252909252902090506002600882015460ff1660048111156148b5576148b5615629565b1415806148c457506003810154155b156148dc57816148d381615a26565b92505050614840565b6148e78189896150ea565b5f816003015485106148fd5781600301546148ff565b845b90505f8260030154821461492857600483015460038401546149239184915f613e20565b61492e565b82600401545b905081836003015f8282546149439190615990565b9250508190555080836004015f82825461495d9190615990565b9091555061496d90508287615990565b955061497981886159a3565b965082600301545f036149a35760088301805460ff191660031790558361499f81615a26565b9450505b505050614840565b6001600160a01b0387165f90815260176020526040902081905582156149e45760405163eb6def5160e01b815260040160405180910390fd5b6149ef8786866151a1565b6149fc86856147456147d8565b60408051858152602081018790526001600160a01b03808a16929089169133917ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db91016125d5565b5f5f614a5b5f516020615c645f395f51905f525490565b90505f614a666138bc565b9050811580614a73575080155b15614a82578492505050610d21565b612c9185838387613e20565b6001600160a01b0381161580614abd57505f828152601560205260409020546001600160a01b03828116911614155b15614adb57604051637a851da960e11b815260040160405180910390fd5b5f8281526014602090815260408083206001600160a01b038516845290915290206001600882015460ff166004811115614b1757614b17615629565b141580614b275750806006015442105b1561199a57604051637a851da960e11b815260040160405180910390fd5b5f8281526014602090815260408083206001600160a01b038516845290915290206003810154600482015460088301805460ff191660021790559091614b8b858561520a565b6001600160a01b0384165f908152601360205260408120805490918591839190614bb6908490615990565b9250508190555082816001015f828254614bd09190615990565b9250508190555083816002015f828254614bea91906159a3565b9250508190555082816003015f828254614c0491906159a3565b925050819055508260025f828254614c1c9190615990565b925050819055508260035f828254614c3491906159a3565b9250508190555050509250929050565b614c4e8282612639565b61399b5760405163e2517d3f60e01b81526001600160a01b038216600482015260248101839052604401611f22565b5f516020615c445f395f51905f526001600160a01b038516614cb45760405163e602df0560e01b81525f6004820152602401611f22565b6001600160a01b038416614cdd57604051634a1406b160e11b81525f6004820152602401611f22565b6001600160a01b038086165f90815260018301602090815260408083209388168352929052208390558115613b6f57836001600160a01b0316856001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92585604051614d5191815260200190565b60405180910390a35050505050565b614d686152ce565b6139b857604051631afcd79f60e31b815260040160405180910390fd5b614d8d614d60565b5f516020615c445f395f51905f527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace03614dc68482615b3c565b506004810161191f8382615b3c565b614ddd614d60565b7f0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e005f80614e09846152e7565b9150915081614e19576012614e1b565b805b83546001600160a81b031916600160a01b60ff92909216919091026001600160a01b031916176001600160a01b0394909416939093179091555050565b6001600160a01b038216614eb8576001600160a01b03831615801590614e9557506001600160a01b0383165f9081526019602052604090205460ff165b15614eb357604051637a851da960e11b815260040160405180910390fd5b614f2a565b6001600160a01b038316614ecf57614eb382615011565b6001600160a01b0383165f9081526018602052604090205460ff1680614f0c57506001600160a01b0382165f9081526018602052604090205460ff165b15614f2a57604051637a851da960e11b815260040160405180910390fd5b61199a83838361424d565b5f6002826003811115614f4a57614f4a615629565b614f549190615bf7565b60ff166001149050919050565b5f5f5f614f6e86866153bd565b91509150815f03614f9257838181614f8857614f88615a7b565b0492505050611613565b818411614fa957614fa960038515026011186153d9565b5f848688095f868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010185841190960395909502919093039390930492909217029150509392505050565b6001600160a01b0381165f9081526018602052604090205460ff161561391057604051637a851da960e11b815260040160405180910390fd5b6001600160a01b0382166150735760405163ec442f0560e01b81525f6004820152602401611f22565b61399b5f8383614e58565b5f5f60205f8451602086015f885af18061509d576040513d5f823e3d81fd5b50505f513d915081156150b45780600114156150c1565b6001600160a01b0384163b155b1561191f57604051635274afe760e01b81526001600160a01b0385166004820152602401611f22565b6150f4828261441b565b60028301546001600160a01b03165f9081526019602052604090205460ff161561513157604051637a851da960e11b815260040160405180910390fd5b60028301546001600160a01b03165f9081526018602052604090205460ff168015614b27575060028301546001600160a01b038381169116141580614b27575060028301546001600160a01b0382811691161461199a57604051637a851da960e11b815260040160405180910390fd5b6001600160a01b0383165f908152601360205260408120600281018054919285926151cd908490615990565b9250508190555081816003015f8282546151e79190615990565b925050819055508160035f8282546151ff9190615990565b909155505050505050565b6001600160a01b0381165f908152601760205260408120549081900361522f57505050565b6001600160a01b0382165f9081526016602052604090208381615253600185615990565b8154811061526357615263615ad0565b905f5260205f20015410156152785750505050565b811561191f578161528881615c18565b9250508381838154811061529e5761529e615ad0565b905f5260205f200154036152c957506001600160a01b039091165f9081526017602052604090205550565b615278565b5f6152d7613961565b54600160401b900460ff16919050565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b17905290515f918291829182916001600160a01b0387169161532d91615c2d565b5f60405180830381855afa9150503d805f8114615365576040519150601f19603f3d011682016040523d82523d5f602084013e61536a565b606091505b509150915081801561537e57506020815110155b156153b1575f818060200190518101906153989190615aa2565b905060ff81116153af576001969095509350505050565b505b505f9485945092505050565b5f805f1983850993909202808410938190039390930393915050565b634e487b715f52806020526024601cfd5b6040518061012001604052805f81526020015f6001600160a01b031681526020015f6001600160a01b031681526020015f81526020015f81526020015f81526020015f81526020015f81526020015f600481111561544a5761544a615629565b905290565b5f6020828403121561545f575f5ffd5b81356001600160e01b031981168114611613575f5ffd5b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b5f602082840312156154bb575f5ffd5b5035919050565b6001600160a01b0381168114613910575f5ffd5b5f5f604083850312156154e7575f5ffd5b82356154f2816154c2565b946020939093013593505050565b5f5f5f60608486031215615512575f5ffd5b833561551d816154c2565b9250602084013561552d816154c2565b929592945050506040919091013590565b5f5f5f60608486031215615550575f5ffd5b833592506020840135615562816154c2565b91506040840135615572816154c2565b809150509250925092565b8015158114613910575f5ffd5b5f5f5f6060848603121561559c575f5ffd5b833592506020840135915060408401356155728161557d565b5f5f604083850312156155c6575f5ffd5b8235915060208301356155d8816154c2565b809150509250929050565b5f602082840312156155f3575f5ffd5b8135611613816154c2565b8151815260208083015190820152604080830151908201526060808301519082015260808101610d21565b634e487b7160e01b5f52602160045260245ffd5b6005811061565957634e487b7160e01b5f52602160045260245ffd5b9052565b5f610120820190508251825260018060a01b03602084015116602083015260018060a01b036040840151166040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e0830152610100830151613a5b61010084018261563d565b5f61016082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e0830152610100830151610100830152610120830151610120830152610140830151613a5b61014084018215159052565b5f5f60408385031215615763575f5ffd5b823561576e816154c2565b915060208301356155d88161557d565b5f5f8284036080811215615790575f5ffd5b833592506060601f19820112156157a5575f5ffd5b506020830190509250929050565b5f602082840312156157c3575f5ffd5b81356116138161557d565b5f61010082019050825182526020830151602083015260408301511515604083015260608301511515606083015260808301511515608083015260a083015161581b60a084018215159052565b5060c083015161583660c08401826001600160a01b03169052565b5060e092830151919092015290565b5f5f60408385031215615856575f5ffd5b8235615861816154c2565b915060208301356155d8816154c2565b5f5f5f60608486031215615883575f5ffd5b833561588e816154c2565b9250602084013591506040840135615572816154c2565b5f5f604083850312156158b6575f5ffd5b50508035926020909101359150565b5f5f5f5f5f5f5f60e0888a0312156158db575f5ffd5b873596506020880135955060408801356158f48161557d565b945060608801356159048161557d565b935060808801356159148161557d565b925060a08801356159248161557d565b915060c0880135615934816154c2565b8091505092959891949750929550565b600181811c9082168061595857607f821691505b60208210810361597657634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b81810381811115610d2157610d2161597c565b80820180821115610d2157610d2161597c565b60ff8181168382160190811115610d2157610d2161597c565b6001600160a01b039390931683526020830191909152604082015260600190565b8135815560208201356001820155600281016040830135615a108161557d565b815490151560ff1660ff19919091161790555050565b5f60018201615a3757615a3761597c565b5060010190565b96875260208701959095529215156040860152901515606085015215156080840152151560a08301526001600160a01b031660c082015260e00190565b634e487b7160e01b5f52601260045260245ffd5b5f82615a9d57615a9d615a7b565b500490565b5f60208284031215615ab2575f5ffd5b5051919050565b8082028115828204841417610d2157610d2161597c565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52604160045260245ffd5b601f82111561199a57805f5260205f20601f840160051c81016020851015615b1d5750805b601f840160051c820191505b81811015613b6f575f8155600101615b29565b815167ffffffffffffffff811115615b5657615b56615ae4565b615b6a81615b648454615944565b84615af8565b6020601f821160018114615b9c575f8315615b855750848201515b5f19600385901b1c1916600184901b178455613b6f565b5f84815260208120601f198516915b82811015615bcb5787850151825560209485019460019092019101615bab565b5084821015615be857868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b5f60ff831680615c0957615c09615a7b565b8060ff84160691505092915050565b5f81615c2657615c2661597c565b505f190190565b5f82518060208501845e5f92019182525091905056fe52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0052c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0265d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a805c6c8176a314009a89154ee315bc4a18d0cf3277d5a02e51a377ea16566483841adcd1e63b365b720fa3914e607573de5a364c3db334a0e00a5e5475c0be6502dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b6268001126a95f637665b1984368fd54018e81678bdeec710c7ef34ff2ccef87c37e9ba2646970667358221220282d3d52ca4139dfe6ca5a6ed56a29b355e6f6d8042e044fe55d6db56f68187064736f6c634300081e0033","name":"StakedUSDx","is_blueprint":false,"license_type":"none","is_fully_verified":true,"is_verified_via_eth_bytecode_db":false,"language":"solidity","evm_version":"osaka","can_be_visualized_via_sol2uml":true,"is_verified_via_sourcify":false,"additional_sources":[{"file_path":"lib/openzeppelin-contracts-upgradeable/contracts/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":"lib/openzeppelin-contracts-upgradeable/contracts/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":"lib/openzeppelin-contracts-upgradeable/contracts/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":"lib/openzeppelin-contracts-upgradeable/contracts/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":"src/v2/interfaces/IRewardManager.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.30;\n\ninterface IRewardManager {\n    struct RewardConfig {\n        // Reporting metadata only. AccessControl roles are the canonical authorization source.\n        address authority;\n        uint256 duration;\n        uint256 maxRate;\n        bool paused;\n    }\n\n    struct RewardState {\n        uint256 accountedAssets;\n        uint256 unvestedRewards;\n        uint256 rewardRate;\n        uint256 periodFinish;\n        uint256 lastUpdated;\n    }\n\n    event RewardsFunded(\n        address indexed funder, uint256 assets, bytes32 indexed sourceRef, uint256 rewardRate, uint256 periodFinish\n    );\n    event RewardConfigUpdated(address indexed authority, uint256 duration, uint256 maxRate, bool paused);\n\n    function fundRewards(uint256 assets, bytes32 sourceRef) external;\n\n    function rewardConfig() external view returns (RewardConfig memory);\n\n    function rewardState() external view returns (RewardState memory);\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/contracts/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":"lib/openzeppelin-contracts-upgradeable/contracts/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":"lib/openzeppelin-contracts/contracts/access/IAccessControl.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (access/IAccessControl.sol)\n\npragma solidity >=0.8.4;\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 to signal 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":"lib/openzeppelin-contracts/contracts/interfaces/IERC1363.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC1363.sol)\n\npragma solidity >=0.6.2;\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":"lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC165.sol)\n\npragma solidity >=0.4.16;\n\nimport {IERC165} from \"../utils/introspection/IERC165.sol\";\n"},{"file_path":"lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC20.sol)\n\npragma solidity >=0.4.16;\n\nimport {IERC20} from \"../token/ERC20/IERC20.sol\";\n"},{"file_path":"lib/openzeppelin-contracts/contracts/interfaces/IERC4626.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC4626.sol)\n\npragma solidity >=0.6.2;\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 redemption 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":"lib/openzeppelin-contracts/contracts/interfaces/draft-IERC6093.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/draft-IERC6093.sol)\npragma solidity >=0.8.4;\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":"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/IERC20.sol)\n\npragma solidity >=0.4.16;\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":"lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity >=0.6.2;\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":"lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.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 Variant of {safeTransfer} that returns a bool instead of reverting if the operation is not successful.\n     */\n    function trySafeTransfer(IERC20 token, address to, uint256 value) internal returns (bool) {\n        return _callOptionalReturnBool(token, abi.encodeCall(token.transfer, (to, value)));\n    }\n\n    /**\n     * @dev Variant of {safeTransferFrom} that returns a bool instead of reverting if the operation is not successful.\n     */\n    function trySafeTransferFrom(IERC20 token, address from, address to, uint256 value) internal returns (bool) {\n        return _callOptionalReturnBool(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":"lib/openzeppelin-contracts/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":"lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/IERC165.sol)\n\npragma solidity >=0.4.16;\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":"lib/openzeppelin-contracts/contracts/utils/math/Math.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.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 Return the 512-bit addition of two uint256.\n     *\n     * The result is stored in two 256 variables such that sum = high * 2²⁵⁶ + low.\n     */\n    function add512(uint256 a, uint256 b) internal pure returns (uint256 high, uint256 low) {\n        assembly (\"memory-safe\") {\n            low := add(a, b)\n            high := lt(low, a)\n        }\n    }\n\n    /**\n     * @dev Return the 512-bit multiplication of two uint256.\n     *\n     * The result is stored in two 256 variables such that product = high * 2²⁵⁶ + low.\n     */\n    function mul512(uint256 a, uint256 b) internal pure returns (uint256 high, uint256 low) {\n        // 512-bit multiply [high low] = 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 = high * 2²⁵⁶ + low.\n        assembly (\"memory-safe\") {\n            let mm := mulmod(a, b, not(0))\n            low := mul(a, b)\n            high := sub(sub(mm, low), lt(mm, low))\n        }\n    }\n\n    /**\n     * @dev Returns the addition of two unsigned integers, with a 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            success = c >= a;\n            result = c * SafeCast.toUint(success);\n        }\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, with a success flag (no overflow).\n     */\n    function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            uint256 c = a - b;\n            success = c <= a;\n            result = c * SafeCast.toUint(success);\n        }\n    }\n\n    /**\n     * @dev Returns the multiplication of two unsigned integers, with a success flag (no overflow).\n     */\n    function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            uint256 c = a * b;\n            assembly (\"memory-safe\") {\n                // Only true when the multiplication doesn't overflow\n                // (c / a == b) || (a == 0)\n                success := or(eq(div(c, a), b), iszero(a))\n            }\n            // equivalent to: success ? c : 0\n            result = c * SafeCast.toUint(success);\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            success = b > 0;\n            assembly (\"memory-safe\") {\n                // The `DIV` opcode returns zero when the denominator is 0.\n                result := div(a, b)\n            }\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            success = b > 0;\n            assembly (\"memory-safe\") {\n                // The `MOD` opcode returns zero when the denominator is 0.\n                result := mod(a, b)\n            }\n        }\n    }\n\n    /**\n     * @dev Unsigned saturating addition, bounds to `2²⁵⁶ - 1` instead of overflowing.\n     */\n    function saturatingAdd(uint256 a, uint256 b) internal pure returns (uint256) {\n        (bool success, uint256 result) = tryAdd(a, b);\n        return ternary(success, result, type(uint256).max);\n    }\n\n    /**\n     * @dev Unsigned saturating subtraction, bounds to zero instead of overflowing.\n     */\n    function saturatingSub(uint256 a, uint256 b) internal pure returns (uint256) {\n        (, uint256 result) = trySub(a, b);\n        return result;\n    }\n\n    /**\n     * @dev Unsigned saturating multiplication, bounds to `2²⁵⁶ - 1` instead of overflowing.\n     */\n    function saturatingMul(uint256 a, uint256 b) internal pure returns (uint256) {\n        (bool success, uint256 result) = tryMul(a, b);\n        return ternary(success, result, type(uint256).max);\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            (uint256 high, uint256 low) = mul512(x, y);\n\n            // Handle non-overflow cases, 256 by 256 division.\n            if (high == 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 low / denominator;\n            }\n\n            // Make sure the result is less than 2²⁵⁶. Also prevents denominator == 0.\n            if (denominator <= high) {\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 [high low].\n            uint256 remainder;\n            assembly (\"memory-safe\") {\n                // Compute remainder using mulmod.\n                remainder := mulmod(x, y, denominator)\n\n                // Subtract 256 bit number from 512 bit number.\n                high := sub(high, gt(remainder, low))\n                low := sub(low, 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 (\"memory-safe\") {\n                // Divide denominator by twos.\n                denominator := div(denominator, twos)\n\n                // Divide [high low] by twos.\n                low := div(low, 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 high into low.\n            low |= high * 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 high\n            // is no longer required.\n            result = low * 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 Calculates floor(x * y >> n) with full precision. Throws if result overflows a uint256.\n     */\n    function mulShr(uint256 x, uint256 y, uint8 n) internal pure returns (uint256 result) {\n        unchecked {\n            (uint256 high, uint256 low) = mul512(x, y);\n            if (high >= 1 << n) {\n                Panic.panic(Panic.UNDER_OVERFLOW);\n            }\n            return (high << (256 - n)) | (low >> n);\n        }\n    }\n\n    /**\n     * @dev Calculates x * y >> n with full precision, following the selected rounding direction.\n     */\n    function mulShr(uint256 x, uint256 y, uint8 n, Rounding rounding) internal pure returns (uint256) {\n        return mulShr(x, y, n) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, 1 << n) > 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 x) internal pure returns (uint256 r) {\n        // If value has upper 128 bits set, log2 result is at least 128\n        r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;\n        // If upper 64 bits of 128-bit half set, add 64 to result\n        r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;\n        // If upper 32 bits of 64-bit half set, add 32 to result\n        r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;\n        // If upper 16 bits of 32-bit half set, add 16 to result\n        r |= SafeCast.toUint((x >> r) > 0xffff) << 4;\n        // If upper 8 bits of 16-bit half set, add 8 to result\n        r |= SafeCast.toUint((x >> r) > 0xff) << 3;\n        // If upper 4 bits of 8-bit half set, add 4 to result\n        r |= SafeCast.toUint((x >> r) > 0xf) << 2;\n\n        // Shifts value right by the current result and use it as an index into this lookup table:\n        //\n        // | x (4 bits) |  index  | table[index] = MSB position |\n        // |------------|---------|-----------------------------|\n        // |    0000    |    0    |        table[0] = 0         |\n        // |    0001    |    1    |        table[1] = 0         |\n        // |    0010    |    2    |        table[2] = 1         |\n        // |    0011    |    3    |        table[3] = 1         |\n        // |    0100    |    4    |        table[4] = 2         |\n        // |    0101    |    5    |        table[5] = 2         |\n        // |    0110    |    6    |        table[6] = 2         |\n        // |    0111    |    7    |        table[7] = 2         |\n        // |    1000    |    8    |        table[8] = 3         |\n        // |    1001    |    9    |        table[9] = 3         |\n        // |    1010    |   10    |        table[10] = 3        |\n        // |    1011    |   11    |        table[11] = 3        |\n        // |    1100    |   12    |        table[12] = 3        |\n        // |    1101    |   13    |        table[13] = 3        |\n        // |    1110    |   14    |        table[14] = 3        |\n        // |    1111    |   15    |        table[15] = 3        |\n        //\n        // The lookup table is represented as a 32-byte value with the MSB positions for 0-15 in the last 16 bytes.\n        assembly (\"memory-safe\") {\n            r := or(r, byte(shr(r, x), 0x0000010102020202030303030303030300000000000000000000000000000000))\n        }\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 x) internal pure returns (uint256 r) {\n        // If value has upper 128 bits set, log2 result is at least 128\n        r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;\n        // If upper 64 bits of 128-bit half set, add 64 to result\n        r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;\n        // If upper 32 bits of 64-bit half set, add 32 to result\n        r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;\n        // If upper 16 bits of 32-bit half set, add 16 to result\n        r |= SafeCast.toUint((x >> r) > 0xffff) << 4;\n        // Add 1 if upper 8 bits of 16-bit half set, and divide accumulated result by 8\n        return (r >> 3) | SafeCast.toUint((x >> r) > 0xff);\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":"lib/openzeppelin-contracts/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":"src/v2/interfaces/IAsyncRedeemVault.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.30;\n\nimport {IERC7540Redeem} from \"./IERC7540Redeem.sol\";\n\ninterface IAsyncRedeemVault is IERC7540Redeem {}\n"},{"file_path":"src/v2/interfaces/IERC7540Redeem.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.30;\n\nimport {IERC165} from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\n\ninterface IERC7540Operator is IERC165 {\n    event OperatorSet(address indexed controller, address indexed operator, bool approved);\n\n    function setOperator(address operator, bool approved) external returns (bool success);\n\n    function isOperator(address controller, address operator) external view returns (bool status);\n}\n\ninterface IERC7540Redeem is IERC7540Operator {\n    event RedeemRequest(\n        address indexed controller, address indexed owner, uint256 indexed requestId, address sender, uint256 shares\n    );\n\n    function requestRedeem(uint256 shares, address controller, address owner) external returns (uint256 requestId);\n\n    function pendingRedeemRequest(uint256 requestId, address controller) external view returns (uint256 shares);\n\n    function claimableRedeemRequest(uint256 requestId, address controller) external view returns (uint256 shares);\n}\n"},{"file_path":"src/v2/interfaces/IGovernedAccessControl.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.30;\n\nimport {IAccessControl} from \"@openzeppelin/contracts/access/IAccessControl.sol\";\nimport {IERC165} from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\n\ninterface IGovernedAccessControl is IAccessControl, IERC165 {}\n"},{"file_path":"src/v2/interfaces/IRedemptionManager.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.30;\n\ninterface IRedemptionManager {\n    enum RedemptionStatus {\n        NONE,\n        PENDING,\n        CLAIMABLE,\n        CLAIMED,\n        CANCELLED\n    }\n\n    struct RedeemRequestState {\n        uint256 pendingShares;\n        uint256 pendingAssets;\n        uint256 claimableShares;\n        uint256 claimableAssets;\n    }\n\n    struct RedemptionState {\n        uint256 requestId;\n        address controller;\n        address owner;\n        uint256 shares;\n        uint256 assetsReserved;\n        uint256 requestedAt;\n        uint256 eligibleAt;\n        bytes32 policyId;\n        RedemptionStatus status;\n    }\n\n    struct RedemptionPolicy {\n        uint256 cooldown;\n        uint256 maxRequestShares;\n        bool enabled;\n    }\n\n    struct RedemptionControls {\n        uint256 cooldown;\n        uint256 maxServiceBatchShares;\n        bool requestPaused;\n        bool claimPaused;\n        bool servicePaused;\n        bool cancelPaused;\n        address serviceAuthority;\n        uint256 updatedAt;\n    }\n\n    struct RedemptionServiceResult {\n        uint256 serviceId;\n        uint256 requestsServiced;\n        uint256 sharesMadeClaimable;\n        uint256 assetsReserved;\n    }\n\n    event RedemptionsServiced(\n        uint256 indexed serviceId, uint256 requestsServiced, uint256 sharesMadeClaimable, uint256 assetsReserved\n    );\n    event RedemptionControlsUpdated(\n        uint256 cooldown,\n        uint256 maxServiceBatchShares,\n        bool requestPaused,\n        bool claimPaused,\n        bool servicePaused,\n        bool cancelPaused,\n        address serviceAuthority\n    );\n    event RedemptionPauseUpdated(bytes32 indexed pause, bool paused);\n    event RedemptionPolicyUpdated(bytes32 indexed policyId, uint256 cooldown, uint256 maxRequestShares, bool enabled);\n    event AccountRedemptionPolicyUpdated(address indexed account, bytes32 indexed policyId);\n    event RedeemRequestCancelled(\n        uint256 indexed requestId,\n        address indexed controller,\n        address indexed owner,\n        uint256 sharesReturned,\n        uint256 assetsReleased\n    );\n\n    function getRedeemRequest(address controller) external view returns (RedeemRequestState memory);\n\n    function redemptionState(uint256 requestId, address controller) external view returns (RedemptionState memory);\n\n    function redemptionControls() external view returns (RedemptionControls memory);\n\n    function redemptionPolicy(bytes32 policyId) external view returns (RedemptionPolicy memory);\n\n    function accountRedemptionPolicy(address account) external view returns (bytes32);\n\n    function serviceRedemptions(uint256 maxShares) external returns (RedemptionServiceResult memory);\n\n    function serviceRedeemRequest(uint256 requestId, address controller)\n        external\n        returns (RedemptionServiceResult memory);\n\n    function cancelRedeemRequest(uint256 requestId, address controller) external returns (uint256 sharesReturned);\n\n    function setRedemptionPolicy(bytes32 policyId, RedemptionPolicy calldata policy) external;\n\n    function setAccountRedemptionPolicy(address account, bytes32 policyId) external;\n}\n"},{"file_path":"src/v2/interfaces/IStakedUSDx.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.30;\n\nimport {IGovernedAccessControl} from \"./IGovernedAccessControl.sol\";\nimport {IAsyncRedeemVault} from \"./IAsyncRedeemVault.sol\";\nimport {IRedemptionManager} from \"./IRedemptionManager.sol\";\nimport {IRewardManager} from \"./IRewardManager.sol\";\nimport {IVaultShareToken} from \"./IVaultShareToken.sol\";\n\ninterface IStakedUSDx is\n    IVaultShareToken,\n    IAsyncRedeemVault,\n    IRewardManager,\n    IRedemptionManager,\n    IGovernedAccessControl\n{\n    struct AccountState {\n        uint256 shareBalance;\n        uint256 assetsValue;\n        uint256 pendingRedeemAssets;\n        uint256 claimableRedeemAssets;\n        bytes32 restrictionStatus;\n        bytes32 blockedActions;\n        bytes32 restrictionBasis;\n    }\n\n    event CooldownDurationUpdated(uint256 previousDuration, uint256 newDuration);\n    event DepositPauseUpdated(bool paused);\n    event RestrictionUpdated(address indexed account, bytes32 indexed status, bytes32 reasonCode, bytes32 authorityRef);\n    event LockedAmountRedistributed(address indexed from, address indexed to, uint256 shares);\n    event RedeemRequestRedistributed(\n        uint256 indexed requestId,\n        address indexed fromController,\n        address indexed toController,\n        uint256 shares,\n        uint256 assets,\n        uint8 status\n    );\n    event Rescue(address indexed token, address indexed to, uint256 amount);\n\n    error InvalidAmount();\n    error InvalidToken();\n    error MinSharesViolation();\n    error OperationNotAllowed();\n    error StillVesting();\n    error InvalidCooldown();\n    error InvalidZeroAddress();\n    error InsufficientClaimable();\n    error Insolvent();\n\n    function REWARD_MANAGER_ROLE() external view returns (bytes32);\n\n    function PAUSER_ROLE() external view returns (bytes32);\n\n    function RESTRICTION_ROLE() external view returns (bytes32);\n\n    function REDEMPTION_SERVICER_ROLE() external view returns (bytes32);\n\n    function DEFAULT_REDEMPTION_POLICY_ID() external view returns (bytes32);\n\n    function MAX_COOLDOWN_DURATION() external view returns (uint256);\n\n    function REQUEST_ID() external view returns (uint256);\n\n    function addToBlacklist(address target, bool isFullRestriction) external;\n\n    function removeFromBlacklist(address target, bool isFullRestriction) external;\n\n    function redistributeLockedAmount(address from, address to) external;\n\n    function redistributeRedeemRequest(uint256 requestId, address controller, address to)\n        external\n        returns (uint256 shares, uint256 assets);\n\n    function rescueTokens(address token, uint256 amount, address to) external;\n\n    function setCooldownDuration(uint256 duration) external;\n\n    function depositPaused() external view returns (bool);\n\n    function setDepositPause(bool paused) external;\n\n    function pauseDeposits() external;\n\n    function getAccountState(address account) external view returns (AccountState memory);\n\n    function share() external view returns (address shareTokenAddress);\n}\n"},{"file_path":"src/v2/interfaces/IVaultShareToken.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.30;\n\nimport {IERC4626} from \"@openzeppelin/contracts/interfaces/IERC4626.sol\";\n\ninterface IVaultShareToken is IERC4626 {\n    struct VaultState {\n        uint256 totalSupply;\n        uint256 totalAssets;\n        uint256 accountedAssets;\n        uint256 pendingRedeemAssets;\n        uint256 claimableRedeemAssets;\n        uint256 redeemLiabilities;\n        uint256 requiredAssets;\n        uint256 assetBalance;\n        uint256 exchangeRate;\n        uint256 cooldown;\n        bool solvent;\n    }\n\n    function accountedAssets() external view returns (uint256);\n\n    function pendingRedeemAssets() external view returns (uint256);\n\n    function claimableRedeemAssets() external view returns (uint256);\n\n    function cooldownDuration() external view returns (uint256);\n\n    function getVaultState() external view returns (VaultState memory);\n\n    function exchangeRate() external view returns (uint256);\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":[{"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":"Insolvent","type":"error"},{"inputs":[],"name":"InsufficientClaimable","type":"error"},{"inputs":[],"name":"InvalidAmount","type":"error"},{"inputs":[],"name":"InvalidCooldown","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"InvalidToken","type":"error"},{"inputs":[],"name":"InvalidZeroAddress","type":"error"},{"inputs":[],"name":"MinSharesViolation","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[],"name":"OperationNotAllowed","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"StillVesting","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"bytes32","name":"policyId","type":"bytes32"}],"name":"AccountRedemptionPolicyUpdated","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":false,"internalType":"uint256","name":"previousDuration","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newDuration","type":"uint256"}],"name":"CooldownDurationUpdated","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":"bool","name":"paused","type":"bool"}],"name":"DepositPauseUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","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":"shares","type":"uint256"}],"name":"LockedAmountRedistributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"controller","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"OperatorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"controller","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"uint256","name":"requestId","type":"uint256"},{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"RedeemRequest","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"requestId","type":"uint256"},{"indexed":true,"internalType":"address","name":"controller","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"sharesReturned","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assetsReleased","type":"uint256"}],"name":"RedeemRequestCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"requestId","type":"uint256"},{"indexed":true,"internalType":"address","name":"fromController","type":"address"},{"indexed":true,"internalType":"address","name":"toController","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint8","name":"status","type":"uint8"}],"name":"RedeemRequestRedistributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"cooldown","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxServiceBatchShares","type":"uint256"},{"indexed":false,"internalType":"bool","name":"requestPaused","type":"bool"},{"indexed":false,"internalType":"bool","name":"claimPaused","type":"bool"},{"indexed":false,"internalType":"bool","name":"servicePaused","type":"bool"},{"indexed":false,"internalType":"bool","name":"cancelPaused","type":"bool"},{"indexed":false,"internalType":"address","name":"serviceAuthority","type":"address"}],"name":"RedemptionControlsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"pause","type":"bytes32"},{"indexed":false,"internalType":"bool","name":"paused","type":"bool"}],"name":"RedemptionPauseUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"policyId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"cooldown","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxRequestShares","type":"uint256"},{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"}],"name":"RedemptionPolicyUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"serviceId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"requestsServiced","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sharesMadeClaimable","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assetsReserved","type":"uint256"}],"name":"RedemptionsServiced","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Rescue","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"bytes32","name":"status","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"reasonCode","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"authorityRef","type":"bytes32"}],"name":"RestrictionUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"authority","type":"address"},{"indexed":false,"internalType":"uint256","name":"duration","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxRate","type":"uint256"},{"indexed":false,"internalType":"bool","name":"paused","type":"bool"}],"name":"RewardConfigUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"funder","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":true,"internalType":"bytes32","name":"sourceRef","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"rewardRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"periodFinish","type":"uint256"}],"name":"RewardsFunded","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":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":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"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_REDEMPTION_POLICY_ID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_COOLDOWN_DURATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REDEMPTION_SERVICER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REQUEST_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RESTRICTION_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REWARD_MANAGER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"accountRedemptionPolicy","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"accountedAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bool","name":"isFullRestriction","type":"bool"}],"name":"addToBlacklist","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":"uint256","name":"requestId","type":"uint256"},{"internalType":"address","name":"controller","type":"address"}],"name":"cancelRedeemRequest","outputs":[{"internalType":"uint256","name":"sharesReturned","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimableRedeemAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"internalType":"address","name":"controller","type":"address"}],"name":"claimableRedeemRequest","outputs":[{"internalType":"uint256","name":"shares","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":"cooldownDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"depositPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exchangeRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"bytes32","name":"sourceRef","type":"bytes32"}],"name":"fundRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getAccountState","outputs":[{"components":[{"internalType":"uint256","name":"shareBalance","type":"uint256"},{"internalType":"uint256","name":"assetsValue","type":"uint256"},{"internalType":"uint256","name":"pendingRedeemAssets","type":"uint256"},{"internalType":"uint256","name":"claimableRedeemAssets","type":"uint256"},{"internalType":"bytes32","name":"restrictionStatus","type":"bytes32"},{"internalType":"bytes32","name":"blockedActions","type":"bytes32"},{"internalType":"bytes32","name":"restrictionBasis","type":"bytes32"}],"internalType":"struct IStakedUSDx.AccountState","name":"state","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"controller","type":"address"}],"name":"getRedeemRequest","outputs":[{"components":[{"internalType":"uint256","name":"pendingShares","type":"uint256"},{"internalType":"uint256","name":"pendingAssets","type":"uint256"},{"internalType":"uint256","name":"claimableShares","type":"uint256"},{"internalType":"uint256","name":"claimableAssets","type":"uint256"}],"internalType":"struct IRedemptionManager.RedeemRequestState","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVaultState","outputs":[{"components":[{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"totalAssets","type":"uint256"},{"internalType":"uint256","name":"accountedAssets","type":"uint256"},{"internalType":"uint256","name":"pendingRedeemAssets","type":"uint256"},{"internalType":"uint256","name":"claimableRedeemAssets","type":"uint256"},{"internalType":"uint256","name":"redeemLiabilities","type":"uint256"},{"internalType":"uint256","name":"requiredAssets","type":"uint256"},{"internalType":"uint256","name":"assetBalance","type":"uint256"},{"internalType":"uint256","name":"exchangeRate","type":"uint256"},{"internalType":"uint256","name":"cooldown","type":"uint256"},{"internalType":"bool","name":"solvent","type":"bool"}],"internalType":"struct IVaultShareToken.VaultState","name":"state","type":"tuple"}],"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":"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":"address","name":"admin","type":"address"},{"internalType":"uint256","name":"rewardDuration_","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"controller","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isOperator","outputs":[{"internalType":"bool","name":"status","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"maxDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"maxMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"controller","type":"address"}],"name":"maxRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"controller","type":"address"}],"name":"maxWithdraw","outputs":[{"internalType":"uint256","name":"","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":"pauseDeposits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pauseRedeemCancellations","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pauseRedeemClaims","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pauseRedeemRequests","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pauseRedemptionServicing","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pauseRewardFunding","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pendingRedeemAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"internalType":"address","name":"controller","type":"address"}],"name":"pendingRedeemRequest","outputs":[{"internalType":"uint256","name":"shares","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":"","type":"uint256"}],"name":"previewRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"previewWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"controller","type":"address"}],"name":"redeem","outputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"redemptionControls","outputs":[{"components":[{"internalType":"uint256","name":"cooldown","type":"uint256"},{"internalType":"uint256","name":"maxServiceBatchShares","type":"uint256"},{"internalType":"bool","name":"requestPaused","type":"bool"},{"internalType":"bool","name":"claimPaused","type":"bool"},{"internalType":"bool","name":"servicePaused","type":"bool"},{"internalType":"bool","name":"cancelPaused","type":"bool"},{"internalType":"address","name":"serviceAuthority","type":"address"},{"internalType":"uint256","name":"updatedAt","type":"uint256"}],"internalType":"struct IRedemptionManager.RedemptionControls","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"policyId","type":"bytes32"}],"name":"redemptionPolicy","outputs":[{"components":[{"internalType":"uint256","name":"cooldown","type":"uint256"},{"internalType":"uint256","name":"maxRequestShares","type":"uint256"},{"internalType":"bool","name":"enabled","type":"bool"}],"internalType":"struct IRedemptionManager.RedemptionPolicy","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"internalType":"address","name":"controller","type":"address"}],"name":"redemptionState","outputs":[{"components":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"internalType":"address","name":"controller","type":"address"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"uint256","name":"assetsReserved","type":"uint256"},{"internalType":"uint256","name":"requestedAt","type":"uint256"},{"internalType":"uint256","name":"eligibleAt","type":"uint256"},{"internalType":"bytes32","name":"policyId","type":"bytes32"},{"internalType":"enum IRedemptionManager.RedemptionStatus","name":"status","type":"uint8"}],"internalType":"struct IRedemptionManager.RedemptionState","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"redistributeLockedAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"internalType":"address","name":"controller","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"redistributeRedeemRequest","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"uint256","name":"assets","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bool","name":"","type":"bool"}],"name":"removeFromBlacklist","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":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"controller","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"requestRedeem","outputs":[{"internalType":"uint256","name":"requestId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"rescueTokens","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":[],"name":"rewardConfig","outputs":[{"components":[{"internalType":"address","name":"authority","type":"address"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"maxRate","type":"uint256"},{"internalType":"bool","name":"paused","type":"bool"}],"internalType":"struct IRewardManager.RewardConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardState","outputs":[{"components":[{"internalType":"uint256","name":"accountedAssets","type":"uint256"},{"internalType":"uint256","name":"unvestedRewards","type":"uint256"},{"internalType":"uint256","name":"rewardRate","type":"uint256"},{"internalType":"uint256","name":"periodFinish","type":"uint256"},{"internalType":"uint256","name":"lastUpdated","type":"uint256"}],"internalType":"struct IRewardManager.RewardState","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"internalType":"address","name":"controller","type":"address"}],"name":"serviceRedeemRequest","outputs":[{"components":[{"internalType":"uint256","name":"serviceId","type":"uint256"},{"internalType":"uint256","name":"requestsServiced","type":"uint256"},{"internalType":"uint256","name":"sharesMadeClaimable","type":"uint256"},{"internalType":"uint256","name":"assetsReserved","type":"uint256"}],"internalType":"struct IRedemptionManager.RedemptionServiceResult","name":"result","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxShares","type":"uint256"}],"name":"serviceRedemptions","outputs":[{"components":[{"internalType":"uint256","name":"serviceId","type":"uint256"},{"internalType":"uint256","name":"requestsServiced","type":"uint256"},{"internalType":"uint256","name":"sharesMadeClaimable","type":"uint256"},{"internalType":"uint256","name":"assetsReserved","type":"uint256"}],"internalType":"struct IRedemptionManager.RedemptionServiceResult","name":"result","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"policyId","type":"bytes32"}],"name":"setAccountRedemptionPolicy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"setCooldownDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"paused","type":"bool"}],"name":"setDepositPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setOperator","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"cooldown","type":"uint256"},{"internalType":"uint256","name":"maxServiceBatchShares","type":"uint256"},{"internalType":"bool","name":"requestPaused","type":"bool"},{"internalType":"bool","name":"claimPaused","type":"bool"},{"internalType":"bool","name":"servicePaused","type":"bool"},{"internalType":"bool","name":"cancelPaused","type":"bool"},{"internalType":"address","name":"serviceAuthority","type":"address"}],"name":"setRedemptionControls","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"policyId","type":"bytes32"},{"components":[{"internalType":"uint256","name":"cooldown","type":"uint256"},{"internalType":"uint256","name":"maxRequestShares","type":"uint256"},{"internalType":"bool","name":"enabled","type":"bool"}],"internalType":"struct IRedemptionManager.RedemptionPolicy","name":"policy","type":"tuple"}],"name":"setRedemptionPolicy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"maxRate","type":"uint256"},{"internalType":"bool","name":"paused","type":"bool"}],"name":"setRewardConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"share","outputs":[{"internalType":"address","name":"shareTokenAddress","type":"address"}],"stateMutability":"view","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":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","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":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"controller","type":"address"}],"name":"withdraw","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}],"is_changed_bytecode":false,"is_partially_verified":false,"constructor_args":null}