{"file_path":"contracts/EmberVault.sol","creation_status":"success","source_code":"/*\n  Copyright (c) 2026 Ember Protocol Inc.\n  Proprietary Smart Contract License – All Rights Reserved.\n\n  This source code is provided for transparency and verification only.\n  Use, modification, reproduction, or redeployment of this code \n  requires prior written permission from the Ember Protocol Inc.\n*/\n\npragma solidity ^0.8.22;\n\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC4626Upgradeable.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport \"@openzeppelin/contracts/utils/math/Math.sol\";\nimport \"./interfaces/IEmberProtocolConfig.sol\";\nimport \"./interfaces/IBridgeable.sol\";\nimport \"./interfaces/IEmberVaultValidator.sol\";\nimport \"./libraries/Math.sol\"; // FixedPointMath library\n\n// Custom errors for gas optimization (errors not in IEmberProtocolConfig)\nerror OperationPaused();\nerror InsufficientBalance();\nerror InsufficientShares();\nerror TransferFailed();\nerror InvalidRequest();\nerror MaxTVLReached();\nerror ZeroAmount();\nerror IndexOutOfBounds();\nerror UseRedeemShares();\nerror BridgeAmountTooSmall();\nerror BridgeAmountTooLarge();\n/// @notice Thrown when a parking lot is set and the caller is neither the parking lot nor a\n///         validator deposit-allow-listed depositor (they must route through the parking lot).\nerror UseParkingLot();\n\n/**\n * @title EmberVault\n * @dev Upgradeable ERC-4626 compliant vault contract using UUPS proxy pattern\n * @notice This is the main vault contract. Implements ERC-4626 with request-based withdrawals.\n *         Standard withdraw/redeem are disabled - users must use requestRedeem and wait for processing.\n *\n * @dev Note: This contract does not explicitly implement IEmberVault interface to avoid\n *      struct/function conflicts. IEmberVault is used by EmberProtocolConfig for cross-contract calls.\n *      It does implement IBridgeable to support cross-chain bridging via OFT adapters.\n */\ncontract EmberVault is\n  Initializable,\n  ERC4626Upgradeable,\n  UUPSUpgradeable,\n  OwnableUpgradeable,\n  ReentrancyGuardUpgradeable,\n  IBridgeable\n{\n  using SafeERC20 for IERC20;\n\n  // Structs\n  /// @notice platform fee struct\n  struct PlatformFee {\n    // the amount of platform fee accrued on the vault\n    uint256 accrued;\n    // timestamp (ms) at which the platform fee was last charged\n    uint256 lastChargedAt;\n    // the platform fee percentage\n    uint256 platformFeePercentage;\n  }\n\n  /// @notice rate struct\n  struct Rate {\n    // the rate of the vault (1e18)\n    uint256 value;\n    // the max allowed change in rate per update\n    uint256 maxRateChangePerUpdate;\n    // the time interval that must elapse before rate can be updated (ms)\n    uint256 rateUpdateInterval;\n    // the last time the rate was updated (ms)\n    uint256 lastUpdatedAt;\n  }\n\n  /// @notice roles struct\n  struct Roles {\n    // the address of the vault admin\n    address admin;\n    // the address of the vault operator\n    address operator;\n    // the address of the vault rate manager\n    address rateManager;\n  }\n\n  /// @notice Pause status for different operations\n  struct PauseStatus {\n    bool deposits;\n    bool withdrawals;\n    // privileged operations are all methods controlled by vault rate manager and operator.\n    //Admin operations are not paused\n    bool privilegedOperations;\n  }\n\n  /// @notice Represents a withdrawal request\n  struct WithdrawalRequest {\n    // the address of the owner that requested the withdrawal\n    address owner;\n    // the address of the receiver that will get the withdrawal amount\n    address receiver;\n    // the number of shares to redeem\n    uint256 shares;\n    // the estimated amount of assets user will receive after withdrawal\n    uint256 estimatedWithdrawAmount;\n    // the time at which withdrawal request was made\n    uint256 timestamp;\n    // this is the sequence number of the vault at the time of requesting withdrawal\n    uint256 sequenceNumber;\n  }\n\n  /// @notice Represents an account in the vault with pending withdrawals\n  struct Account {\n    // the amount of shares that the account has pending for withdrawal\n    uint256 totalPendingWithdrawalShares;\n    // The sequence numbers of the withdrawal requests that the account has made and are pending processing\n    uint256[] pendingWithdrawalRequestSequenceNumbers;\n    // The sequence numbers of the withdrawal requests that the account has cancelled\n    uint256[] cancelWithdrawRequestSequenceNumbers;\n  }\n  /**\n   * @dev Initialize function replaces constructor for upgradeable contracts\n   * @param initialOwner Address of the contract owner\n   */\n  struct VaultInitParams {\n    string name;\n    string receiptTokenSymbol;\n    address collateralToken;\n    address admin;\n    address operator;\n    address rateManager;\n    uint256 maxRateChangePerUpdate;\n    uint256 feePercentage;\n    uint256 minWithdrawableShares;\n    uint256 rateUpdateInterval;\n    uint256 maxTVL;\n  }\n\n  // Constants\n  /// @notice Fee denominator for platform fee calculation (1e18 * 365 * 24 * 60 * 60 * 1000)\n  uint256 private constant FEE_DENOMINATOR = 31_536_000_000_000_000_000_000_000_000;\n\n  /// @notice Hash constants for pause operation comparison (computed at compile time)\n  bytes32 private constant DEPOSITS_HASH = keccak256(\"deposits\");\n  bytes32 private constant WITHDRAWALS_HASH = keccak256(\"withdrawals\");\n  bytes32 private constant PRIVILEGED_OPS_HASH = keccak256(\"privilegedOperations\");\n\n  /// @notice name of the vault (shadows ERC20 name for custom naming)\n  string private _vaultName;\n\n  /// @notice maximum total value locked\n  uint256 public maxTVL;\n\n  /// @notice min withdrawable shares amount\n  uint256 public minWithdrawableShares;\n\n  /// @notice list of all whitelisted sub-accounts\n  mapping(address => bool) public subAccounts;\n\n  PlatformFee public platformFee;\n\n  Rate public rate;\n\n  Roles public roles;\n\n  /// @notice Protocol config contract\n  IEmberProtocolConfig public protocolConfig;\n\n  /// @notice Current pause status of the vault\n  PauseStatus public pauseStatus;\n\n  /// @notice Sequence number that increments with each vault action\n  uint256 public sequenceNumber;\n\n  /// @notice queue of pending withdrawal requests\n  WithdrawalRequest[] public pendingWithdrawals;\n\n  /// @notice start index for the withdrawal queue (for efficient dequeuing)\n  uint256 private withdrawalQueueStartIndex;\n\n  /// @notice mapping of user addresses to their account state\n  mapping(address => Account) public accounts;\n\n  /// @notice The authorized bridge adapter for cross-chain mint/burn operations\n  address public bridgeAdapter;\n\n  /// @notice Minimum amount for bridge operations (0 = no minimum)\n  uint256 public minBridgeAmount;\n\n  /// @notice Maximum amount for bridge operations (0 = no maximum)\n  uint256 public maxBridgeAmount;\n\n  /// @notice Validator contract for withdrawal fees and deposit allow lists\n  IEmberVaultValidator public vaultValidator;\n\n  /// @notice The EmberDepositParkingLot for this vault. When set (non-zero), direct deposits and\n  ///         mints are restricted to this address and to validator deposit-allow-listed\n  ///         depositors; everyone else must route through the parking lot (async deposits).\n  ///         address(0) (the default) keeps deposits permissionless, preserving the original\n  ///         behavior. Set by the vault owner.\n  address public parkingLot;\n\n  /**\n   * @dev Reserved storage gap for future upgrades. Reduced from 49 to 48 for the appended\n   *      `parkingLot` variable (added after all pre-existing variables, consuming one former\n   *      gap slot, so the prior storage layout is unchanged — upgrade-safe).\n   * See: https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable#storage-gaps\n   */\n  uint256[48] private __gap;\n\n  // Events\n  /// @notice Emitted when a vault is created\n  event VaultCreated(\n    address indexed vault,\n    string name,\n    string symbol,\n    address collateralToken,\n    address admin,\n    address operator,\n    address rateProvider,\n    address[] subAccounts,\n    uint256 minWithdrawableShares,\n    uint256 feePercentage,\n    uint256 maxRateChangePerUpdate,\n    uint256 rateUpdateInterval,\n    uint256 rate,\n    uint256 maxTVL,\n    uint256 timestamp,\n    uint256 sequenceNumber\n  );\n\n  /// @notice Emitted when the vault rate manager is updated\n  event VaultRateManagerUpdated(\n    address indexed vault,\n    address indexed previousRateManager,\n    address indexed newRateManager,\n    uint256 timestamp,\n    uint256 sequenceNumber\n  );\n\n  /// @notice Emitted when the vault max TVL is updated\n  event VaultMaxTVLUpdated(\n    address indexed vault,\n    uint256 previousMaxTVL,\n    uint256 newMaxTVL,\n    uint256 timestamp,\n    uint256 sequenceNumber\n  );\n\n  /// @notice Emitted when the vault rate update interval is changed\n  event VaultRateUpdateIntervalChanged(\n    address indexed vault,\n    uint256 previousInterval,\n    uint256 newInterval,\n    uint256 timestamp,\n    uint256 sequenceNumber\n  );\n\n  /// @notice Emitted when vault max rate change per update is changed\n  event VaultMaxRateChangePerUpdateChanged(\n    address indexed vault,\n    uint256 previousMaxRateChangePerUpdate,\n    uint256 newMaxRateChangePerUpdate,\n    uint256 timestamp,\n    uint256 sequenceNumber\n  );\n\n  /// @notice Emitted when the vault admin is changed\n  event VaultAdminChanged(\n    address indexed vault,\n    address indexed previousAdmin,\n    address indexed newAdmin,\n    uint256 timestamp,\n    uint256 sequenceNumber\n  );\n\n  /// @notice Emitted when the vault operator is changed\n  event VaultOperatorChanged(\n    address indexed vault,\n    address indexed previousOperator,\n    address indexed newOperator,\n    uint256 timestamp,\n    uint256 sequenceNumber\n  );\n\n  /// @notice Emitted when the vault fee percentage is updated\n  event VaultFeePercentageUpdated(\n    address indexed vault,\n    uint256 previousFeePercentage,\n    uint256 newFeePercentage,\n    uint256 timestamp,\n    uint256 sequenceNumber\n  );\n\n  /// @notice Emitted when the vault name is updated\n  event VaultNameUpdated(\n    address indexed vault,\n    string previousName,\n    string newName,\n    uint256 timestamp,\n    uint256 sequenceNumber\n  );\n\n  event VaultMinWithdrawableSharesUpdated(\n    address indexed vault,\n    uint256 previousMinWithdrawableShares,\n    uint256 newMinWithdrawableShares,\n    uint256 timestamp,\n    uint256 sequenceNumber\n  );\n\n  /// @notice Emitted when a sub-account is added or removed\n  event VaultSubAccountUpdated(\n    address indexed vault,\n    address indexed account,\n    bool isSubAccount,\n    uint256 timestamp,\n    uint256 sequenceNumber\n  );\n\n  /// @notice Emitted when vault pause status is updated\n  event VaultPauseStatusUpdated(\n    address indexed vault,\n    string operation,\n    bool paused,\n    uint256 timestamp,\n    uint256 sequenceNumber\n  );\n\n  /// @notice Emitted when the vault rate is updated\n  event VaultRateUpdated(\n    address indexed vault,\n    uint256 previousRate,\n    uint256 newRate,\n    uint256 timestamp,\n    uint256 sequenceNumber\n  );\n\n  /// @notice Emitted when platform fees are charged\n  event VaultPlatformFeeCharged(\n    address indexed vault,\n    uint256 feeAmount,\n    uint256 totalAccrued,\n    uint256 timestamp,\n    uint256 sequenceNumber\n  );\n\n  /// @notice Emitted when platform fees are collected\n  event VaultPlatformFeeCollected(\n    address indexed vault,\n    address indexed recipient,\n    uint256 amount,\n    uint256 timestamp,\n    uint256 sequenceNumber\n  );\n\n  /// @notice Emitted when a user deposits assets into the vault\n  event VaultDeposit(\n    address indexed vault,\n    address indexed depositor,\n    address indexed receiver,\n    uint256 amountDeposited,\n    uint256 sharesMinted,\n    uint256 totalShares,\n    uint256 timestamp,\n    uint256 sequenceNumber\n  );\n\n  /// @notice Emitted when a user redeems shares (creates a withdrawal request)\n  event RequestRedeemed(\n    address indexed vault,\n    address indexed owner,\n    address indexed receiver,\n    uint256 shares,\n    uint256 timestamp,\n    uint256 totalShares,\n    uint256 totalSharesPendingToBurn,\n    uint256 sequenceNumber\n  );\n\n  /// @notice Emitted when a user cancels a pending withdrawal request\n  event RequestCancelled(\n    address indexed vault,\n    address indexed owner,\n    uint256 requestSequenceNumber,\n    uint256[] cancelWithdrawRequestSequenceNumbers,\n    uint256 timestamp\n  );\n\n  /// @notice Emitted when vault operator withdraws from vault without redeeming shares\n  event VaultWithdrawalWithoutRedeemingShares(\n    address indexed vault,\n    address indexed subAccount,\n    uint256 previousBalance,\n    uint256 newBalance,\n    uint256 amount,\n    uint256 timestamp,\n    uint256 sequenceNumber\n  );\n\n  /// @notice Emitted when a withdrawal request is processed\n  event RequestProcessed(\n    address indexed vault,\n    address indexed owner,\n    address indexed receiver,\n    uint256 shares,\n    uint256 withdrawAmount,\n    uint256 requestTimestamp,\n    uint256 processTimestamp,\n    bool skipped,\n    bool cancelled,\n    uint256 totalShares,\n    uint256 totalSharesPendingToBurn,\n    uint256 sequenceNumber,\n    uint256 requestSequenceNumber\n  );\n\n  /// @notice Emitted alongside RequestProcessed when withdrawal fees are charged\n  event WithdrawalFeeCharged(\n    address indexed vault,\n    address indexed owner,\n    uint256 requestSequenceNumber,\n    uint256 permanentFeeCharged,\n    uint256 timeBasedFeeCharged\n  );\n\n  /// @notice Emitted when withdrawal requests are processed (summary event)\n  event ProcessRequestsSummary(\n    address indexed vault,\n    uint256 totalRequestProcessed,\n    uint256 requestsSkipped,\n    uint256 requestsCancelled,\n    uint256 totalSharesBurnt,\n    uint256 totalAmountWithdrawn,\n    uint256 totalShares,\n    uint256 totalSharesPendingToBurn,\n    uint256 rate,\n    uint256 sequenceNumber\n  );\n\n  /// @notice Emitted when the bridge adapter is updated\n  event BridgeAdapterUpdated(\n    address indexed vault,\n    address indexed previousAdapter,\n    address indexed newAdapter,\n    uint256 timestamp,\n    uint256 sequenceNumber\n  );\n\n  /// @notice Emitted when bridge limits are updated\n  event BridgeLimitsUpdated(\n    address indexed vault,\n    uint256 minBridgeAmount,\n    uint256 maxBridgeAmount,\n    uint256 timestamp,\n    uint256 sequenceNumber\n  );\n\n  /// @notice Emitted when tokens are minted via bridge\n  event BridgeMint(\n    address indexed vault,\n    address indexed to,\n    uint256 amount,\n    uint256 totalShares,\n    uint256 timestamp,\n    uint256 sequenceNumber\n  );\n\n  /// @notice Emitted when tokens are burned via bridge\n  event BridgeBurn(\n    address indexed vault,\n    address indexed from,\n    uint256 amount,\n    uint256 totalShares,\n    uint256 timestamp,\n    uint256 sequenceNumber\n  );\n\n  /// @notice Emitted when the vault's parking lot is set or cleared. A non-zero value gates\n  ///         direct deposits to the parking lot; address(0) restores permissionless deposits.\n  event ParkingLotUpdated(\n    address indexed vault,\n    address indexed previousParkingLot,\n    address indexed newParkingLot,\n    uint256 timestamp,\n    uint256 sequenceNumber\n  );\n\n  // Modifiers\n  /// @notice Only the vault operator can call this function\n  modifier onlyOperator() {\n    if (msg.sender != roles.operator) revert Unauthorized();\n    _;\n  }\n\n  /// @notice Only the vault rate manager can call this function\n  modifier onlyRateManager() {\n    if (msg.sender != roles.rateManager) revert Unauthorized();\n    _;\n  }\n\n  /// @notice Only the protocol config can call this function\n  modifier onlyProtocolConfig() {\n    if (msg.sender != address(protocolConfig)) revert Unauthorized();\n    _;\n  }\n\n  /// @notice Verifies caller is admin (used with onlyProtocolConfig for setter functions)\n  /// @param caller The original caller address passed from protocol config\n  modifier onlyAdmin(address caller) {\n    if (caller != roles.admin) revert Unauthorized();\n    _;\n  }\n\n  /// @notice Verifies caller is owner (used with onlyProtocolConfig for setter functions)\n  /// @param caller The original caller address passed from protocol config\n  modifier onlyOwnerRole(address caller) {\n    if (caller != owner()) revert Unauthorized();\n    _;\n  }\n\n  /// @notice Only the bridge adapter can call this function\n  modifier onlyBridgeAdapter() {\n    if (msg.sender != bridgeAdapter) revert Unauthorized();\n    _;\n  }\n\n  /// @custom:oz-upgrades-unsafe-allow constructor\n  constructor() {\n    _disableInitializers();\n  }\n\n  function initialize(\n    address _protocolConfig,\n    address initialOwner,\n    VaultInitParams memory params,\n    address[] memory _subAccounts\n  ) public initializer {\n    if (_protocolConfig == address(0)) revert ZeroAddress();\n    if (params.admin == address(0)) revert ZeroAddress();\n    if (params.operator == address(0)) revert ZeroAddress();\n    if (params.rateManager == address(0)) revert ZeroAddress();\n    if (\n      params.admin == params.operator ||\n      params.admin == params.rateManager ||\n      params.operator == params.rateManager\n    ) revert InvalidValue();\n\n    if (params.collateralToken == address(0)) revert ZeroAddress();\n\n    IEmberProtocolConfig configProxy = IEmberProtocolConfig(_protocolConfig);\n\n    if (\n      params.rateUpdateInterval < configProxy.getMinRateInterval() ||\n      params.rateUpdateInterval > configProxy.getMaxRateInterval()\n    ) revert InvalidInterval();\n\n    if (params.maxRateChangePerUpdate == 0) revert InvalidRate();\n\n    if (params.feePercentage > configProxy.getMaxAllowedFeePercentage()) revert InvalidValue();\n\n    // Initialize ERC4626 with the collateral token as the underlying asset\n    __ERC20_init(params.name, params.receiptTokenSymbol);\n    __ERC4626_init(IERC20(params.collateralToken));\n    __Ownable_init(initialOwner);\n    __UUPSUpgradeable_init();\n    __ReentrancyGuard_init();\n\n    protocolConfig = IEmberProtocolConfig(_protocolConfig);\n\n    if (bytes(params.name).length == 0) revert InvalidValue();\n    if (params.minWithdrawableShares == 0) revert ZeroAmount();\n    if (params.maxTVL == 0) revert ZeroAmount();\n\n    _vaultName = params.name;\n    maxTVL = params.maxTVL;\n    minWithdrawableShares = params.minWithdrawableShares;\n\n    uint256 currentTime = _getChainTimestampMs();\n\n    platformFee = PlatformFee({\n      accrued: 0,\n      lastChargedAt: currentTime,\n      platformFeePercentage: params.feePercentage\n    });\n\n    rate = Rate({\n      value: configProxy.getDefaultRate(),\n      maxRateChangePerUpdate: params.maxRateChangePerUpdate,\n      rateUpdateInterval: params.rateUpdateInterval,\n      lastUpdatedAt: currentTime\n    });\n\n    if (configProxy.isAccountBlacklisted(params.admin)) revert Blacklisted();\n    if (configProxy.isAccountBlacklisted(params.operator)) revert Blacklisted();\n    if (configProxy.isAccountBlacklisted(params.rateManager)) revert Blacklisted();\n\n    roles = Roles({\n      admin: params.admin,\n      operator: params.operator,\n      rateManager: params.rateManager\n    });\n\n    for (uint256 i = 0; i < _subAccounts.length; i++) {\n      address subAccount = _subAccounts[i];\n      if (subAccount == address(0)) revert ZeroAddress();\n      if (\n        subAccount == params.admin ||\n        subAccount == params.operator ||\n        subAccount == params.rateManager\n      ) revert InvalidValue();\n      subAccounts[subAccount] = true;\n    }\n\n    // Initialize sequence number\n    sequenceNumber = 0;\n\n    emit VaultCreated(\n      address(this),\n      params.name,\n      params.receiptTokenSymbol,\n      params.collateralToken,\n      roles.admin,\n      roles.operator,\n      roles.rateManager,\n      _subAccounts,\n      minWithdrawableShares,\n      platformFee.platformFeePercentage,\n      rate.maxRateChangePerUpdate,\n      rate.rateUpdateInterval,\n      rate.value,\n      maxTVL,\n      currentTime,\n      sequenceNumber\n    );\n  }\n\n  // ============================================\n  // Protocol Config Setter Functions\n  // ============================================\n\n  /// @notice Sets the max TVL of the vault\n  /// @dev Only callable by protocol config, caller must be admin\n  /// @param caller The original caller address (must be admin)\n  /// @param newMaxTVL The new maximum total value locked\n  function setMaxTVL(\n    address caller,\n    uint256 newMaxTVL\n  ) external nonReentrant onlyProtocolConfig onlyAdmin(caller) {\n    uint256 previousMaxTVL = maxTVL;\n    maxTVL = newMaxTVL;\n    _incrementSequence();\n\n    emit VaultMaxTVLUpdated(\n      address(this),\n      previousMaxTVL,\n      newMaxTVL,\n      _getChainTimestampMs(),\n      sequenceNumber\n    );\n  }\n\n  /// @notice Sets the vault rate update interval\n  /// @dev Only callable by protocol config, caller must be admin\n  /// @param caller The original caller address (must be admin)\n  /// @param newInterval The new rate update interval (in milliseconds)\n  function setRateUpdateInterval(\n    address caller,\n    uint256 newInterval\n  ) external nonReentrant onlyProtocolConfig onlyAdmin(caller) {\n    uint256 previousInterval = rate.rateUpdateInterval;\n    rate.rateUpdateInterval = newInterval;\n    _incrementSequence();\n\n    emit VaultRateUpdateIntervalChanged(\n      address(this),\n      previousInterval,\n      newInterval,\n      _getChainTimestampMs(),\n      sequenceNumber\n    );\n  }\n\n  /// @notice Sets the vault max rate change per update\n  /// @dev Only callable by protocol config, caller must be admin\n  /// @param caller The original caller address (must be admin)\n  /// @param newMaxRateChangePerUpdate The new max rate change allowed per update\n  function setMaxRateChangePerUpdate(\n    address caller,\n    uint256 newMaxRateChangePerUpdate\n  ) external nonReentrant onlyProtocolConfig onlyAdmin(caller) {\n    uint256 previousMaxRateChangePerUpdate = rate.maxRateChangePerUpdate;\n    rate.maxRateChangePerUpdate = newMaxRateChangePerUpdate;\n    _incrementSequence();\n\n    emit VaultMaxRateChangePerUpdateChanged(\n      address(this),\n      previousMaxRateChangePerUpdate,\n      newMaxRateChangePerUpdate,\n      _getChainTimestampMs(),\n      sequenceNumber\n    );\n  }\n\n  /// @notice Sets the vault admin\n  /// @dev Only callable by protocol config, caller must be owner\n  /// @param caller The original caller address (must be owner)\n  /// @param newAdmin The new admin address\n  function setAdmin(\n    address caller,\n    address newAdmin\n  ) external nonReentrant onlyProtocolConfig onlyOwnerRole(caller) {\n    address previousAdmin = roles.admin;\n    roles.admin = newAdmin;\n    _incrementSequence();\n\n    emit VaultAdminChanged(\n      address(this),\n      previousAdmin,\n      newAdmin,\n      _getChainTimestampMs(),\n      sequenceNumber\n    );\n  }\n\n  /// @notice Sets the vault operator\n  /// @dev Only callable by protocol config, caller must be admin\n  /// @param caller The original caller address (must be admin)\n  /// @param newOperator The new operator address\n  function setOperator(\n    address caller,\n    address newOperator\n  ) external nonReentrant onlyProtocolConfig onlyAdmin(caller) {\n    address previousOperator = roles.operator;\n    roles.operator = newOperator;\n    _incrementSequence();\n\n    emit VaultOperatorChanged(\n      address(this),\n      previousOperator,\n      newOperator,\n      _getChainTimestampMs(),\n      sequenceNumber\n    );\n  }\n\n  /// @notice Sets the vault rate manager\n  /// @dev Only callable by protocol config, caller must be admin\n  /// @param caller The original caller address (must be admin)\n  /// @param newRateManager The new rate manager address\n  function setRateManager(\n    address caller,\n    address newRateManager\n  ) external nonReentrant onlyProtocolConfig onlyAdmin(caller) {\n    address previousRateManager = roles.rateManager;\n    roles.rateManager = newRateManager;\n    _incrementSequence();\n\n    emit VaultRateManagerUpdated(\n      address(this),\n      previousRateManager,\n      newRateManager,\n      _getChainTimestampMs(),\n      sequenceNumber\n    );\n  }\n\n  /// @notice Sets the vault fee percentage\n  /// @dev Only callable by protocol config, caller must be admin\n  /// @param caller The original caller address (must be admin)\n  /// @param newFeePercentage The new fee percentage\n  function setFeePercentage(\n    address caller,\n    uint256 newFeePercentage\n  ) external nonReentrant onlyProtocolConfig onlyAdmin(caller) {\n    // Settle accrued fees at the OLD percentage before mutating, so prior elapsed time\n    // is not retroactively re-priced at the new rate. Cap is enforced upstream by\n    // EmberProtocolConfig.updateVaultFeePercentage; this entry is onlyProtocolConfig.\n    _chargeAccruedPlatformFees();\n\n    uint256 previousFeePercentage = platformFee.platformFeePercentage;\n    platformFee.platformFeePercentage = newFeePercentage;\n    _incrementSequence();\n\n    emit VaultFeePercentageUpdated(\n      address(this),\n      previousFeePercentage,\n      newFeePercentage,\n      _getChainTimestampMs(),\n      sequenceNumber\n    );\n  }\n\n  /// @notice Updates the vault name\n  /// @dev Only callable by protocol config, caller must be admin\n  /// @param caller The original caller address (must be admin)\n  /// @param newName The new vault name\n  function setVaultName(\n    address caller,\n    string calldata newName\n  ) external nonReentrant onlyProtocolConfig onlyAdmin(caller) {\n    string memory previousName = _vaultName;\n    _vaultName = newName;\n    _incrementSequence();\n\n    emit VaultNameUpdated(\n      address(this),\n      previousName,\n      newName,\n      _getChainTimestampMs(),\n      sequenceNumber\n    );\n  }\n\n  /// @notice Updates the minimum withdrawable shares\n  /// @dev Only callable by protocol config, caller must be admin\n  /// @param caller The original caller address (must be admin)\n  /// @param newMinWithdrawableShares The new minimum withdrawable shares amount\n  function setMinWithdrawableShares(\n    address caller,\n    uint256 newMinWithdrawableShares\n  ) external nonReentrant onlyProtocolConfig onlyAdmin(caller) {\n    uint256 previousMinWithdrawableShares = minWithdrawableShares;\n    minWithdrawableShares = newMinWithdrawableShares;\n    _incrementSequence();\n\n    emit VaultMinWithdrawableSharesUpdated(\n      address(this),\n      previousMinWithdrawableShares,\n      newMinWithdrawableShares,\n      _getChainTimestampMs(),\n      sequenceNumber\n    );\n  }\n\n  /// @notice Sets or removes a sub-account\n  /// @dev Only callable by protocol config, caller must be admin\n  /// @param caller The original caller address (must be admin)\n  /// @param account The account address to set or remove\n  /// @param isSubAccount True to add as sub-account, false to remove\n  function setSubAccountStatus(\n    address caller,\n    address account,\n    bool isSubAccount\n  ) external nonReentrant onlyProtocolConfig onlyAdmin(caller) {\n    subAccounts[account] = isSubAccount;\n\n    _incrementSequence();\n    emit VaultSubAccountUpdated(\n      address(this),\n      account,\n      isSubAccount,\n      _getChainTimestampMs(),\n      sequenceNumber\n    );\n  }\n\n  /// @notice Sets (or clears) the vault's deposit parking lot.\n  /// @dev Only callable by protocol config, caller must be admin. A non-zero address\n  ///      gates direct deposits/mints to the parking lot (async-deposit mode); pass\n  ///      address(0) to restore permissionless deposits.\n  /// @param caller The original caller address (must be admin)\n  /// @param newParkingLot The parking lot address, or address(0) to disable gating\n  function setParkingLot(\n    address caller,\n    address newParkingLot\n  ) external nonReentrant onlyProtocolConfig onlyAdmin(caller) {\n    address previousParkingLot = parkingLot;\n    if (previousParkingLot == newParkingLot) revert SameValue();\n    parkingLot = newParkingLot;\n    _incrementSequence();\n    emit ParkingLotUpdated(\n      address(this),\n      previousParkingLot,\n      newParkingLot,\n      _getChainTimestampMs(),\n      sequenceNumber\n    );\n  }\n\n  /// @notice Updates the vault rate\n  /// @dev Only the rate manager can update the rate\n  /// @param newRate The new rate value (in fixed-point format, 1e18)\n  function updateVaultRate(uint256 newRate) external nonReentrant onlyRateManager {\n    IEmberProtocolConfig configProxy = protocolConfig;\n\n    // Check protocol is not paused\n    if (configProxy.getProtocolPauseStatus()) revert ProtocolPaused();\n\n    // Check vault privileged operations are not paused\n    if (pauseStatus.privilegedOperations) revert OperationPaused();\n\n    // Charge accrued platform fees\n    _chargeAccruedPlatformFees();\n\n    uint256 currentTime = _getChainTimestampMs();\n    uint256 lastUpdatedAt = rate.lastUpdatedAt;\n\n    // Check enough time has passed since last update\n    if (currentTime < lastUpdatedAt + rate.rateUpdateInterval) revert InvalidInterval();\n\n    // Validate rate is within bounds\n    if (newRate < configProxy.getMinRate() || newRate > configProxy.getMaxRate())\n      revert InvalidRate();\n\n    // Calculate percentage change\n    uint256 percentChange = FixedPointMath.percentChangeFrom(rate.value, newRate);\n\n    // Validate rate change is within allowed limit\n    if (percentChange > rate.maxRateChangePerUpdate) revert InvalidRate();\n\n    // Check rate is different from current\n    if (newRate == rate.value) revert SameValue();\n\n    uint256 previousRate = rate.value;\n\n    // Update rate and timestamp\n    rate.value = newRate;\n    rate.lastUpdatedAt = currentTime;\n\n    _incrementSequence();\n    emit VaultRateUpdated(address(this), previousRate, newRate, currentTime, sequenceNumber);\n  }\n\n  /// @notice Collects accrued platform fees and transfers them to the fee recipient\n  /// @dev Only the vault operator can call this function\n  /// @dev Reverts if protocol is paused, vault privileged operations are paused, no fees accrued, or insufficient balance\n  /// @return amount The amount of fees collected and transferred\n  function collectPlatformFee() external nonReentrant onlyOperator returns (uint256 amount) {\n    IEmberProtocolConfig configProxy = protocolConfig;\n\n    // Check protocol is not paused\n    if (configProxy.getProtocolPauseStatus()) revert ProtocolPaused();\n\n    // Check vault privileged operations are not paused\n    if (pauseStatus.privilegedOperations) revert OperationPaused();\n\n    // Charge accrued fees up to the current timestamp (mirrors EmberETHVault).\n    _chargeAccruedPlatformFees();\n\n    // Check that there are accrued fees\n    if (platformFee.accrued == 0) revert ZeroAmount();\n\n    amount = platformFee.accrued;\n\n    // Check that vault has sufficient balance\n    uint256 vaultBalance = IERC20(asset()).balanceOf(address(this));\n    if (vaultBalance < amount) revert InsufficientBalance();\n\n    // Get fee recipient from protocol config\n    address recipient = configProxy.getPlatformFeeRecipient();\n    if (recipient == address(0)) revert ZeroAddress();\n\n    // Reset accrued fees\n    platformFee.accrued = 0;\n\n    // Transfer fees to recipient using SafeERC20\n    IERC20(asset()).safeTransfer(recipient, amount);\n\n    // Increment sequence number\n    _incrementSequence();\n\n    uint256 currentTime = _getChainTimestampMs();\n\n    emit VaultPlatformFeeCollected(address(this), recipient, amount, currentTime, sequenceNumber);\n\n    return amount;\n  }\n\n  /// @notice Sets the pause status for a specific operation\n  /// @dev Only callable by protocol config. Authorization (guardian-only) is\n  ///      enforced in `EmberProtocolConfig.setVaultPausedStatus` to keep this\n  ///      contract under the EVM size limit. The `caller` parameter is retained\n  ///      for ABI compatibility with the forwarder but is not used here.\n  /// @param operation The operation to pause/unpause: \"deposits\", \"withdrawals\", or \"privilegedOperations\"\n  /// @param paused True to pause, false to unpause\n  function setPausedStatus(\n    address /* caller */,\n    string calldata operation,\n    bool paused\n  ) external nonReentrant onlyProtocolConfig {\n    // Compute hash once at runtime; constants are computed at compile time\n    bytes32 operationHash = keccak256(bytes(operation));\n\n    bool currentStatus;\n    bool statusChanged = false;\n\n    if (operationHash == DEPOSITS_HASH) {\n      currentStatus = pauseStatus.deposits;\n      if (currentStatus != paused) {\n        pauseStatus.deposits = paused;\n        statusChanged = true;\n      }\n    } else if (operationHash == WITHDRAWALS_HASH) {\n      currentStatus = pauseStatus.withdrawals;\n      if (currentStatus != paused) {\n        pauseStatus.withdrawals = paused;\n        statusChanged = true;\n      }\n    } else if (operationHash == PRIVILEGED_OPS_HASH) {\n      currentStatus = pauseStatus.privilegedOperations;\n      if (currentStatus != paused) {\n        pauseStatus.privilegedOperations = paused;\n        statusChanged = true;\n      }\n    } else {\n      revert InvalidValue();\n    }\n\n    if (!statusChanged) revert SameValue();\n\n    _incrementSequence();\n    emit VaultPauseStatusUpdated(\n      address(this),\n      operation,\n      paused,\n      _getChainTimestampMs(),\n      sequenceNumber\n    );\n  }\n\n  // ============ Bridge Functions ============\n\n  /// @notice Sets the authorized bridge adapter for cross-chain operations\n  /// @dev Only callable by protocol config, caller must be admin\n  /// @param caller The original caller address (must be admin)\n  /// @param newAdapter The new bridge adapter address (can be zero to disable)\n  function setBridgeAdapter(\n    address caller,\n    address newAdapter\n  ) external nonReentrant onlyProtocolConfig onlyAdmin(caller) {\n    address previousAdapter = bridgeAdapter;\n    if (previousAdapter == newAdapter) revert SameValue();\n\n    bridgeAdapter = newAdapter;\n\n    unchecked {\n      sequenceNumber++;\n    }\n\n    emit BridgeAdapterUpdated(\n      address(this),\n      previousAdapter,\n      newAdapter,\n      _getChainTimestampMs(),\n      sequenceNumber\n    );\n  }\n\n  /// @notice Sets the minimum and maximum bridge amounts\n  /// @dev Only callable by protocol config, caller must be admin\n  /// @param caller The original caller address (must be admin)\n  /// @param _minBridgeAmount The minimum amount for bridge operations (0 = no minimum)\n  /// @param _maxBridgeAmount The maximum amount for bridge operations (0 = no maximum)\n  function setBridgeLimits(\n    address caller,\n    uint256 _minBridgeAmount,\n    uint256 _maxBridgeAmount\n  ) external nonReentrant onlyProtocolConfig onlyAdmin(caller) {\n    minBridgeAmount = _minBridgeAmount;\n    maxBridgeAmount = _maxBridgeAmount;\n\n    unchecked {\n      sequenceNumber++;\n    }\n\n    emit BridgeLimitsUpdated(\n      address(this),\n      _minBridgeAmount,\n      _maxBridgeAmount,\n      _getChainTimestampMs(),\n      sequenceNumber\n    );\n  }\n\n  /// @notice Mints shares to a recipient for cross-chain bridging\n  /// @dev Only callable by the authorized bridge adapter\n  /// @dev Inbound LZ messages must NOT revert here — funds would be stuck in flight.\n  ///      Blacklist enforcement therefore lives only on the burn (send) side; the redeem\n  ///      flow already gates blacklisted holders at exit time.\n  /// @param to The recipient address\n  /// @param amount The amount of shares to mint\n  function bridgeMint(address to, uint256 amount) external nonReentrant onlyBridgeAdapter {\n    if (to == address(0)) revert ZeroAddress();\n    if (amount == 0) revert ZeroAmount();\n\n    // Settle accrued fees against the OLD totalSupply before minting changes TVL.\n    _chargeAccruedPlatformFees();\n\n    // Mint shares directly (bypassing deposit flow for bridge operations)\n    _mint(to, amount);\n\n    unchecked {\n      sequenceNumber++;\n    }\n\n    uint256 totalShares = totalSupply();\n\n    emit BridgeMint(address(this), to, amount, totalShares, _getChainTimestampMs(), sequenceNumber);\n  }\n\n  /// @notice Burns shares from an account for cross-chain bridging\n  /// @dev Only callable by the authorized bridge adapter\n  /// @param from The account to burn from\n  /// @param amount The amount of shares to burn\n  function bridgeBurn(address from, uint256 amount) external nonReentrant onlyBridgeAdapter {\n    if (from == address(0)) revert ZeroAddress();\n    if (amount == 0) revert ZeroAmount();\n    if (balanceOf(from) < amount) revert InsufficientShares();\n\n    IEmberProtocolConfig configProxy = protocolConfig;\n\n    // Honor protocol-level pause; vault-level withdrawals pause is intentionally NOT enforced\n    // here so bridging stays available for in-flight position migration even when withdrawals\n    // are temporarily halted.\n    if (configProxy.getProtocolPauseStatus()) revert ProtocolPaused();\n\n    // Blacklist is enforced only on the send side; inbound messages must never revert.\n    if (configProxy.isAccountBlacklisted(from)) revert Blacklisted();\n\n    // Enforce bridge amount limits\n    if (minBridgeAmount > 0 && amount < minBridgeAmount) revert BridgeAmountTooSmall();\n    if (maxBridgeAmount > 0 && amount > maxBridgeAmount) revert BridgeAmountTooLarge();\n\n    // Settle accrued fees against the OLD totalSupply before burning changes TVL.\n    _chargeAccruedPlatformFees();\n\n    // Burn shares directly (bypassing withdrawal flow for bridge operations)\n    _burn(from, amount);\n\n    unchecked {\n      sequenceNumber++;\n    }\n\n    uint256 totalShares = totalSupply();\n\n    emit BridgeBurn(\n      address(this),\n      from,\n      amount,\n      totalShares,\n      _getChainTimestampMs(),\n      sequenceNumber\n    );\n  }\n\n  /// @notice Sets the vault validator contract address\n  /// @dev Only callable by protocol config, caller must be admin\n  function setVaultValidator(\n    address caller,\n    address _validator\n  ) external nonReentrant onlyProtocolConfig onlyAdmin(caller) {\n    vaultValidator = IEmberVaultValidator(_validator);\n  }\n\n  /// @notice Allows a user to redeem shares of a vault and receive underlying assets.\n  /// The shares are locked into vault upon request and only when the vault operator processes\n  /// the withdrawal request, the shares are burnt and the underlying asset based\n  /// on the vault rate at the time of processing claim request is sent to the user.\n  /// @param shares The number of shares to redeem\n  /// @param receiver The address to send the underlying assets to\n  /// @return request The withdrawal request that was created\n  function redeemShares(\n    uint256 shares,\n    address receiver\n  ) external nonReentrant returns (WithdrawalRequest memory request) {\n    IEmberProtocolConfig configProxy = protocolConfig;\n\n    // Check protocol is not paused\n    if (configProxy.getProtocolPauseStatus()) revert ProtocolPaused();\n\n    // Check vault withdrawals are not paused\n    if (pauseStatus.withdrawals) revert OperationPaused();\n\n    address shareOwner = msg.sender;\n\n    // Verify user is not blacklisted\n    if (configProxy.isAccountBlacklisted(shareOwner)) revert Blacklisted();\n    if (configProxy.isAccountBlacklisted(receiver)) revert Blacklisted();\n    // Reject a null receiver: such a request would be queued, then revert at processing time\n    // on the transfer to address(0), freezing the FIFO withdrawal queue at the head.\n    if (receiver == address(0)) revert ZeroAddress();\n\n    if (shares < minWithdrawableShares) revert InsufficientShares();\n\n    // Check allowance and transfer shares from user to vault (they will be burned when processing the withdrawal)\n    // We use _spendAllowance and _transfer directly because transferFrom uses msg.sender as spender\n    _spendAllowance(shareOwner, address(this), shares);\n    _transfer(shareOwner, address(this), shares);\n\n    // Calculate the estimated withdraw amount based on the current vault rate\n    // using rate-based conversion with floor rounding (favors vault, matches actual processing)\n    uint256 estimatedWithdrawAmount = convertToAssets(shares);\n\n    // Increment the sequence number\n    _incrementSequence();\n\n    uint256 currentTime = _getChainTimestampMs();\n\n    // Create withdrawal request\n    request = WithdrawalRequest({\n      owner: shareOwner,\n      receiver: receiver,\n      shares: shares,\n      estimatedWithdrawAmount: estimatedWithdrawAmount,\n      timestamp: currentTime,\n      sequenceNumber: sequenceNumber\n    });\n\n    // Add request to queue\n    pendingWithdrawals.push(request);\n\n    // Update the shares to be redeemed for the account\n    _updateAccountState(request, true, type(uint256).max); // type(uint256).max means no index (none in Move)\n\n    uint256 totalShares = totalSupply();\n    uint256 pendingSharesToBurn = balanceOf(address(this));\n\n    emit RequestRedeemed(\n      address(this),\n      request.owner,\n      request.receiver,\n      request.shares,\n      request.timestamp,\n      totalShares,\n      pendingSharesToBurn,\n      sequenceNumber\n    );\n\n    return request;\n  }\n\n  /// @notice Allows an owner to cancel a pending withdrawal request\n  /// @dev Reverts if protocol is paused, vault withdrawals are paused, user has no account, request not found, or already cancelled\n  /// @param requestSequenceNumber The sequence number of the withdrawal request to cancel\n  function cancelPendingWithdrawalRequest(uint256 requestSequenceNumber) external nonReentrant {\n    IEmberProtocolConfig configProxy = protocolConfig;\n\n    // Check protocol is not paused\n    if (configProxy.getProtocolPauseStatus()) revert ProtocolPaused();\n\n    // Check vault withdrawals are not paused\n    if (pauseStatus.withdrawals) revert OperationPaused();\n\n    address requestOwner = msg.sender;\n    Account storage accountState = accounts[requestOwner];\n\n    // Check user has an account (has pending withdrawals)\n    if (accountState.totalPendingWithdrawalShares == 0) revert InvalidRequest();\n\n    // Check if sequence number is already in cancel list\n    uint256[] storage cancelList = accountState.cancelWithdrawRequestSequenceNumbers;\n    for (uint256 i = 0; i < cancelList.length; i++) {\n      if (cancelList[i] == requestSequenceNumber) {\n        revert InvalidRequest();\n      }\n    }\n\n    // Find the withdrawal request with the given sequence number\n    uint256[] storage pendingList = accountState.pendingWithdrawalRequestSequenceNumbers;\n    bool found = false;\n    for (uint256 i = 0; i < pendingList.length; i++) {\n      if (pendingList[i] == requestSequenceNumber) {\n        found = true;\n        break;\n      }\n    }\n    if (!found) revert InvalidRequest();\n\n    // Add sequence number to cancel list\n    cancelList.push(requestSequenceNumber);\n\n    // Emit event\n    emit RequestCancelled(\n      address(this),\n      requestOwner,\n      requestSequenceNumber,\n      cancelList,\n      _getChainTimestampMs()\n    );\n  }\n\n  /// @notice Withdraws from the vault without redeeming shares\n  /// @dev Only the vault operator can withdraw from the vault\n  /// @dev Used to withdraw funds from the vault to one of the whitelisted sub accounts\n  /// @param subAccount The sub account address to withdraw to (must be whitelisted)\n  /// @param amount The amount of collateral tokens to withdraw\n  function withdrawFromVaultWithoutRedeemingShares(\n    address subAccount,\n    uint256 amount\n  ) external nonReentrant onlyOperator {\n    IEmberProtocolConfig configProxy = protocolConfig;\n\n    // Check protocol is not paused\n    if (configProxy.getProtocolPauseStatus()) revert ProtocolPaused();\n\n    // Check that privileged operations are not paused\n    if (pauseStatus.privilegedOperations) revert OperationPaused();\n\n    // Check sub account is whitelisted\n    if (!subAccounts[subAccount]) revert InvalidValue();\n\n    // Check amount is valid\n    if (amount == 0) revert ZeroAmount();\n\n    // Check vault has sufficient balance\n    uint256 vaultBalance = IERC20(asset()).balanceOf(address(this));\n    if (amount > vaultBalance) revert InsufficientBalance();\n\n    uint256 previousBalance = vaultBalance;\n\n    // Transfer collateral tokens to sub account using SafeERC20\n    IERC20(asset()).safeTransfer(subAccount, amount);\n\n    uint256 newBalance = IERC20(asset()).balanceOf(address(this));\n\n    // Increment sequence number\n    _incrementSequence();\n\n    uint256 currentTime = _getChainTimestampMs();\n    uint256 currentSequenceNumber = sequenceNumber;\n\n    emit VaultWithdrawalWithoutRedeemingShares(\n      address(this),\n      subAccount,\n      previousBalance,\n      newBalance,\n      amount,\n      currentTime,\n      currentSequenceNumber\n    );\n  }\n\n  /// @notice Processes withdrawal requests from the queue\n  /// @dev Only the vault operator can call this function\n  /// @param numRequests The number of requests to process\n  function processWithdrawalRequests(uint256 numRequests) external nonReentrant onlyOperator {\n    IEmberProtocolConfig configProxy = protocolConfig;\n\n    // Check protocol is not paused\n    if (configProxy.getProtocolPauseStatus()) revert ProtocolPaused();\n\n    // Check privileged operations are not paused\n    if (pauseStatus.privilegedOperations) revert OperationPaused();\n\n    if (numRequests == 0) revert ZeroAmount();\n\n    // Settle accrued time-based fees BEFORE burning any shares. The fee base nets accrued\n    // out of TVL, and the shares redeemed here were under management for the whole elapsed\n    // window (they remain in totalSupply until burned here). Charging after the burn loop\n    // prices that window against the post-burn (smaller) TVL and under-collects. Charge\n    // first to match the instant redeem/burn path.\n    _chargeAccruedPlatformFees();\n\n    // Increment sequence number\n    _incrementSequence();\n\n    // Cache storage variables\n    uint256 startIndex = withdrawalQueueStartIndex;\n    uint256 queueLength = pendingWithdrawals.length;\n\n    // Limit numRequests to available requests\n    {\n      uint256 availableRequests = queueLength > startIndex ? queueLength - startIndex : 0;\n      if (numRequests > availableRequests) {\n        numRequests = availableRequests;\n      }\n    }\n\n    uint256 currentTime = _getChainTimestampMs();\n    uint256[5] memory counters; // [totalSharesBurnt, totalRequestProcessed, totalAmountWithdrawn, requestsSkipped, requestsCancelled]\n\n    // Process requests\n    for (uint256 i = 0; i < numRequests; ) {\n      WithdrawalRequest memory request = pendingWithdrawals[startIndex];\n\n      // Delete the processed entry to free storage and get gas refund\n      delete pendingWithdrawals[startIndex];\n\n      unchecked {\n        startIndex++;\n        i++;\n      }\n\n      (bool skipped, bool cancelled, uint256 withdrawAmount, uint256 sharesBurnt) = _processRequest(\n        request,\n        currentTime\n      );\n\n      unchecked {\n        counters[1]++; // totalRequestProcessed\n        counters[0] += sharesBurnt; // totalSharesBurnt\n        counters[2] += withdrawAmount; // totalAmountWithdrawn\n        if (skipped) counters[3]++; // requestsSkipped\n        if (cancelled) counters[4]++; // requestsCancelled\n      }\n    }\n\n    // Reset queue if empty (prevents unbounded growth)\n    if (startIndex >= queueLength) {\n      // Queue is empty - reset everything\n      delete pendingWithdrawals;\n      withdrawalQueueStartIndex = 0;\n    } else {\n      // Queue still has items - just update start index\n      withdrawalQueueStartIndex = startIndex;\n    }\n\n    emit ProcessRequestsSummary(\n      address(this),\n      counters[1], // totalRequestProcessed\n      counters[3], // requestsSkipped\n      counters[4], // requestsCancelled\n      counters[0], // totalSharesBurnt\n      counters[2], // totalAmountWithdrawn\n      totalSupply(),\n      balanceOf(address(this)),\n      rate.value,\n      sequenceNumber\n    );\n  }\n\n  /// @notice Get pending withdrawal request at index (accounting for start index)\n  /// @param index The index of the request (0-based from start index)\n  /// @return The withdrawal request at the given index\n  function getPendingWithdrawal(uint256 index) external view returns (WithdrawalRequest memory) {\n    uint256 startIndex = withdrawalQueueStartIndex;\n    uint256 queueLength = pendingWithdrawals.length;\n    if (startIndex + index >= queueLength) revert IndexOutOfBounds();\n    return pendingWithdrawals[startIndex + index];\n  }\n\n  /// @notice Get the effective length of the pending withdrawals queue\n  /// @return The number of unprocessed withdrawal requests\n  function getPendingWithdrawalsLength() external view returns (uint256) {\n    uint256 startIndex = withdrawalQueueStartIndex;\n    uint256 queueLength = pendingWithdrawals.length;\n    return queueLength > startIndex ? queueLength - startIndex : 0;\n  }\n\n  /**\n   * @dev Get the contract version\n   * @return Version number\n   */\n  function version() external pure virtual returns (string memory) {\n    return \"v2.3.1\";\n  }\n\n  /// @notice Get the vault name (legacy function for backwards compatibility)\n  /// @return The vault name\n  function vaultName() external view returns (string memory) {\n    return _vaultName;\n  }\n\n  // ============================================\n  // ERC-4626 Overrides\n  // ============================================\n\n  /**\n   * @notice Returns total assets under management\n   * @dev Overrides ERC4626 totalAssets - calculates from total shares divided by vault rate\n   * @dev Note: This is a calculated value based on the rate-based conversion system,\n   *      not the actual token balance (which may differ due to operator withdrawals)\n   * @return Total assets in the vault based on current rate\n   */\n  function totalAssets() public view virtual override returns (uint256) {\n    // Calculate total assets based on total shares and vault rate\n    // assets = shares / rate (using rate-based conversion)\n    uint256 shares = totalSupply();\n    if (shares == 0) {\n      return 0;\n    }\n    return convertToAssets(shares);\n  }\n\n  /**\n   * @notice Internal conversion function from assets to shares using rate-based conversion\n   * @dev Overrides ERC4626 pool-based conversion with custom rate-based formula\n   * @dev Formula: shares = assets * rate\n   * @dev The rounding parameter is kept for interface compatibility but unused in rate-based conversion\n   * @param assets The amount of assets to convert\n   * @return The equivalent amount of shares\n   */\n  function _convertToShares(\n    uint256 assets,\n    Math.Rounding /* rounding */\n  ) internal view virtual override returns (uint256) {\n    // Use rate-based conversion instead of pool-based\n    // shares = assets * rate\n    uint256 rateValue = rate.value;\n    if (rateValue == 0) {\n      return 0;\n    }\n    return FixedPointMath.mul(assets, rateValue);\n  }\n\n  /**\n   * @notice Internal conversion function from shares to assets using rate-based conversion\n   * @dev Overrides ERC4626 pool-based conversion with custom rate-based formula\n   * @dev Formula: assets = shares / rate (with ceiling for Ceil rounding)\n   * @param shares The amount of shares to convert\n   * @param rounding The rounding direction (Down or Ceil)\n   * @return The equivalent amount of assets\n   */\n  function _convertToAssets(\n    uint256 shares,\n    Math.Rounding rounding\n  ) internal view virtual override returns (uint256) {\n    // Use rate-based conversion instead of pool-based\n    // assets = shares / rate\n    uint256 rateValue = rate.value;\n    if (rateValue == 0 || shares == 0) {\n      return 0;\n    }\n\n    // Use ceiling division for Ceil rounding (used in mint operations)\n    // Use regular division for Down rounding (used in withdraw operations)\n    if (rounding == Math.Rounding.Ceil) {\n      return FixedPointMath.divCeil(shares, rateValue);\n    } else {\n      return FixedPointMath.div(shares, rateValue);\n    }\n  }\n\n  /**\n   * @notice Standard ERC-4626 withdraw is disabled\n   * @dev Users must use redeemShares() and wait for processWithdrawalRequests()\n   */\n  function withdraw(uint256, address, address) public virtual override returns (uint256) {\n    revert UseRedeemShares();\n  }\n\n  /**\n   * @notice Standard ERC-4626 redeem is disabled\n   * @dev Users must use redeemShares() and wait for processWithdrawalRequests()\n   */\n  function redeem(uint256, address, address) public virtual override returns (uint256) {\n    revert UseRedeemShares();\n  }\n\n  /**\n   * @notice Returns the maximum assets the owner would receive if they redeemed all their shares\n   * @dev This is an estimate based on current rate. Actual withdrawal requires requestRedeem flow.\n   *      Note: Instant withdrawals are disabled - users must use requestRedeem and wait for processing.\n   * @param account The address of the share owner\n   * @return Maximum assets the owner would receive at current rate\n   */\n  function maxWithdraw(address account) public view virtual override returns (uint256) {\n    uint256 ownerShares = balanceOf(account);\n    if (ownerShares == 0) {\n      return 0;\n    }\n    // Convert shares to assets using rate-based conversion\n    return convertToAssets(ownerShares);\n  }\n\n  /**\n   * @notice Returns the maximum shares the owner can redeem (their full balance)\n   * @dev This represents all shares the owner holds. Actual redemption requires requestRedeem flow.\n   *      Note: Instant redemptions are disabled - users must use requestRedeem and wait for processing.\n   * @param account The address of the share owner\n   * @return Maximum shares the owner can redeem\n   */\n  function maxRedeem(address account) public view virtual override returns (uint256) {\n    return balanceOf(account);\n  }\n\n  /**\n   * @notice Returns the maximum amount that can be deposited\n   * @dev Returns remaining capacity until maxTVL is reached, or 0 if deposits are paused\n   */\n  function maxDeposit(address) public view virtual override returns (uint256) {\n    if (pauseStatus.deposits || protocolConfig.getProtocolPauseStatus()) {\n      return 0;\n    }\n    uint256 currentTVL = totalAssets();\n    if (currentTVL >= maxTVL) {\n      return 0;\n    }\n    return maxTVL - currentTVL;\n  }\n\n  /**\n   * @notice Returns the maximum shares that can be minted\n   * @dev Based on remaining TVL capacity\n   */\n  function maxMint(address) public view virtual override returns (uint256) {\n    if (pauseStatus.deposits || protocolConfig.getProtocolPauseStatus()) {\n      return 0;\n    }\n    uint256 currentTVL = totalAssets();\n    if (currentTVL >= maxTVL) {\n      return 0;\n    }\n    uint256 remainingCapacity = maxTVL - currentTVL;\n    // Convert remaining capacity to shares using rate-based conversion\n    return convertToShares(remainingCapacity);\n  }\n\n  /**\n   * @notice ERC-4626 deposit - deposits assets and mints shares\n   * @dev Overrides base implementation with custom logic\n   * @param assets Amount of assets to deposit\n   * @param receiver Address to receive the shares\n   * @return shares Amount of shares minted\n   */\n  function deposit(\n    uint256 assets,\n    address receiver\n  ) public virtual override nonReentrant returns (uint256 shares) {\n    _enforceDepositGate();\n    return _deposit(assets, receiver, msg.sender);\n  }\n\n  /**\n   * @notice Deposits assets using ERC20 Permit for gasless approval\n   * @dev Combines permit approval and deposit in a single transaction\n   * @dev Requires the underlying collateral token to support ERC20 Permit (EIP-2612)\n   * @param assets Amount of assets to deposit\n   * @param receiver Address to receive the shares\n   * @param deadline Permit signature deadline\n   * @param v Permit signature v component\n   * @param r Permit signature r component\n   * @param s Permit signature s component\n   * @return shares Amount of shares minted\n   */\n  function depositWithPermit(\n    uint256 assets,\n    address receiver,\n    uint256 deadline,\n    uint8 v,\n    bytes32 r,\n    bytes32 s\n  ) external nonReentrant returns (uint256 shares) {\n    _enforceDepositGate();\n    // Call permit on the underlying asset - reverts naturally if unsupported\n    IERC20Permit(asset()).permit(msg.sender, address(this), assets, deadline, v, r, s);\n    return _deposit(assets, receiver, msg.sender);\n  }\n\n  /**\n   * @notice ERC-4626 mint - mints exact shares by depositing required assets\n   * @dev Overrides base implementation with custom logic\n   * @param shares Amount of shares to mint\n   * @param receiver Address to receive the shares\n   * @return assets Amount of assets deposited\n   */\n  function mint(\n    uint256 shares,\n    address receiver\n  ) public virtual override nonReentrant returns (uint256 assets) {\n    _enforceDepositGate();\n    return _mintShares(shares, receiver, msg.sender);\n  }\n\n  /**\n   * @notice Mints exact shares using ERC20 Permit for gasless approval\n   * @dev Combines permit approval and mint in a single transaction\n   * @dev Requires the underlying collateral token to support ERC20 Permit (EIP-2612)\n   * @param shares Amount of shares to mint\n   * @param receiver Address to receive the shares\n   * @param deadline Permit signature deadline\n   * @param v Permit signature v component\n   * @param r Permit signature r component\n   * @param s Permit signature s component\n   * @return assets Amount of assets deposited\n   */\n  function mintWithPermit(\n    uint256 shares,\n    address receiver,\n    uint256 deadline,\n    uint8 v,\n    bytes32 r,\n    bytes32 s\n  ) external nonReentrant returns (uint256 assets) {\n    _enforceDepositGate();\n    // Calculate assets required first to know the approval amount\n    if (shares == 0) revert ZeroAmount();\n    assets = _convertToAssets(shares, Math.Rounding.Ceil);\n    if (assets == 0) revert ZeroAmount();\n    // Call permit on the underlying asset - reverts naturally if unsupported\n    IERC20Permit(asset()).permit(msg.sender, address(this), assets, deadline, v, r, s);\n    return _mintShares(shares, receiver, msg.sender);\n  }\n\n  /// @notice Get the current chain timestamp in milliseconds\n  /// @return Timestamp in milliseconds\n  function getChainTimestampMs() public view returns (uint256) {\n    return _getChainTimestampMs();\n  }\n\n  /// @notice Get the account state for a given address\n  /// @param accountAddress The address of the account to query\n  /// @return totalPendingWithdrawalShares The total amount of shares pending for withdrawal\n  /// @return pendingWithdrawalRequestSequenceNumbers Array of sequence numbers for pending withdrawal requests\n  /// @return cancelWithdrawRequestSequenceNumbers Array of sequence numbers for cancelled withdrawal requests\n  function getAccountState(\n    address accountAddress\n  )\n    public\n    view\n    returns (\n      uint256 totalPendingWithdrawalShares,\n      uint256[] memory pendingWithdrawalRequestSequenceNumbers,\n      uint256[] memory cancelWithdrawRequestSequenceNumbers\n    )\n  {\n    Account storage account = accounts[accountAddress];\n    return (\n      account.totalPendingWithdrawalShares,\n      account.pendingWithdrawalRequestSequenceNumbers,\n      account.cancelWithdrawRequestSequenceNumbers\n    );\n  }\n\n  /// @notice Internal function to get the current chain timestamp in milliseconds\n  /// @return Timestamp in milliseconds\n  function _getChainTimestampMs() internal view returns (uint256) {\n    return block.timestamp * 1000;\n  }\n\n  /// @notice Internal helper to increment the sequence number\n  function _incrementSequence() internal {\n    unchecked {\n      sequenceNumber++;\n    }\n  }\n\n  /**\n   * @dev Function that authorizes an upgrade to a new implementation.\n   *      Authorization is handled by the onlyOwner modifier.\n   * @param newImplementation Address of the new implementation (unused, validated by UUPS)\n   */\n  function _authorizeUpgrade(address newImplementation) internal override onlyOwner {\n    // solhint-disable-next-line no-empty-blocks\n    // Authorization is handled by onlyOwner modifier; no additional logic needed\n  }\n\n  /// @notice Internal function to charge accrued platform fees\n  /// @dev Calculates fees based on TVL, fee percentage, and elapsed time\n  function _chargeAccruedPlatformFees() internal {\n    uint256 currentTime = _getChainTimestampMs();\n\n    // Cache storage variables\n    uint256 lastChargedAt = platformFee.lastChargedAt;\n    uint256 feePercentage = platformFee.platformFeePercentage;\n    uint256 accruedFees = platformFee.accrued;\n\n    // Calculate elapsed time in milliseconds\n    if (currentTime <= lastChargedAt) {\n      return; // No time has passed or time went backwards\n    }\n\n    uint256 elapsedTimeMs;\n    unchecked {\n      elapsedTimeMs = currentTime - lastChargedAt;\n    }\n\n    // Get TVL\n    uint256 tvl = totalAssets();\n\n    if (tvl == 0) {\n      // Update last charged time even if TVL is 0\n      platformFee.lastChargedAt = currentTime;\n      return;\n    }\n\n    // Calculate TVL available for fee calculation (exclude already accrued fees)\n    // This prevents fees from compounding on themselves\n    uint256 tvlForFeeCalc = tvl > accruedFees ? tvl - accruedFees : 0;\n\n    if (tvlForFeeCalc == 0) {\n      // Update last charged time even if net TVL is 0\n      platformFee.lastChargedAt = currentTime;\n      return;\n    }\n\n    // FEE_DENOMINATOR = 1e18 * 365 * 24 * 60 * 60 * 1000 = 31_536_000_000_000_000_000_000_000_000\n    // fee_amount = (tvlForFeeCalc * fee_percentage * elapsed_time_ms) / FEE_DENOMINATOR\n    // Note: feePercentage is already in 1e18 format, and FEE_DENOMINATOR includes 1e18,\n    // so we should NOT divide by 1e18 separately\n\n    // Calculate fee amount on net TVL: (tvlForFeeCalc * fee_percentage * elapsed_time_ms) / FEE_DENOMINATOR\n    // Use safe math to prevent overflow - break into steps to avoid intermediate overflow\n    uint256 temp = tvlForFeeCalc * feePercentage;\n    // Then multiply by elapsed time\n    uint256 numerator = temp * elapsedTimeMs;\n    uint256 feeAmount = numerator / FEE_DENOMINATOR;\n\n    // Always advance lastChargedAt so the same elapsed period isn't priced again later.\n    platformFee.lastChargedAt = currentTime;\n\n    // Skip sequence bump and event emission when there's nothing to record. Aligns with\n    // EmberETHVault._chargeAccruedPlatformFees so the two vaults emit the same way.\n    if (feeAmount == 0) return;\n\n    uint256 newAccrued;\n    unchecked {\n      newAccrued = platformFee.accrued + feeAmount;\n      platformFee.accrued = newAccrued;\n    }\n    _incrementSequence();\n\n    emit VaultPlatformFeeCharged(address(this), feeAmount, newAccrued, currentTime, sequenceNumber);\n  }\n\n  /// @notice Gates direct deposits/mints when a parking lot is set.\n  /// @dev No-op when `parkingLot` is address(0) (open deposits). Otherwise the caller must be\n  ///      the parking lot itself, OR be explicitly on the vault validator's deposit allow list\n  ///      (`depositAllowList[vault][caller]`) — letting trusted depositors keep depositing\n  ///      directly. Everyone else must route through the parking lot. Note this checks explicit\n  ///      allow-list membership, so an empty/inactive allow list lets only the parking lot in.\n  function _enforceDepositGate() internal view {\n    address lot = parkingLot;\n    if (lot == address(0) || msg.sender == lot) return;\n\n    IEmberVaultValidator v = vaultValidator;\n    if (address(v) != address(0) && v.depositAllowList(address(this), msg.sender)) {\n      return; // explicitly allow-listed direct depositor\n    }\n    revert UseParkingLot();\n  }\n\n  /// @notice Internal helper to validate deposit requirements\n  /// @param depositor Address of the depositor\n  /// @param configProxy Protocol config proxy\n  function _validateDeposit(address depositor, IEmberProtocolConfig configProxy) internal view {\n    if (configProxy.getProtocolPauseStatus()) revert ProtocolPaused();\n    if (pauseStatus.deposits) revert OperationPaused();\n    if (configProxy.isAccountBlacklisted(depositor)) revert Blacklisted();\n    if (subAccounts[depositor]) revert InvalidValue();\n    // The configured parking lot is implicitly allowed. Forwarded async deposits arrive with\n    // `depositor == parkingLot`, and the validator's direct-deposit allow-list must not gate them:\n    // if the allow-list is non-empty and the lot isn't on it, every forward would revert here,\n    // get caught by the parking lot's try/catch, and be silently skipped + refunded — a confusing\n    // total outage of async deposits. The lot is the protocol's own forwarder (the real depositor\n    // was already vetted at the lot), so the direct-deposit allow-list does not apply to it.\n    if (address(vaultValidator) != address(0) && depositor != parkingLot) {\n      vaultValidator.validateDeposit(address(this), depositor);\n    }\n  }\n\n  /// @notice Internal helper that implements the core deposit logic\n  /// @param assets Amount of assets to deposit\n  /// @param receiver Address to receive the shares\n  /// @param depositor Address of the depositor\n  /// @return shares Amount of shares minted\n  function _deposit(\n    uint256 assets,\n    address receiver,\n    address depositor\n  ) internal returns (uint256 shares) {\n    IEmberProtocolConfig configProxy = protocolConfig;\n\n    // Charge accrued platform fees\n    _chargeAccruedPlatformFees();\n\n    _validateDeposit(depositor, configProxy);\n\n    // Verify receiver is not blacklisted\n    if (configProxy.isAccountBlacklisted(receiver)) revert Blacklisted();\n\n    // Verify receiver is not a sub-account\n    if (subAccounts[receiver]) revert InvalidValue();\n\n    if (assets == 0) revert ZeroAmount();\n\n    // Transfer collateral from user to vault using SafeERC20\n    IERC20(asset()).safeTransferFrom(depositor, address(this), assets);\n\n    // Calculate shares to mint using rate-based conversion\n    shares = convertToShares(assets);\n\n    if (shares == 0) revert ZeroAmount();\n\n    // Mint shares to receiver\n    _mint(receiver, shares);\n\n    uint256 totalShares = totalSupply();\n\n    // Check TVL doesn't exceed maxTVL\n    uint256 currentTVL = totalAssets();\n    if (currentTVL > maxTVL) revert MaxTVLReached();\n\n    // Increment sequence number\n    _incrementSequence();\n\n    uint256 currentTime = _getChainTimestampMs();\n\n    // Record last deposit timestamp for time-based withdrawal fee calculation\n    if (address(vaultValidator) != address(0)) {\n      vaultValidator.recordDeposit(address(this), receiver, currentTime);\n    }\n\n    uint256 currentSequenceNumber = sequenceNumber;\n\n    emit VaultDeposit(\n      address(this),\n      depositor,\n      receiver,\n      assets,\n      shares,\n      totalShares,\n      currentTime,\n      currentSequenceNumber\n    );\n\n    return shares;\n  }\n\n  /// @notice Internal helper that implements the core mint logic\n  /// @param shares Amount of shares to mint\n  /// @param receiver Address to receive the shares\n  /// @param depositor Address of the depositor\n  /// @return assets Amount of assets deposited\n  function _mintShares(\n    uint256 shares,\n    address receiver,\n    address depositor\n  ) internal returns (uint256 assets) {\n    IEmberProtocolConfig configProxy = protocolConfig;\n    _chargeAccruedPlatformFees();\n\n    _validateDeposit(depositor, configProxy);\n\n    // Verify receiver is not blacklisted\n    if (configProxy.isAccountBlacklisted(receiver)) revert Blacklisted();\n\n    // Verify receiver is not a sub-account\n    if (subAccounts[receiver]) revert InvalidValue();\n\n    if (shares == 0) revert ZeroAmount();\n\n    // Calculate assets required using rate-based conversion with ceiling rounding\n    assets = _convertToAssets(shares, Math.Rounding.Ceil);\n    if (assets == 0) revert ZeroAmount();\n\n    // Transfer collateral from user to vault using SafeERC20\n    IERC20(asset()).safeTransferFrom(depositor, address(this), assets);\n\n    _mint(receiver, shares);\n    if (totalAssets() > maxTVL) revert MaxTVLReached();\n\n    _incrementSequence();\n\n    uint256 totalShares = totalSupply();\n    uint256 currentTime = _getChainTimestampMs();\n\n    // Record last deposit timestamp for time-based withdrawal fee calculation\n    if (address(vaultValidator) != address(0)) {\n      vaultValidator.recordDeposit(address(this), receiver, currentTime);\n    }\n\n    uint256 currentSequenceNumber = sequenceNumber;\n\n    emit VaultDeposit(\n      address(this),\n      depositor,\n      receiver,\n      assets,\n      shares,\n      totalShares,\n      currentTime,\n      currentSequenceNumber\n    );\n\n    return assets;\n  }\n\n  /// @notice Internal helper to update account state for a withdrawal request\n  /// @param request The withdrawal request\n  /// @param add Whether to add or subtract the shares\n  /// @param index An optional index indicating the index of request that got cancelled (use type(uint256).max for none)\n  function _updateAccountState(WithdrawalRequest memory request, bool add, uint256 index) internal {\n    if (add && index != type(uint256).max) revert InvalidRequest();\n\n    Account storage accountState = accounts[request.owner];\n\n    if (add) {\n      unchecked {\n        accountState.totalPendingWithdrawalShares += request.shares;\n      }\n      accountState.pendingWithdrawalRequestSequenceNumbers.push(request.sequenceNumber);\n    } else {\n      if (accountState.totalPendingWithdrawalShares < request.shares) revert InsufficientShares();\n      unchecked {\n        accountState.totalPendingWithdrawalShares -= request.shares;\n      }\n\n      // Find and remove the specific sequence number from the pending requests array\n      uint256[] storage pendingSeqNums = accountState.pendingWithdrawalRequestSequenceNumbers;\n      uint256 pendingLength = pendingSeqNums.length;\n      if (pendingLength == 0) revert InvalidRequest();\n\n      // Cache the sequence number to avoid repeated memory reads\n      uint256 reqSeqNum = request.sequenceNumber;\n\n      // Find the index of the sequence number to remove\n      uint256 seqNumIndex = 0;\n      bool found = false;\n      for (uint256 i; i < pendingLength; ) {\n        if (pendingSeqNums[i] == reqSeqNum) {\n          seqNumIndex = i;\n          found = true;\n          break;\n        }\n        unchecked {\n          ++i;\n        }\n      }\n\n      // If sequence number not found, revert\n      if (!found) revert InvalidRequest();\n\n      // Use swap-and-pop: move last element to the removed position, then pop\n      uint256 lastIndex = pendingLength - 1;\n      if (seqNumIndex != lastIndex) {\n        pendingSeqNums[seqNumIndex] = pendingSeqNums[lastIndex];\n      }\n      pendingSeqNums.pop();\n\n      // If this request was skipped due to cancellation, remove its sequence number\n      if (index != type(uint256).max) {\n        uint256[] storage cancelSeqNums = accountState.cancelWithdrawRequestSequenceNumbers;\n        uint256 cancelLength = cancelSeqNums.length;\n        // Defensive check: ensure index is within bounds\n        if (index < cancelLength) {\n          // Use swap-and-pop\n          unchecked {\n            uint256 lastCancelIndex = cancelLength - 1;\n            if (index != lastCancelIndex) {\n              cancelSeqNums[index] = cancelSeqNums[lastCancelIndex];\n            }\n          }\n          cancelSeqNums.pop();\n        }\n      }\n    }\n  }\n\n  /// @notice Internal helper to process a single withdrawal request\n  /// @dev NOTE: This function makes external calls (blacklist checks, token transfers) and is called in a loop\n  ///      by processWithdrawalRequests(). The loop is bounded by numRequests parameter to prevent excessive gas usage.\n  ///      External calls are necessary for security (blacklist checks) and functionality (token transfers).\n  /// @param request The withdrawal request to process\n  /// @param currentTime The current timestamp in milliseconds\n  /// @return skipped Whether the request was skipped\n  /// @return cancelled Whether the request was cancelled\n  /// @return withdrawAmount The amount withdrawn (0 if skipped)\n  /// @return sharesBurnt The number of shares burnt\n  function _processRequest(\n    WithdrawalRequest memory request,\n    uint256 currentTime\n  ) internal returns (bool skipped, bool cancelled, uint256 withdrawAmount, uint256 sharesBurnt) {\n    // Cache storage variables\n    IEmberProtocolConfig configProxy = protocolConfig;\n\n    // Calculate withdraw amount using rate-based conversion\n    withdrawAmount = convertToAssets(request.shares);\n\n    Account storage accountState = accounts[request.owner];\n    uint256[] storage cancelSeqNums = accountState.cancelWithdrawRequestSequenceNumbers;\n    uint256 numCancelledRequests = cancelSeqNums.length;\n\n    // Check if request was cancelled\n    bool isCancelled = false;\n    uint256 cancelIndex = type(uint256).max;\n    uint256 requestSeqNum = request.sequenceNumber;\n\n    for (uint256 i = 0; i < numCancelledRequests; ) {\n      if (cancelSeqNums[i] == requestSeqNum) {\n        isCancelled = true;\n        cancelIndex = i;\n        break;\n      }\n      unchecked {\n        i++;\n      }\n    }\n\n    cancelled = isCancelled;\n\n    // Determine the index to use for account state update\n    uint256 indexToUse = isCancelled ? cancelIndex : type(uint256).max;\n\n    // Check if request should be skipped (blacklisted owner/receiver, cancelled, or zero withdraw amount)\n    bool ownerBlacklisted = configProxy.isAccountBlacklisted(request.owner);\n    bool receiverBlacklisted = configProxy.isAccountBlacklisted(request.receiver);\n    bool shouldSkip = ownerBlacklisted || receiverBlacklisted || isCancelled || withdrawAmount == 0;\n\n    uint256 permanentFeeCharged = 0;\n    uint256 timeBasedFeeCharged = 0;\n\n    if (shouldSkip) {\n      // If skipped due to blacklisting or zero amount (not cancellation), set index to numCancelledRequests\n      if (!isCancelled) {\n        indexToUse = numCancelledRequests;\n      }\n\n      skipped = true;\n      withdrawAmount = 0;\n      sharesBurnt = 0; // No shares were burnt since request was skipped\n\n      // Return shares to owner (use _transfer to transfer from vault, not from msg.sender)\n      _transfer(address(this), request.owner, request.shares);\n    } else {\n      skipped = false;\n\n      // Calculate withdrawal fees via validator\n      if (address(vaultValidator) != address(0)) {\n        (permanentFeeCharged, timeBasedFeeCharged) = vaultValidator.calculateWithdrawalFees(\n          address(this),\n          request.owner,\n          withdrawAmount,\n          currentTime\n        );\n        uint256 totalFee = permanentFeeCharged + timeBasedFeeCharged;\n        if (totalFee > 0) {\n          withdrawAmount -= totalFee;\n        }\n      }\n\n      // Burn shares (they are already in the vault from redeemShares)\n      _burn(address(this), request.shares);\n      sharesBurnt = request.shares; // Shares were actually burnt\n\n      // Check vault has sufficient balance\n      if (IERC20(asset()).balanceOf(address(this)) < withdrawAmount) revert InsufficientBalance();\n\n      // Transfer funds to receiver using SafeERC20\n      IERC20(asset()).safeTransfer(request.receiver, withdrawAmount);\n    }\n\n    // Update account state\n    _updateAccountState(request, false, indexToUse);\n\n    // Cache values for event\n    uint256 totalShares = totalSupply();\n    uint256 totalSharesPendingToBurn = balanceOf(address(this));\n    uint256 currentSequenceNumber = sequenceNumber;\n\n    emit RequestProcessed(\n      address(this),\n      request.owner,\n      request.receiver,\n      request.shares,\n      withdrawAmount,\n      request.timestamp,\n      currentTime,\n      skipped,\n      cancelled,\n      totalShares,\n      totalSharesPendingToBurn,\n      currentSequenceNumber,\n      requestSeqNum\n    );\n\n    if (permanentFeeCharged > 0 || timeBasedFeeCharged > 0) {\n      emit WithdrawalFeeCharged(\n        address(this),\n        request.owner,\n        requestSeqNum,\n        permanentFeeCharged,\n        timeBasedFeeCharged\n      );\n    }\n  }\n}\n","deployed_bytecode":"0x60a0604052600436101561001257600080fd5b60003560e01c806301e1d1141461438857806306fdde03146142e957806307a2d13a146138a8578063095ea7b3146142365780630a28a477146142185780630ace9ca0146141e857806318160ddd146141bd57806323b872dd1461418557806326232a2e146141535780632c4e722e146141195780632da08052146140f0578063313ce567146140b657806337a7f8cf14613ec057806338a3c87814613e5757806338d52e0f14613e21578063392f5f6414613de4578063402d267d14613dc057806342749b5c14613d1157806345579ad114613b0f578063466916ca14613ad257806347bf474b146138d657806349d0ea97146138ad5780634cdad506146138a85780634f1ef286146136c557806350921b231461362e57806352d1902d146135c357806354fd4d501461357c5780635c7a68b3146134f85780635d78739a146134745780635e5c06e21461343a57806360132c9c1461341c57806363a0daac1461339357806364737b0b1461337557806364ca23ef146133575780636c184d59146131d65780636e553f651461319e57806370a082311461101e578063715018a61461313457806374f4f54714612f7a5780637ec0947814612eb65780638c2a993e14612e005780638da5cb5b14612dca57806392709e7414612d4657806394bf804d14612cf457806395d89b4114612c1e5780639707df4d14612b62578063983c676d146128a75780639ee2735b14612811578063a2cdb4071461262a578063a2f8bc18146125a6578063a9059cbb14612575578063ad3cb1cc1461252b578063b3d7f6b91461250d578063b4069af91461163e578063b460af9414611639578063ba08765214611639578063bd5d5768146115c6578063be7dc09b1461159d578063c3c224751461157f578063c55b6bb7146114b6578063c63d75b614611492578063c6e6f592146104a7578063cbe0130e146113c9578063cd475c5a146112f7578063ce96cb77146112d4578063d2045f6d146112b6578063d26a685e14611280578063d29e155a14611064578063d905777e1461101e578063da34250c14610fdf578063dd62ed3e14610f96578063e126430314610ec0578063e1bece8514610544578063e6150400146104cf578063eeb36eba146104ac578063ef8b30f7146104a7578063f1ead126146103da578063f2fde38b146103af5763f5efbb4f1461038157600080fd5b346103aa5760003660031901126103aa57600e546040516001600160a01b039091168152602090f35b600080fd5b346103aa5760203660031901126103aa576103d86103cb614401565b6103d361546c565b614b4b565b005b346103aa5760403660031901126103aa576103f3614401565b6103fb614417565b610403614e32565b600e546001600160a01b03929083163303610496578280600b54169116036104965781600c549116918260018060a01b0319831617600c55600160105401918260105561044e614eb1565b92604051938452602084015216907fabf0382cf5e7450b27a0c3b50f29baceb2bb1747e229bda15ca066ee224fc4cf60403092a46001600080516020615ad283398151915255005b6040516282b42960e81b8152600490fd5b614218565b346103aa5760003660031901126103aa5760206104c7614eb1565b604051908152f35b346103aa5760203660031901126103aa576004356011548110156103aa576104f860c0916146a7565b5060018060a01b039081815416916001820154169060028101546003820154906005600484015493015493604051958652602086015260408501526060840152608083015260a0820152f35b346103aa5760203660031901126103aa57600435610560614e32565b600c546001600160a01b0316330361049657600e5460405163019db35d60e11b81528291602090829060049082906001600160a01b03165afa908115610cde57600091610ea1575b50610e8f5760ff600f5460101c16610e7e578015610e6c576105c86151c8565b6001601054016010556012549060115490828211600014610e63576105ed83836148a6565b80915b11610e5b575b506105ff614eb1565b92604051938460a08101106001600160401b0360a087011117610e455760a0850160405260a03686376000915b8083106107a257505050811061079a575060115460006011558061070b575b5060006012555b60208101519060608101519060808101519060408151910151600080516020615a528339815191525490306000526000805160206159f2833981519152602052604060002054926007549460105496604051988952602089015260408801526060870152608086015260a085015260c084015260e08301526101008201527f392542f20039b266992ba103307d2d1062cb8eb9e6a245970cbd5371ffc0d17b6101203092a26001600080516020615ad283398151915255005b600690806006029060068204036107845760116000527f31ecc21a745e3968a04e9570e4425bc18fa8019c68028196b546d1669c200c68908101905b81811061075557505061064b565b806000849255600060018201556000600282015560006003820155600060048201556000600582015501610747565b634e487b7160e01b600052601160045260246000fd5b601255610652565b6107b66107b08694966146a7565b50614854565b926107c0816146a7565b610e2f57600191600060058382869555828582015582600282015582600382015582600482015501550195019260018060a01b03600e5416906108066040820151614c4d565b81516001600160a01b03166000908152601360205260408120600201805460a08501519295939092909160001990875b858110610e02575b50508615610df9575b8551604051630f1d76c160e01b81526001600160a01b03909116600482015294909390602086602481845afa958615610cde57600096610dd8575b50602087810151604051630f1d76c160e01b81526001600160a01b03909116600482015291829060249082905afa908115610cde57600091610da9575b508515610da1575b508415610d99575b8415610d90575b600092600095600014610bfb57508615610bf3575b5060019460009460009461090e60018060a01b0384511660408501519030614d56565b60018060a01b0383511660005260136020526040600020805460408501518110610be15760408501519003815560018101548015610ba05760a085015160009060009060005b848110610bb2575b505015610ba0578160001981011161078457600182820301610b71575b5050610987600182016155b7565b60018201610aff575b5050600080516020615a5283398151915254306000526000805160206159f28339815191526020526040600020548b60105460018060a01b038651169260018060a01b036020880151169460408801519360808901516040519586528d6020870152604086015260608501528c151560808501528d151560a085015260c084015260e0830152610100820152856101208201527f14239ade46d853ae1a98641c2a237d05a11e24ff2678eb6bf0e409953779a0576101403092a48315801590610af6575b610aa4575b50505050600160208b01510160208b015289510189526040890151016040890152610a94575b1561062c57608086016001815101905261062c565b6060870160018151019052610a7f565b9051604080519384526020840194909452928201526001600160a01b039091169030907f4bc1a4a73c07fffa8f0f6fcb5eee620223fa56322bafaa97c2447ffba146156d90606090a38a808080610a59565b50801515610a54565b600201805491828110610b13575b50610990565b610b2b926000190190818103610b33575b50506155b7565b8e8080610b0d565b610b51610b43610b6a9385614984565b90549060031b1c9184614984565b90919082549060031b91821b91600019901b1916179055565b3880610b24565b610b51610b88610b99936000190160018601614984565b90549060031b1c9160018501614984565b3880610979565b6040516341abc80160e01b8152600490fd5b81610bc08260018901614984565b90549060031b1c14610bd457600101610954565b925050506001388061095c565b604051633999656760e01b8152600490fd5b92508c6108eb565b60175460009791969192506001600160a01b031680610cea575b50610c246040830151306154a5565b604082810151600080516020615ab28339815191525491516370a0823160e01b81523060048201529096916001600160a01b031690602081602481855afa8015610cde578991600091610ca9575b5010610c97576020840151610c929189916001600160a01b031690614e62565b61090e565b604051631e9acf1760e31b8152600490fd5b9150506020813d602011610cd6575b81610cc56020938361452c565b810103126103aa5788905138610c72565b3d9150610cb8565b6040513d6000823e3d90fd5b935050604060018060a01b038251166084825180968193631145b00f60e31b835230600484015260248301528960448301528d60648301525afa8015610cde57600093600091610d57575b50610d408185614847565b8015610c1557610d5091966148a6565b948e610c15565b9350506040833d604011610d88575b81610d736040938361452c565b810103126103aa57602083519301518e610d35565b3d9150610d66565b821594506108d6565b8694506108cf565b94508d6108c7565b610dcb915060203d602011610dd1575b610dc3818361452c565b8101906147d9565b8e6108bf565b503d610db9565b610df291965060203d602011610dd157610dc3818361452c565b948e610882565b50600019610847565b83610e0d8284614984565b90549060031b1c14610e2157600101610836565b975050506001958d8061083e565b634e487b7160e01b600052600060045260246000fd5b634e487b7160e01b600052604160045260246000fd5b9250836105f6565b600080916105f0565b604051631f2a200560e01b8152600490fd5b60405162332c3760e81b8152600490fd5b604051634427925560e01b8152600490fd5b610eba915060203d602011610dd157610dc3818361452c565b836105a8565b346103aa5760403660031901126103aa57610ed9614401565b610ee1614417565b610ee9614e32565b600e546001600160a01b03929083163303610496578280600b54169116036104965760185491808316911691828214610f84576001600160a01b03191682176018556010805460010190819055610f3e614eb1565b9060405191825260208201527fe05c3a6b7b6fb5d4d6824af1b72178068db41a4034bd894aafb5f37a0862263460403092a46001600080516020615ad283398151915255005b60405163c23f6ccb60e01b8152600490fd5b346103aa5760403660031901126103aa57610faf614401565b610fc0610fba614417565b9161459f565b9060018060a01b03166000526020526020604060002054604051908152f35b346103aa5760203660031901126103aa576001600160a01b03611000614401565b166000526003602052602060ff604060002054166040519015158152f35b346103aa5760203660031901126103aa5760206104c761103c614401565b6001600160a01b031660009081526000805160206159f2833981519152602052604090205490565b346103aa5760603660031901126103aa5761107d614401565b506024356001600160401b0381116103aa5761109d90369060040161460c565b906110a6614698565b916110af614e32565b600e546001600160a01b03163303610496576110cc368284614568565b602081519101206000907f5f64eae0fc590a819e523a183a9fd4edc3a1c8c4a7b48218351d61312d3f0ea981146000146111ab5750600f548415158060ff8316151503611193575b50505b15610f84577f2f5a2354fe3af45a0eca3f54b24ff976ddb44f0fce1b11ea34ca93f0bd8d05cf916001601054019081601055611167611154614eb1565b9160405194608086526080860191614a52565b9415156020840152604083015260608201528030930390a26001600080516020615ad283398151915255005b60ff919250169060ff191617600f5560018480611114565b7f8f920a39984cc439587762c50a220d6cc5590b1c4ecb08553287920ec5b8472e810361120d5750600f548415158060ff8360081c161515036111f0575b5050611117565b61ff0091925060081b169061ff00191617600f55600184806111e9565b7fa63f24cc1ddfba9aba789f3526150f9502ed673269c23a73c2ee48f83d667d740361126e57600f548415158060ff8360101c1615150361124f575050611117565b62ff000091925060101b169062ff0000191617600f55600184806111e9565b604051632a9ffab760e21b8152600490fd5b346103aa5760003660031901126103aa57601254601154818111156112ab576020916104c7916148a6565b5050602060006104c7565b346103aa5760003660031901126103aa576020600154604051908152f35b346103aa5760203660031901126103aa5760206104c76112f2614401565b614b04565b346103aa5760603660031901126103aa57611310614401565b611318614417565b90611321614698565b9161132a614e32565b600e546001600160a01b03929083163303610496578280600b541691160361049657169081600052600360205260406000209015159060ff1981541660ff83161790556001601054018060105561137f614eb1565b604051928352602083015260408201527f9e675b24cc7385aaade7e2a734dbac9e591abf9c239e11336f6b582868af3c3f60603092a36001600080516020615ad283398151915255005b346103aa5760403660031901126103aa576113e2614401565b602435906113ee614e32565b600e546001600160a01b0390811633036104965780600b5416911603610496576114166151c8565b7fe55193f6ef36646764379f90bc58ad4b10a3a0fdfb49ede367ff57b04e1b9fd26006549180600655600160105401908160105561147b611455614eb1565b926040519384933097859094939260609260808301968352602083015260408201520152565b0390a26001600080516020615ad283398151915255005b346103aa5760203660031901126103aa576114ab614401565b5060206104c7614a73565b346103aa5760403660031901126103aa576114cf614401565b6114d7614417565b6114df614e32565b600e546001600160a01b03929083163303610496578280600080516020615a3283398151915254169116036104965781600b549116918260018060a01b0319831617600b556001601054019182601055611537614eb1565b92604051938452602084015216907f580ae3f4445324f6fb6182e19b568f2ce59fb7550d3d3a9016130507ba807ea860403092a46001600080516020615ad283398151915255005b346103aa5760003660031901126103aa576020601554604051908152f35b346103aa5760003660031901126103aa576014546040516001600160a01b039091168152602090f35b346103aa5760403660031901126103aa576115df614401565b6115e7614417565b6115ef614e32565b600e546001600160a01b03929083163303610496578280600b5416911603610496571660018060a01b031960175416176017556001600080516020615ad283398151915255600080f35b614657565b346103aa576003196080368201126103aa57611658614401565b611660614417565b916001600160401b03604435116103aa5761016090604435360301126103aa576040519161016083018381106001600160401b03821117610e4557604052604435600401356001600160401b0381116103aa576116c590600436916044350101614639565b8352602460443501356001600160401b0381116103aa576116ee90600436916044350101614639565b6020840152611700604480350161442d565b604084015261171360646044350161442d565b606084015261172660846044350161442d565b608084015261173960a46044350161442d565b60a084015260443560c481013560c085015260e481013560e085015261010481013561010085015261012481013561012085015261014401356101408401526001600160401b03606435116103aa573660236064350112156103aa576001600160401b036064356004013511610e4557604051906117c360206064356004013560051b018361452c565b60643560040135825260208201803660246064356004013560051b6064350101116103aa57602460643501905b60246064356004013560051b606435010182106124f5575050600080516020615b1283398151915254916001600160401b03831615806124e7575b60016001600160401b0385161490816124dd575b1590816124d4575b506124c25760016001600160401b0319841617600080516020615b128339815191525560ff8360401c1615612495575b6001600160a01b03851615611e4d5760608601516001600160a01b031615611e4d5760808601516001600160a01b031615611e4d5760a08601516001600160a01b031615611e4d57606086015160808701516001600160a01b03918216911681811491821561247e575b508115612467575b5061126e5760408601516001600160a01b031615611e4d57610120860151604051636347b4f760e01b8152906020826004816001600160a01b038b165afa918215610cde57600092612433575b501080156123c2575b6123b05760c08601511561239e5760e0860151604051633d3f7e8360e11b8152906020826004816001600160a01b038b165afa918215610cde5760009261236a575b501161126e57855160208701519061199761588f565b61199f61588f565b8051906001600160401b038211610e45576119c86000805160206159d283398151915254614701565b601f81116122fc575b50602090601f831160011461225957611a03929160009183612156575b50508160011b916000199060031b1c19161790565b6000805160206159d2833981519152555b8051906001600160401b038211610e4557611a3d600080516020615a1283398151915254614701565b601f81116121eb575b50602090601f8311600114612161579180611a7c92611afa95946000926121565750508160011b916000199060031b1c19161790565b600080516020615a12833981519152555b60408701516001600160a01b0316611aa361588f565b611aab61588f565b611ab4816158ee565b901561214d57905b600080516020615ab283398151915280546001600160a81b03191660a09390931b60ff60a01b1692909217179055611af261588f565b6103d361588f565b611b0261588f565b611b0a61588f565b611b1261588f565b6001600080516020615ad283398151915255600e80546001600160a01b0319166001600160a01b0386161790558451511561126e5761010085015115610e6c5761014085015115610e6c5784518051906001600160401b038211610e4557611b8482611b7f600054614701565b6149fd565b602090601f83116001146120c657611bb49291600091836120bb5750508160011b916000199060031b1c19161790565b6000555b610140850151600155610100850151600255611bd2614eb1565b9360e08601518060408051611be6816144f6565b60008152886020820152015260006004558560055560065560405163aa12543760e01b815260208160048160018060a01b0386165afa908115610cde57600091612089575b5060c0870151610120880151916040518060808101106001600160401b03608083011117610e455760608160808b9301604052838152846020820152856040820152015260075560085560095584600a5560018060a01b0360608701511660405190630f1d76c160e01b8252600482015260208160248160018060a01b0386165afa908115610cde5760009161206a575b5061201a576080860151604051630f1d76c160e01b81526001600160a01b039182166004820152906020908290602490829086165afa908115610cde5760009161204b575b5061201a5760a0860151604051630f1d76c160e01b81526001600160a01b0391821660048201529160209183916024918391165afa908115610cde5760009161202c575b5061201a576060850151608086015160a0870151604080516001600160a01b03928316949383169390921691849190611d7d816144f6565b838152846020820152015260018060a01b0319600b541617600b5560018060a01b0319600c541617600c5560018060a01b0319600d541617600d5560005b8351811015611e5f57600581901b8401602001516001600160a01b0316908115611e4d5760608701516001600160a01b031682148015611e37575b8015611e21575b61126e57600191600052600360205260406000208260ff1982541617905501611dbb565b5060a08701516001600160a01b03168214611dfd565b5060808701516001600160a01b03168214611df6565b60405163d92e233d60e01b8152600490fd5b5083856000601055805190602081015190604060018060a01b03910151169560018060a01b03600b54169060018060a01b03600c54169060018060a01b03600d541690602060025491600654936008549560095497611eeb6007549a611eda6001549d6040516080526101e0806080515260805101906143a3565b9060805182038860805101526143a3565b9e604060805101526060608051015260808051015260a060805101526080518c0360c06080510152519a8b8152019760009a5b808c10611ff757505060ff995060e06080510152610100608051015261012060805101526101406080510152610160608051015261018060805101526101a0608051015260006101c060805101527f7ba25c704df0b6295b7e0ea25b4a39c849d2d23e3feea925186a2bf0bafa1d5030916080519003608051a260401c1615611fa357005b60ff60401b19600080516020615b128339815191525416600080516020615b12833981519152557fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602060405160018152a1005b81516001600160a01b03168a5260019b909b019a6020998a019990910190611f1e565b6040516309550c7760e01b8152600490fd5b612045915060203d602011610dd157610dc3818361452c565b86611d45565b612064915060203d602011610dd157610dc3818361452c565b87611d01565b612083915060203d602011610dd157610dc3818361452c565b87611cbc565b90506020813d6020116120b3575b816120a46020938361452c565b810103126103aa575187611c2b565b3d9150612097565b0151905088806119ee565b600080805292917f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563915b601f1984168510612132576001945083601f19811610612119575b505050811b01600055611bb8565b015160001960f88460031b161c1916905587808061210b565b818101518355602094850194600190930192909101906120f0565b50601290611abc565b015190508a806119ee565b90600080516020615a1283398151915260005260206000209160005b601f19851681106121d35750918391600193611afa9695601f198116106121ba575b505050811b01600080516020615a1283398151915255611a8d565b015160001960f88460031b161c1916905589808061219f565b9192602060018192868501518155019401920161217d565b600080516020615a128339815191526000527f46a2803e59a4de4e7a4c574b1243f25977ac4c77d5a1a4a609b5394cebb4a2aa601f840160051c810160208510612252575b601f830160051c82018110612246575050611a46565b60008155600101612230565b5080612230565b6000805160206159d2833981519152600090815292917f2ae08a8e29253f69ac5d979a101956ab8f8d9d7ded63fa7a83b16fc47648eab0915b601f19841685106122e1576001945083601f198116106122c8575b505050811b016000805160206159d283398151915255611a14565b015160001960f88460031b161c191690558980806122ad565b81810151835560209485019460019093019290910190612292565b6000805160206159d28339815191526000527f2ae08a8e29253f69ac5d979a101956ab8f8d9d7ded63fa7a83b16fc47648eab0601f840160051c810160208510612363575b601f830160051c820181106123575750506119d1565b60008155600101612341565b5080612341565b9091506020813d602011612396575b816123866020938361452c565b810103126103aa57519088611981565b3d9150612379565b604051636a43f8d160e01b8152600490fd5b6040516305fabb6160e41b8152600490fd5b50610120860151604051631857361b60e21b8152906020826004816001600160a01b038b165afa918215610cde576000926123ff575b501161193f565b9091506020813d60201161242b575b8161241b6020938361452c565b810103126103aa575190886123f8565b3d915061240e565b9091506020813d60201161245f575b8161244f6020938361452c565b810103126103aa57519088611936565b3d9150612442565b60a08801516001600160a01b0316149050876118e9565b60a08901516001600160a01b0316149150886118e1565b68ffffffffffffffffff1983166801000000000000000117600080516020615b1283398151915255611877565b60405163f92ee8a960e01b8152600490fd5b90501587611847565b303b15915061183f565b5060ff8360401c161561182b565b602080916125028461442d565b8152019101906117f0565b346103aa5760203660031901126103aa5760206104c7600435614bbf565b346103aa5760003660031901126103aa5761257160405161254b81614511565b60058152640352e302e360dc1b60208201526040519182916020835260208301906143a3565b0390f35b346103aa5760403660031901126103aa5761259b612591614401565b6024359033614d56565b602060405160018152f35b346103aa5760403660031901126103aa576125bf614401565b602435906125cb614e32565b600e546001600160a01b0390811633036104965780600b5416911603610496577faf012b1ff2011f0badfa5327c0027eab916991fa181cb95668cb91d869640f846009549180600955600160105401908160105561147b611455614eb1565b346103aa5760403660031901126103aa57612643614401565b6001600160401b036024358181116103aa5761266390369060040161460c565b91909261266e614e32565b600e546001600160a01b0390811633036104965780600b54169116036104965761269661473b565b908211610e45576126ac82611b7f600054614701565b600092601f831160011461276c576126fe83807f5b9253f728a28595515c0c13aeff4928b4f7575a65faed9686a5b81ec115092f9596600091612761575b508160011b916000199060031b1c19161790565b6000555b61273c6001601054019182601055612718614eb1565b9561272e604051956080875260808701906143a3565b918583036020870152614a52565b93604083015260608201528030930390a26001600080516020615ad283398151915255005b9050830135876126ea565b6000808052601f198416947f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5639160205b8782106127f9575050847f5b9253f728a28595515c0c13aeff4928b4f7575a65faed9686a5b81ec115092f9596106127df575b5050600184811b01600055612702565b820135600019600387901b60f8161c1916905584806127cf565b8060018495829495880135815501940192019061279c565b346103aa5760203660031901126103aa576001600160a01b03612832614401565b16600052601360205260406000208054612571600261287d604051946128668661285f81600185016149bf565b038761452c565b61287660405180948193016149bf565b038261452c565b61289960405194859485526060602086015260608501906145d8565b9083820360408501526145d8565b346103aa5760403660031901126103aa576004356128c3614417565b906128cc614815565b506128d5614e32565b600e5460405163019db35d60e11b81526020936001600160a01b0393928416918581600481865afa908115610cde57600091612b45575b50610e8f5760ff600f5460081c16610e7e57604051630f1d76c160e01b808252336004830152908681602481875afa908115610cde57600091612b28575b5061201a578491602487926040519485938492835216958660048301525afa908115610cde57600091612b0b575b5061201a578015611e4d576002548210610be157612997823033614c80565b6129a2823033614d56565b6129ab82614c4d565b9360016010540194856010556129bf614eb1565b91604051956129cd876144db565b33875281870194855260408701958652606087019283526080870193845260a08701978852601154600160401b811015610e4557806001612a1192016011556146a7565b610e2f57612571987fa860c7ba918bd53ab101f8fa1e1e8cee055aedf31b1d9c5b12401a91d79b17bd94612a9d92848b51169160018060a01b031983818454161783556001830190878c5116908254161790558a51600283015551600382015587516004820155600583519101556000526013845260016040600020918951835401835551910161499c565b6000805160206159f2833981519152600080516020615a5283398151915254923060005252612aea60406000205491808951169651169651945191601054906040519485943098866147f1565b0390a46001600080516020615ad28339815191525560405191829182614441565b612b229150853d8711610dd157610dc3818361452c565b85612978565b612b3f9150873d8911610dd157610dc3818361452c565b8761294a565b612b5c9150863d8811610dd157610dc3818361452c565b8661290c565b346103aa5760403660031901126103aa57612b7b614401565b612b83614417565b612b8b614e32565b600e546001600160a01b03929083163303610496578280600b54169116036104965781600d549116918260018060a01b0319831617600d556001601054019182601055612bd6614eb1565b92604051938452602084015216907faa7b0c7c6fd0cf2871410f0351872fc38289ba30c1d2bbce69801ecc6f580f5a60403092a46001600080516020615ad283398151915255005b346103aa5760003660031901126103aa57604051600080516020615a128339815191528054826000612c4f83614701565b9283835260209460019186600182169182600014612cd2575050600114612c93575b5050612c7f9250038361452c565b6125716040519282849384528301906143a3565b85925060005281600020906000915b858310612cba575050612c7f93508201018580612c71565b80548389018501528794508693909201918101612ca2565b9250935050612c7f94915060ff191682840152151560051b8201018580612c71565b346103aa5760403660031901126103aa576020612d2c612d12614417565b612d1a614e32565b612d22614ec7565b3390600435614f94565b6001600080516020615ad283398151915255604051908152f35b346103aa5760403660031901126103aa57612d5f614401565b60243590612d6b614e32565b600e546001600160a01b0390811633036104965780600b5416911603610496577f115a07d75a133acb9893ca5ea90040364eaa202319089bc8bbb680c20b1f308d6002549180600255600160105401908160105561147b611455614eb1565b346103aa5760003660031901126103aa57600080516020615a32833981519152546040516001600160a01b039091168152602090f35b346103aa5760403660031901126103aa57612e19614401565b602435612e24614e32565b6014546001600160a01b039081163303610496578216918215611e4d578115610e6c5781612e5991612e546151c8565b615550565b7ff6cce9a39dfad6ea6b603668e99eb3a1502136af6257359c819805bc2c2545a560016010540180601055600080516020615a5283398151915254612e9f611455614eb1565b0390a36001600080516020615ad283398151915255005b346103aa5760403660031901126103aa57612ecf614401565b612ed7614417565b612edf614e32565b600e546001600160a01b03929083163303610496578280600b54169116036104965760145491808316911691828214610f84576001600160a01b03191682176014556010805460010190819055612f34614eb1565b9060405191825260208201527f5166063541fd6563da14bd3fd7ed5ea88c8e5b8f00c98d4789d38b7410ab4f7060403092a46001600080516020615ad283398151915255005b346103aa5760403660031901126103aa57612f93614401565b602435612f9e614e32565b6014546001600160a01b0392908316330361049657828116928315611e4d578215610e6c57836000526020906000805160206159f283398151915282528360406000205410610be157600e541660405163019db35d60e11b81528281600481855afa908115610cde57600091613117575b50610e8f578160249160405192838092630f1d76c160e01b82528960048301525afa918215610cde576000926130fa575b505061201a5760155480151590816130f0575b506130de5760165480151590816130d4575b506130c2578161307c916130776151c8565b6154a5565b7f16fb7381242ae680ccbe83b8f7560299159d55ddb3060325d6f8049c3a75eba660016010540180601055600080516020615a5283398151915254612e9f611455614eb1565b604051637066db4560e11b8152600490fd5b9050821184613065565b604051630591c40b60e11b8152600490fd5b9050821084613053565b6131109250803d10610dd157610dc3818361452c565b8480613040565b61312e9150833d8511610dd157610dc3818361452c565b8661300f565b346103aa5760003660031901126103aa5761314d61546c565b600080516020615a3283398151915280546001600160a01b031981169091556000906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b346103aa5760403660031901126103aa576020612d2c6131bc614417565b6131c4614e32565b6131cc614ec7565b33906004356152b3565b346103aa576020806003193601126103aa57600435906131f4614e32565b600e5460405163019db35d60e11b8152908290829060049082906001600160a01b03165afa908115610cde5760009161333a575b50610e8f5760ff600f5460081c16610e7e5733600052601381526040600020805415610ba057600281019060008254905b81811061331b5750506001908101805460009291835b8281106132ef575b5050505015610ba0578061328e846132ac9361499c565b6060613298614eb1565b9360405195865285015260608401906149bf565b9060408301527f26a8ebe011d9df7dc41969463828f28aca8de2432684e98ab0802dedfec312c833928030930390a36001600080516020615ad283398151915255005b876132fa8284614984565b90549060031b1c1461330d57830161326f565b505050905084808080613277565b856133268286614984565b90549060031b1c14610ba057600101613259565b6133519150823d8411610dd157610dc3818361452c565b83613228565b346103aa5760003660031901126103aa576020601054604051908152f35b346103aa5760003660031901126103aa576020600254604051908152f35b346103aa5760603660031901126103aa576133ac614401565b60243590604435906133bc614e32565b600e546001600160a01b0390811633036104965780600b5416911603610496577f525a3e3b7e8f4cb6c1f7d97c77c7bcda7e468260ca0b572ad285f04348fd89fb908260155580601655600160105401908160105561147b611455614eb1565b346103aa5760003660031901126103aa576020601654604051908152f35b346103aa5760203660031901126103aa576001600160a01b0361345b614401565b1660005260136020526020604060002054604051908152f35b346103aa5760403660031901126103aa5761348d614401565b60243590613499614e32565b600e546001600160a01b0390811633036104965780600b5416911603610496577f81cba3db70153b4391f7ba791982067b5da23698c9cc17bec36baa0ca2e238706001549180600155600160105401908160105561147b611455614eb1565b346103aa5760403660031901126103aa57613511614401565b6024359061351d614e32565b600e546001600160a01b0390811633036104965780600b5416911603610496577f85d21a4da3a9ce4a976ba412337cce37ea05422537f1a7f7d69c16a66afb29796008549180600855600160105401908160105561147b611455614eb1565b346103aa5760003660031901126103aa5761257160405161359c81614511565b600681526576322e332e3160d01b60208201526040519182916020835260208301906143a3565b346103aa5760003660031901126103aa577f000000000000000000000000ab222201c5bd8a18dc6b340ba78a709589e017816001600160a01b0316300361361c576020604051600080516020615a728339815191528152f35b60405163703e46dd60e11b8152600490fd5b346103aa5761363c36614488565b949291613647614e32565b61364f614ec7565b600080516020615ab2833981519152546001600160a01b031690813b156103aa5760008094613697604051998a968795869463d505accf60e01b86528b303360048901614948565b03925af1918215610cde57602093612d2c936136b6575b5033916152b3565b6136bf906144c8565b846136ae565b60403660031901126103aa576136d9614401565b6024356001600160401b0381116103aa57366023820112156103aa57613709903690602481600401359101614568565b906001600160a01b037f000000000000000000000000ab222201c5bd8a18dc6b340ba78a709589e01781811630811490811561388c575b5061361c5761374d61546c565b8116906040516352d1902d60e01b8152602081600481865afa60009181613858575b5061378d57604051634c9c8ce360e01b815260048101849052602490fd5b600080516020615a72833981519152929192908181036138405750823b156138275780546001600160a01b03191682179055604051907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a282511561380e57506000808360206103d895519101845af46138086158be565b9161596e565b9150503461381857005b63b398979f60e01b8152600490fd5b604051634c9c8ce360e01b815260048101839052602490fd5b60249060405190632a87526960e21b82526004820152fd5b9091506020813d602011613884575b816138746020938361452c565b810103126103aa5751908561376f565b3d9150613867565b905081600080516020615a728339815191525416141584613740565b6143e3565b346103aa5760003660031901126103aa576018546040516001600160a01b039091168152602090f35b346103aa5760003660031901126103aa576138ef614e32565b600c546001600160a01b0390811633036104965780600e54166040519163019db35d60e11b83526020928381600481865afa908115610cde57600091613ab5575b50610e8f5760ff600f5460101c16610e7e5761394a6151c8565b600454918215610e6c5781600080516020615ab28339815191525416916040516370a0823160e01b81523060048201528581602481875afa8015610cde578591600091613a84575b5010610c97578460049260405193848092633a7c187560e21b82525afa918215610cde57600092613a4c575b508116918215611e4d576139d89184916000600455614e62565b600160105401806010557fed02de62b141d889c91396300a7aa3f6029483056b39c484aaf352dcde144a9d613a2f613a0e614eb1565b92604051918291309588846040919493926060820195825260208201520152565b0390a36001600080516020615ad283398151915255604051908152f35b9091508481813d8311613a7d575b613a64818361452c565b810103126103aa575181811681036103aa5790856139be565b503d613a5a565b809250878092503d8311613aae575b613a9d818361452c565b810103126103aa5784905187613992565b503d613a93565b613acc9150843d8611610dd157610dc3818361452c565b84613930565b346103aa5760003660031901126103aa576060600f5460ff6040519181811615158352818160081c161515602084015260101c1615156040820152f35b346103aa576020806003193601126103aa57600435613b2c614e32565b600d546001600160a01b03908116330361049657600e541660405163019db35d60e11b81528381600481855afa908115610cde57600091613cf4575b50610e8f5760ff600f5460101c16610e7e57613b826151c8565b613b8a614eb1565b92613b9a600a5460095490614847565b84106123b0576040516302ef24cf60e31b81528181600481865afa908115610cde57600091613cc7575b508310918215613c64575b505061239e576007549181831115613c5857613bed838381036155f7565b6008541061239e57828214610f8457817f2f01f78204677498e6fe869268f60da77c27471229868c46a58de1b2f11183199260075581600a5561147b600160105401806010556040519384933097859094939260609260808301968352602083015260408201520152565b613bed838084036155f7565b604051636953700160e11b81529192508290829060049082905afa918215610cde57600092613c99575b505081118380613bcf565b90809250813d8311613cc0575b613cb0818361452c565b810103126103aa57518380613c8e565b503d613ca6565b90508181813d8311613ced575b613cde818361452c565b810103126103aa575185613bc4565b503d613cd4565b613d0b9150843d8611610dd157610dc3818361452c565b84613b68565b346103aa57613d1f36614488565b613d2c9593929195614e32565b613d34614ec7565b8315610e6c57613d4384614bbf565b928315610e6c57600080516020615ab2833981519152546001600160a01b031691823b156103aa57600094613d9286926040519a8b978896879563d505accf60e01b8752303360048901614948565b03925af1918215610cde57602093612d2c93613db1575b503391614f94565b613dba906144c8565b84613da9565b346103aa5760203660031901126103aa57613dd9614401565b5060206104c76148b3565b346103aa5760003660031901126103aa57606060018060a01b0380600b54169080600c541690600d54169060405192835260208301526040820152f35b346103aa5760003660031901126103aa57600080516020615ab2833981519152546040516001600160a01b039091168152602090f35b346103aa5760203660031901126103aa57600435613e73614815565b50601254601154613e848383614847565b1015613eae576107b0613e9d61257193613ea293614847565b6146a7565b60405191829182614441565b604051634e23d03560e01b8152600490fd5b346103aa5760403660031901126103aa57613ed9614401565b60243590613ee5614e32565b600c546001600160a01b039190821633036104965781600e541692604051809463019db35d60e11b825281600460209788935afa908115610cde57600091614099575b50610e8f5760ff600f5460101c16610e7e5782821693846000526003815260ff604060002054161561126e578115610e6c57600080516020615ab2833981519152938085541690604051956370a0823160e01b958688523060048901528488602481875afa978815610cde5760009861406a575b50878611610c975785613fb0918695614e62565b54169360246040518096819382523060048301525afa908115610cde5760009161401c575b507f3a344e0647678717dfd96e700b702a8a59a7aa8d1f3451b6351fcf0ae083ec559250612e9f6001601054018060105561400e614eb1565b6040519485943098866147f1565b905082813d8311614063575b614032818361452c565b810103126103aa577f3a344e0647678717dfd96e700b702a8a59a7aa8d1f3451b6351fcf0ae083ec55915185613fd5565b503d614028565b9097508481813d8311614092575b614082818361452c565b810103126103aa57519689613f9c565b503d614078565b6140b09150853d8711610dd157610dc3818361452c565b85613f28565b346103aa5760003660031901126103aa5760ff600080516020615ab28339815191525460a01c1660ff811161078457602090604051908152f35b346103aa5760003660031901126103aa576017546040516001600160a01b039091168152602090f35b346103aa5760003660031901126103aa57600754600854600954600a54604080519485526020850193909352918301526060820152608090f35b346103aa5760003660031901126103aa5760045460055460065460408051938452602084019290925290820152606090f35b346103aa5760603660031901126103aa5761259b6141a1614401565b6141a9614417565b604435916141b8833383614c80565b614d56565b346103aa5760003660031901126103aa576020600080516020615a5283398151915254604051908152f35b346103aa5760003660031901126103aa5761257161420461473b565b6040519182916020835260208301906143a3565b346103aa5760203660031901126103aa5760206104c7600435614c6e565b346103aa5760403660031901126103aa5761424f614401565b6024359033156142d0576001600160a01b03169081156142b7576142723361459f565b82600052602052806040600020556040519081527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560203392a3602060405160018152f35b604051634a1406b160e11b815260006004820152602490fd5b60405163e602df0560e01b815260006004820152602490fd5b346103aa5760003660031901126103aa576040516000805160206159d2833981519152805482600061431a83614701565b9283835260209460019186600182169182600014612cd2575050600114614349575050612c7f9250038361452c565b85925060005281600020906000915b858310614370575050612c7f93508201018580612c71565b80548389018501528794508693909201918101614358565b346103aa5760003660031901126103aa5760206104c76146dc565b919082519283825260005b8481106143cf575050826000602080949584010152601f8019910116010190565b6020818301810151848301820152016143ae565b346103aa5760203660031901126103aa5760206104c7600435614c4d565b600435906001600160a01b03821682036103aa57565b602435906001600160a01b03821682036103aa57565b35906001600160a01b03821682036103aa57565b91909160a08060c0830194600180831b0380825116855260208201511660208501526040810151604085015260608101516060850152608081015160808501520151910152565b60c09060031901126103aa57600435906024356001600160a01b03811681036103aa57906044359060643560ff811681036103aa57906084359060a43590565b6001600160401b038111610e4557604052565b60c081019081106001600160401b03821117610e4557604052565b606081019081106001600160401b03821117610e4557604052565b604081019081106001600160401b03821117610e4557604052565b90601f801991011681019081106001600160401b03821117610e4557604052565b6001600160401b038111610e4557601f01601f191660200190565b9291926145748261454d565b91614582604051938461452c565b8294818452818301116103aa578281602093846000960137010152565b6001600160a01b031660009081527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace016020526040902090565b90815180825260208080930193019160005b8281106145f8575050505090565b8351855293810193928101926001016145ea565b9181601f840112156103aa578235916001600160401b0383116103aa57602083818601950101116103aa57565b9080601f830112156103aa5781602061465493359101614568565b90565b346103aa5760603660031901126103aa576001600160a01b03602435818116036103aa57604435908116036103aa576040516328ce783b60e21b8152600490fd5b6044359081151582036103aa57565b6011548110156146c65760116000526006602060002091020190600090565b634e487b7160e01b600052603260045260246000fd5b600080516020615a528339815191525480156146fb5761465490614c4d565b50600090565b90600182811c92168015614731575b602083101461471b57565b634e487b7160e01b600052602260045260246000fd5b91607f1691614710565b604051906000826000549161474f83614701565b8083526020936001908181169081156147b9575060011461477b575b50506147799250038361452c565b565b600080805285812095935091905b8183106147a15750506147799350820101388061476b565b85548884018501529485019487945091830191614789565b91505061477994925060ff191682840152151560051b820101388061476b565b908160209103126103aa575180151581036103aa5790565b9192608093969594919660a084019784526020840152604083015260608201520152565b60405190614822826144db565b8160a06000918281528260208201528260408201528260608201528260808201520152565b9190820180921161078457565b90604051614861816144db565b82546001600160a01b039081168252600184015416602082015260028301546040820152600383015460608201526004830154608082015260059092015460a0830152565b9190820391821161078457565b60ff600f541680156148ed575b6148e8576148cc6146dc565b60015490818110156148e157614654916148a6565b5050600090565b600090565b50600e5460405163019db35d60e11b815290602090829060049082906001600160a01b03165afa908115610cde57600091614929575b506148c0565b614942915060203d602011610dd157610dc3818361452c565b38614923565b9360ff929897969360c0969260e087019a60018060a01b0380921688521660208701526040860152606085015216608083015260a08201520152565b80548210156146c65760005260206000200190600090565b80549190600160401b831015610e455782610b5191600161477995018155614984565b9081548082526020809201926000526020600020916000905b8282106149e6575050505090565b8354855293840193600193840193909101906149d8565b601f8111614a09575050565b600090600080526020600020906020601f850160051c83019410614a48575b601f0160051c01915b828110614a3d57505050565b818155600101614a31565b9092508290614a28565b908060209392818452848401376000828201840152601f01601f1916010190565b60ff600f54168015614aa9575b6148e857614a8c6146dc565b600154808210156148e15761465491614aa4916148a6565b614c6e565b50600e5460405163019db35d60e11b815290602090829060049082906001600160a01b03165afa908115610cde57600091614ae5575b50614a80565b614afe915060203d602011610dd157610dc3818361452c565b38614adf565b6001600160a01b031660009081526000805160206159f2833981519152602052604090205480156146fb5761465490614c4d565b8181029291811591840414171561078457565b6001600160a01b03908116908115614ba657600080516020615a3283398151915280546001600160a01b031981168417909155167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b604051631e4fbdf760e01b815260006004820152602490fd5b600754908115808015614c45575b614c3d57614c2b577812725dd1d243aba0e75fe645cc4873f9e65afe688c928e1f218111614c1957670de0b6b3a76400000290600019808201198311614c1957816146549301016151a8565b604051631a93c68960e11b8152600490fd5b6040516323d359a360e01b8152600490fd5b505050600090565b508115614bcd565b60075480158015614c66575b6148e157614654916155f7565b508115614c59565b60075480156148e15761465491615631565b9190614c8b8361459f565b9260018060a01b0390818316916000958387526020526040862054936000198510614cba575b50505050505050565b858510614d255750811615614d0c578115614cf35790614cdd604094939261459f565b9085526020520391205538808080808080614cb1565b604051634a1406b160e11b815260048101869052602490fd5b60405163e602df0560e01b815260048101869052602490fd5b604051637dc7a0d960e11b81526001600160a01b039190911660048201526024810185905260448101869052606490fd5b916001600160a01b03808416928315614e195716928315614e00576000908382526000805160206159f283398151915280602052604083205491848310614dcd57508284600080516020615a92833981519152959360409388602097528652038282205586815220818154019055604051908152a3565b60405163391434e360e21b81526001600160a01b0391909116600482015260248101929092525060448101839052606490fd5b60405163ec442f0560e01b815260006004820152602490fd5b604051634b637e8f60e11b815260006004820152602490fd5b600080516020615ad28339815191526002815414614e505760029055565b604051633ee5aeb560e01b8152600490fd5b60405163a9059cbb60e01b60208201526001600160a01b03909216602483015260448083019390935291815260808101916001600160401b03831182841017610e455761477992604052615652565b6103e88042029042820414421517156107845790565b6018546001600160a01b039081168015908115614f68575b50614f6557601754168015159081614f09575b5061477957604051638d66bceb60e01b8152600490fd5b604051630b25a48960e01b81523060048201523360248201529150602090829060449082905afa908115610cde57600091614f46575b5038614ef2565b614f5f915060203d602011610dd157610dc3818361452c565b38614f3f565b50565b9050331438614edf565b6001600160a01b03918216815291166020820152604081019190915260600190565b600e5491926001600160a01b0392831692909190614fb06151c8565b614fba84846156ae565b604092835193630f1d76c160e01b8552600494602081602481878c169a8b8b8301525afa90811561519d5760009161517e575b5061516f5785600052600360205260ff8160002054166151605783156151515761501684614bbf565b9687156151415761503b8885600080516020615ab28339815191525416853091615854565b6150458582615550565b61504d6146dc565b6001541061513157600160105401601055600080516020615a528339815191525495615077614eb1565b91856017541691826150b6575b505050600080516020615af28339815191529392916150b0916010549151948594169730978b866147f1565b0390a490565b823b156103aa576150e39260009283869388519687958694859363e859930760e01b855230908501614f72565b03925af180156151265791600080516020615af2833981519152959493916150b093615117575b8294959650819350615084565b615120906144c8565b3861510a565b83513d6000823e3d90fd5b8151631c26652f60e21b81528690fd5b8151631f2a200560e01b81528690fd5b51631f2a200560e01b81528490fd5b51632a9ffab760e21b81528490fd5b516309550c7760e01b81528490fd5b615197915060203d602011610dd157610dc3818361452c565b38614fed565b82513d6000823e3d90fd5b81156151b2570490565b634e487b7160e01b600052601260045260246000fd5b6151d0614eb1565b6005546006549060045491818411156152ad576151eb6146dc565b801561529b5783808211156152a457615203916148a6565b801561529b5761522661522b926b65e5f7c1933c98e93000000094870392614b38565b614b38565b049180600555821561529657827f8967f4cdfa45d45e3ec0538510114515ae97545d8085b648d805880513efdcca920180600455615291600160105401806010556040519384933097859094939260609260808301968352602083015260408201520152565b0390a2565b505050565b50505050600555565b50506000615203565b50505050565b600e5491926001600160a01b03928316929091906152cf6151c8565b6152d984846156ae565b604092835193630f1d76c160e01b8552600494602081602481878c169a8b8b8301525afa90811561519d5760009161544d575b5061516f5785600052600360205260ff8160002054166151605783156151515761534a8484600080516020615ab28339815191525416843091615854565b61535384614c6e565b968715615141576153648882615550565b600080516020615a52833981519152549561537d6146dc565b6001541061543f57600160105401601055615396614eb1565b91856017541691826153cf575b505050600080516020615af28339815191529392916150b091601054915194859416978a3098866147f1565b823b156103aa576153fc9260009283869388519687958694859363e859930760e01b855230908501614f72565b03925af180156151265791600080516020615af2833981519152959493916150b093615430575b82949596508193506153a3565b615439906144c8565b38615423565b8251631c26652f60e21b8152fd5b615466915060203d602011610dd157610dc3818361452c565b3861530c565b600080516020615a32833981519152546001600160a01b0316330361548d57565b60405163118cdaa760e01b8152336004820152602490fd5b91906001600160a01b038316908115614e1957816000526000805160206159f2833981519152806020526040600020549482861061551f575081600080516020615a9283398151915292600095966020938688528452036040862055600080516020615a52833981519152818154039055604051908152a3565b60405163391434e360e21b81526001600160a01b039190911660048201526024810186905260448101839052606490fd5b6001600160a01b0316908115614e0057600080516020615a928339815191526020600092600080516020615a5283398151915261558e828254614847565b90558484526000805160206159f2833981519152825260408420818154019055604051908152a3565b80549081156155e157600019918201916155d18383614984565b909182549160031b1b1916905555565b634e487b7160e01b600052603160045260246000fd5b908015614c2b577812725dd1d243aba0e75fe645cc4873f9e65afe688c928e1f218211614c1957670de0b6b3a764000061465492026151a8565b9081156148e15781600019048111614c1957670de0b6b3a764000091020490565b906000602091828151910182855af115610cde576000513d6156a557506001600160a01b0381163b155b6156835750565b604051635274afe760e01b81526001600160a01b039091166004820152602490fd5b6001141561567c565b6040805163019db35d60e11b81526001600160a01b039384169391926004929091602090818186818a5afa90811561580d57600091615837575b506158275760ff600f5416615818578451630f1d76c160e01b815281816024818688169a8b8a8301525afa90811561580d576000916157f0575b506157e057600390866000525260ff8460002054166157d05780601754169485151591826157c1575b50506157575750505050565b833b156103aa578251636e60301d60e11b8152309281019283526001600160a01b039091166020830152926000918491908290819060400103915afa9081156157b757506157a8575b8080806152ad565b6157b1906144c8565b386157a0565b513d6000823e3d90fd5b6018541614159050388061574b565b8351632a9ffab760e21b81528390fd5b84516309550c7760e01b81528490fd5b6158079150823d8411610dd157610dc3818361452c565b38615722565b86513d6000823e3d90fd5b845162332c3760e81b81528490fd5b8451634427925560e01b81528490fd5b61584e9150823d8411610dd157610dc3818361452c565b386156e8565b9061588a9061587c614779956040519586936323b872dd60e01b602086015260248501614f72565b03601f19810184528361452c565b615652565b60ff600080516020615b128339815191525460401c16156158ac57565b604051631afcd79f60e31b8152600490fd5b3d156158e9573d906158cf8261454d565b916158dd604051938461452c565b82523d6000602084013e565b606090565b90604051602081019063313ce56760e01b82526004815261590e81614511565b5160009384928392916001600160a01b03165afa61592a6158be565b9080615962575b61593b575b508190565b60208180518101031261595e576020015160ff8111615936576001925060ff1690565b8280fd5b50602081511015615931565b90615995575080511561598357602081519101fd5b60405163d6bda27560e01b8152600490fd5b815115806159c8575b6159a6575090565b604051639996b31560e01b81526001600160a01b039091166004820152602490fd5b50803b1561599e56fe52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0352c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0052c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace049016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930052c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace02360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbcddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e009b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f002f319f08ae3fcb401c4325ba57ae57a5d38a443aca074042d7b0329c69dec991f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00a2646970667358221220b581410d57b0103bc71def97ae97ac77c353bd37ec91a2b34a8deeba1ac00dad64736f6c63430008160033","optimization_enabled":true,"verified_twin_address_hash":null,"is_verified":true,"compiler_settings":{"evmVersion":"paris","libraries":{},"optimizer":{"enabled":true,"runs":100},"outputSelection":{"*":{"":["*"],"*":["*"]}},"viaIR":true},"optimization_runs":100,"sourcify_repo_url":null,"decoded_constructor_args":null,"compiler_version":"v0.8.22+commit.4fc1097e","is_verified_via_verifier_alliance":false,"verified_at":"2026-07-28T10:39:27.275439Z","implementations":[],"proxy_type":null,"external_libraries":[],"creation_bytecode":"0x60a08060405234620000d157306080527ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a009081549060ff8260401c16620000c257506001600160401b036002600160401b0319828216016200007c575b604051615b679081620000d782396080518181816135d601526137140152f35b6001600160401b031990911681179091556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a13880806200005c565b63f92ee8a960e01b8152600490fd5b600080fdfe60a0604052600436101561001257600080fd5b60003560e01c806301e1d1141461438857806306fdde03146142e957806307a2d13a146138a8578063095ea7b3146142365780630a28a477146142185780630ace9ca0146141e857806318160ddd146141bd57806323b872dd1461418557806326232a2e146141535780632c4e722e146141195780632da08052146140f0578063313ce567146140b657806337a7f8cf14613ec057806338a3c87814613e5757806338d52e0f14613e21578063392f5f6414613de4578063402d267d14613dc057806342749b5c14613d1157806345579ad114613b0f578063466916ca14613ad257806347bf474b146138d657806349d0ea97146138ad5780634cdad506146138a85780634f1ef286146136c557806350921b231461362e57806352d1902d146135c357806354fd4d501461357c5780635c7a68b3146134f85780635d78739a146134745780635e5c06e21461343a57806360132c9c1461341c57806363a0daac1461339357806364737b0b1461337557806364ca23ef146133575780636c184d59146131d65780636e553f651461319e57806370a082311461101e578063715018a61461313457806374f4f54714612f7a5780637ec0947814612eb65780638c2a993e14612e005780638da5cb5b14612dca57806392709e7414612d4657806394bf804d14612cf457806395d89b4114612c1e5780639707df4d14612b62578063983c676d146128a75780639ee2735b14612811578063a2cdb4071461262a578063a2f8bc18146125a6578063a9059cbb14612575578063ad3cb1cc1461252b578063b3d7f6b91461250d578063b4069af91461163e578063b460af9414611639578063ba08765214611639578063bd5d5768146115c6578063be7dc09b1461159d578063c3c224751461157f578063c55b6bb7146114b6578063c63d75b614611492578063c6e6f592146104a7578063cbe0130e146113c9578063cd475c5a146112f7578063ce96cb77146112d4578063d2045f6d146112b6578063d26a685e14611280578063d29e155a14611064578063d905777e1461101e578063da34250c14610fdf578063dd62ed3e14610f96578063e126430314610ec0578063e1bece8514610544578063e6150400146104cf578063eeb36eba146104ac578063ef8b30f7146104a7578063f1ead126146103da578063f2fde38b146103af5763f5efbb4f1461038157600080fd5b346103aa5760003660031901126103aa57600e546040516001600160a01b039091168152602090f35b600080fd5b346103aa5760203660031901126103aa576103d86103cb614401565b6103d361546c565b614b4b565b005b346103aa5760403660031901126103aa576103f3614401565b6103fb614417565b610403614e32565b600e546001600160a01b03929083163303610496578280600b54169116036104965781600c549116918260018060a01b0319831617600c55600160105401918260105561044e614eb1565b92604051938452602084015216907fabf0382cf5e7450b27a0c3b50f29baceb2bb1747e229bda15ca066ee224fc4cf60403092a46001600080516020615ad283398151915255005b6040516282b42960e81b8152600490fd5b614218565b346103aa5760003660031901126103aa5760206104c7614eb1565b604051908152f35b346103aa5760203660031901126103aa576004356011548110156103aa576104f860c0916146a7565b5060018060a01b039081815416916001820154169060028101546003820154906005600484015493015493604051958652602086015260408501526060840152608083015260a0820152f35b346103aa5760203660031901126103aa57600435610560614e32565b600c546001600160a01b0316330361049657600e5460405163019db35d60e11b81528291602090829060049082906001600160a01b03165afa908115610cde57600091610ea1575b50610e8f5760ff600f5460101c16610e7e578015610e6c576105c86151c8565b6001601054016010556012549060115490828211600014610e63576105ed83836148a6565b80915b11610e5b575b506105ff614eb1565b92604051938460a08101106001600160401b0360a087011117610e455760a0850160405260a03686376000915b8083106107a257505050811061079a575060115460006011558061070b575b5060006012555b60208101519060608101519060808101519060408151910151600080516020615a528339815191525490306000526000805160206159f2833981519152602052604060002054926007549460105496604051988952602089015260408801526060870152608086015260a085015260c084015260e08301526101008201527f392542f20039b266992ba103307d2d1062cb8eb9e6a245970cbd5371ffc0d17b6101203092a26001600080516020615ad283398151915255005b600690806006029060068204036107845760116000527f31ecc21a745e3968a04e9570e4425bc18fa8019c68028196b546d1669c200c68908101905b81811061075557505061064b565b806000849255600060018201556000600282015560006003820155600060048201556000600582015501610747565b634e487b7160e01b600052601160045260246000fd5b601255610652565b6107b66107b08694966146a7565b50614854565b926107c0816146a7565b610e2f57600191600060058382869555828582015582600282015582600382015582600482015501550195019260018060a01b03600e5416906108066040820151614c4d565b81516001600160a01b03166000908152601360205260408120600201805460a08501519295939092909160001990875b858110610e02575b50508615610df9575b8551604051630f1d76c160e01b81526001600160a01b03909116600482015294909390602086602481845afa958615610cde57600096610dd8575b50602087810151604051630f1d76c160e01b81526001600160a01b03909116600482015291829060249082905afa908115610cde57600091610da9575b508515610da1575b508415610d99575b8415610d90575b600092600095600014610bfb57508615610bf3575b5060019460009460009461090e60018060a01b0384511660408501519030614d56565b60018060a01b0383511660005260136020526040600020805460408501518110610be15760408501519003815560018101548015610ba05760a085015160009060009060005b848110610bb2575b505015610ba0578160001981011161078457600182820301610b71575b5050610987600182016155b7565b60018201610aff575b5050600080516020615a5283398151915254306000526000805160206159f28339815191526020526040600020548b60105460018060a01b038651169260018060a01b036020880151169460408801519360808901516040519586528d6020870152604086015260608501528c151560808501528d151560a085015260c084015260e0830152610100820152856101208201527f14239ade46d853ae1a98641c2a237d05a11e24ff2678eb6bf0e409953779a0576101403092a48315801590610af6575b610aa4575b50505050600160208b01510160208b015289510189526040890151016040890152610a94575b1561062c57608086016001815101905261062c565b6060870160018151019052610a7f565b9051604080519384526020840194909452928201526001600160a01b039091169030907f4bc1a4a73c07fffa8f0f6fcb5eee620223fa56322bafaa97c2447ffba146156d90606090a38a808080610a59565b50801515610a54565b600201805491828110610b13575b50610990565b610b2b926000190190818103610b33575b50506155b7565b8e8080610b0d565b610b51610b43610b6a9385614984565b90549060031b1c9184614984565b90919082549060031b91821b91600019901b1916179055565b3880610b24565b610b51610b88610b99936000190160018601614984565b90549060031b1c9160018501614984565b3880610979565b6040516341abc80160e01b8152600490fd5b81610bc08260018901614984565b90549060031b1c14610bd457600101610954565b925050506001388061095c565b604051633999656760e01b8152600490fd5b92508c6108eb565b60175460009791969192506001600160a01b031680610cea575b50610c246040830151306154a5565b604082810151600080516020615ab28339815191525491516370a0823160e01b81523060048201529096916001600160a01b031690602081602481855afa8015610cde578991600091610ca9575b5010610c97576020840151610c929189916001600160a01b031690614e62565b61090e565b604051631e9acf1760e31b8152600490fd5b9150506020813d602011610cd6575b81610cc56020938361452c565b810103126103aa5788905138610c72565b3d9150610cb8565b6040513d6000823e3d90fd5b935050604060018060a01b038251166084825180968193631145b00f60e31b835230600484015260248301528960448301528d60648301525afa8015610cde57600093600091610d57575b50610d408185614847565b8015610c1557610d5091966148a6565b948e610c15565b9350506040833d604011610d88575b81610d736040938361452c565b810103126103aa57602083519301518e610d35565b3d9150610d66565b821594506108d6565b8694506108cf565b94508d6108c7565b610dcb915060203d602011610dd1575b610dc3818361452c565b8101906147d9565b8e6108bf565b503d610db9565b610df291965060203d602011610dd157610dc3818361452c565b948e610882565b50600019610847565b83610e0d8284614984565b90549060031b1c14610e2157600101610836565b975050506001958d8061083e565b634e487b7160e01b600052600060045260246000fd5b634e487b7160e01b600052604160045260246000fd5b9250836105f6565b600080916105f0565b604051631f2a200560e01b8152600490fd5b60405162332c3760e81b8152600490fd5b604051634427925560e01b8152600490fd5b610eba915060203d602011610dd157610dc3818361452c565b836105a8565b346103aa5760403660031901126103aa57610ed9614401565b610ee1614417565b610ee9614e32565b600e546001600160a01b03929083163303610496578280600b54169116036104965760185491808316911691828214610f84576001600160a01b03191682176018556010805460010190819055610f3e614eb1565b9060405191825260208201527fe05c3a6b7b6fb5d4d6824af1b72178068db41a4034bd894aafb5f37a0862263460403092a46001600080516020615ad283398151915255005b60405163c23f6ccb60e01b8152600490fd5b346103aa5760403660031901126103aa57610faf614401565b610fc0610fba614417565b9161459f565b9060018060a01b03166000526020526020604060002054604051908152f35b346103aa5760203660031901126103aa576001600160a01b03611000614401565b166000526003602052602060ff604060002054166040519015158152f35b346103aa5760203660031901126103aa5760206104c761103c614401565b6001600160a01b031660009081526000805160206159f2833981519152602052604090205490565b346103aa5760603660031901126103aa5761107d614401565b506024356001600160401b0381116103aa5761109d90369060040161460c565b906110a6614698565b916110af614e32565b600e546001600160a01b03163303610496576110cc368284614568565b602081519101206000907f5f64eae0fc590a819e523a183a9fd4edc3a1c8c4a7b48218351d61312d3f0ea981146000146111ab5750600f548415158060ff8316151503611193575b50505b15610f84577f2f5a2354fe3af45a0eca3f54b24ff976ddb44f0fce1b11ea34ca93f0bd8d05cf916001601054019081601055611167611154614eb1565b9160405194608086526080860191614a52565b9415156020840152604083015260608201528030930390a26001600080516020615ad283398151915255005b60ff919250169060ff191617600f5560018480611114565b7f8f920a39984cc439587762c50a220d6cc5590b1c4ecb08553287920ec5b8472e810361120d5750600f548415158060ff8360081c161515036111f0575b5050611117565b61ff0091925060081b169061ff00191617600f55600184806111e9565b7fa63f24cc1ddfba9aba789f3526150f9502ed673269c23a73c2ee48f83d667d740361126e57600f548415158060ff8360101c1615150361124f575050611117565b62ff000091925060101b169062ff0000191617600f55600184806111e9565b604051632a9ffab760e21b8152600490fd5b346103aa5760003660031901126103aa57601254601154818111156112ab576020916104c7916148a6565b5050602060006104c7565b346103aa5760003660031901126103aa576020600154604051908152f35b346103aa5760203660031901126103aa5760206104c76112f2614401565b614b04565b346103aa5760603660031901126103aa57611310614401565b611318614417565b90611321614698565b9161132a614e32565b600e546001600160a01b03929083163303610496578280600b541691160361049657169081600052600360205260406000209015159060ff1981541660ff83161790556001601054018060105561137f614eb1565b604051928352602083015260408201527f9e675b24cc7385aaade7e2a734dbac9e591abf9c239e11336f6b582868af3c3f60603092a36001600080516020615ad283398151915255005b346103aa5760403660031901126103aa576113e2614401565b602435906113ee614e32565b600e546001600160a01b0390811633036104965780600b5416911603610496576114166151c8565b7fe55193f6ef36646764379f90bc58ad4b10a3a0fdfb49ede367ff57b04e1b9fd26006549180600655600160105401908160105561147b611455614eb1565b926040519384933097859094939260609260808301968352602083015260408201520152565b0390a26001600080516020615ad283398151915255005b346103aa5760203660031901126103aa576114ab614401565b5060206104c7614a73565b346103aa5760403660031901126103aa576114cf614401565b6114d7614417565b6114df614e32565b600e546001600160a01b03929083163303610496578280600080516020615a3283398151915254169116036104965781600b549116918260018060a01b0319831617600b556001601054019182601055611537614eb1565b92604051938452602084015216907f580ae3f4445324f6fb6182e19b568f2ce59fb7550d3d3a9016130507ba807ea860403092a46001600080516020615ad283398151915255005b346103aa5760003660031901126103aa576020601554604051908152f35b346103aa5760003660031901126103aa576014546040516001600160a01b039091168152602090f35b346103aa5760403660031901126103aa576115df614401565b6115e7614417565b6115ef614e32565b600e546001600160a01b03929083163303610496578280600b5416911603610496571660018060a01b031960175416176017556001600080516020615ad283398151915255600080f35b614657565b346103aa576003196080368201126103aa57611658614401565b611660614417565b916001600160401b03604435116103aa5761016090604435360301126103aa576040519161016083018381106001600160401b03821117610e4557604052604435600401356001600160401b0381116103aa576116c590600436916044350101614639565b8352602460443501356001600160401b0381116103aa576116ee90600436916044350101614639565b6020840152611700604480350161442d565b604084015261171360646044350161442d565b606084015261172660846044350161442d565b608084015261173960a46044350161442d565b60a084015260443560c481013560c085015260e481013560e085015261010481013561010085015261012481013561012085015261014401356101408401526001600160401b03606435116103aa573660236064350112156103aa576001600160401b036064356004013511610e4557604051906117c360206064356004013560051b018361452c565b60643560040135825260208201803660246064356004013560051b6064350101116103aa57602460643501905b60246064356004013560051b606435010182106124f5575050600080516020615b1283398151915254916001600160401b03831615806124e7575b60016001600160401b0385161490816124dd575b1590816124d4575b506124c25760016001600160401b0319841617600080516020615b128339815191525560ff8360401c1615612495575b6001600160a01b03851615611e4d5760608601516001600160a01b031615611e4d5760808601516001600160a01b031615611e4d5760a08601516001600160a01b031615611e4d57606086015160808701516001600160a01b03918216911681811491821561247e575b508115612467575b5061126e5760408601516001600160a01b031615611e4d57610120860151604051636347b4f760e01b8152906020826004816001600160a01b038b165afa918215610cde57600092612433575b501080156123c2575b6123b05760c08601511561239e5760e0860151604051633d3f7e8360e11b8152906020826004816001600160a01b038b165afa918215610cde5760009261236a575b501161126e57855160208701519061199761588f565b61199f61588f565b8051906001600160401b038211610e45576119c86000805160206159d283398151915254614701565b601f81116122fc575b50602090601f831160011461225957611a03929160009183612156575b50508160011b916000199060031b1c19161790565b6000805160206159d2833981519152555b8051906001600160401b038211610e4557611a3d600080516020615a1283398151915254614701565b601f81116121eb575b50602090601f8311600114612161579180611a7c92611afa95946000926121565750508160011b916000199060031b1c19161790565b600080516020615a12833981519152555b60408701516001600160a01b0316611aa361588f565b611aab61588f565b611ab4816158ee565b901561214d57905b600080516020615ab283398151915280546001600160a81b03191660a09390931b60ff60a01b1692909217179055611af261588f565b6103d361588f565b611b0261588f565b611b0a61588f565b611b1261588f565b6001600080516020615ad283398151915255600e80546001600160a01b0319166001600160a01b0386161790558451511561126e5761010085015115610e6c5761014085015115610e6c5784518051906001600160401b038211610e4557611b8482611b7f600054614701565b6149fd565b602090601f83116001146120c657611bb49291600091836120bb5750508160011b916000199060031b1c19161790565b6000555b610140850151600155610100850151600255611bd2614eb1565b9360e08601518060408051611be6816144f6565b60008152886020820152015260006004558560055560065560405163aa12543760e01b815260208160048160018060a01b0386165afa908115610cde57600091612089575b5060c0870151610120880151916040518060808101106001600160401b03608083011117610e455760608160808b9301604052838152846020820152856040820152015260075560085560095584600a5560018060a01b0360608701511660405190630f1d76c160e01b8252600482015260208160248160018060a01b0386165afa908115610cde5760009161206a575b5061201a576080860151604051630f1d76c160e01b81526001600160a01b039182166004820152906020908290602490829086165afa908115610cde5760009161204b575b5061201a5760a0860151604051630f1d76c160e01b81526001600160a01b0391821660048201529160209183916024918391165afa908115610cde5760009161202c575b5061201a576060850151608086015160a0870151604080516001600160a01b03928316949383169390921691849190611d7d816144f6565b838152846020820152015260018060a01b0319600b541617600b5560018060a01b0319600c541617600c5560018060a01b0319600d541617600d5560005b8351811015611e5f57600581901b8401602001516001600160a01b0316908115611e4d5760608701516001600160a01b031682148015611e37575b8015611e21575b61126e57600191600052600360205260406000208260ff1982541617905501611dbb565b5060a08701516001600160a01b03168214611dfd565b5060808701516001600160a01b03168214611df6565b60405163d92e233d60e01b8152600490fd5b5083856000601055805190602081015190604060018060a01b03910151169560018060a01b03600b54169060018060a01b03600c54169060018060a01b03600d541690602060025491600654936008549560095497611eeb6007549a611eda6001549d6040516080526101e0806080515260805101906143a3565b9060805182038860805101526143a3565b9e604060805101526060608051015260808051015260a060805101526080518c0360c06080510152519a8b8152019760009a5b808c10611ff757505060ff995060e06080510152610100608051015261012060805101526101406080510152610160608051015261018060805101526101a0608051015260006101c060805101527f7ba25c704df0b6295b7e0ea25b4a39c849d2d23e3feea925186a2bf0bafa1d5030916080519003608051a260401c1615611fa357005b60ff60401b19600080516020615b128339815191525416600080516020615b12833981519152557fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602060405160018152a1005b81516001600160a01b03168a5260019b909b019a6020998a019990910190611f1e565b6040516309550c7760e01b8152600490fd5b612045915060203d602011610dd157610dc3818361452c565b86611d45565b612064915060203d602011610dd157610dc3818361452c565b87611d01565b612083915060203d602011610dd157610dc3818361452c565b87611cbc565b90506020813d6020116120b3575b816120a46020938361452c565b810103126103aa575187611c2b565b3d9150612097565b0151905088806119ee565b600080805292917f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563915b601f1984168510612132576001945083601f19811610612119575b505050811b01600055611bb8565b015160001960f88460031b161c1916905587808061210b565b818101518355602094850194600190930192909101906120f0565b50601290611abc565b015190508a806119ee565b90600080516020615a1283398151915260005260206000209160005b601f19851681106121d35750918391600193611afa9695601f198116106121ba575b505050811b01600080516020615a1283398151915255611a8d565b015160001960f88460031b161c1916905589808061219f565b9192602060018192868501518155019401920161217d565b600080516020615a128339815191526000527f46a2803e59a4de4e7a4c574b1243f25977ac4c77d5a1a4a609b5394cebb4a2aa601f840160051c810160208510612252575b601f830160051c82018110612246575050611a46565b60008155600101612230565b5080612230565b6000805160206159d2833981519152600090815292917f2ae08a8e29253f69ac5d979a101956ab8f8d9d7ded63fa7a83b16fc47648eab0915b601f19841685106122e1576001945083601f198116106122c8575b505050811b016000805160206159d283398151915255611a14565b015160001960f88460031b161c191690558980806122ad565b81810151835560209485019460019093019290910190612292565b6000805160206159d28339815191526000527f2ae08a8e29253f69ac5d979a101956ab8f8d9d7ded63fa7a83b16fc47648eab0601f840160051c810160208510612363575b601f830160051c820181106123575750506119d1565b60008155600101612341565b5080612341565b9091506020813d602011612396575b816123866020938361452c565b810103126103aa57519088611981565b3d9150612379565b604051636a43f8d160e01b8152600490fd5b6040516305fabb6160e41b8152600490fd5b50610120860151604051631857361b60e21b8152906020826004816001600160a01b038b165afa918215610cde576000926123ff575b501161193f565b9091506020813d60201161242b575b8161241b6020938361452c565b810103126103aa575190886123f8565b3d915061240e565b9091506020813d60201161245f575b8161244f6020938361452c565b810103126103aa57519088611936565b3d9150612442565b60a08801516001600160a01b0316149050876118e9565b60a08901516001600160a01b0316149150886118e1565b68ffffffffffffffffff1983166801000000000000000117600080516020615b1283398151915255611877565b60405163f92ee8a960e01b8152600490fd5b90501587611847565b303b15915061183f565b5060ff8360401c161561182b565b602080916125028461442d565b8152019101906117f0565b346103aa5760203660031901126103aa5760206104c7600435614bbf565b346103aa5760003660031901126103aa5761257160405161254b81614511565b60058152640352e302e360dc1b60208201526040519182916020835260208301906143a3565b0390f35b346103aa5760403660031901126103aa5761259b612591614401565b6024359033614d56565b602060405160018152f35b346103aa5760403660031901126103aa576125bf614401565b602435906125cb614e32565b600e546001600160a01b0390811633036104965780600b5416911603610496577faf012b1ff2011f0badfa5327c0027eab916991fa181cb95668cb91d869640f846009549180600955600160105401908160105561147b611455614eb1565b346103aa5760403660031901126103aa57612643614401565b6001600160401b036024358181116103aa5761266390369060040161460c565b91909261266e614e32565b600e546001600160a01b0390811633036104965780600b54169116036104965761269661473b565b908211610e45576126ac82611b7f600054614701565b600092601f831160011461276c576126fe83807f5b9253f728a28595515c0c13aeff4928b4f7575a65faed9686a5b81ec115092f9596600091612761575b508160011b916000199060031b1c19161790565b6000555b61273c6001601054019182601055612718614eb1565b9561272e604051956080875260808701906143a3565b918583036020870152614a52565b93604083015260608201528030930390a26001600080516020615ad283398151915255005b9050830135876126ea565b6000808052601f198416947f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5639160205b8782106127f9575050847f5b9253f728a28595515c0c13aeff4928b4f7575a65faed9686a5b81ec115092f9596106127df575b5050600184811b01600055612702565b820135600019600387901b60f8161c1916905584806127cf565b8060018495829495880135815501940192019061279c565b346103aa5760203660031901126103aa576001600160a01b03612832614401565b16600052601360205260406000208054612571600261287d604051946128668661285f81600185016149bf565b038761452c565b61287660405180948193016149bf565b038261452c565b61289960405194859485526060602086015260608501906145d8565b9083820360408501526145d8565b346103aa5760403660031901126103aa576004356128c3614417565b906128cc614815565b506128d5614e32565b600e5460405163019db35d60e11b81526020936001600160a01b0393928416918581600481865afa908115610cde57600091612b45575b50610e8f5760ff600f5460081c16610e7e57604051630f1d76c160e01b808252336004830152908681602481875afa908115610cde57600091612b28575b5061201a578491602487926040519485938492835216958660048301525afa908115610cde57600091612b0b575b5061201a578015611e4d576002548210610be157612997823033614c80565b6129a2823033614d56565b6129ab82614c4d565b9360016010540194856010556129bf614eb1565b91604051956129cd876144db565b33875281870194855260408701958652606087019283526080870193845260a08701978852601154600160401b811015610e4557806001612a1192016011556146a7565b610e2f57612571987fa860c7ba918bd53ab101f8fa1e1e8cee055aedf31b1d9c5b12401a91d79b17bd94612a9d92848b51169160018060a01b031983818454161783556001830190878c5116908254161790558a51600283015551600382015587516004820155600583519101556000526013845260016040600020918951835401835551910161499c565b6000805160206159f2833981519152600080516020615a5283398151915254923060005252612aea60406000205491808951169651169651945191601054906040519485943098866147f1565b0390a46001600080516020615ad28339815191525560405191829182614441565b612b229150853d8711610dd157610dc3818361452c565b85612978565b612b3f9150873d8911610dd157610dc3818361452c565b8761294a565b612b5c9150863d8811610dd157610dc3818361452c565b8661290c565b346103aa5760403660031901126103aa57612b7b614401565b612b83614417565b612b8b614e32565b600e546001600160a01b03929083163303610496578280600b54169116036104965781600d549116918260018060a01b0319831617600d556001601054019182601055612bd6614eb1565b92604051938452602084015216907faa7b0c7c6fd0cf2871410f0351872fc38289ba30c1d2bbce69801ecc6f580f5a60403092a46001600080516020615ad283398151915255005b346103aa5760003660031901126103aa57604051600080516020615a128339815191528054826000612c4f83614701565b9283835260209460019186600182169182600014612cd2575050600114612c93575b5050612c7f9250038361452c565b6125716040519282849384528301906143a3565b85925060005281600020906000915b858310612cba575050612c7f93508201018580612c71565b80548389018501528794508693909201918101612ca2565b9250935050612c7f94915060ff191682840152151560051b8201018580612c71565b346103aa5760403660031901126103aa576020612d2c612d12614417565b612d1a614e32565b612d22614ec7565b3390600435614f94565b6001600080516020615ad283398151915255604051908152f35b346103aa5760403660031901126103aa57612d5f614401565b60243590612d6b614e32565b600e546001600160a01b0390811633036104965780600b5416911603610496577f115a07d75a133acb9893ca5ea90040364eaa202319089bc8bbb680c20b1f308d6002549180600255600160105401908160105561147b611455614eb1565b346103aa5760003660031901126103aa57600080516020615a32833981519152546040516001600160a01b039091168152602090f35b346103aa5760403660031901126103aa57612e19614401565b602435612e24614e32565b6014546001600160a01b039081163303610496578216918215611e4d578115610e6c5781612e5991612e546151c8565b615550565b7ff6cce9a39dfad6ea6b603668e99eb3a1502136af6257359c819805bc2c2545a560016010540180601055600080516020615a5283398151915254612e9f611455614eb1565b0390a36001600080516020615ad283398151915255005b346103aa5760403660031901126103aa57612ecf614401565b612ed7614417565b612edf614e32565b600e546001600160a01b03929083163303610496578280600b54169116036104965760145491808316911691828214610f84576001600160a01b03191682176014556010805460010190819055612f34614eb1565b9060405191825260208201527f5166063541fd6563da14bd3fd7ed5ea88c8e5b8f00c98d4789d38b7410ab4f7060403092a46001600080516020615ad283398151915255005b346103aa5760403660031901126103aa57612f93614401565b602435612f9e614e32565b6014546001600160a01b0392908316330361049657828116928315611e4d578215610e6c57836000526020906000805160206159f283398151915282528360406000205410610be157600e541660405163019db35d60e11b81528281600481855afa908115610cde57600091613117575b50610e8f578160249160405192838092630f1d76c160e01b82528960048301525afa918215610cde576000926130fa575b505061201a5760155480151590816130f0575b506130de5760165480151590816130d4575b506130c2578161307c916130776151c8565b6154a5565b7f16fb7381242ae680ccbe83b8f7560299159d55ddb3060325d6f8049c3a75eba660016010540180601055600080516020615a5283398151915254612e9f611455614eb1565b604051637066db4560e11b8152600490fd5b9050821184613065565b604051630591c40b60e11b8152600490fd5b9050821084613053565b6131109250803d10610dd157610dc3818361452c565b8480613040565b61312e9150833d8511610dd157610dc3818361452c565b8661300f565b346103aa5760003660031901126103aa5761314d61546c565b600080516020615a3283398151915280546001600160a01b031981169091556000906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b346103aa5760403660031901126103aa576020612d2c6131bc614417565b6131c4614e32565b6131cc614ec7565b33906004356152b3565b346103aa576020806003193601126103aa57600435906131f4614e32565b600e5460405163019db35d60e11b8152908290829060049082906001600160a01b03165afa908115610cde5760009161333a575b50610e8f5760ff600f5460081c16610e7e5733600052601381526040600020805415610ba057600281019060008254905b81811061331b5750506001908101805460009291835b8281106132ef575b5050505015610ba0578061328e846132ac9361499c565b6060613298614eb1565b9360405195865285015260608401906149bf565b9060408301527f26a8ebe011d9df7dc41969463828f28aca8de2432684e98ab0802dedfec312c833928030930390a36001600080516020615ad283398151915255005b876132fa8284614984565b90549060031b1c1461330d57830161326f565b505050905084808080613277565b856133268286614984565b90549060031b1c14610ba057600101613259565b6133519150823d8411610dd157610dc3818361452c565b83613228565b346103aa5760003660031901126103aa576020601054604051908152f35b346103aa5760003660031901126103aa576020600254604051908152f35b346103aa5760603660031901126103aa576133ac614401565b60243590604435906133bc614e32565b600e546001600160a01b0390811633036104965780600b5416911603610496577f525a3e3b7e8f4cb6c1f7d97c77c7bcda7e468260ca0b572ad285f04348fd89fb908260155580601655600160105401908160105561147b611455614eb1565b346103aa5760003660031901126103aa576020601654604051908152f35b346103aa5760203660031901126103aa576001600160a01b0361345b614401565b1660005260136020526020604060002054604051908152f35b346103aa5760403660031901126103aa5761348d614401565b60243590613499614e32565b600e546001600160a01b0390811633036104965780600b5416911603610496577f81cba3db70153b4391f7ba791982067b5da23698c9cc17bec36baa0ca2e238706001549180600155600160105401908160105561147b611455614eb1565b346103aa5760403660031901126103aa57613511614401565b6024359061351d614e32565b600e546001600160a01b0390811633036104965780600b5416911603610496577f85d21a4da3a9ce4a976ba412337cce37ea05422537f1a7f7d69c16a66afb29796008549180600855600160105401908160105561147b611455614eb1565b346103aa5760003660031901126103aa5761257160405161359c81614511565b600681526576322e332e3160d01b60208201526040519182916020835260208301906143a3565b346103aa5760003660031901126103aa577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316300361361c576020604051600080516020615a728339815191528152f35b60405163703e46dd60e11b8152600490fd5b346103aa5761363c36614488565b949291613647614e32565b61364f614ec7565b600080516020615ab2833981519152546001600160a01b031690813b156103aa5760008094613697604051998a968795869463d505accf60e01b86528b303360048901614948565b03925af1918215610cde57602093612d2c936136b6575b5033916152b3565b6136bf906144c8565b846136ae565b60403660031901126103aa576136d9614401565b6024356001600160401b0381116103aa57366023820112156103aa57613709903690602481600401359101614568565b906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811630811490811561388c575b5061361c5761374d61546c565b8116906040516352d1902d60e01b8152602081600481865afa60009181613858575b5061378d57604051634c9c8ce360e01b815260048101849052602490fd5b600080516020615a72833981519152929192908181036138405750823b156138275780546001600160a01b03191682179055604051907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a282511561380e57506000808360206103d895519101845af46138086158be565b9161596e565b9150503461381857005b63b398979f60e01b8152600490fd5b604051634c9c8ce360e01b815260048101839052602490fd5b60249060405190632a87526960e21b82526004820152fd5b9091506020813d602011613884575b816138746020938361452c565b810103126103aa5751908561376f565b3d9150613867565b905081600080516020615a728339815191525416141584613740565b6143e3565b346103aa5760003660031901126103aa576018546040516001600160a01b039091168152602090f35b346103aa5760003660031901126103aa576138ef614e32565b600c546001600160a01b0390811633036104965780600e54166040519163019db35d60e11b83526020928381600481865afa908115610cde57600091613ab5575b50610e8f5760ff600f5460101c16610e7e5761394a6151c8565b600454918215610e6c5781600080516020615ab28339815191525416916040516370a0823160e01b81523060048201528581602481875afa8015610cde578591600091613a84575b5010610c97578460049260405193848092633a7c187560e21b82525afa918215610cde57600092613a4c575b508116918215611e4d576139d89184916000600455614e62565b600160105401806010557fed02de62b141d889c91396300a7aa3f6029483056b39c484aaf352dcde144a9d613a2f613a0e614eb1565b92604051918291309588846040919493926060820195825260208201520152565b0390a36001600080516020615ad283398151915255604051908152f35b9091508481813d8311613a7d575b613a64818361452c565b810103126103aa575181811681036103aa5790856139be565b503d613a5a565b809250878092503d8311613aae575b613a9d818361452c565b810103126103aa5784905187613992565b503d613a93565b613acc9150843d8611610dd157610dc3818361452c565b84613930565b346103aa5760003660031901126103aa576060600f5460ff6040519181811615158352818160081c161515602084015260101c1615156040820152f35b346103aa576020806003193601126103aa57600435613b2c614e32565b600d546001600160a01b03908116330361049657600e541660405163019db35d60e11b81528381600481855afa908115610cde57600091613cf4575b50610e8f5760ff600f5460101c16610e7e57613b826151c8565b613b8a614eb1565b92613b9a600a5460095490614847565b84106123b0576040516302ef24cf60e31b81528181600481865afa908115610cde57600091613cc7575b508310918215613c64575b505061239e576007549181831115613c5857613bed838381036155f7565b6008541061239e57828214610f8457817f2f01f78204677498e6fe869268f60da77c27471229868c46a58de1b2f11183199260075581600a5561147b600160105401806010556040519384933097859094939260609260808301968352602083015260408201520152565b613bed838084036155f7565b604051636953700160e11b81529192508290829060049082905afa918215610cde57600092613c99575b505081118380613bcf565b90809250813d8311613cc0575b613cb0818361452c565b810103126103aa57518380613c8e565b503d613ca6565b90508181813d8311613ced575b613cde818361452c565b810103126103aa575185613bc4565b503d613cd4565b613d0b9150843d8611610dd157610dc3818361452c565b84613b68565b346103aa57613d1f36614488565b613d2c9593929195614e32565b613d34614ec7565b8315610e6c57613d4384614bbf565b928315610e6c57600080516020615ab2833981519152546001600160a01b031691823b156103aa57600094613d9286926040519a8b978896879563d505accf60e01b8752303360048901614948565b03925af1918215610cde57602093612d2c93613db1575b503391614f94565b613dba906144c8565b84613da9565b346103aa5760203660031901126103aa57613dd9614401565b5060206104c76148b3565b346103aa5760003660031901126103aa57606060018060a01b0380600b54169080600c541690600d54169060405192835260208301526040820152f35b346103aa5760003660031901126103aa57600080516020615ab2833981519152546040516001600160a01b039091168152602090f35b346103aa5760203660031901126103aa57600435613e73614815565b50601254601154613e848383614847565b1015613eae576107b0613e9d61257193613ea293614847565b6146a7565b60405191829182614441565b604051634e23d03560e01b8152600490fd5b346103aa5760403660031901126103aa57613ed9614401565b60243590613ee5614e32565b600c546001600160a01b039190821633036104965781600e541692604051809463019db35d60e11b825281600460209788935afa908115610cde57600091614099575b50610e8f5760ff600f5460101c16610e7e5782821693846000526003815260ff604060002054161561126e578115610e6c57600080516020615ab2833981519152938085541690604051956370a0823160e01b958688523060048901528488602481875afa978815610cde5760009861406a575b50878611610c975785613fb0918695614e62565b54169360246040518096819382523060048301525afa908115610cde5760009161401c575b507f3a344e0647678717dfd96e700b702a8a59a7aa8d1f3451b6351fcf0ae083ec559250612e9f6001601054018060105561400e614eb1565b6040519485943098866147f1565b905082813d8311614063575b614032818361452c565b810103126103aa577f3a344e0647678717dfd96e700b702a8a59a7aa8d1f3451b6351fcf0ae083ec55915185613fd5565b503d614028565b9097508481813d8311614092575b614082818361452c565b810103126103aa57519689613f9c565b503d614078565b6140b09150853d8711610dd157610dc3818361452c565b85613f28565b346103aa5760003660031901126103aa5760ff600080516020615ab28339815191525460a01c1660ff811161078457602090604051908152f35b346103aa5760003660031901126103aa576017546040516001600160a01b039091168152602090f35b346103aa5760003660031901126103aa57600754600854600954600a54604080519485526020850193909352918301526060820152608090f35b346103aa5760003660031901126103aa5760045460055460065460408051938452602084019290925290820152606090f35b346103aa5760603660031901126103aa5761259b6141a1614401565b6141a9614417565b604435916141b8833383614c80565b614d56565b346103aa5760003660031901126103aa576020600080516020615a5283398151915254604051908152f35b346103aa5760003660031901126103aa5761257161420461473b565b6040519182916020835260208301906143a3565b346103aa5760203660031901126103aa5760206104c7600435614c6e565b346103aa5760403660031901126103aa5761424f614401565b6024359033156142d0576001600160a01b03169081156142b7576142723361459f565b82600052602052806040600020556040519081527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560203392a3602060405160018152f35b604051634a1406b160e11b815260006004820152602490fd5b60405163e602df0560e01b815260006004820152602490fd5b346103aa5760003660031901126103aa576040516000805160206159d2833981519152805482600061431a83614701565b9283835260209460019186600182169182600014612cd2575050600114614349575050612c7f9250038361452c565b85925060005281600020906000915b858310614370575050612c7f93508201018580612c71565b80548389018501528794508693909201918101614358565b346103aa5760003660031901126103aa5760206104c76146dc565b919082519283825260005b8481106143cf575050826000602080949584010152601f8019910116010190565b6020818301810151848301820152016143ae565b346103aa5760203660031901126103aa5760206104c7600435614c4d565b600435906001600160a01b03821682036103aa57565b602435906001600160a01b03821682036103aa57565b35906001600160a01b03821682036103aa57565b91909160a08060c0830194600180831b0380825116855260208201511660208501526040810151604085015260608101516060850152608081015160808501520151910152565b60c09060031901126103aa57600435906024356001600160a01b03811681036103aa57906044359060643560ff811681036103aa57906084359060a43590565b6001600160401b038111610e4557604052565b60c081019081106001600160401b03821117610e4557604052565b606081019081106001600160401b03821117610e4557604052565b604081019081106001600160401b03821117610e4557604052565b90601f801991011681019081106001600160401b03821117610e4557604052565b6001600160401b038111610e4557601f01601f191660200190565b9291926145748261454d565b91614582604051938461452c565b8294818452818301116103aa578281602093846000960137010152565b6001600160a01b031660009081527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace016020526040902090565b90815180825260208080930193019160005b8281106145f8575050505090565b8351855293810193928101926001016145ea565b9181601f840112156103aa578235916001600160401b0383116103aa57602083818601950101116103aa57565b9080601f830112156103aa5781602061465493359101614568565b90565b346103aa5760603660031901126103aa576001600160a01b03602435818116036103aa57604435908116036103aa576040516328ce783b60e21b8152600490fd5b6044359081151582036103aa57565b6011548110156146c65760116000526006602060002091020190600090565b634e487b7160e01b600052603260045260246000fd5b600080516020615a528339815191525480156146fb5761465490614c4d565b50600090565b90600182811c92168015614731575b602083101461471b57565b634e487b7160e01b600052602260045260246000fd5b91607f1691614710565b604051906000826000549161474f83614701565b8083526020936001908181169081156147b9575060011461477b575b50506147799250038361452c565b565b600080805285812095935091905b8183106147a15750506147799350820101388061476b565b85548884018501529485019487945091830191614789565b91505061477994925060ff191682840152151560051b820101388061476b565b908160209103126103aa575180151581036103aa5790565b9192608093969594919660a084019784526020840152604083015260608201520152565b60405190614822826144db565b8160a06000918281528260208201528260408201528260608201528260808201520152565b9190820180921161078457565b90604051614861816144db565b82546001600160a01b039081168252600184015416602082015260028301546040820152600383015460608201526004830154608082015260059092015460a0830152565b9190820391821161078457565b60ff600f541680156148ed575b6148e8576148cc6146dc565b60015490818110156148e157614654916148a6565b5050600090565b600090565b50600e5460405163019db35d60e11b815290602090829060049082906001600160a01b03165afa908115610cde57600091614929575b506148c0565b614942915060203d602011610dd157610dc3818361452c565b38614923565b9360ff929897969360c0969260e087019a60018060a01b0380921688521660208701526040860152606085015216608083015260a08201520152565b80548210156146c65760005260206000200190600090565b80549190600160401b831015610e455782610b5191600161477995018155614984565b9081548082526020809201926000526020600020916000905b8282106149e6575050505090565b8354855293840193600193840193909101906149d8565b601f8111614a09575050565b600090600080526020600020906020601f850160051c83019410614a48575b601f0160051c01915b828110614a3d57505050565b818155600101614a31565b9092508290614a28565b908060209392818452848401376000828201840152601f01601f1916010190565b60ff600f54168015614aa9575b6148e857614a8c6146dc565b600154808210156148e15761465491614aa4916148a6565b614c6e565b50600e5460405163019db35d60e11b815290602090829060049082906001600160a01b03165afa908115610cde57600091614ae5575b50614a80565b614afe915060203d602011610dd157610dc3818361452c565b38614adf565b6001600160a01b031660009081526000805160206159f2833981519152602052604090205480156146fb5761465490614c4d565b8181029291811591840414171561078457565b6001600160a01b03908116908115614ba657600080516020615a3283398151915280546001600160a01b031981168417909155167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b604051631e4fbdf760e01b815260006004820152602490fd5b600754908115808015614c45575b614c3d57614c2b577812725dd1d243aba0e75fe645cc4873f9e65afe688c928e1f218111614c1957670de0b6b3a76400000290600019808201198311614c1957816146549301016151a8565b604051631a93c68960e11b8152600490fd5b6040516323d359a360e01b8152600490fd5b505050600090565b508115614bcd565b60075480158015614c66575b6148e157614654916155f7565b508115614c59565b60075480156148e15761465491615631565b9190614c8b8361459f565b9260018060a01b0390818316916000958387526020526040862054936000198510614cba575b50505050505050565b858510614d255750811615614d0c578115614cf35790614cdd604094939261459f565b9085526020520391205538808080808080614cb1565b604051634a1406b160e11b815260048101869052602490fd5b60405163e602df0560e01b815260048101869052602490fd5b604051637dc7a0d960e11b81526001600160a01b039190911660048201526024810185905260448101869052606490fd5b916001600160a01b03808416928315614e195716928315614e00576000908382526000805160206159f283398151915280602052604083205491848310614dcd57508284600080516020615a92833981519152959360409388602097528652038282205586815220818154019055604051908152a3565b60405163391434e360e21b81526001600160a01b0391909116600482015260248101929092525060448101839052606490fd5b60405163ec442f0560e01b815260006004820152602490fd5b604051634b637e8f60e11b815260006004820152602490fd5b600080516020615ad28339815191526002815414614e505760029055565b604051633ee5aeb560e01b8152600490fd5b60405163a9059cbb60e01b60208201526001600160a01b03909216602483015260448083019390935291815260808101916001600160401b03831182841017610e455761477992604052615652565b6103e88042029042820414421517156107845790565b6018546001600160a01b039081168015908115614f68575b50614f6557601754168015159081614f09575b5061477957604051638d66bceb60e01b8152600490fd5b604051630b25a48960e01b81523060048201523360248201529150602090829060449082905afa908115610cde57600091614f46575b5038614ef2565b614f5f915060203d602011610dd157610dc3818361452c565b38614f3f565b50565b9050331438614edf565b6001600160a01b03918216815291166020820152604081019190915260600190565b600e5491926001600160a01b0392831692909190614fb06151c8565b614fba84846156ae565b604092835193630f1d76c160e01b8552600494602081602481878c169a8b8b8301525afa90811561519d5760009161517e575b5061516f5785600052600360205260ff8160002054166151605783156151515761501684614bbf565b9687156151415761503b8885600080516020615ab28339815191525416853091615854565b6150458582615550565b61504d6146dc565b6001541061513157600160105401601055600080516020615a528339815191525495615077614eb1565b91856017541691826150b6575b505050600080516020615af28339815191529392916150b0916010549151948594169730978b866147f1565b0390a490565b823b156103aa576150e39260009283869388519687958694859363e859930760e01b855230908501614f72565b03925af180156151265791600080516020615af2833981519152959493916150b093615117575b8294959650819350615084565b615120906144c8565b3861510a565b83513d6000823e3d90fd5b8151631c26652f60e21b81528690fd5b8151631f2a200560e01b81528690fd5b51631f2a200560e01b81528490fd5b51632a9ffab760e21b81528490fd5b516309550c7760e01b81528490fd5b615197915060203d602011610dd157610dc3818361452c565b38614fed565b82513d6000823e3d90fd5b81156151b2570490565b634e487b7160e01b600052601260045260246000fd5b6151d0614eb1565b6005546006549060045491818411156152ad576151eb6146dc565b801561529b5783808211156152a457615203916148a6565b801561529b5761522661522b926b65e5f7c1933c98e93000000094870392614b38565b614b38565b049180600555821561529657827f8967f4cdfa45d45e3ec0538510114515ae97545d8085b648d805880513efdcca920180600455615291600160105401806010556040519384933097859094939260609260808301968352602083015260408201520152565b0390a2565b505050565b50505050600555565b50506000615203565b50505050565b600e5491926001600160a01b03928316929091906152cf6151c8565b6152d984846156ae565b604092835193630f1d76c160e01b8552600494602081602481878c169a8b8b8301525afa90811561519d5760009161544d575b5061516f5785600052600360205260ff8160002054166151605783156151515761534a8484600080516020615ab28339815191525416843091615854565b61535384614c6e565b968715615141576153648882615550565b600080516020615a52833981519152549561537d6146dc565b6001541061543f57600160105401601055615396614eb1565b91856017541691826153cf575b505050600080516020615af28339815191529392916150b091601054915194859416978a3098866147f1565b823b156103aa576153fc9260009283869388519687958694859363e859930760e01b855230908501614f72565b03925af180156151265791600080516020615af2833981519152959493916150b093615430575b82949596508193506153a3565b615439906144c8565b38615423565b8251631c26652f60e21b8152fd5b615466915060203d602011610dd157610dc3818361452c565b3861530c565b600080516020615a32833981519152546001600160a01b0316330361548d57565b60405163118cdaa760e01b8152336004820152602490fd5b91906001600160a01b038316908115614e1957816000526000805160206159f2833981519152806020526040600020549482861061551f575081600080516020615a9283398151915292600095966020938688528452036040862055600080516020615a52833981519152818154039055604051908152a3565b60405163391434e360e21b81526001600160a01b039190911660048201526024810186905260448101839052606490fd5b6001600160a01b0316908115614e0057600080516020615a928339815191526020600092600080516020615a5283398151915261558e828254614847565b90558484526000805160206159f2833981519152825260408420818154019055604051908152a3565b80549081156155e157600019918201916155d18383614984565b909182549160031b1b1916905555565b634e487b7160e01b600052603160045260246000fd5b908015614c2b577812725dd1d243aba0e75fe645cc4873f9e65afe688c928e1f218211614c1957670de0b6b3a764000061465492026151a8565b9081156148e15781600019048111614c1957670de0b6b3a764000091020490565b906000602091828151910182855af115610cde576000513d6156a557506001600160a01b0381163b155b6156835750565b604051635274afe760e01b81526001600160a01b039091166004820152602490fd5b6001141561567c565b6040805163019db35d60e11b81526001600160a01b039384169391926004929091602090818186818a5afa90811561580d57600091615837575b506158275760ff600f5416615818578451630f1d76c160e01b815281816024818688169a8b8a8301525afa90811561580d576000916157f0575b506157e057600390866000525260ff8460002054166157d05780601754169485151591826157c1575b50506157575750505050565b833b156103aa578251636e60301d60e11b8152309281019283526001600160a01b039091166020830152926000918491908290819060400103915afa9081156157b757506157a8575b8080806152ad565b6157b1906144c8565b386157a0565b513d6000823e3d90fd5b6018541614159050388061574b565b8351632a9ffab760e21b81528390fd5b84516309550c7760e01b81528490fd5b6158079150823d8411610dd157610dc3818361452c565b38615722565b86513d6000823e3d90fd5b845162332c3760e81b81528490fd5b8451634427925560e01b81528490fd5b61584e9150823d8411610dd157610dc3818361452c565b386156e8565b9061588a9061587c614779956040519586936323b872dd60e01b602086015260248501614f72565b03601f19810184528361452c565b615652565b60ff600080516020615b128339815191525460401c16156158ac57565b604051631afcd79f60e31b8152600490fd5b3d156158e9573d906158cf8261454d565b916158dd604051938461452c565b82523d6000602084013e565b606090565b90604051602081019063313ce56760e01b82526004815261590e81614511565b5160009384928392916001600160a01b03165afa61592a6158be565b9080615962575b61593b575b508190565b60208180518101031261595e576020015160ff8111615936576001925060ff1690565b8280fd5b50602081511015615931565b90615995575080511561598357602081519101fd5b60405163d6bda27560e01b8152600490fd5b815115806159c8575b6159a6575090565b604051639996b31560e01b81526001600160a01b039091166004820152602490fd5b50803b1561599e56fe52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0352c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0052c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace049016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930052c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace02360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbcddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e009b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f002f319f08ae3fcb401c4325ba57ae57a5d38a443aca074042d7b0329c69dec991f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00a2646970667358221220b581410d57b0103bc71def97ae97ac77c353bd37ec91a2b34a8deeba1ac00dad64736f6c63430008160033","name":"EmberVault","is_blueprint":false,"license_type":"none","is_fully_verified":true,"is_verified_via_eth_bytecode_db":false,"language":"solidity","evm_version":"paris","can_be_visualized_via_sol2uml":true,"is_verified_via_sourcify":false,"additional_sources":[{"file_path":"contracts/interfaces/IBridgeable.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.22;\n\n/**\n * @title IBridgeable\n * @notice Interface for tokens that support bridge mint/burn operations\n */\ninterface IBridgeable {\n  /// @notice Mints tokens to a recipient (only callable by authorized bridge adapter)\n  /// @param to The recipient address\n  /// @param amount The amount to mint\n  function bridgeMint(address to, uint256 amount) external;\n\n  /// @notice Burns tokens from an account (only callable by authorized bridge adapter)\n  /// @param from The account to burn from\n  /// @param amount The amount to burn\n  function bridgeBurn(address from, uint256 amount) external;\n\n  /// @notice Returns the minimum bridge amount (0 = no minimum)\n  function minBridgeAmount() external view returns (uint256);\n\n  /// @notice Returns the maximum bridge amount (0 = no maximum)\n  function maxBridgeAmount() external view returns (uint256);\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ContextUpgradeable} from \"../utils/ContextUpgradeable.sol\";\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The initial owner is set to the address provided by the deployer. This can\n * later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n    /// @custom:storage-location erc7201:openzeppelin.storage.Ownable\n    struct OwnableStorage {\n        address _owner;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Ownable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300;\n\n    function _getOwnableStorage() private pure returns (OwnableStorage storage $) {\n        assembly {\n            $.slot := OwnableStorageLocation\n        }\n    }\n\n    /**\n     * @dev The caller account is not authorized to perform an operation.\n     */\n    error OwnableUnauthorizedAccount(address account);\n\n    /**\n     * @dev The owner is not a valid owner account. (eg. `address(0)`)\n     */\n    error OwnableInvalidOwner(address owner);\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n     */\n    function __Ownable_init(address initialOwner) internal onlyInitializing {\n        __Ownable_init_unchained(initialOwner);\n    }\n\n    function __Ownable_init_unchained(address initialOwner) internal onlyInitializing {\n        if (initialOwner == address(0)) {\n            revert OwnableInvalidOwner(address(0));\n        }\n        _transferOwnership(initialOwner);\n    }\n\n    /**\n     * @dev Throws if called by any account other than the owner.\n     */\n    modifier onlyOwner() {\n        _checkOwner();\n        _;\n    }\n\n    /**\n     * @dev Returns the address of the current owner.\n     */\n    function owner() public view virtual returns (address) {\n        OwnableStorage storage $ = _getOwnableStorage();\n        return $._owner;\n    }\n\n    /**\n     * @dev Throws if the sender is not the owner.\n     */\n    function _checkOwner() internal view virtual {\n        if (owner() != _msgSender()) {\n            revert OwnableUnauthorizedAccount(_msgSender());\n        }\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby disabling any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        _transferOwnership(address(0));\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        if (newOwner == address(0)) {\n            revert OwnableInvalidOwner(address(0));\n        }\n        _transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Internal function without access restriction.\n     */\n    function _transferOwnership(address newOwner) internal virtual {\n        OwnableStorage storage $ = _getOwnableStorage();\n        address oldOwner = $._owner;\n        $._owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n *     function initialize() initializer public {\n *         __ERC20_init(\"MyToken\", \"MTK\");\n *     }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n *     function initializeV2() reinitializer(2) public {\n *         __ERC20Permit_init(\"MyToken\");\n *     }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n *     _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Storage of the initializable contract.\n     *\n     * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\n     * when using with upgradeable contracts.\n     *\n     * @custom:storage-location erc7201:openzeppelin.storage.Initializable\n     */\n    struct InitializableStorage {\n        /**\n         * @dev Indicates that the contract has been initialized.\n         */\n        uint64 _initialized;\n        /**\n         * @dev Indicates that the contract is in the process of being initialized.\n         */\n        bool _initializing;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Initializable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;\n\n    /**\n     * @dev The contract is already initialized.\n     */\n    error InvalidInitialization();\n\n    /**\n     * @dev The contract is not initializing.\n     */\n    error NotInitializing();\n\n    /**\n     * @dev Triggered when the contract has been initialized or reinitialized.\n     */\n    event Initialized(uint64 version);\n\n    /**\n     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n     * `onlyInitializing` functions can be used to initialize parent contracts.\n     *\n     * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any\n     * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in\n     * production.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier initializer() {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        // Cache values to avoid duplicated sloads\n        bool isTopLevelCall = !$._initializing;\n        uint64 initialized = $._initialized;\n\n        // Allowed calls:\n        // - initialSetup: the contract is not in the initializing state and no previous version was\n        //                 initialized\n        // - construction: the contract is initialized at version 1 (no reinitialization) and the\n        //                 current contract is just being deployed\n        bool initialSetup = initialized == 0 && isTopLevelCall;\n        bool construction = initialized == 1 && address(this).code.length == 0;\n\n        if (!initialSetup && !construction) {\n            revert InvalidInitialization();\n        }\n        $._initialized = 1;\n        if (isTopLevelCall) {\n            $._initializing = true;\n        }\n        _;\n        if (isTopLevelCall) {\n            $._initializing = false;\n            emit Initialized(1);\n        }\n    }\n\n    /**\n     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n     * used to initialize parent contracts.\n     *\n     * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n     * are added through upgrades and that require initialization.\n     *\n     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n     * cannot be nested. If one is invoked in the context of another, execution will revert.\n     *\n     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n     * a contract, executing them in the right order is up to the developer or operator.\n     *\n     * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier reinitializer(uint64 version) {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing || $._initialized >= version) {\n            revert InvalidInitialization();\n        }\n        $._initialized = version;\n        $._initializing = true;\n        _;\n        $._initializing = false;\n        emit Initialized(version);\n    }\n\n    /**\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n     * {initializer} and {reinitializer} modifiers, directly or indirectly.\n     */\n    modifier onlyInitializing() {\n        _checkInitializing();\n        _;\n    }\n\n    /**\n     * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\n     */\n    function _checkInitializing() internal view virtual {\n        if (!_isInitializing()) {\n            revert NotInitializing();\n        }\n    }\n\n    /**\n     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n     * through proxies.\n     *\n     * Emits an {Initialized} event the first time it is successfully executed.\n     */\n    function _disableInitializers() internal virtual {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing) {\n            revert InvalidInitialization();\n        }\n        if ($._initialized != type(uint64).max) {\n            $._initialized = type(uint64).max;\n            emit Initialized(type(uint64).max);\n        }\n    }\n\n    /**\n     * @dev Returns the highest version that has been initialized. See {reinitializer}.\n     */\n    function _getInitializedVersion() internal view returns (uint64) {\n        return _getInitializableStorage()._initialized;\n    }\n\n    /**\n     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n     */\n    function _isInitializing() internal view returns (bool) {\n        return _getInitializableStorage()._initializing;\n    }\n\n    /**\n     * @dev Pointer to storage slot. Allows integrators to override it with a custom storage location.\n     *\n     * NOTE: Consider following the ERC-7201 formula to derive storage locations.\n     */\n    function _initializableStorageSlot() internal pure virtual returns (bytes32) {\n        return INITIALIZABLE_STORAGE;\n    }\n\n    /**\n     * @dev Returns a pointer to the storage namespace.\n     */\n    // solhint-disable-next-line var-name-mixedcase\n    function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\n        bytes32 slot = _initializableStorageSlot();\n        assembly {\n            $.slot := slot\n        }\n    }\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.22;\n\nimport {IERC1822Proxiable} from \"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\";\nimport {ERC1967Utils} from \"@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol\";\nimport {Initializable} from \"./Initializable.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n */\nabstract contract UUPSUpgradeable is Initializable, IERC1822Proxiable {\n    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n    address private immutable __self = address(this);\n\n    /**\n     * @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgradeTo(address)`\n     * and `upgradeToAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called,\n     * while `upgradeToAndCall` will invoke the `receive` function if the second argument is the empty byte string.\n     * If the getter returns `\"5.0.0\"`, only `upgradeToAndCall(address,bytes)` is present, and the second argument must\n     * be the empty byte string if no function should be called, making it impossible to invoke the `receive` function\n     * during an upgrade.\n     */\n    string public constant UPGRADE_INTERFACE_VERSION = \"5.0.0\";\n\n    /**\n     * @dev The call is from an unauthorized context.\n     */\n    error UUPSUnauthorizedCallContext();\n\n    /**\n     * @dev The storage `slot` is unsupported as a UUID.\n     */\n    error UUPSUnsupportedProxiableUUID(bytes32 slot);\n\n    /**\n     * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n     * a proxy contract with an implementation (as defined in ERC-1967) pointing to self. This should only be the case\n     * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n     * function through ERC-1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n     * fail.\n     */\n    modifier onlyProxy() {\n        _checkProxy();\n        _;\n    }\n\n    /**\n     * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n     * callable on the implementing contract but not through proxies.\n     */\n    modifier notDelegated() {\n        _checkNotDelegated();\n        _;\n    }\n\n    function __UUPSUpgradeable_init() internal onlyInitializing {\n    }\n\n    function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\n    }\n    /**\n     * @dev Implementation of the ERC-1822 {proxiableUUID} function. This returns the storage slot used by the\n     * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\n     *\n     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n     * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\n     */\n    function proxiableUUID() external view virtual notDelegated returns (bytes32) {\n        return ERC1967Utils.IMPLEMENTATION_SLOT;\n    }\n\n    /**\n     * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n     * encoded in `data`.\n     *\n     * Calls {_authorizeUpgrade}.\n     *\n     * Emits an {Upgraded} event.\n     *\n     * @custom:oz-upgrades-unsafe-allow-reachable delegatecall\n     */\n    function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {\n        _authorizeUpgrade(newImplementation);\n        _upgradeToAndCallUUPS(newImplementation, data);\n    }\n\n    /**\n     * @dev Reverts if the execution is not performed via delegatecall or the execution\n     * context is not of a proxy with an ERC-1967 compliant implementation pointing to self.\n     */\n    function _checkProxy() internal view virtual {\n        if (\n            address(this) == __self || // Must be called through delegatecall\n            ERC1967Utils.getImplementation() != __self // Must be called through an active proxy\n        ) {\n            revert UUPSUnauthorizedCallContext();\n        }\n    }\n\n    /**\n     * @dev Reverts if the execution is performed via delegatecall.\n     * See {notDelegated}.\n     */\n    function _checkNotDelegated() internal view virtual {\n        if (address(this) != __self) {\n            // Must not be called through delegatecall\n            revert UUPSUnauthorizedCallContext();\n        }\n    }\n\n    /**\n     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n     * {upgradeToAndCall}.\n     *\n     * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n     *\n     * ```solidity\n     * function _authorizeUpgrade(address) internal onlyOwner {}\n     * ```\n     */\n    function _authorizeUpgrade(address newImplementation) internal virtual;\n\n    /**\n     * @dev Performs an implementation upgrade with a security check for UUPS proxies, and additional setup call.\n     *\n     * As a security check, {proxiableUUID} is invoked in the new implementation, and the return value\n     * is expected to be the implementation slot in ERC-1967.\n     *\n     * Emits an {IERC1967-Upgraded} event.\n     */\n    function _upgradeToAndCallUUPS(address newImplementation, bytes memory data) private {\n        try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n            if (slot != ERC1967Utils.IMPLEMENTATION_SLOT) {\n                revert UUPSUnsupportedProxiableUUID(slot);\n            }\n            ERC1967Utils.upgradeToAndCall(newImplementation, data);\n        } catch {\n            // The implementation is not UUPS\n            revert ERC1967Utils.ERC1967InvalidImplementation(newImplementation);\n        }\n    }\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {IERC20Metadata} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {ContextUpgradeable} from \"../../utils/ContextUpgradeable.sol\";\nimport {IERC20Errors} from \"@openzeppelin/contracts/interfaces/draft-IERC6093.sol\";\nimport {Initializable} from \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * The default value of {decimals} is 18. To change this, you should override\n * this function so it returns a different value.\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC-20\n * applications.\n */\nabstract contract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20, IERC20Metadata, IERC20Errors {\n    /// @custom:storage-location erc7201:openzeppelin.storage.ERC20\n    struct ERC20Storage {\n        mapping(address account => uint256) _balances;\n\n        mapping(address account => mapping(address spender => uint256)) _allowances;\n\n        uint256 _totalSupply;\n\n        string _name;\n        string _symbol;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.ERC20\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant ERC20StorageLocation = 0x52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00;\n\n    function _getERC20Storage() private pure returns (ERC20Storage storage $) {\n        assembly {\n            $.slot := ERC20StorageLocation\n        }\n    }\n\n    /**\n     * @dev Sets the values for {name} and {symbol}.\n     *\n     * Both values are immutable: they can only be set once during construction.\n     */\n    function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {\n        __ERC20_init_unchained(name_, symbol_);\n    }\n\n    function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {\n        ERC20Storage storage $ = _getERC20Storage();\n        $._name = name_;\n        $._symbol = symbol_;\n    }\n\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() public view virtual returns (string memory) {\n        ERC20Storage storage $ = _getERC20Storage();\n        return $._name;\n    }\n\n    /**\n     * @dev Returns the symbol of the token, usually a shorter version of the\n     * name.\n     */\n    function symbol() public view virtual returns (string memory) {\n        ERC20Storage storage $ = _getERC20Storage();\n        return $._symbol;\n    }\n\n    /**\n     * @dev Returns the number of decimals used to get its user representation.\n     * For example, if `decimals` equals `2`, a balance of `505` tokens should\n     * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n     *\n     * Tokens usually opt for a value of 18, imitating the relationship between\n     * Ether and Wei. This is the default value returned by this function, unless\n     * it's overridden.\n     *\n     * NOTE: This information is only used for _display_ purposes: it in\n     * no way affects any of the arithmetic of the contract, including\n     * {IERC20-balanceOf} and {IERC20-transfer}.\n     */\n    function decimals() public view virtual returns (uint8) {\n        return 18;\n    }\n\n    /// @inheritdoc IERC20\n    function totalSupply() public view virtual returns (uint256) {\n        ERC20Storage storage $ = _getERC20Storage();\n        return $._totalSupply;\n    }\n\n    /// @inheritdoc IERC20\n    function balanceOf(address account) public view virtual returns (uint256) {\n        ERC20Storage storage $ = _getERC20Storage();\n        return $._balances[account];\n    }\n\n    /**\n     * @dev See {IERC20-transfer}.\n     *\n     * Requirements:\n     *\n     * - `to` cannot be the zero address.\n     * - the caller must have a balance of at least `value`.\n     */\n    function transfer(address to, uint256 value) public virtual returns (bool) {\n        address owner = _msgSender();\n        _transfer(owner, to, value);\n        return true;\n    }\n\n    /// @inheritdoc IERC20\n    function allowance(address owner, address spender) public view virtual returns (uint256) {\n        ERC20Storage storage $ = _getERC20Storage();\n        return $._allowances[owner][spender];\n    }\n\n    /**\n     * @dev See {IERC20-approve}.\n     *\n     * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on\n     * `transferFrom`. This is semantically equivalent to an infinite approval.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     */\n    function approve(address spender, uint256 value) public virtual returns (bool) {\n        address owner = _msgSender();\n        _approve(owner, spender, value);\n        return true;\n    }\n\n    /**\n     * @dev See {IERC20-transferFrom}.\n     *\n     * Skips emitting an {Approval} event indicating an allowance update. This is not\n     * required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve].\n     *\n     * NOTE: Does not update the allowance if the current allowance\n     * is the maximum `uint256`.\n     *\n     * Requirements:\n     *\n     * - `from` and `to` cannot be the zero address.\n     * - `from` must have a balance of at least `value`.\n     * - the caller must have allowance for ``from``'s tokens of at least\n     * `value`.\n     */\n    function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {\n        address spender = _msgSender();\n        _spendAllowance(from, spender, value);\n        _transfer(from, to, value);\n        return true;\n    }\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to`.\n     *\n     * This internal function is equivalent to {transfer}, and can be used to\n     * e.g. implement automatic token fees, slashing mechanisms, etc.\n     *\n     * Emits a {Transfer} event.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead.\n     */\n    function _transfer(address from, address to, uint256 value) internal {\n        if (from == address(0)) {\n            revert ERC20InvalidSender(address(0));\n        }\n        if (to == address(0)) {\n            revert ERC20InvalidReceiver(address(0));\n        }\n        _update(from, to, value);\n    }\n\n    /**\n     * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`\n     * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding\n     * this function.\n     *\n     * Emits a {Transfer} event.\n     */\n    function _update(address from, address to, uint256 value) internal virtual {\n        ERC20Storage storage $ = _getERC20Storage();\n        if (from == address(0)) {\n            // Overflow check required: The rest of the code assumes that totalSupply never overflows\n            $._totalSupply += value;\n        } else {\n            uint256 fromBalance = $._balances[from];\n            if (fromBalance < value) {\n                revert ERC20InsufficientBalance(from, fromBalance, value);\n            }\n            unchecked {\n                // Overflow not possible: value <= fromBalance <= totalSupply.\n                $._balances[from] = fromBalance - value;\n            }\n        }\n\n        if (to == address(0)) {\n            unchecked {\n                // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.\n                $._totalSupply -= value;\n            }\n        } else {\n            unchecked {\n                // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.\n                $._balances[to] += value;\n            }\n        }\n\n        emit Transfer(from, to, value);\n    }\n\n    /**\n     * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).\n     * Relies on the `_update` mechanism\n     *\n     * Emits a {Transfer} event with `from` set to the zero address.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead.\n     */\n    function _mint(address account, uint256 value) internal {\n        if (account == address(0)) {\n            revert ERC20InvalidReceiver(address(0));\n        }\n        _update(address(0), account, value);\n    }\n\n    /**\n     * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.\n     * Relies on the `_update` mechanism.\n     *\n     * Emits a {Transfer} event with `to` set to the zero address.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead\n     */\n    function _burn(address account, uint256 value) internal {\n        if (account == address(0)) {\n            revert ERC20InvalidSender(address(0));\n        }\n        _update(account, address(0), value);\n    }\n\n    /**\n     * @dev Sets `value` as the allowance of `spender` over the `owner`'s tokens.\n     *\n     * This internal function is equivalent to `approve`, and can be used to\n     * e.g. set automatic allowances for certain subsystems, etc.\n     *\n     * Emits an {Approval} event.\n     *\n     * Requirements:\n     *\n     * - `owner` cannot be the zero address.\n     * - `spender` cannot be the zero address.\n     *\n     * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n     */\n    function _approve(address owner, address spender, uint256 value) internal {\n        _approve(owner, spender, value, true);\n    }\n\n    /**\n     * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.\n     *\n     * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by\n     * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any\n     * `Approval` event during `transferFrom` operations.\n     *\n     * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to\n     * true using the following override:\n     *\n     * ```solidity\n     * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {\n     *     super._approve(owner, spender, value, true);\n     * }\n     * ```\n     *\n     * Requirements are the same as {_approve}.\n     */\n    function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {\n        ERC20Storage storage $ = _getERC20Storage();\n        if (owner == address(0)) {\n            revert ERC20InvalidApprover(address(0));\n        }\n        if (spender == address(0)) {\n            revert ERC20InvalidSpender(address(0));\n        }\n        $._allowances[owner][spender] = value;\n        if (emitEvent) {\n            emit Approval(owner, spender, value);\n        }\n    }\n\n    /**\n     * @dev Updates `owner`'s allowance for `spender` based on spent `value`.\n     *\n     * Does not update the allowance value in case of infinite allowance.\n     * Revert if not enough allowance is available.\n     *\n     * Does not emit an {Approval} event.\n     */\n    function _spendAllowance(address owner, address spender, uint256 value) internal virtual {\n        uint256 currentAllowance = allowance(owner, spender);\n        if (currentAllowance < type(uint256).max) {\n            if (currentAllowance < value) {\n                revert ERC20InsufficientAllowance(spender, currentAllowance, value);\n            }\n            unchecked {\n                _approve(owner, spender, currentAllowance - value, false);\n            }\n        }\n    }\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC4626Upgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/extensions/ERC4626.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {IERC20Metadata} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {ERC20Upgradeable} from \"../ERC20Upgradeable.sol\";\nimport {SafeERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {IERC4626} from \"@openzeppelin/contracts/interfaces/IERC4626.sol\";\nimport {Math} from \"@openzeppelin/contracts/utils/math/Math.sol\";\nimport {Initializable} from \"../../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the ERC-4626 \"Tokenized Vault Standard\" as defined in\n * https://eips.ethereum.org/EIPS/eip-4626[ERC-4626].\n *\n * This extension allows the minting and burning of \"shares\" (represented using the ERC-20 inheritance) in exchange for\n * underlying \"assets\" through standardized {deposit}, {mint}, {redeem} and {burn} workflows. This contract extends\n * the ERC-20 standard. Any additional extensions included along it would affect the \"shares\" token represented by this\n * contract and not the \"assets\" token which is an independent contract.\n *\n * [CAUTION]\n * ====\n * In empty (or nearly empty) ERC-4626 vaults, deposits are at high risk of being stolen through frontrunning\n * with a \"donation\" to the vault that inflates the price of a share. This is variously known as a donation or inflation\n * attack and is essentially a problem of slippage. Vault deployers can protect against this attack by making an initial\n * deposit of a non-trivial amount of the asset, such that price manipulation becomes infeasible. Withdrawals may\n * similarly be affected by slippage. Users can protect against this attack as well as unexpected slippage in general by\n * verifying the amount received is as expected, using a wrapper that performs these checks such as\n * https://github.com/fei-protocol/ERC4626#erc4626router-and-base[ERC4626Router].\n *\n * Since v4.9, this implementation introduces configurable virtual assets and shares to help developers mitigate that risk.\n * The `_decimalsOffset()` corresponds to an offset in the decimal representation between the underlying asset's decimals\n * and the vault decimals. This offset also determines the rate of virtual shares to virtual assets in the vault, which\n * itself determines the initial exchange rate. While not fully preventing the attack, analysis shows that the default\n * offset (0) makes it non-profitable even if an attacker is able to capture value from multiple user deposits, as a result\n * of the value being captured by the virtual shares (out of the attacker's donation) matching the attacker's expected gains.\n * With a larger offset, the attack becomes orders of magnitude more expensive than it is profitable. More details about the\n * underlying math can be found xref:ROOT:erc4626.adoc#inflation-attack[here].\n *\n * The drawback of this approach is that the virtual shares do capture (a very small) part of the value being accrued\n * to the vault. Also, if the vault experiences losses, the users try to exit the vault, the virtual shares and assets\n * will cause the first user to exit to experience reduced losses in detriment to the last users that will experience\n * bigger losses. Developers willing to revert back to the pre-v4.9 behavior just need to override the\n * `_convertToShares` and `_convertToAssets` functions.\n *\n * To learn more, check out our xref:ROOT:erc4626.adoc[ERC-4626 guide].\n * ====\n */\nabstract contract ERC4626Upgradeable is Initializable, ERC20Upgradeable, IERC4626 {\n    using Math for uint256;\n\n    /// @custom:storage-location erc7201:openzeppelin.storage.ERC4626\n    struct ERC4626Storage {\n        IERC20 _asset;\n        uint8 _underlyingDecimals;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.ERC4626\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant ERC4626StorageLocation = 0x0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e00;\n\n    function _getERC4626Storage() private pure returns (ERC4626Storage storage $) {\n        assembly {\n            $.slot := ERC4626StorageLocation\n        }\n    }\n\n    /**\n     * @dev Attempted to deposit more assets than the max amount for `receiver`.\n     */\n    error ERC4626ExceededMaxDeposit(address receiver, uint256 assets, uint256 max);\n\n    /**\n     * @dev Attempted to mint more shares than the max amount for `receiver`.\n     */\n    error ERC4626ExceededMaxMint(address receiver, uint256 shares, uint256 max);\n\n    /**\n     * @dev Attempted to withdraw more assets than the max amount for `receiver`.\n     */\n    error ERC4626ExceededMaxWithdraw(address owner, uint256 assets, uint256 max);\n\n    /**\n     * @dev Attempted to redeem more shares than the max amount for `receiver`.\n     */\n    error ERC4626ExceededMaxRedeem(address owner, uint256 shares, uint256 max);\n\n    /**\n     * @dev Set the underlying asset contract. This must be an ERC20-compatible contract (ERC-20 or ERC-777).\n     */\n    function __ERC4626_init(IERC20 asset_) internal onlyInitializing {\n        __ERC4626_init_unchained(asset_);\n    }\n\n    function __ERC4626_init_unchained(IERC20 asset_) internal onlyInitializing {\n        ERC4626Storage storage $ = _getERC4626Storage();\n        (bool success, uint8 assetDecimals) = _tryGetAssetDecimals(asset_);\n        $._underlyingDecimals = success ? assetDecimals : 18;\n        $._asset = asset_;\n    }\n\n    /**\n     * @dev Attempts to fetch the asset decimals. A return value of false indicates that the attempt failed in some way.\n     */\n    function _tryGetAssetDecimals(IERC20 asset_) private view returns (bool ok, uint8 assetDecimals) {\n        (bool success, bytes memory encodedDecimals) = address(asset_).staticcall(\n            abi.encodeCall(IERC20Metadata.decimals, ())\n        );\n        if (success && encodedDecimals.length >= 32) {\n            uint256 returnedDecimals = abi.decode(encodedDecimals, (uint256));\n            if (returnedDecimals <= type(uint8).max) {\n                return (true, uint8(returnedDecimals));\n            }\n        }\n        return (false, 0);\n    }\n\n    /**\n     * @dev Decimals are computed by adding the decimal offset on top of the underlying asset's decimals. This\n     * \"original\" value is cached during construction of the vault contract. If this read operation fails (e.g., the\n     * asset has not been created yet), a default of 18 is used to represent the underlying asset's decimals.\n     *\n     * See {IERC20Metadata-decimals}.\n     */\n    function decimals() public view virtual override(IERC20Metadata, ERC20Upgradeable) returns (uint8) {\n        ERC4626Storage storage $ = _getERC4626Storage();\n        return $._underlyingDecimals + _decimalsOffset();\n    }\n\n    /// @inheritdoc IERC4626\n    function asset() public view virtual returns (address) {\n        ERC4626Storage storage $ = _getERC4626Storage();\n        return address($._asset);\n    }\n\n    /// @inheritdoc IERC4626\n    function totalAssets() public view virtual returns (uint256) {\n        return IERC20(asset()).balanceOf(address(this));\n    }\n\n    /// @inheritdoc IERC4626\n    function convertToShares(uint256 assets) public view virtual returns (uint256) {\n        return _convertToShares(assets, Math.Rounding.Floor);\n    }\n\n    /// @inheritdoc IERC4626\n    function convertToAssets(uint256 shares) public view virtual returns (uint256) {\n        return _convertToAssets(shares, Math.Rounding.Floor);\n    }\n\n    /// @inheritdoc IERC4626\n    function maxDeposit(address) public view virtual returns (uint256) {\n        return type(uint256).max;\n    }\n\n    /// @inheritdoc IERC4626\n    function maxMint(address) public view virtual returns (uint256) {\n        return type(uint256).max;\n    }\n\n    /// @inheritdoc IERC4626\n    function maxWithdraw(address owner) public view virtual returns (uint256) {\n        return _convertToAssets(balanceOf(owner), Math.Rounding.Floor);\n    }\n\n    /// @inheritdoc IERC4626\n    function maxRedeem(address owner) public view virtual returns (uint256) {\n        return balanceOf(owner);\n    }\n\n    /// @inheritdoc IERC4626\n    function previewDeposit(uint256 assets) public view virtual returns (uint256) {\n        return _convertToShares(assets, Math.Rounding.Floor);\n    }\n\n    /// @inheritdoc IERC4626\n    function previewMint(uint256 shares) public view virtual returns (uint256) {\n        return _convertToAssets(shares, Math.Rounding.Ceil);\n    }\n\n    /// @inheritdoc IERC4626\n    function previewWithdraw(uint256 assets) public view virtual returns (uint256) {\n        return _convertToShares(assets, Math.Rounding.Ceil);\n    }\n\n    /// @inheritdoc IERC4626\n    function previewRedeem(uint256 shares) public view virtual returns (uint256) {\n        return _convertToAssets(shares, Math.Rounding.Floor);\n    }\n\n    /// @inheritdoc IERC4626\n    function deposit(uint256 assets, address receiver) public virtual returns (uint256) {\n        uint256 maxAssets = maxDeposit(receiver);\n        if (assets > maxAssets) {\n            revert ERC4626ExceededMaxDeposit(receiver, assets, maxAssets);\n        }\n\n        uint256 shares = previewDeposit(assets);\n        _deposit(_msgSender(), receiver, assets, shares);\n\n        return shares;\n    }\n\n    /// @inheritdoc IERC4626\n    function mint(uint256 shares, address receiver) public virtual returns (uint256) {\n        uint256 maxShares = maxMint(receiver);\n        if (shares > maxShares) {\n            revert ERC4626ExceededMaxMint(receiver, shares, maxShares);\n        }\n\n        uint256 assets = previewMint(shares);\n        _deposit(_msgSender(), receiver, assets, shares);\n\n        return assets;\n    }\n\n    /// @inheritdoc IERC4626\n    function withdraw(uint256 assets, address receiver, address owner) public virtual returns (uint256) {\n        uint256 maxAssets = maxWithdraw(owner);\n        if (assets > maxAssets) {\n            revert ERC4626ExceededMaxWithdraw(owner, assets, maxAssets);\n        }\n\n        uint256 shares = previewWithdraw(assets);\n        _withdraw(_msgSender(), receiver, owner, assets, shares);\n\n        return shares;\n    }\n\n    /// @inheritdoc IERC4626\n    function redeem(uint256 shares, address receiver, address owner) public virtual returns (uint256) {\n        uint256 maxShares = maxRedeem(owner);\n        if (shares > maxShares) {\n            revert ERC4626ExceededMaxRedeem(owner, shares, maxShares);\n        }\n\n        uint256 assets = previewRedeem(shares);\n        _withdraw(_msgSender(), receiver, owner, assets, shares);\n\n        return assets;\n    }\n\n    /**\n     * @dev Internal conversion function (from assets to shares) with support for rounding direction.\n     */\n    function _convertToShares(uint256 assets, Math.Rounding rounding) internal view virtual returns (uint256) {\n        return assets.mulDiv(totalSupply() + 10 ** _decimalsOffset(), totalAssets() + 1, rounding);\n    }\n\n    /**\n     * @dev Internal conversion function (from shares to assets) with support for rounding direction.\n     */\n    function _convertToAssets(uint256 shares, Math.Rounding rounding) internal view virtual returns (uint256) {\n        return shares.mulDiv(totalAssets() + 1, totalSupply() + 10 ** _decimalsOffset(), rounding);\n    }\n\n    /**\n     * @dev Deposit/mint common workflow.\n     */\n    function _deposit(address caller, address receiver, uint256 assets, uint256 shares) internal virtual {\n        // If asset() is ERC-777, `transferFrom` can trigger a reentrancy BEFORE the transfer happens through the\n        // `tokensToSend` hook. On the other hand, the `tokenReceived` hook, that is triggered after the transfer,\n        // calls the vault, which is assumed not malicious.\n        //\n        // Conclusion: we need to do the transfer before we mint so that any reentrancy would happen before the\n        // assets are transferred and before the shares are minted, which is a valid state.\n        // slither-disable-next-line reentrancy-no-eth\n        SafeERC20.safeTransferFrom(IERC20(asset()), caller, address(this), assets);\n        _mint(receiver, shares);\n\n        emit Deposit(caller, receiver, assets, shares);\n    }\n\n    /**\n     * @dev Withdraw/redeem common workflow.\n     */\n    function _withdraw(\n        address caller,\n        address receiver,\n        address owner,\n        uint256 assets,\n        uint256 shares\n    ) internal virtual {\n        if (caller != owner) {\n            _spendAllowance(owner, caller, shares);\n        }\n\n        // If asset() is ERC-777, `transfer` can trigger a reentrancy AFTER the transfer happens through the\n        // `tokensReceived` hook. On the other hand, the `tokensToSend` hook, that is triggered before the transfer,\n        // calls the vault, which is assumed not malicious.\n        //\n        // Conclusion: we need to do the transfer after the burn so that any reentrancy would happen after the\n        // shares are burned and after the assets are transferred, which is a valid state.\n        _burn(owner, shares);\n        SafeERC20.safeTransfer(IERC20(asset()), receiver, assets);\n\n        emit Withdraw(caller, receiver, owner, assets, shares);\n    }\n\n    function _decimalsOffset() internal view virtual returns (uint8) {\n        return 0;\n    }\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n    function __Context_init() internal onlyInitializing {\n    }\n\n    function __Context_init_unchained() internal onlyInitializing {\n    }\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    function _contextSuffixLength() internal view virtual returns (uint256) {\n        return 0;\n    }\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol)\n\npragma solidity ^0.8.20;\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,\n * consider using {ReentrancyGuardTransient} instead.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n    // Booleans are more expensive than uint256 or any type that takes up a full\n    // word because each write operation emits an extra SLOAD to first read the\n    // slot's contents, replace the bits taken up by the boolean, and then write\n    // back. This is the compiler's defense against contract upgrades and\n    // pointer aliasing, and it cannot be disabled.\n\n    // The values being non-zero value makes deployment a bit more expensive,\n    // but in exchange the refund on every call to nonReentrant will be lower in\n    // amount. Since refunds are capped to a percentage of the total\n    // transaction's gas, it is best to keep them low in cases like this one, to\n    // increase the likelihood of the full refund coming into effect.\n    uint256 private constant NOT_ENTERED = 1;\n    uint256 private constant ENTERED = 2;\n\n    /// @custom:storage-location erc7201:openzeppelin.storage.ReentrancyGuard\n    struct ReentrancyGuardStorage {\n        uint256 _status;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.ReentrancyGuard\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant ReentrancyGuardStorageLocation = 0x9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00;\n\n    function _getReentrancyGuardStorage() private pure returns (ReentrancyGuardStorage storage $) {\n        assembly {\n            $.slot := ReentrancyGuardStorageLocation\n        }\n    }\n\n    /**\n     * @dev Unauthorized reentrant call.\n     */\n    error ReentrancyGuardReentrantCall();\n\n    function __ReentrancyGuard_init() internal onlyInitializing {\n        __ReentrancyGuard_init_unchained();\n    }\n\n    function __ReentrancyGuard_init_unchained() internal onlyInitializing {\n        ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();\n        $._status = NOT_ENTERED;\n    }\n\n    /**\n     * @dev Prevents a contract from calling itself, directly or indirectly.\n     * Calling a `nonReentrant` function from another `nonReentrant`\n     * function is not supported. It is possible to prevent this from happening\n     * by making the `nonReentrant` function external, and making it call a\n     * `private` function that does the actual work.\n     */\n    modifier nonReentrant() {\n        _nonReentrantBefore();\n        _;\n        _nonReentrantAfter();\n    }\n\n    function _nonReentrantBefore() private {\n        ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();\n        // On the first call to nonReentrant, _status will be NOT_ENTERED\n        if ($._status == ENTERED) {\n            revert ReentrancyGuardReentrantCall();\n        }\n\n        // Any calls to nonReentrant after this point will fail\n        $._status = ENTERED;\n    }\n\n    function _nonReentrantAfter() private {\n        ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();\n        // By storing the original value once again, a refund is triggered (see\n        // https://eips.ethereum.org/EIPS/eip-2200)\n        $._status = NOT_ENTERED;\n    }\n\n    /**\n     * @dev Returns true if the reentrancy guard is currently set to \"entered\", which indicates there is a\n     * `nonReentrant` function in the call stack.\n     */\n    function _reentrancyGuardEntered() internal view returns (bool) {\n        ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();\n        return $._status == ENTERED;\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/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":"@openzeppelin/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":"@openzeppelin/contracts/interfaces/IERC1967.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC1967.sol)\n\npragma solidity >=0.4.11;\n\n/**\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\n */\ninterface IERC1967 {\n    /**\n     * @dev Emitted when the implementation is upgraded.\n     */\n    event Upgraded(address indexed implementation);\n\n    /**\n     * @dev Emitted when the admin account has changed.\n     */\n    event AdminChanged(address previousAdmin, address newAdmin);\n\n    /**\n     * @dev Emitted when the beacon is changed.\n     */\n    event BeaconUpgraded(address indexed beacon);\n}\n"},{"file_path":"@openzeppelin/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":"@openzeppelin/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":"@openzeppelin/contracts/interfaces/draft-IERC1822.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity >=0.4.16;\n\n/**\n * @dev ERC-1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n    /**\n     * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n     * address.\n     *\n     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n     * function revert if invoked through a proxy.\n     */\n    function proxiableUUID() external view returns (bytes32);\n}\n"},{"file_path":"@openzeppelin/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":"@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (proxy/ERC1967/ERC1967Utils.sol)\n\npragma solidity ^0.8.21;\n\nimport {IBeacon} from \"../beacon/IBeacon.sol\";\nimport {IERC1967} from \"../../interfaces/IERC1967.sol\";\nimport {Address} from \"../../utils/Address.sol\";\nimport {StorageSlot} from \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This library provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[ERC-1967] slots.\n */\nlibrary ERC1967Utils {\n    /**\n     * @dev Storage slot with the address of the current implementation.\n     * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1.\n     */\n    // solhint-disable-next-line private-vars-leading-underscore\n    bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n    /**\n     * @dev The `implementation` of the proxy is invalid.\n     */\n    error ERC1967InvalidImplementation(address implementation);\n\n    /**\n     * @dev The `admin` of the proxy is invalid.\n     */\n    error ERC1967InvalidAdmin(address admin);\n\n    /**\n     * @dev The `beacon` of the proxy is invalid.\n     */\n    error ERC1967InvalidBeacon(address beacon);\n\n    /**\n     * @dev An upgrade function sees `msg.value > 0` that may be lost.\n     */\n    error ERC1967NonPayable();\n\n    /**\n     * @dev Returns the current implementation address.\n     */\n    function getImplementation() internal view returns (address) {\n        return StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new address in the ERC-1967 implementation slot.\n     */\n    function _setImplementation(address newImplementation) private {\n        if (newImplementation.code.length == 0) {\n            revert ERC1967InvalidImplementation(newImplementation);\n        }\n        StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation;\n    }\n\n    /**\n     * @dev Performs implementation upgrade with additional setup call if data is nonempty.\n     * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected\n     * to avoid stuck value in the contract.\n     *\n     * Emits an {IERC1967-Upgraded} event.\n     */\n    function upgradeToAndCall(address newImplementation, bytes memory data) internal {\n        _setImplementation(newImplementation);\n        emit IERC1967.Upgraded(newImplementation);\n\n        if (data.length > 0) {\n            Address.functionDelegateCall(newImplementation, data);\n        } else {\n            _checkNonPayable();\n        }\n    }\n\n    /**\n     * @dev Storage slot with the admin of the contract.\n     * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1.\n     */\n    // solhint-disable-next-line private-vars-leading-underscore\n    bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n    /**\n     * @dev Returns the current admin.\n     *\n     * TIP: To get this value clients can read directly from the storage slot shown below (specified by ERC-1967) using\n     * the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n     * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n     */\n    function getAdmin() internal view returns (address) {\n        return StorageSlot.getAddressSlot(ADMIN_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new address in the ERC-1967 admin slot.\n     */\n    function _setAdmin(address newAdmin) private {\n        if (newAdmin == address(0)) {\n            revert ERC1967InvalidAdmin(address(0));\n        }\n        StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin;\n    }\n\n    /**\n     * @dev Changes the admin of the proxy.\n     *\n     * Emits an {IERC1967-AdminChanged} event.\n     */\n    function changeAdmin(address newAdmin) internal {\n        emit IERC1967.AdminChanged(getAdmin(), newAdmin);\n        _setAdmin(newAdmin);\n    }\n\n    /**\n     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n     * This is the keccak-256 hash of \"eip1967.proxy.beacon\" subtracted by 1.\n     */\n    // solhint-disable-next-line private-vars-leading-underscore\n    bytes32 internal constant BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n    /**\n     * @dev Returns the current beacon.\n     */\n    function getBeacon() internal view returns (address) {\n        return StorageSlot.getAddressSlot(BEACON_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new beacon in the ERC-1967 beacon slot.\n     */\n    function _setBeacon(address newBeacon) private {\n        if (newBeacon.code.length == 0) {\n            revert ERC1967InvalidBeacon(newBeacon);\n        }\n\n        StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon;\n\n        address beaconImplementation = IBeacon(newBeacon).implementation();\n        if (beaconImplementation.code.length == 0) {\n            revert ERC1967InvalidImplementation(beaconImplementation);\n        }\n    }\n\n    /**\n     * @dev Change the beacon and trigger a setup call if data is nonempty.\n     * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected\n     * to avoid stuck value in the contract.\n     *\n     * Emits an {IERC1967-BeaconUpgraded} event.\n     *\n     * CAUTION: Invoking this function has no effect on an instance of {BeaconProxy} since v5, since\n     * it uses an immutable beacon without looking at the value of the ERC-1967 beacon slot for\n     * efficiency.\n     */\n    function upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal {\n        _setBeacon(newBeacon);\n        emit IERC1967.BeaconUpgraded(newBeacon);\n\n        if (data.length > 0) {\n            Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n        } else {\n            _checkNonPayable();\n        }\n    }\n\n    /**\n     * @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract\n     * if an upgrade doesn't perform an initialization call.\n     */\n    function _checkNonPayable() private {\n        if (msg.value > 0) {\n            revert ERC1967NonPayable();\n        }\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/proxy/beacon/IBeacon.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (proxy/beacon/IBeacon.sol)\n\npragma solidity >=0.4.16;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n    /**\n     * @dev Must return an address that can be used as a delegate call target.\n     *\n     * {UpgradeableBeacon} will check that this address is a contract.\n     */\n    function implementation() external view returns (address);\n}\n"},{"file_path":"@openzeppelin/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":"@openzeppelin/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":"@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/extensions/IERC20Permit.sol)\n\npragma solidity >=0.4.16;\n\n/**\n * @dev Interface of the ERC-20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[ERC-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC-20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * ==== Security Considerations\n *\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n * generally recommended is:\n *\n * ```solidity\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n *     doThing(..., value);\n * }\n *\n * function doThing(..., uint256 value) public {\n *     token.safeTransferFrom(msg.sender, address(this), value);\n *     ...\n * }\n * ```\n *\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n * {SafeERC20-safeTransferFrom}).\n *\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n * contracts should have entry points that don't rely on permit.\n */\ninterface IERC20Permit {\n    /**\n     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n     * given ``owner``'s signed approval.\n     *\n     * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n     * ordering also apply here.\n     *\n     * Emits an {Approval} event.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     * - `deadline` must be a timestamp in the future.\n     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n     * over the EIP712-formatted function arguments.\n     * - the signature must use ``owner``'s current nonce (see {nonces}).\n     *\n     * For more information on the signature format, see the\n     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n     * section].\n     *\n     * CAUTION: See Security Considerations above.\n     */\n    function permit(\n        address owner,\n        address spender,\n        uint256 value,\n        uint256 deadline,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) external;\n\n    /**\n     * @dev Returns the current nonce for `owner`. This value must be\n     * included whenever a signature is generated for {permit}.\n     *\n     * Every successful call to {permit} increases ``owner``'s nonce by one. This\n     * prevents a signature from being used multiple times.\n     */\n    function nonces(address owner) external view returns (uint256);\n\n    /**\n     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n     */\n    // solhint-disable-next-line func-name-mixedcase\n    function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n"},{"file_path":"@openzeppelin/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":"@openzeppelin/contracts/utils/Address.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (utils/Address.sol)\n\npragma solidity ^0.8.20;\n\nimport {Errors} from \"./Errors.sol\";\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n    /**\n     * @dev There's no code at `target` (it is not a contract).\n     */\n    error AddressEmptyCode(address target);\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        if (address(this).balance < amount) {\n            revert Errors.InsufficientBalance(address(this).balance, amount);\n        }\n\n        (bool success, bytes memory returndata) = recipient.call{value: amount}(\"\");\n        if (!success) {\n            _revert(returndata);\n        }\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason or custom error, it is bubbled\n     * up by this function (like regular Solidity function calls). However, if\n     * the call reverted with no returned reason, this function reverts with a\n     * {Errors.FailedCall} error.\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     */\n    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n        if (address(this).balance < value) {\n            revert Errors.InsufficientBalance(address(this).balance, value);\n        }\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResultFromTarget(target, success, returndata);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResultFromTarget(target, success, returndata);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a delegate call.\n     */\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.delegatecall(data);\n        return verifyCallResultFromTarget(target, success, returndata);\n    }\n\n    /**\n     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n     * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case\n     * of an unsuccessful call.\n     */\n    function verifyCallResultFromTarget(\n        address target,\n        bool success,\n        bytes memory returndata\n    ) internal view returns (bytes memory) {\n        if (!success) {\n            _revert(returndata);\n        } else {\n            // only check if target is a contract if the call was successful and the return data is empty\n            // otherwise we already know that it was a contract\n            if (returndata.length == 0 && target.code.length == 0) {\n                revert AddressEmptyCode(target);\n            }\n            return returndata;\n        }\n    }\n\n    /**\n     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n     * revert reason or with a default {Errors.FailedCall} error.\n     */\n    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n        if (!success) {\n            _revert(returndata);\n        } else {\n            return returndata;\n        }\n    }\n\n    /**\n     * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.\n     */\n    function _revert(bytes memory returndata) private pure {\n        // Look for revert reason and bubble it up if present\n        if (returndata.length > 0) {\n            // The easiest way to bubble the revert reason is using memory via assembly\n            assembly (\"memory-safe\") {\n                revert(add(returndata, 0x20), mload(returndata))\n            }\n        } else {\n            revert Errors.FailedCall();\n        }\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/utils/Errors.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Collection of common custom errors used in multiple contracts\n *\n * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.\n * It is recommended to avoid relying on the error API for critical functionality.\n *\n * _Available since v5.1._\n */\nlibrary Errors {\n    /**\n     * @dev The ETH balance of the account is not enough to perform the operation.\n     */\n    error InsufficientBalance(uint256 balance, uint256 needed);\n\n    /**\n     * @dev A call to an address target failed. The target may have reverted.\n     */\n    error FailedCall();\n\n    /**\n     * @dev The deployment failed.\n     */\n    error FailedDeployment();\n\n    /**\n     * @dev A necessary precompile is missing.\n     */\n    error MissingPrecompile(address);\n}\n"},{"file_path":"@openzeppelin/contracts/utils/Panic.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Helper library for emitting standardized panic codes.\n *\n * ```solidity\n * contract Example {\n *      using Panic for uint256;\n *\n *      // Use any of the declared internal constants\n *      function foo() { Panic.GENERIC.panic(); }\n *\n *      // Alternatively\n *      function foo() { Panic.panic(Panic.GENERIC); }\n * }\n * ```\n *\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\n *\n * _Available since v5.1._\n */\n// slither-disable-next-line unused-state\nlibrary Panic {\n    /// @dev generic / unspecified error\n    uint256 internal constant GENERIC = 0x00;\n    /// @dev used by the assert() builtin\n    uint256 internal constant ASSERT = 0x01;\n    /// @dev arithmetic underflow or overflow\n    uint256 internal constant UNDER_OVERFLOW = 0x11;\n    /// @dev division or modulo by zero\n    uint256 internal constant DIVISION_BY_ZERO = 0x12;\n    /// @dev enum conversion error\n    uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\n    /// @dev invalid encoding in storage\n    uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\n    /// @dev empty array pop\n    uint256 internal constant EMPTY_ARRAY_POP = 0x31;\n    /// @dev array out of bounds access\n    uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\n    /// @dev resource error (too large allocation or too large array)\n    uint256 internal constant RESOURCE_ERROR = 0x41;\n    /// @dev calling invalid internal function\n    uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\n\n    /// @dev Reverts with a panic code. Recommended to use with\n    /// the internal constants with predefined codes.\n    function panic(uint256 code) internal pure {\n        assembly (\"memory-safe\") {\n            mstore(0x00, 0x4e487b71)\n            mstore(0x20, code)\n            revert(0x1c, 0x24)\n        }\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/utils/StorageSlot.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC-1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n *     // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\n *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n *     function _getImplementation() internal view returns (address) {\n *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n *     }\n *\n *     function _setImplementation(address newImplementation) internal {\n *         require(newImplementation.code.length > 0);\n *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n *     }\n * }\n * ```\n *\n * TIP: Consider using this library along with {SlotDerivation}.\n */\nlibrary StorageSlot {\n    struct AddressSlot {\n        address value;\n    }\n\n    struct BooleanSlot {\n        bool value;\n    }\n\n    struct Bytes32Slot {\n        bytes32 value;\n    }\n\n    struct Uint256Slot {\n        uint256 value;\n    }\n\n    struct Int256Slot {\n        int256 value;\n    }\n\n    struct StringSlot {\n        string value;\n    }\n\n    struct BytesSlot {\n        bytes value;\n    }\n\n    /**\n     * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n     */\n    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\n     */\n    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\n     */\n    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\n     */\n    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `Int256Slot` with member `value` located at `slot`.\n     */\n    function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `StringSlot` with member `value` located at `slot`.\n     */\n    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n     */\n    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := store.slot\n        }\n    }\n\n    /**\n     * @dev Returns a `BytesSlot` with member `value` located at `slot`.\n     */\n    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n     */\n    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := store.slot\n        }\n    }\n}\n"},{"file_path":"@openzeppelin/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":"@openzeppelin/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":"@openzeppelin/contracts/utils/math/SafeCast.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeCast {\n    /**\n     * @dev Value doesn't fit in an uint of `bits` size.\n     */\n    error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\n\n    /**\n     * @dev An int value doesn't fit in an uint of `bits` size.\n     */\n    error SafeCastOverflowedIntToUint(int256 value);\n\n    /**\n     * @dev Value doesn't fit in an int of `bits` size.\n     */\n    error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\n\n    /**\n     * @dev An uint value doesn't fit in an int of `bits` size.\n     */\n    error SafeCastOverflowedUintToInt(uint256 value);\n\n    /**\n     * @dev Returns the downcasted uint248 from uint256, reverting on\n     * overflow (when the input is greater than largest uint248).\n     *\n     * Counterpart to Solidity's `uint248` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 248 bits\n     */\n    function toUint248(uint256 value) internal pure returns (uint248) {\n        if (value > type(uint248).max) {\n            revert SafeCastOverflowedUintDowncast(248, value);\n        }\n        return uint248(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint240 from uint256, reverting on\n     * overflow (when the input is greater than largest uint240).\n     *\n     * Counterpart to Solidity's `uint240` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 240 bits\n     */\n    function toUint240(uint256 value) internal pure returns (uint240) {\n        if (value > type(uint240).max) {\n            revert SafeCastOverflowedUintDowncast(240, value);\n        }\n        return uint240(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint232 from uint256, reverting on\n     * overflow (when the input is greater than largest uint232).\n     *\n     * Counterpart to Solidity's `uint232` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 232 bits\n     */\n    function toUint232(uint256 value) internal pure returns (uint232) {\n        if (value > type(uint232).max) {\n            revert SafeCastOverflowedUintDowncast(232, value);\n        }\n        return uint232(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint224 from uint256, reverting on\n     * overflow (when the input is greater than largest uint224).\n     *\n     * Counterpart to Solidity's `uint224` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 224 bits\n     */\n    function toUint224(uint256 value) internal pure returns (uint224) {\n        if (value > type(uint224).max) {\n            revert SafeCastOverflowedUintDowncast(224, value);\n        }\n        return uint224(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint216 from uint256, reverting on\n     * overflow (when the input is greater than largest uint216).\n     *\n     * Counterpart to Solidity's `uint216` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 216 bits\n     */\n    function toUint216(uint256 value) internal pure returns (uint216) {\n        if (value > type(uint216).max) {\n            revert SafeCastOverflowedUintDowncast(216, value);\n        }\n        return uint216(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint208 from uint256, reverting on\n     * overflow (when the input is greater than largest uint208).\n     *\n     * Counterpart to Solidity's `uint208` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 208 bits\n     */\n    function toUint208(uint256 value) internal pure returns (uint208) {\n        if (value > type(uint208).max) {\n            revert SafeCastOverflowedUintDowncast(208, value);\n        }\n        return uint208(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint200 from uint256, reverting on\n     * overflow (when the input is greater than largest uint200).\n     *\n     * Counterpart to Solidity's `uint200` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 200 bits\n     */\n    function toUint200(uint256 value) internal pure returns (uint200) {\n        if (value > type(uint200).max) {\n            revert SafeCastOverflowedUintDowncast(200, value);\n        }\n        return uint200(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint192 from uint256, reverting on\n     * overflow (when the input is greater than largest uint192).\n     *\n     * Counterpart to Solidity's `uint192` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 192 bits\n     */\n    function toUint192(uint256 value) internal pure returns (uint192) {\n        if (value > type(uint192).max) {\n            revert SafeCastOverflowedUintDowncast(192, value);\n        }\n        return uint192(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint184 from uint256, reverting on\n     * overflow (when the input is greater than largest uint184).\n     *\n     * Counterpart to Solidity's `uint184` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 184 bits\n     */\n    function toUint184(uint256 value) internal pure returns (uint184) {\n        if (value > type(uint184).max) {\n            revert SafeCastOverflowedUintDowncast(184, value);\n        }\n        return uint184(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint176 from uint256, reverting on\n     * overflow (when the input is greater than largest uint176).\n     *\n     * Counterpart to Solidity's `uint176` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 176 bits\n     */\n    function toUint176(uint256 value) internal pure returns (uint176) {\n        if (value > type(uint176).max) {\n            revert SafeCastOverflowedUintDowncast(176, value);\n        }\n        return uint176(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint168 from uint256, reverting on\n     * overflow (when the input is greater than largest uint168).\n     *\n     * Counterpart to Solidity's `uint168` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 168 bits\n     */\n    function toUint168(uint256 value) internal pure returns (uint168) {\n        if (value > type(uint168).max) {\n            revert SafeCastOverflowedUintDowncast(168, value);\n        }\n        return uint168(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint160 from uint256, reverting on\n     * overflow (when the input is greater than largest uint160).\n     *\n     * Counterpart to Solidity's `uint160` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 160 bits\n     */\n    function toUint160(uint256 value) internal pure returns (uint160) {\n        if (value > type(uint160).max) {\n            revert SafeCastOverflowedUintDowncast(160, value);\n        }\n        return uint160(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint152 from uint256, reverting on\n     * overflow (when the input is greater than largest uint152).\n     *\n     * Counterpart to Solidity's `uint152` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 152 bits\n     */\n    function toUint152(uint256 value) internal pure returns (uint152) {\n        if (value > type(uint152).max) {\n            revert SafeCastOverflowedUintDowncast(152, value);\n        }\n        return uint152(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint144 from uint256, reverting on\n     * overflow (when the input is greater than largest uint144).\n     *\n     * Counterpart to Solidity's `uint144` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 144 bits\n     */\n    function toUint144(uint256 value) internal pure returns (uint144) {\n        if (value > type(uint144).max) {\n            revert SafeCastOverflowedUintDowncast(144, value);\n        }\n        return uint144(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint136 from uint256, reverting on\n     * overflow (when the input is greater than largest uint136).\n     *\n     * Counterpart to Solidity's `uint136` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 136 bits\n     */\n    function toUint136(uint256 value) internal pure returns (uint136) {\n        if (value > type(uint136).max) {\n            revert SafeCastOverflowedUintDowncast(136, value);\n        }\n        return uint136(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint128 from uint256, reverting on\n     * overflow (when the input is greater than largest uint128).\n     *\n     * Counterpart to Solidity's `uint128` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 128 bits\n     */\n    function toUint128(uint256 value) internal pure returns (uint128) {\n        if (value > type(uint128).max) {\n            revert SafeCastOverflowedUintDowncast(128, value);\n        }\n        return uint128(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint120 from uint256, reverting on\n     * overflow (when the input is greater than largest uint120).\n     *\n     * Counterpart to Solidity's `uint120` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 120 bits\n     */\n    function toUint120(uint256 value) internal pure returns (uint120) {\n        if (value > type(uint120).max) {\n            revert SafeCastOverflowedUintDowncast(120, value);\n        }\n        return uint120(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint112 from uint256, reverting on\n     * overflow (when the input is greater than largest uint112).\n     *\n     * Counterpart to Solidity's `uint112` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 112 bits\n     */\n    function toUint112(uint256 value) internal pure returns (uint112) {\n        if (value > type(uint112).max) {\n            revert SafeCastOverflowedUintDowncast(112, value);\n        }\n        return uint112(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint104 from uint256, reverting on\n     * overflow (when the input is greater than largest uint104).\n     *\n     * Counterpart to Solidity's `uint104` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 104 bits\n     */\n    function toUint104(uint256 value) internal pure returns (uint104) {\n        if (value > type(uint104).max) {\n            revert SafeCastOverflowedUintDowncast(104, value);\n        }\n        return uint104(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint96 from uint256, reverting on\n     * overflow (when the input is greater than largest uint96).\n     *\n     * Counterpart to Solidity's `uint96` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 96 bits\n     */\n    function toUint96(uint256 value) internal pure returns (uint96) {\n        if (value > type(uint96).max) {\n            revert SafeCastOverflowedUintDowncast(96, value);\n        }\n        return uint96(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint88 from uint256, reverting on\n     * overflow (when the input is greater than largest uint88).\n     *\n     * Counterpart to Solidity's `uint88` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 88 bits\n     */\n    function toUint88(uint256 value) internal pure returns (uint88) {\n        if (value > type(uint88).max) {\n            revert SafeCastOverflowedUintDowncast(88, value);\n        }\n        return uint88(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint80 from uint256, reverting on\n     * overflow (when the input is greater than largest uint80).\n     *\n     * Counterpart to Solidity's `uint80` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 80 bits\n     */\n    function toUint80(uint256 value) internal pure returns (uint80) {\n        if (value > type(uint80).max) {\n            revert SafeCastOverflowedUintDowncast(80, value);\n        }\n        return uint80(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint72 from uint256, reverting on\n     * overflow (when the input is greater than largest uint72).\n     *\n     * Counterpart to Solidity's `uint72` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 72 bits\n     */\n    function toUint72(uint256 value) internal pure returns (uint72) {\n        if (value > type(uint72).max) {\n            revert SafeCastOverflowedUintDowncast(72, value);\n        }\n        return uint72(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint64 from uint256, reverting on\n     * overflow (when the input is greater than largest uint64).\n     *\n     * Counterpart to Solidity's `uint64` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 64 bits\n     */\n    function toUint64(uint256 value) internal pure returns (uint64) {\n        if (value > type(uint64).max) {\n            revert SafeCastOverflowedUintDowncast(64, value);\n        }\n        return uint64(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint56 from uint256, reverting on\n     * overflow (when the input is greater than largest uint56).\n     *\n     * Counterpart to Solidity's `uint56` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 56 bits\n     */\n    function toUint56(uint256 value) internal pure returns (uint56) {\n        if (value > type(uint56).max) {\n            revert SafeCastOverflowedUintDowncast(56, value);\n        }\n        return uint56(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint48 from uint256, reverting on\n     * overflow (when the input is greater than largest uint48).\n     *\n     * Counterpart to Solidity's `uint48` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 48 bits\n     */\n    function toUint48(uint256 value) internal pure returns (uint48) {\n        if (value > type(uint48).max) {\n            revert SafeCastOverflowedUintDowncast(48, value);\n        }\n        return uint48(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint40 from uint256, reverting on\n     * overflow (when the input is greater than largest uint40).\n     *\n     * Counterpart to Solidity's `uint40` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 40 bits\n     */\n    function toUint40(uint256 value) internal pure returns (uint40) {\n        if (value > type(uint40).max) {\n            revert SafeCastOverflowedUintDowncast(40, value);\n        }\n        return uint40(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint32 from uint256, reverting on\n     * overflow (when the input is greater than largest uint32).\n     *\n     * Counterpart to Solidity's `uint32` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 32 bits\n     */\n    function toUint32(uint256 value) internal pure returns (uint32) {\n        if (value > type(uint32).max) {\n            revert SafeCastOverflowedUintDowncast(32, value);\n        }\n        return uint32(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint24 from uint256, reverting on\n     * overflow (when the input is greater than largest uint24).\n     *\n     * Counterpart to Solidity's `uint24` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 24 bits\n     */\n    function toUint24(uint256 value) internal pure returns (uint24) {\n        if (value > type(uint24).max) {\n            revert SafeCastOverflowedUintDowncast(24, value);\n        }\n        return uint24(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint16 from uint256, reverting on\n     * overflow (when the input is greater than largest uint16).\n     *\n     * Counterpart to Solidity's `uint16` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 16 bits\n     */\n    function toUint16(uint256 value) internal pure returns (uint16) {\n        if (value > type(uint16).max) {\n            revert SafeCastOverflowedUintDowncast(16, value);\n        }\n        return uint16(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint8 from uint256, reverting on\n     * overflow (when the input is greater than largest uint8).\n     *\n     * Counterpart to Solidity's `uint8` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 8 bits\n     */\n    function toUint8(uint256 value) internal pure returns (uint8) {\n        if (value > type(uint8).max) {\n            revert SafeCastOverflowedUintDowncast(8, value);\n        }\n        return uint8(value);\n    }\n\n    /**\n     * @dev Converts a signed int256 into an unsigned uint256.\n     *\n     * Requirements:\n     *\n     * - input must be greater than or equal to 0.\n     */\n    function toUint256(int256 value) internal pure returns (uint256) {\n        if (value < 0) {\n            revert SafeCastOverflowedIntToUint(value);\n        }\n        return uint256(value);\n    }\n\n    /**\n     * @dev Returns the downcasted int248 from int256, reverting on\n     * overflow (when the input is less than smallest int248 or\n     * greater than largest int248).\n     *\n     * Counterpart to Solidity's `int248` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 248 bits\n     */\n    function toInt248(int256 value) internal pure returns (int248 downcasted) {\n        downcasted = int248(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(248, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int240 from int256, reverting on\n     * overflow (when the input is less than smallest int240 or\n     * greater than largest int240).\n     *\n     * Counterpart to Solidity's `int240` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 240 bits\n     */\n    function toInt240(int256 value) internal pure returns (int240 downcasted) {\n        downcasted = int240(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(240, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int232 from int256, reverting on\n     * overflow (when the input is less than smallest int232 or\n     * greater than largest int232).\n     *\n     * Counterpart to Solidity's `int232` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 232 bits\n     */\n    function toInt232(int256 value) internal pure returns (int232 downcasted) {\n        downcasted = int232(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(232, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int224 from int256, reverting on\n     * overflow (when the input is less than smallest int224 or\n     * greater than largest int224).\n     *\n     * Counterpart to Solidity's `int224` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 224 bits\n     */\n    function toInt224(int256 value) internal pure returns (int224 downcasted) {\n        downcasted = int224(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(224, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int216 from int256, reverting on\n     * overflow (when the input is less than smallest int216 or\n     * greater than largest int216).\n     *\n     * Counterpart to Solidity's `int216` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 216 bits\n     */\n    function toInt216(int256 value) internal pure returns (int216 downcasted) {\n        downcasted = int216(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(216, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int208 from int256, reverting on\n     * overflow (when the input is less than smallest int208 or\n     * greater than largest int208).\n     *\n     * Counterpart to Solidity's `int208` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 208 bits\n     */\n    function toInt208(int256 value) internal pure returns (int208 downcasted) {\n        downcasted = int208(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(208, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int200 from int256, reverting on\n     * overflow (when the input is less than smallest int200 or\n     * greater than largest int200).\n     *\n     * Counterpart to Solidity's `int200` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 200 bits\n     */\n    function toInt200(int256 value) internal pure returns (int200 downcasted) {\n        downcasted = int200(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(200, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int192 from int256, reverting on\n     * overflow (when the input is less than smallest int192 or\n     * greater than largest int192).\n     *\n     * Counterpart to Solidity's `int192` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 192 bits\n     */\n    function toInt192(int256 value) internal pure returns (int192 downcasted) {\n        downcasted = int192(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(192, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int184 from int256, reverting on\n     * overflow (when the input is less than smallest int184 or\n     * greater than largest int184).\n     *\n     * Counterpart to Solidity's `int184` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 184 bits\n     */\n    function toInt184(int256 value) internal pure returns (int184 downcasted) {\n        downcasted = int184(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(184, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int176 from int256, reverting on\n     * overflow (when the input is less than smallest int176 or\n     * greater than largest int176).\n     *\n     * Counterpart to Solidity's `int176` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 176 bits\n     */\n    function toInt176(int256 value) internal pure returns (int176 downcasted) {\n        downcasted = int176(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(176, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int168 from int256, reverting on\n     * overflow (when the input is less than smallest int168 or\n     * greater than largest int168).\n     *\n     * Counterpart to Solidity's `int168` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 168 bits\n     */\n    function toInt168(int256 value) internal pure returns (int168 downcasted) {\n        downcasted = int168(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(168, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int160 from int256, reverting on\n     * overflow (when the input is less than smallest int160 or\n     * greater than largest int160).\n     *\n     * Counterpart to Solidity's `int160` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 160 bits\n     */\n    function toInt160(int256 value) internal pure returns (int160 downcasted) {\n        downcasted = int160(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(160, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int152 from int256, reverting on\n     * overflow (when the input is less than smallest int152 or\n     * greater than largest int152).\n     *\n     * Counterpart to Solidity's `int152` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 152 bits\n     */\n    function toInt152(int256 value) internal pure returns (int152 downcasted) {\n        downcasted = int152(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(152, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int144 from int256, reverting on\n     * overflow (when the input is less than smallest int144 or\n     * greater than largest int144).\n     *\n     * Counterpart to Solidity's `int144` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 144 bits\n     */\n    function toInt144(int256 value) internal pure returns (int144 downcasted) {\n        downcasted = int144(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(144, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int136 from int256, reverting on\n     * overflow (when the input is less than smallest int136 or\n     * greater than largest int136).\n     *\n     * Counterpart to Solidity's `int136` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 136 bits\n     */\n    function toInt136(int256 value) internal pure returns (int136 downcasted) {\n        downcasted = int136(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(136, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int128 from int256, reverting on\n     * overflow (when the input is less than smallest int128 or\n     * greater than largest int128).\n     *\n     * Counterpart to Solidity's `int128` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 128 bits\n     */\n    function toInt128(int256 value) internal pure returns (int128 downcasted) {\n        downcasted = int128(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(128, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int120 from int256, reverting on\n     * overflow (when the input is less than smallest int120 or\n     * greater than largest int120).\n     *\n     * Counterpart to Solidity's `int120` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 120 bits\n     */\n    function toInt120(int256 value) internal pure returns (int120 downcasted) {\n        downcasted = int120(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(120, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int112 from int256, reverting on\n     * overflow (when the input is less than smallest int112 or\n     * greater than largest int112).\n     *\n     * Counterpart to Solidity's `int112` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 112 bits\n     */\n    function toInt112(int256 value) internal pure returns (int112 downcasted) {\n        downcasted = int112(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(112, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int104 from int256, reverting on\n     * overflow (when the input is less than smallest int104 or\n     * greater than largest int104).\n     *\n     * Counterpart to Solidity's `int104` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 104 bits\n     */\n    function toInt104(int256 value) internal pure returns (int104 downcasted) {\n        downcasted = int104(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(104, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int96 from int256, reverting on\n     * overflow (when the input is less than smallest int96 or\n     * greater than largest int96).\n     *\n     * Counterpart to Solidity's `int96` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 96 bits\n     */\n    function toInt96(int256 value) internal pure returns (int96 downcasted) {\n        downcasted = int96(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(96, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int88 from int256, reverting on\n     * overflow (when the input is less than smallest int88 or\n     * greater than largest int88).\n     *\n     * Counterpart to Solidity's `int88` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 88 bits\n     */\n    function toInt88(int256 value) internal pure returns (int88 downcasted) {\n        downcasted = int88(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(88, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int80 from int256, reverting on\n     * overflow (when the input is less than smallest int80 or\n     * greater than largest int80).\n     *\n     * Counterpart to Solidity's `int80` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 80 bits\n     */\n    function toInt80(int256 value) internal pure returns (int80 downcasted) {\n        downcasted = int80(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(80, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int72 from int256, reverting on\n     * overflow (when the input is less than smallest int72 or\n     * greater than largest int72).\n     *\n     * Counterpart to Solidity's `int72` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 72 bits\n     */\n    function toInt72(int256 value) internal pure returns (int72 downcasted) {\n        downcasted = int72(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(72, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int64 from int256, reverting on\n     * overflow (when the input is less than smallest int64 or\n     * greater than largest int64).\n     *\n     * Counterpart to Solidity's `int64` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 64 bits\n     */\n    function toInt64(int256 value) internal pure returns (int64 downcasted) {\n        downcasted = int64(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(64, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int56 from int256, reverting on\n     * overflow (when the input is less than smallest int56 or\n     * greater than largest int56).\n     *\n     * Counterpart to Solidity's `int56` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 56 bits\n     */\n    function toInt56(int256 value) internal pure returns (int56 downcasted) {\n        downcasted = int56(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(56, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int48 from int256, reverting on\n     * overflow (when the input is less than smallest int48 or\n     * greater than largest int48).\n     *\n     * Counterpart to Solidity's `int48` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 48 bits\n     */\n    function toInt48(int256 value) internal pure returns (int48 downcasted) {\n        downcasted = int48(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(48, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int40 from int256, reverting on\n     * overflow (when the input is less than smallest int40 or\n     * greater than largest int40).\n     *\n     * Counterpart to Solidity's `int40` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 40 bits\n     */\n    function toInt40(int256 value) internal pure returns (int40 downcasted) {\n        downcasted = int40(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(40, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int32 from int256, reverting on\n     * overflow (when the input is less than smallest int32 or\n     * greater than largest int32).\n     *\n     * Counterpart to Solidity's `int32` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 32 bits\n     */\n    function toInt32(int256 value) internal pure returns (int32 downcasted) {\n        downcasted = int32(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(32, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int24 from int256, reverting on\n     * overflow (when the input is less than smallest int24 or\n     * greater than largest int24).\n     *\n     * Counterpart to Solidity's `int24` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 24 bits\n     */\n    function toInt24(int256 value) internal pure returns (int24 downcasted) {\n        downcasted = int24(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(24, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int16 from int256, reverting on\n     * overflow (when the input is less than smallest int16 or\n     * greater than largest int16).\n     *\n     * Counterpart to Solidity's `int16` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 16 bits\n     */\n    function toInt16(int256 value) internal pure returns (int16 downcasted) {\n        downcasted = int16(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(16, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int8 from int256, reverting on\n     * overflow (when the input is less than smallest int8 or\n     * greater than largest int8).\n     *\n     * Counterpart to Solidity's `int8` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 8 bits\n     */\n    function toInt8(int256 value) internal pure returns (int8 downcasted) {\n        downcasted = int8(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(8, value);\n        }\n    }\n\n    /**\n     * @dev Converts an unsigned uint256 into a signed int256.\n     *\n     * Requirements:\n     *\n     * - input must be less than or equal to maxInt256.\n     */\n    function toInt256(uint256 value) internal pure returns (int256) {\n        // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n        if (value > uint256(type(int256).max)) {\n            revert SafeCastOverflowedUintToInt(value);\n        }\n        return int256(value);\n    }\n\n    /**\n     * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\n     */\n    function toUint(bool b) internal pure returns (uint256 u) {\n        assembly (\"memory-safe\") {\n            u := iszero(iszero(b))\n        }\n    }\n}\n"},{"file_path":"contracts/interfaces/IEmberProtocolConfig.sol","source_code":"/*\n  Copyright (c) 2026 Ember Protocol Inc.\n  Proprietary Smart Contract License – All Rights Reserved.\n\n  This source code is provided for transparency and verification only.\n  Use, modification, reproduction, or redeployment of this code \n  requires prior written permission from the Ember Protocol Inc.\n*/\n\npragma solidity ^0.8.22;\n\n// Custom errors\nerror Unauthorized();\nerror ZeroAddress();\nerror InvalidValue();\nerror SameValue();\nerror ProtocolPaused();\nerror Blacklisted();\nerror InvalidInterval();\nerror InvalidRate();\nerror InvalidFeePercentage();\n\n/// @title Ember Protocol Config Interface\n/// @notice Describes the functions/events exposed by `EmberProtocolConfig`\ninterface IEmberProtocolConfig {\n  /// @dev Replicates the initializer that must be called for upgradeable proxies.\n  function initialize(address initialOwner, address _platformFeeRecipient) external;\n\n  function version() external pure returns (string memory);\n\n  // Protocol admin functions (owner only)\n  function pauseNonAdminOperations(bool pauseFlag) external;\n  function updatePlatformFeeRecipient(address recipient) external;\n  function updateMinRate(uint256 minRate_) external;\n  function updateMaxRate(uint256 maxRate_) external;\n  function updateDefaultRate(uint256 defaultRate_) external;\n  function updateMaxFeePercentage(uint256 maxFeePercentage_) external;\n  function updateMinRateInterval(uint256 minRateInterval_) external;\n  function updateMaxRateInterval(uint256 maxRateInterval_) external;\n  function setBlacklistedAccount(address account, bool blacklisted) external;\n\n  // Guardian functions\n  function guardian() external view returns (address);\n  function setGuardian(address newGuardian) external;\n  function guardianPauseNonAdminOperations(bool pauseFlag) external;\n  function guardianSetBlacklistedAccount(address account, bool blacklisted) external;\n\n  // Vault admin functions\n  function updateVaultMaxTVL(address vault, uint256 newMaxTVL) external;\n  function updateVaultRateUpdateInterval(address vault, uint256 newInterval) external;\n  function updateVaultMaxRateChangePerUpdate(\n    address vault,\n    uint256 newMaxRateChangePerUpdate\n  ) external;\n  function updateVaultAdmin(address vault, address newAdmin) external;\n  function updateVaultOperator(address vault, address newOperator) external;\n  function updateVaultRateManager(address vault, address newRateManager) external;\n  function updateVaultFeePercentage(address vault, uint256 newFeePercentage) external;\n  function updateVaultName(address vault, string calldata newName) external;\n  function updateVaultMinWithdrawableShares(\n    address vault,\n    uint256 newMinWithdrawableShares\n  ) external;\n  function setVaultSubAccount(address vault, address account, bool isSubAccount) external;\n  function setVaultPausedStatus(address vault, string calldata operation, bool paused) external;\n\n  // Getter functions\n  function isAccountBlacklisted(address account) external view returns (bool);\n  function getProtocolPauseStatus() external view returns (bool);\n  function getPlatformFeeRecipient() external view returns (address);\n  function getMinRate() external view returns (uint256);\n  function getMaxRate() external view returns (uint256);\n  function getDefaultRate() external view returns (uint256);\n  function getMinRateInterval() external view returns (uint256);\n  function getMaxRateInterval() external view returns (uint256);\n  function getMaxAllowedFeePercentage() external view returns (uint256);\n  function verifyProtocolNotPaused() external view;\n  function verifyAccountNotBlacklisted(address account) external view;\n\n  // Events\n  event PauseNonAdminOperations(bool paused);\n  event SupportedVersionUpdated(uint256 previousVersion, uint256 newVersion);\n  event PlatformFeeRecipientUpdated(address previousRecipient, address newRecipient);\n  event MinRateUpdated(uint256 previousRate, uint256 newRate);\n  event MaxRateUpdated(uint256 previousRate, uint256 newRate);\n  event DefaultRateUpdated(uint256 previousRate, uint256 newRate);\n  event MinRateIntervalUpdated(uint256 previousInterval, uint256 newInterval);\n  event MaxRateIntervalUpdated(uint256 previousInterval, uint256 newInterval);\n  event MaxAllowedFeePercentageUpdated(uint256 previousFee, uint256 newFee);\n  event BlacklistedAccountUpdated(address indexed account, bool isBlacklisted);\n  event GuardianUpdated(address indexed previousGuardian, address indexed newGuardian);\n}\n"},{"file_path":"contracts/interfaces/IEmberVaultValidator.sol","source_code":"pragma solidity ^0.8.22;\n\nerror DepositNotAllowed();\n\n/// @title Ember Vault Validator Interface\n/// @notice Interface for the validator contract that manages withdrawal fees and deposit allow lists\ninterface IEmberVaultValidator {\n  struct WithdrawalFee {\n    uint256 permanentFeePercentage;\n    uint256 timeBasedFeePercentage;\n    uint256 timeBasedFeeThreshold;\n  }\n\n  // ============================================\n  // Getter Functions\n  // ============================================\n\n  function withdrawalFee(address vault) external view returns (WithdrawalFee memory);\n  function feeExemptAccounts(address vault, address account) external view returns (bool);\n  function depositAllowList(address vault, address account) external view returns (bool);\n  function lastDepositTimestamp(address vault, address account) external view returns (uint256);\n  function depositAllowListCount(address vault) external view returns (uint256);\n\n  // ============================================\n  // Vault-Called Functions\n  // ============================================\n\n  /// @notice Validates whether a depositor is allowed to deposit\n  /// @dev Called by the vault during deposit. Reverts if not allowed.\n  function validateDeposit(address vault, address depositor) external view;\n\n  /// @notice Records the last deposit timestamp for the receiver\n  /// @dev Called by the vault after a successful deposit\n  function recordDeposit(address vault, address receiver, uint256 timestamp) external;\n\n  /// @notice Calculates withdrawal fees for a given owner and amount\n  /// @dev Called by the vault during withdrawal processing\n  /// @return permanentFeeCharged The permanent fee amount\n  /// @return timeBasedFeeCharged The time-based fee amount\n  function calculateWithdrawalFees(\n    address vault,\n    address owner,\n    uint256 withdrawAmount,\n    uint256 currentTime\n  ) external view returns (uint256 permanentFeeCharged, uint256 timeBasedFeeCharged);\n\n  // ============================================\n  // ProtocolConfig-Called Setter Functions\n  // ============================================\n\n  function setDepositAllowListStatus(\n    address caller,\n    address vault,\n    address user,\n    bool status\n  ) external;\n  function setFeeExemptionListStatus(\n    address caller,\n    address vault,\n    address user,\n    bool status\n  ) external;\n  function setPermanentFeePercentage(address caller, address vault, uint256 newPercentage) external;\n  function setTimeBasedFeePercentage(address caller, address vault, uint256 newPercentage) external;\n  function setTimeBasedFeeThreshold(address caller, address vault, uint256 newThreshold) external;\n}\n"},{"file_path":"contracts/libraries/Math.sol","source_code":"/*\n  Copyright (c) 2026 Ember Protocol Inc.\n  Proprietary Smart Contract License – All Rights Reserved.\n\n  This source code is provided for transparency and verification only.\n  Use, modification, reproduction, or redeployment of this code \n  requires prior written permission from the Ember Protocol Inc.\n*/\n\npragma solidity ^0.8.22;\n\n// Custom errors\nerror Overflow();\nerror DivisionByZero();\n\n/**\n * @title FixedPointMath\n * @dev Fixed-point math library for vault calculations\n * @notice All numbers use uint256 with BASE = 1e18 for fixed-point precision\n */\nlibrary FixedPointMath {\n  // === Constants ===\n\n  /// @notice Base unit for fixed-point arithmetic (1e18)\n  uint256 internal constant BASE = 1e18;\n\n  // === Internal Functions ===\n\n  /// @notice Multiplies two uint256 values with fixed-point precision\n  /// @param a The first value to multiply\n  /// @param b The second value to multiply\n  /// @return The result of the multiplication (a * b / BASE)\n  /// @dev Reverts with Overflow if the multiplication overflows uint256\n  function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n    // Early return for zero (saves gas)\n    if (a == 0) {\n      return 0;\n    }\n\n    // Check if a * b would overflow\n    if (b > type(uint256).max / a) revert Overflow();\n\n    // Division is safe after overflow check\n    unchecked {\n      return (a * b) / BASE;\n    }\n  }\n\n  /// @notice Divides two uint256 values with fixed-point precision\n  /// @param a The dividend\n  /// @param b The divisor\n  /// @return The result of the division (a * BASE / b)\n  /// @dev Reverts with DivisionByZero if the divisor is zero\n  /// @dev Reverts with Overflow if the result overflows uint256\n  function div(uint256 a, uint256 b) internal pure returns (uint256) {\n    if (b == 0) revert DivisionByZero();\n    // Check for potential overflow: a * BASE might overflow\n    if (a > type(uint256).max / BASE) revert Overflow();\n\n    // Multiplication and division are safe after overflow check\n    unchecked {\n      return (a * BASE) / b;\n    }\n  }\n\n  /// @notice Calculates the absolute difference between two uint256 values\n  /// @param a The first value\n  /// @param b The second value\n  /// @return The absolute difference between the two values\n  function diffAbs(uint256 a, uint256 b) internal pure returns (uint256) {\n    // Subtraction is safe since we check which is larger first\n    unchecked {\n      return a > b ? a - b : b - a;\n    }\n  }\n\n  /// @notice Calculates the percentage change from a to b\n  /// @param a The first value (base value)\n  /// @param b The second value (new value)\n  /// @return The percentage difference between the two values (|a - b| * BASE / a)\n  /// @dev Reverts with DivisionByZero if a is zero\n  /// @dev Reverts with Overflow if the result overflows uint256\n  function percentChangeFrom(uint256 a, uint256 b) internal pure returns (uint256) {\n    return div(diffAbs(a, b), a);\n  }\n\n  /// @notice Divides two uint256 values and rounds up to the nearest integer\n  /// @param a The dividend\n  /// @param b The divisor\n  /// @return The result of the division rounded up (ceil(a * BASE / b))\n  /// @dev Reverts with DivisionByZero if the divisor is zero\n  /// @dev Reverts with Overflow if the result overflows uint256\n  /// @dev Uses the efficient ceiling formula: ceil(a/b) = (a + b - 1) / b\n  function divCeil(uint256 a, uint256 b) internal pure returns (uint256) {\n    if (b == 0) revert DivisionByZero();\n    // Check for potential overflow: a * BASE might overflow\n    if (a > type(uint256).max / BASE) revert Overflow();\n\n    // All operations are safe after overflow check\n    unchecked {\n      uint256 numerator = a * BASE;\n      // Check for overflow in ceiling calculation: numerator + b - 1\n      if (numerator > type(uint256).max - (b - 1)) revert Overflow();\n      // Use ceiling formula: (numerator + b - 1) / b\n      return (numerator + b - 1) / b;\n    }\n  }\n}\n"}],"certified":false,"conflicting_implementations":null,"abi":[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[],"name":"Blacklisted","type":"error"},{"inputs":[],"name":"BridgeAmountTooLarge","type":"error"},{"inputs":[],"name":"BridgeAmountTooSmall","type":"error"},{"inputs":[],"name":"DivisionByZero","type":"error"},{"inputs":[{"internalType":"address","name":"implementation","type":"address"}],"name":"ERC1967InvalidImplementation","type":"error"},{"inputs":[],"name":"ERC1967NonPayable","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":"FailedCall","type":"error"},{"inputs":[],"name":"IndexOutOfBounds","type":"error"},{"inputs":[],"name":"InsufficientBalance","type":"error"},{"inputs":[],"name":"InsufficientShares","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"InvalidInterval","type":"error"},{"inputs":[],"name":"InvalidRate","type":"error"},{"inputs":[],"name":"InvalidRequest","type":"error"},{"inputs":[],"name":"InvalidValue","type":"error"},{"inputs":[],"name":"MaxTVLReached","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[],"name":"OperationPaused","type":"error"},{"inputs":[],"name":"Overflow","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ProtocolPaused","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"SameValue","type":"error"},{"inputs":[],"name":"UUPSUnauthorizedCallContext","type":"error"},{"inputs":[{"internalType":"bytes32","name":"slot","type":"bytes32"}],"name":"UUPSUnsupportedProxiableUUID","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"inputs":[],"name":"UseParkingLot","type":"error"},{"inputs":[],"name":"UseRedeemShares","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"inputs":[],"name":"ZeroAmount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":true,"internalType":"address","name":"previousAdapter","type":"address"},{"indexed":true,"internalType":"address","name":"newAdapter","type":"address"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sequenceNumber","type":"uint256"}],"name":"BridgeAdapterUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalShares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sequenceNumber","type":"uint256"}],"name":"BridgeBurn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"uint256","name":"minBridgeAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxBridgeAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sequenceNumber","type":"uint256"}],"name":"BridgeLimitsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalShares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sequenceNumber","type":"uint256"}],"name":"BridgeMint","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":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":true,"internalType":"address","name":"previousParkingLot","type":"address"},{"indexed":true,"internalType":"address","name":"newParkingLot","type":"address"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sequenceNumber","type":"uint256"}],"name":"ParkingLotUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"uint256","name":"totalRequestProcessed","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"requestsSkipped","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"requestsCancelled","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalSharesBurnt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalAmountWithdrawn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalShares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalSharesPendingToBurn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sequenceNumber","type":"uint256"}],"name":"ProcessRequestsSummary","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"requestSequenceNumber","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"cancelWithdrawRequestSequenceNumbers","type":"uint256[]"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"RequestCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"withdrawAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"requestTimestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"processTimestamp","type":"uint256"},{"indexed":false,"internalType":"bool","name":"skipped","type":"bool"},{"indexed":false,"internalType":"bool","name":"cancelled","type":"bool"},{"indexed":false,"internalType":"uint256","name":"totalShares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalSharesPendingToBurn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sequenceNumber","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"requestSequenceNumber","type":"uint256"}],"name":"RequestProcessed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalShares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalSharesPendingToBurn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sequenceNumber","type":"uint256"}],"name":"RequestRedeemed","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":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":true,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":true,"internalType":"address","name":"newAdmin","type":"address"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sequenceNumber","type":"uint256"}],"name":"VaultAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"address","name":"collateralToken","type":"address"},{"indexed":false,"internalType":"address","name":"admin","type":"address"},{"indexed":false,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"address","name":"rateProvider","type":"address"},{"indexed":false,"internalType":"address[]","name":"subAccounts","type":"address[]"},{"indexed":false,"internalType":"uint256","name":"minWithdrawableShares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"feePercentage","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxRateChangePerUpdate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rateUpdateInterval","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxTVL","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sequenceNumber","type":"uint256"}],"name":"VaultCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":true,"internalType":"address","name":"depositor","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountDeposited","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sharesMinted","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalShares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sequenceNumber","type":"uint256"}],"name":"VaultDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"uint256","name":"previousFeePercentage","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newFeePercentage","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sequenceNumber","type":"uint256"}],"name":"VaultFeePercentageUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"uint256","name":"previousMaxRateChangePerUpdate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newMaxRateChangePerUpdate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sequenceNumber","type":"uint256"}],"name":"VaultMaxRateChangePerUpdateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"uint256","name":"previousMaxTVL","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newMaxTVL","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sequenceNumber","type":"uint256"}],"name":"VaultMaxTVLUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"uint256","name":"previousMinWithdrawableShares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newMinWithdrawableShares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sequenceNumber","type":"uint256"}],"name":"VaultMinWithdrawableSharesUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"string","name":"previousName","type":"string"},{"indexed":false,"internalType":"string","name":"newName","type":"string"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sequenceNumber","type":"uint256"}],"name":"VaultNameUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":true,"internalType":"address","name":"previousOperator","type":"address"},{"indexed":true,"internalType":"address","name":"newOperator","type":"address"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sequenceNumber","type":"uint256"}],"name":"VaultOperatorChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"string","name":"operation","type":"string"},{"indexed":false,"internalType":"bool","name":"paused","type":"bool"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sequenceNumber","type":"uint256"}],"name":"VaultPauseStatusUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"uint256","name":"feeAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalAccrued","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sequenceNumber","type":"uint256"}],"name":"VaultPlatformFeeCharged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sequenceNumber","type":"uint256"}],"name":"VaultPlatformFeeCollected","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":true,"internalType":"address","name":"previousRateManager","type":"address"},{"indexed":true,"internalType":"address","name":"newRateManager","type":"address"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sequenceNumber","type":"uint256"}],"name":"VaultRateManagerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"uint256","name":"previousInterval","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newInterval","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sequenceNumber","type":"uint256"}],"name":"VaultRateUpdateIntervalChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"uint256","name":"previousRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sequenceNumber","type":"uint256"}],"name":"VaultRateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"bool","name":"isSubAccount","type":"bool"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sequenceNumber","type":"uint256"}],"name":"VaultSubAccountUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":true,"internalType":"address","name":"subAccount","type":"address"},{"indexed":false,"internalType":"uint256","name":"previousBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sequenceNumber","type":"uint256"}],"name":"VaultWithdrawalWithoutRedeemingShares","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Withdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"requestSequenceNumber","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"permanentFeeCharged","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timeBasedFeeCharged","type":"uint256"}],"name":"WithdrawalFeeCharged","type":"event"},{"inputs":[],"name":"UPGRADE_INTERFACE_VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"accounts","outputs":[{"internalType":"uint256","name":"totalPendingWithdrawalShares","type":"uint256"}],"stateMutability":"view","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":[],"name":"bridgeAdapter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"bridgeBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"bridgeMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestSequenceNumber","type":"uint256"}],"name":"cancelPendingWithdrawalRequest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"collectPlatformFee","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"nonpayable","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":"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":"shares","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"depositWithPermit","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"accountAddress","type":"address"}],"name":"getAccountState","outputs":[{"internalType":"uint256","name":"totalPendingWithdrawalShares","type":"uint256"},{"internalType":"uint256[]","name":"pendingWithdrawalRequestSequenceNumbers","type":"uint256[]"},{"internalType":"uint256[]","name":"cancelWithdrawRequestSequenceNumbers","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getChainTimestampMs","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getPendingWithdrawal","outputs":[{"components":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"uint256","name":"estimatedWithdrawAmount","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"sequenceNumber","type":"uint256"}],"internalType":"struct EmberVault.WithdrawalRequest","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPendingWithdrawalsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_protocolConfig","type":"address"},{"internalType":"address","name":"initialOwner","type":"address"},{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"receiptTokenSymbol","type":"string"},{"internalType":"address","name":"collateralToken","type":"address"},{"internalType":"address","name":"admin","type":"address"},{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"rateManager","type":"address"},{"internalType":"uint256","name":"maxRateChangePerUpdate","type":"uint256"},{"internalType":"uint256","name":"feePercentage","type":"uint256"},{"internalType":"uint256","name":"minWithdrawableShares","type":"uint256"},{"internalType":"uint256","name":"rateUpdateInterval","type":"uint256"},{"internalType":"uint256","name":"maxTVL","type":"uint256"}],"internalType":"struct EmberVault.VaultInitParams","name":"params","type":"tuple"},{"internalType":"address[]","name":"_subAccounts","type":"address[]"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxBridgeAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"maxDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"maxMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"maxRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxTVL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"maxWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minBridgeAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minWithdrawableShares","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":"assets","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"mintWithPermit","outputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"parkingLot","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pauseStatus","outputs":[{"internalType":"bool","name":"deposits","type":"bool"},{"internalType":"bool","name":"withdrawals","type":"bool"},{"internalType":"bool","name":"privilegedOperations","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"pendingWithdrawals","outputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"uint256","name":"estimatedWithdrawAmount","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"sequenceNumber","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"platformFee","outputs":[{"internalType":"uint256","name":"accrued","type":"uint256"},{"internalType":"uint256","name":"lastChargedAt","type":"uint256"},{"internalType":"uint256","name":"platformFeePercentage","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"previewDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"previewMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"previewRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"previewWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"numRequests","type":"uint256"}],"name":"processWithdrawalRequests","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"protocolConfig","outputs":[{"internalType":"contract IEmberProtocolConfig","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rate","outputs":[{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"maxRateChangePerUpdate","type":"uint256"},{"internalType":"uint256","name":"rateUpdateInterval","type":"uint256"},{"internalType":"uint256","name":"lastUpdatedAt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"redeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"redeemShares","outputs":[{"components":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"uint256","name":"estimatedWithdrawAmount","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"sequenceNumber","type":"uint256"}],"internalType":"struct EmberVault.WithdrawalRequest","name":"request","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"roles","outputs":[{"internalType":"address","name":"admin","type":"address"},{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"rateManager","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sequenceNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"address","name":"newAdmin","type":"address"}],"name":"setAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"address","name":"newAdapter","type":"address"}],"name":"setBridgeAdapter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"uint256","name":"_minBridgeAmount","type":"uint256"},{"internalType":"uint256","name":"_maxBridgeAmount","type":"uint256"}],"name":"setBridgeLimits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"uint256","name":"newFeePercentage","type":"uint256"}],"name":"setFeePercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"uint256","name":"newMaxRateChangePerUpdate","type":"uint256"}],"name":"setMaxRateChangePerUpdate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"uint256","name":"newMaxTVL","type":"uint256"}],"name":"setMaxTVL","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"uint256","name":"newMinWithdrawableShares","type":"uint256"}],"name":"setMinWithdrawableShares","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"address","name":"newOperator","type":"address"}],"name":"setOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"address","name":"newParkingLot","type":"address"}],"name":"setParkingLot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"string","name":"operation","type":"string"},{"internalType":"bool","name":"paused","type":"bool"}],"name":"setPausedStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"address","name":"newRateManager","type":"address"}],"name":"setRateManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"uint256","name":"newInterval","type":"uint256"}],"name":"setRateUpdateInterval","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"address","name":"account","type":"address"},{"internalType":"bool","name":"isSubAccount","type":"bool"}],"name":"setSubAccountStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"string","name":"newName","type":"string"}],"name":"setVaultName","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"address","name":"_validator","type":"address"}],"name":"setVaultValidator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"subAccounts","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":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newRate","type":"uint256"}],"name":"updateVaultRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"vaultName","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vaultValidator","outputs":[{"internalType":"contract IEmberVaultValidator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"withdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"subAccount","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawFromVaultWithoutRedeemingShares","outputs":[],"stateMutability":"nonpayable","type":"function"}],"is_changed_bytecode":false,"is_partially_verified":false,"constructor_args":null}