{"file_path":"contracts/InsuranceCapitalLayer.sol","creation_status":"success","source_code":"//SPDX-License-Identifier:ISC\npragma solidity 0.8.20;\n\nimport \"@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport {SafeERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {IKYCRegistry} from \"./interfaces/IKYCRegistry.sol\";\nimport {IPool} from \"./interfaces/IPool.sol\";\nimport {IPoolRegistry} from \"./interfaces/IPoolRegistry.sol\";\nimport {IInsuranceCapitalLayer} from \"./interfaces/IInsuranceCapitalLayer.sol\";\nimport {IDecentralizedFund} from \"./interfaces/IDecentralizedFund.sol\";\nimport {ShareToken} from \"./token/ShareToken.sol\";\nimport {ConvertDecimals} from \"./utils/ConvertDecimals.sol\";\nimport {IDepositTokenRegistry} from \"./interfaces/IDepositTokenRegistry.sol\";\nimport {ISharePriceCalculator} from \"./interfaces/ISharePriceCalculator.sol\";\nimport {ICollateralTokenHandler} from \"./interfaces/ICollateralTokenHandler.sol\";\nimport {IWETH} from \"./interfaces/IWETH.sol\";\nimport {IRedemptionTokenHandler} from \"./interfaces/IRedemptionTokenHandler.sol\";\nimport {IDepositManager} from \"./interfaces/IDepositManager.sol\";\nimport {IERC20Errors} from \"@openzeppelin/contracts/interfaces/draft-IERC6093.sol\";\nimport {ICustodyManager} from \"./interfaces/ICustodyManager.sol\";\nimport \"./errors/InsuranceCapitalLayerErrors.sol\";\n\ncontract InsuranceCapitalLayer is\n  Initializable,\n  ReentrancyGuardUpgradeable,\n  AccessControlUpgradeable,\n  PausableUpgradeable,\n  UUPSUpgradeable,\n  IDepositManager,\n  ICollateralTokenHandler,\n  IRedemptionTokenHandler,\n  ICustodyManager\n{\n  using SafeERC20 for IERC20;\n  /////////////////////\n  /// Configuration ///\n  /////////////////////\n  /// @notice Role identifier for operators who can manage core functionality\n  bytes32 public constant OPERATOR_ROLE = keccak256(\"OPERATOR_ROLE\");\n  /// @notice Role identifier for administrators with elevated privileges\n  bytes32 public constant ADMIN_ROLE = keccak256(\"ADMIN_ROLE\");\n  /// @notice Role identifier for fee managers who can adjust and claim fees\n  bytes32 public constant FEE_MANAGER_ROLE = keccak256(\"FEE_MANAGER_ROLE\");\n  /// @notice Role identifier for custodian managers who can add/remove custodians\n  bytes32 public constant CUSTODIAN_MANAGER_ROLE =\n    keccak256(\"CUSTODIAN_MANAGER_ROLE\");\n  /// @notice Role identifier for collateral managers who handle collateral operations\n  bytes32 public constant COLLATERAL_MANAGER_ROLE =\n    keccak256(\"COLLATERAL_MANAGER_ROLE\");\n  /// @notice Role identifier for users who can pause the contract\n  bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n  /// @notice Role identifier for custodians who can deposit assets back\n  bytes32 public constant CUSTODIAN_ROLE = keccak256(\"CUSTODIAN_ROLE\");\n  /// @notice Role identifier for upgraders who can upgrade the contract\n  bytes32 public constant UPGRADER_ROLE = keccak256(\"UPGRADER_ROLE\");\n\n  /// @notice ShareToken contract reference\n  /// @dev Immutable after deployment\n  ShareToken public shareToken;\n\n  /// @notice KYC registry contract reference for user verification\n  IKYCRegistry public kycRegistry;\n\n  /// @notice Name of the insurance capital layer\n  string public name;\n  /// @notice Symbol of the insurance capital layer\n  string public symbol;\n\n  /// @notice Mapping of total deposit fees collected per token\n  mapping(address => uint256) private _totalDepositFeeAmount;\n\n  /// @notice Last claimed deposit fee amount\n  /// @dev Updated only when fees are claimed\n  uint public lastClaimedDepositFeeAmount;\n\n  /// @notice Flag indicating if deposits are enabled\n  bool private _depositEnabled;\n\n  /// @notice Registry for managing deposit tokens\n  IDepositTokenRegistry public depositTokenRegistry;\n\n  /// @notice Calculator for share price conversions\n  ISharePriceCalculator public sharePriceCalculator;\n\n  /// @notice Address of the collateral manager\n  address public collateralManager;\n\n  /// @notice Address of the redemption manager\n  address public redemptionManager;\n\n  /// @notice Mapping of custodians for each token\n  /// @dev token address => array of custodian addresses\n  mapping(address => address[]) public custodians;\n\n  // Add state variables for tracking\n  mapping(address => uint256) public userRedemptionDeposits;\n  uint256 public contractShareTokenBalance;\n  mapping(address => uint256) private _lockedRedemptionTokens;\n  mapping(address => uint256) private _lockedCollateralTokens;\n\n  mapping(address => mapping(address => uint256))\n    private _totalDepositsFromCustodian;\n  mapping(address => mapping(address => uint256))\n    private _totalWithdrawalsToCustodian;\n\n  // Add near the top with other state variables\n  bool private _shareTokenSet;\n\n  // Add event for transparency\n  event ShareTokenSet(address indexed token);\n\n  // Add error\n  error ShareTokenAlreadySet();\n\n  //////////////\n  /// EVENTS ///\n  //////////////\n\n  /**\n   * @notice Emitted when deposit fees are claimed\n   * @param token The token address the fees were claimed for\n   * @param recipient The address that received the fees\n   * @param amount The amount of fees claimed\n   */\n  event DepositFeeClaimed(\n    address indexed token,\n    address indexed recipient,\n    uint256 amount\n  );\n\n  event CollateralTokensLocked(address indexed token, uint256 amount);\n\n  event CollateralTokensUnlocked(address indexed token, uint256 amount);\n\n  /**\n   * @notice Emitted when a user deposits tokens into the insurance capital layer\n   * @param user Address of the user making the deposit\n   * @param token Address of the token being deposited\n   * @param amount Amount of tokens deposited\n   */\n  event Deposited(address user, address token, uint amount);\n\n  /**\n   * @notice Emitted when tokens are deposited into a pool\n   * @param pool Address of the pool receiving the deposit\n   * @param amount Amount of tokens deposited into the pool\n   */\n  event DepositedToPool(address pool, uint amount);\n\n  /**\n   * @notice Emitted when tokens are withdrawn from a pool\n   * @param pool Address of the pool tokens are withdrawn from\n   * @param amount Amount of tokens withdrawn\n   */\n  event WithdrawnFromPool(address pool, uint amount);\n\n  /**\n   * @notice Emitted when the collateral manager address is updated\n   * @param collateralManager New address of the collateral manager\n   */\n  event CollateralManagerUpdated(address collateralManager);\n\n  /**\n   * @notice Emitted when a new custodian is added for a token\n   * @param token Address of the token the custodian is added for\n   * @param custodian Address of the newly added custodian\n   */\n  event CustodianAdded(address indexed token, address indexed custodian);\n\n  /**\n   * @notice Emitted when a custodian is removed for a token\n   * @param token Address of the token the custodian is removed from\n   * @param custodian Address of the removed custodian\n   */\n  event CustodianRemoved(address indexed token, address indexed custodian);\n\n  /////////////////\n  /// MODIFIERS ///\n  /////////////////\n  /// @notice Modifier to ensure only KYC approved users can access certain functions\n  modifier onlyKYCUser() {\n    if (!kycRegistry.isKYCApproved(msg.sender)) {\n      revert OnlyApprovedKYCUser();\n    }\n    _;\n  }\n\n  /// @notice Modifier to validate token address\n  modifier validToken(address token) {\n    if (token == address(0)) {\n      revert InvalidToken(token);\n    }\n    _;\n  }\n\n  /// @notice Modifier to validate amount\n  modifier validAmount(uint256 amount) {\n    if (amount == 0) {\n      revert InvalidAmount(amount);\n    }\n    _;\n  }\n\n  /// @notice Modifier to validate custodian for token\n  modifier validCustodian(address custodian, address token) {\n    if (custodian == address(0) || !isCustodian(token, custodian)) {\n      revert InvalidCustodian(custodian, token);\n    }\n    _;\n  }\n\n  modifier onlyCollateralManager() {\n    if (msg.sender != collateralManager) {\n      revert OnlyCollateralManager();\n    }\n    _;\n  }\n\n  /// @custom:oz-upgrades-unsafe-allow constructor\n  constructor() {\n    _disableInitializers();\n  }\n\n  function initialize(\n    address initialAdmin_,\n    string memory tokenName,\n    string memory tokenSymbol,\n    address kycRegistry_,\n    address operator_,\n    address depositTokenRegistry_,\n    address _sharePriceCalculator\n  ) public initializer {\n    __ReentrancyGuard_init();\n    __AccessControl_init();\n    __Pausable_init();\n    __UUPSUpgradeable_init();\n\n    if (initialAdmin_ == address(0)) revert InvalidAdminAddress();\n    if (kycRegistry_ == address(0)) revert InvalidKYCRegistryAddress();\n    if (operator_ == address(0)) revert InvalidOperatorAddress();\n    if (depositTokenRegistry_ == address(0)) revert InvalidRegistryAddress();\n    if (_sharePriceCalculator == address(0)) revert InvalidCalculatorAddress();\n\n    kycRegistry = IKYCRegistry(kycRegistry_);\n\n    depositTokenRegistry = IDepositTokenRegistry(depositTokenRegistry_);\n    sharePriceCalculator = ISharePriceCalculator(_sharePriceCalculator);\n\n    _grantRole(DEFAULT_ADMIN_ROLE, initialAdmin_);\n    _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);\n\n    _grantRole(OPERATOR_ROLE, operator_);\n    _grantRole(OPERATOR_ROLE, msg.sender);\n\n    _grantRole(UPGRADER_ROLE, initialAdmin_);\n  }\n\n  /// @dev Authorization function for UUPS upgrade\n  function _authorizeUpgrade(\n    address newImplementation\n  ) internal override onlyRole(UPGRADER_ROLE) {}\n\n  /**\n   * @notice Simulates a deposit operation without executing it\n   * @dev This function calculates the expected shares and fees for a potential deposit\n   * @param token The address of the token to deposit\n   * @param amount The amount of tokens to deposit\n   * @return shares The amount of shares that would be minted\n   * @return depositFees The amount of fees that would be charged\n   * @return isAllowed Whether the deposit would be allowed\n   * @return errorMessage A descriptive message if the deposit would fail, empty string if successful\n   */\n  function previewDeposit(\n    address token,\n    uint256 amount\n  )\n    external\n    view\n    whenNotPaused\n    returns (\n      uint256 shares,\n      uint256 depositFees,\n      bool isAllowed,\n      string memory errorMessage\n    )\n  {\n    // Check if deposit is enabled\n    if (!_depositEnabled) {\n      return (0, 0, false, \"Deposit is not enabled\");\n    }\n\n    // Check if token deposit is enabled\n    if (!depositTokenRegistry.isDepositEnabled(token)) {\n      return (0, 0, false, \"Token deposit not enabled\");\n    }\n\n    // Check if amount is valid\n    if (amount == 0) {\n      return (0, 0, false, \"Invalid amount\");\n    }\n\n    // Calculate deposit fee using DepositTokenRegistry\n    try depositTokenRegistry.previewDepositFees(token, amount) returns (\n      uint256 fees\n    ) {\n      depositFees = fees;\n    } catch Error(string memory reason) {\n      return (0, 0, false, reason);\n    } catch {\n      return (0, 0, false, \"Error calculating fees\");\n    }\n\n    uint256 amountAfterFee = amount - depositFees;\n\n    // Calculate shares\n    try sharePriceCalculator.convertToShares(token, amountAfterFee) returns (\n      uint256 calculatedShares\n    ) {\n      shares = calculatedShares;\n      isAllowed = true;\n      errorMessage = \"\";\n    } catch Error(string memory reason) {\n      return (0, 0, false, reason);\n    } catch {\n      return (0, 0, false, \"Error calculating shares\");\n    }\n  }\n\n  function pause() external onlyRole(PAUSER_ROLE) {\n    _pause();\n  }\n\n  function unpause() external onlyRole(PAUSER_ROLE) {\n    _unpause();\n  }\n\n  // Update the _processDeposit function to use the new fee calculation\n  function _processDeposit(\n    address token,\n    uint amount,\n    uint minShares,\n    address receiver\n  ) internal whenNotPaused {\n    if (!_depositEnabled) {\n      revert DepositNotEnabled();\n    }\n    if (amount == 0) {\n      revert InvalidAmount(amount);\n    }\n    if (!depositTokenRegistry.isDepositEnabled(token)) {\n      revert TokenNotEnabledForDeposit(token);\n    }\n\n    uint depositFeeAmount = depositTokenRegistry.previewDepositFees(\n      token,\n      amount\n    );\n    uint amountAfterFee = amount - depositFeeAmount;\n\n    uint shareAmount = sharePriceCalculator.convertToShares(\n      token,\n      amountAfterFee\n    );\n    if (shareAmount < minShares) {\n      revert InsufficientShares(shareAmount, minShares);\n    }\n\n    _totalDepositFeeAmount[token] += depositFeeAmount;\n\n    IERC20(token).safeTransferFrom(msg.sender, address(this), amount);\n    shareToken.mint(receiver, shareAmount);\n\n    emit Deposited(msg.sender, token, amount);\n  }\n\n  /**\n   * @dev Deposit tokens to insurance capital layer\n   * @param token Address of the token to deposit\n   * @param amount Token amount to deposit\n   */\n  function deposit(\n    address token,\n    uint amount,\n    uint minShares\n  ) external nonReentrant whenNotPaused onlyKYCUser {\n    _processDeposit(token, amount, minShares, msg.sender);\n  }\n\n  /**\n   * @dev Deposit native token (ETH) to insurance capital layer\n   * @param minShares Minimum shares expected to receive\n   */\n  function depositNative(\n    uint minShares\n  ) external payable nonReentrant whenNotPaused onlyKYCUser {\n    if (msg.value == 0) {\n      revert NoNativeTokenSent();\n    }\n    if (!_depositEnabled) {\n      revert DepositNotEnabled();\n    }\n    address token = depositTokenRegistry.getWrappedNative();\n    if (!depositTokenRegistry.isDepositEnabled(token)) {\n      revert TokenNotEnabledForDeposit(token);\n    }\n\n    uint depositFeeAmount = depositTokenRegistry.previewDepositFees(\n      token,\n      msg.value\n    );\n    uint amountAfterFee = msg.value - depositFeeAmount;\n\n    uint shareAmount = sharePriceCalculator.convertToShares(\n      token,\n      amountAfterFee\n    );\n    if (shareAmount < minShares) {\n      revert InsufficientShares(shareAmount, minShares);\n    }\n\n    _totalDepositFeeAmount[token] += depositFeeAmount;\n\n    shareToken.mint(msg.sender, shareAmount);\n    IWETH(token).deposit{value: msg.value}();\n\n    emit Deposited(msg.sender, token, msg.value);\n  }\n\n  /**\n   * @dev Deposit tokens to insurance capital layer\n   * @param token Address of the token to deposit\n   * @param amount Token amount to deposit\n   */\n  function processPrestakedDeposit(\n    address token,\n    uint amount,\n    uint minShares,\n    address receiver\n  ) external nonReentrant whenNotPaused {\n    if (!kycRegistry.isKYCApproved(receiver)) {\n      revert OnlyApprovedKYCUser();\n    }\n    _processDeposit(token, amount, minShares, receiver);\n  }\n\n  /**\n   * @dev Set Deposit enabled or not\n   * @param depositEnabled_ new deposit enabled value to be set\n   */\n  function setDepositEnabled(\n    bool depositEnabled_\n  ) external whenNotPaused onlyRole(OPERATOR_ROLE) {\n    if (_depositEnabled == depositEnabled_) {\n      revert DepositStateAlreadySet(depositEnabled_);\n    }\n    _depositEnabled = depositEnabled_;\n  }\n\n  function setKycRegistry(\n    address kycRegistry_\n  ) external whenNotPaused onlyRole(OPERATOR_ROLE) {\n    if (kycRegistry_ == address(0)) {\n      revert InvalidKYCRegistryAddress();\n    }\n    kycRegistry = IKYCRegistry(kycRegistry_);\n  }\n\n  /**\n   * @notice Simulates a mint operation without executing it\n   * @dev This function calculates the required token amount and fees to mint a specific number of shares\n   * @param token The address of the token to be deposited\n   * @param shares The amount of shares to be minted\n   * @return amount The total amount of tokens required (including fees)\n   * @return depositFees The amount of fees that would be charged\n   * @return isAllowed Whether the mint operation would be allowed\n   * @return errorMessage A descriptive message if the mint would fail, empty string if successful\n   */\n  function previewMint(\n    address token,\n    uint256 shares\n  )\n    external\n    view\n    whenNotPaused\n    returns (\n      uint256 amount,\n      uint256 depositFees,\n      bool isAllowed,\n      string memory errorMessage\n    )\n  {\n    // Check if deposit is enabled\n    if (!_depositEnabled) {\n      return (0, 0, false, \"Deposit is not enabled\");\n    }\n\n    // Check if token deposit is enabled\n    if (!depositTokenRegistry.isDepositEnabled(token)) {\n      return (0, 0, false, \"Token deposit not enabled\");\n    }\n\n    // Check if shares is valid\n    if (shares == 0) {\n      return (0, 0, false, \"Invalid shares amount\");\n    }\n\n    // Calculate token amount from shares without fees\n    uint256 baseAmount;\n    try sharePriceCalculator.convertFromShares(token, shares) returns (\n      uint256 calculatedAmount\n    ) {\n      baseAmount = calculatedAmount;\n    } catch Error(string memory reason) {\n      return (0, 0, false, reason);\n    } catch {\n      return (0, 0, false, \"Error calculating token amount\");\n    }\n\n    // Calculate fees\n    try depositTokenRegistry.previewMintFees(token, baseAmount) returns (\n      uint256 fees\n    ) {\n      depositFees = fees;\n      amount = baseAmount + fees;\n      isAllowed = true;\n      errorMessage = \"\";\n    } catch Error(string memory reason) {\n      return (baseAmount, 0, false, reason);\n    } catch {\n      return (baseAmount, 0, false, \"Error calculating fees\");\n    }\n\n    return (amount, depositFees, isAllowed, errorMessage);\n  }\n\n  /**\n   * @notice Converts a token amount to the equivalent number of shares\n   * @dev Uses the sharePriceCalculator to determine the conversion rate\n   * @param token The address of the token to convert from\n   * @param amount The amount of tokens to convert\n   * @return The number of shares equivalent to the given token amount\n   */\n  function convertToShares(\n    address token,\n    uint256 amount\n  ) external view whenNotPaused returns (uint256) {\n    return sharePriceCalculator.convertToShares(token, amount);\n  }\n\n  function convertFromShares(\n    address token,\n    uint256 shares\n  ) external view whenNotPaused returns (uint256) {\n    return sharePriceCalculator.convertFromShares(token, shares);\n  }\n\n  function setDepositTokenRegistry(\n    address depositTokenRegistry_\n  ) external whenNotPaused onlyRole(OPERATOR_ROLE) {\n    if (depositTokenRegistry_ == address(0)) {\n      revert InvalidRegistryAddress();\n    }\n    depositTokenRegistry = IDepositTokenRegistry(depositTokenRegistry_);\n  }\n\n  function setSharePriceCalculator(\n    address sharePriceCalculator_\n  ) external whenNotPaused onlyRole(OPERATOR_ROLE) {\n    if (sharePriceCalculator_ == address(0)) {\n      revert InvalidCalculatorAddress();\n    }\n    sharePriceCalculator = ISharePriceCalculator(sharePriceCalculator_);\n  }\n\n  /**\n   * @dev Sets the collateral manager address\n   * @param _collateralManager The new collateral manager address\n   */\n  function setCollateralManager(\n    address _collateralManager\n  ) external whenNotPaused onlyRole(OPERATOR_ROLE) {\n    if (_collateralManager == address(0)) {\n      revert InvalidCollateralManagerAddress();\n    }\n    collateralManager = _collateralManager;\n    emit CollateralManagerUpdated(_collateralManager);\n  }\n\n  /**\n   * @dev Sets the redemption manager address\n   * @param _redemptionManager The new redemption manager address\n   */\n  function setRedemptionManager(\n    address _redemptionManager\n  ) external whenNotPaused onlyRole(OPERATOR_ROLE) {\n    if (_redemptionManager == address(0)) {\n      revert InvalidRedemptionManagerAddress();\n    }\n    redemptionManager = _redemptionManager;\n  }\n\n  function depositEnabled() external view returns (bool) {\n    return _depositEnabled;\n  }\n\n  /**\n   * @dev Add a custodian for a specific token\n   * @param token The address of the token\n   * @param custodian The address of the custodian\n   */\n  function addCustodian(\n    address token,\n    address custodian\n  ) external whenNotPaused onlyRole(CUSTODIAN_MANAGER_ROLE) {\n    if (token == address(0)) {\n      revert InvalidToken(token);\n    }\n    if (custodian == address(0)) {\n      revert InvalidCustodian(custodian, token);\n    }\n    if (isCustodian(token, custodian)) {\n      revert CustodianAlreadySet(custodian, token);\n    }\n\n    custodians[token].push(custodian);\n    emit CustodianAdded(token, custodian);\n  }\n\n  /**\n   * @dev Remove a custodian for a specific token\n   * @param token The address of the token\n   * @param custodian The address of the custodian\n   */\n  function removeCustodian(\n    address token,\n    address custodian\n  ) external whenNotPaused onlyRole(CUSTODIAN_MANAGER_ROLE) {\n    if (token == address(0)) {\n      revert InvalidToken(token);\n    }\n    if (custodian == address(0)) {\n      revert InvalidCustodian(custodian, token);\n    }\n\n    address[] storage tokenCustodians = custodians[token];\n    for (uint i = 0; i < tokenCustodians.length; i++) {\n      if (tokenCustodians[i] == custodian) {\n        tokenCustodians[i] = tokenCustodians[tokenCustodians.length - 1];\n        tokenCustodians.pop();\n        emit CustodianRemoved(token, custodian);\n        return;\n      }\n    }\n    revert InvalidCustodian(custodian, token);\n  }\n\n  /**\n   * @dev Check if a custodian is valid for a token\n   * @param token The address of the token\n   * @param custodian The address of the custodian\n   * @return True if the custodian is valid for the token, false otherwise\n   */\n  function isCustodian(\n    address token,\n    address custodian\n  ) public view whenNotPaused returns (bool) {\n    address[] memory tokenCustodians = custodians[token];\n    for (uint i = 0; i < tokenCustodians.length; i++) {\n      if (tokenCustodians[i] == custodian) {\n        return true;\n      }\n    }\n    return false;\n  }\n\n  /**\n   * @dev Get the list of custodians for a specific token\n   * @param token The address of the token\n   * @return An array of custodian addresses\n   */\n  function getCustodiansForToken(\n    address token\n  ) external view whenNotPaused returns (address[] memory) {\n    return custodians[token];\n  }\n\n  /**\n   * @dev Transfer a specified token and amount to the designated custodian\n   * @param custodian The address of the custodian\n   * @param token The address of the token to transfer\n   * @param amount The amount of tokens to transfer\n   */\n  function withdrawToCustodian(\n    address custodian,\n    address token,\n    uint256 amount\n  )\n    external\n    onlyRole(OPERATOR_ROLE)\n    nonReentrant\n    whenNotPaused\n    validToken(token)\n    validAmount(amount)\n    validCustodian(custodian, token)\n  {\n    uint256 availableBalance = IERC20(token).balanceOf(address(this)) -\n      _lockedRedemptionTokens[token] -\n      _lockedCollateralTokens[token];\n    if (availableBalance < amount) {\n      revert InsufficientAvailableBalance(availableBalance, amount);\n    }\n\n    _totalWithdrawalsToCustodian[token][custodian] += amount;\n\n    IERC20(token).safeTransfer(custodian, amount);\n    emit AssetWithdrawnToCustodian(custodian, token, amount, block.timestamp);\n  }\n\n  /**\n   * @dev Receive tokens back from a custodian\n   * @param token The address of the token being deposited\n   * @param amount The amount of tokens to deposit\n   */\n  function depositFromCustodian(\n    address token,\n    uint256 amount\n  )\n    external\n    nonReentrant\n    whenNotPaused\n    validToken(token)\n    validAmount(amount)\n    validCustodian(msg.sender, token)\n  {\n    if (IERC20(token).allowance(msg.sender, address(this)) < amount) {\n      revert InsufficientAllowance(\n        msg.sender,\n        IERC20(token).allowance(msg.sender, address(this)),\n        amount\n      );\n    }\n\n    _totalDepositsFromCustodian[token][msg.sender] += amount;\n\n    IERC20(token).safeTransferFrom(msg.sender, address(this), amount);\n    emit AssetDepositedFromCustodian(\n      msg.sender,\n      token,\n      amount,\n      block.timestamp\n    );\n  }\n\n  // Add view functions to query the totals\n  function getTotalDepositsFromCustodian(\n    address token,\n    address custodian\n  ) external view returns (uint256) {\n    return _totalDepositsFromCustodian[token][custodian];\n  }\n\n  function getTotalWithdrawalsToCustodian(\n    address token,\n    address custodian\n  ) external view returns (uint256) {\n    return _totalWithdrawalsToCustodian[token][custodian];\n  }\n\n  /**\n   * @notice Get the net balance position of a custodian for a specific token\n   * @param token The address of the token\n   * @param custodian The address of the custodian\n   * @return withdrawals Total withdrawals to custodian\n   * @return deposits Total deposits from custodian\n   * @return netBalance Net balance position (deposits - withdrawals)\n   */\n  function getCustodianNetPosition(\n    address token,\n    address custodian\n  )\n    external\n    view\n    returns (uint256 withdrawals, uint256 deposits, int256 netBalance)\n  {\n    withdrawals = _totalWithdrawalsToCustodian[token][custodian];\n    deposits = _totalDepositsFromCustodian[token][custodian];\n    netBalance = int256(deposits) - int256(withdrawals);\n    return (withdrawals, deposits, netBalance);\n  }\n\n  /**\n   * @dev Transfer tokens to a recipient\n   * @param token The address of the token to transfer\n   * @param recipient The address of the recipient\n   * @param amount The amount of tokens to transfer\n   */\n  function transferTokens(\n    address token,\n    address recipient,\n    uint256 amount\n  ) external override nonReentrant whenNotPaused {\n    if (msg.sender != collateralManager) {\n      revert OnlyCollateralManager();\n    }\n    if (token == address(0)) {\n      revert InvalidToken(token);\n    }\n    if (recipient == address(0)) {\n      revert InvalidRecipient(recipient);\n    }\n    if (amount == 0) {\n      revert InvalidAmount(amount);\n    }\n\n    uint256 balance = IERC20(token).balanceOf(address(this));\n\n    if (balance < amount) {\n      revert InsufficientAvailableBalance(balance, amount);\n    }\n\n    IERC20(token).safeTransfer(recipient, amount);\n  }\n\n  /**\n   * @dev Receives tokens into InsuranceCapitalLayer from a sender.\n   * @param token The address of the ERC20 token.\n   * @param from The sender address.\n   * @param amount The amount of tokens to receive.\n   */\n  function receiveTokens(\n    address token,\n    address from,\n    uint256 amount\n  ) external nonReentrant whenNotPaused {\n    if (msg.sender != collateralManager) {\n      revert OnlyCollateralManager();\n    }\n    if (token == address(0)) {\n      revert InvalidToken(token);\n    }\n    if (from == address(0)) {\n      revert InvalidSender(from);\n    }\n    if (amount == 0) {\n      revert InvalidAmount(amount);\n    }\n    if (IERC20(token).allowance(from, address(this)) < amount) {\n      revert InsufficientAllowance(\n        from,\n        IERC20(token).allowance(from, address(this)),\n        amount\n      );\n    }\n\n    IERC20(token).safeTransferFrom(from, address(this), amount);\n  }\n\n  /**\n   * @notice Receives share tokens from a user into the contract for redemption\n   * @param from The address sending the share tokens\n   * @param amount The amount of share tokens to receive\n   */\n  function receiveShareTokens(\n    address from,\n    uint256 amount\n  ) external override nonReentrant whenNotPaused {\n    if (msg.sender != redemptionManager) {\n      revert OnlyRedemptionManager();\n    }\n    if (from == address(0)) {\n      revert InvalidSender(from);\n    }\n    if (amount == 0) {\n      revert InvalidAmount(amount);\n    }\n    if (IERC20(address(shareToken)).allowance(from, address(this)) < amount) {\n      revert InsufficientAllowance(\n        from,\n        IERC20(address(shareToken)).allowance(from, address(this)),\n        amount\n      );\n    }\n    // Update tracking state\n    userRedemptionDeposits[from] += amount;\n    contractShareTokenBalance += amount;\n\n    // Transfer tokens\n    IERC20(address(shareToken)).safeTransferFrom(from, address(this), amount);\n\n    emit ShareTokensReceived(from, amount);\n  }\n\n  /**\n   * @notice Burns share tokens from the contract after redemption\n   * @param amount The amount of share tokens to burn\n   */\n  function burnShareTokens(\n    uint256 amount\n  ) external override nonReentrant whenNotPaused {\n    if (msg.sender != redemptionManager) {\n      revert OnlyRedemptionManager();\n    }\n    if (amount == 0) {\n      revert InvalidAmount(amount);\n    }\n    if (IERC20(address(shareToken)).balanceOf(address(this)) < amount) {\n      revert InsufficientBalance(\n        IERC20(address(shareToken)).balanceOf(address(this)),\n        amount\n      );\n    }\n    // Only update contract balance, not user deposits\n    contractShareTokenBalance -= amount;\n\n    // Burn tokens\n    shareToken.burn(address(this), amount);\n\n    emit ShareTokensBurned(amount);\n  }\n\n  /**\n   * @notice Transfers redemption tokens to a user\n   * @param token The address of the redemption token to transfer\n   * @param to The address receiving the redemption tokens\n   * @param amount The amount of redemption tokens to transfer\n   */\n  function transferRedemptionTokens(\n    address token,\n    address to,\n    uint256 amount\n  ) external override nonReentrant whenNotPaused {\n    if (msg.sender != redemptionManager) {\n      revert OnlyRedemptionManager();\n    }\n    if (to == address(0)) {\n      revert InvalidRecipient(to);\n    }\n    if (amount == 0) {\n      revert InvalidAmount(amount);\n    }\n    if (_lockedRedemptionTokens[token] < amount) {\n      revert InsufficientLockedRedeemableBalance(\n        token,\n        _lockedRedemptionTokens[token],\n        amount\n      );\n    }\n\n    _lockedRedemptionTokens[token] -= amount;\n    IERC20(token).safeTransfer(to, amount);\n\n    emit RedemptionTokensTransferred(token, to, amount);\n  }\n\n  /**\n   * @notice Transfers share tokens back to a user (e.g., on redemption cancellation)\n   * @param to The address receiving the share tokens back\n   * @param amount The amount of share tokens to transfer back\n   */\n  function transferShareTokens(\n    address to,\n    uint256 amount\n  ) external override nonReentrant whenNotPaused {\n    if (msg.sender != redemptionManager) {\n      revert OnlyRedemptionManager();\n    }\n    if (to == address(0)) {\n      revert InvalidRecipient(to);\n    }\n    if (amount == 0) {\n      revert InvalidAmount(amount);\n    }\n    if (IERC20(address(shareToken)).balanceOf(address(this)) < amount) {\n      revert InsufficientBalance(\n        IERC20(address(shareToken)).balanceOf(address(this)),\n        amount\n      );\n    }\n\n    // Update tracking state\n    userRedemptionDeposits[to] -= amount;\n    contractShareTokenBalance -= amount;\n\n    // Transfer tokens\n    IERC20(address(shareToken)).safeTransfer(to, amount);\n\n    emit ShareTokensTransferred(to, amount);\n  }\n\n  // Add events for tracking\n  event ShareTokensReceived(address indexed from, uint256 amount);\n  event ShareTokensBurned(uint256 amount);\n  event ShareTokensTransferred(address indexed to, uint256 amount);\n\n  /**\n   * @notice Returns the amount of tokens locked for redemption rounds\n   * @param token The token address to query\n   * @return lockedAmount The amount of tokens locked\n   * @return availableAmount The amount of tokens available for new rounds\n   */\n  function getRedemptionTokenStatus(\n    address token\n  ) external view returns (uint256 lockedAmount, uint256 availableAmount) {\n    lockedAmount = _lockedRedemptionTokens[token];\n    availableAmount = IERC20(token).balanceOf(address(this)) - lockedAmount;\n    return (lockedAmount, availableAmount);\n  }\n\n  /**\n   * @notice Locks redemption tokens for a round\n   * @dev Can only be called by the redemption manager\n   * @param token The token to lock\n   * @param amount The amount to lock\n   */\n  function lockRedemptionTokens(\n    address token,\n    uint256 amount\n  ) external override nonReentrant whenNotPaused {\n    if (msg.sender != redemptionManager) {\n      revert OnlyRedemptionManager();\n    }\n    uint256 currentBalance = IERC20(token).balanceOf(address(this));\n    uint256 requiredBalance = amount +\n      _lockedRedemptionTokens[token] +\n      _lockedCollateralTokens[token];\n    if (currentBalance < requiredBalance) {\n      revert InsufficientAvailableBalance(currentBalance, requiredBalance);\n    }\n\n    _lockedRedemptionTokens[token] += amount;\n\n    emit RedemptionTokensLocked(token, amount);\n  }\n\n  // Add events\n  event RedemptionTokensLocked(address indexed token, uint256 amount);\n  event RedemptionTokensTransferred(\n    address indexed token,\n    address indexed to,\n    uint256 amount\n  );\n\n  /**\n   * @notice Returns the total amount of deposit fees collected for a specific token\n   * @param token The address of the token to query\n   * @return The total amount of deposit fees for the token\n   */\n  function getTotalDepositFeeAmount(\n    address token\n  ) external view returns (uint256) {\n    if (token == address(0)) {\n      revert InvalidToken(token);\n    }\n    return _totalDepositFeeAmount[token];\n  }\n\n  /**\n   * @notice Claims accumulated deposit fees for a specific token\n   * @param token The address of the token to claim fees for\n   * @param recipient The address to receive the claimed fees\n   * @return amount The amount of fees claimed\n   */\n  function claimDepositFees(\n    address token,\n    address recipient\n  )\n    external\n    nonReentrant\n    whenNotPaused\n    onlyRole(FEE_MANAGER_ROLE)\n    returns (uint256)\n  {\n    if (token == address(0)) {\n      revert InvalidToken(token);\n    }\n    if (recipient == address(0)) {\n      revert InvalidRecipient(recipient);\n    }\n\n    uint256 feeAmount = _totalDepositFeeAmount[token];\n    if (feeAmount == 0) {\n      revert NoFeesToClaim();\n    }\n\n    // Reset fee amount before transfer to prevent reentrancy\n    _totalDepositFeeAmount[token] = 0;\n\n    // Transfer the fees\n    IERC20(token).safeTransfer(recipient, feeAmount);\n\n    emit DepositFeeClaimed(token, recipient, feeAmount);\n\n    return feeAmount;\n  }\n\n  /**\n   * @dev Locks collateral tokens to prevent them from being used for redemptions\n   * @param token The address of the token to lock\n   * @param amount The amount to lock\n   */\n  function lockCollateralTokens(\n    address token,\n    uint256 amount\n  ) external override onlyCollateralManager whenNotPaused {\n    uint256 currentBalance = IERC20(token).balanceOf(address(this));\n    uint256 requiredBalance = amount +\n      _lockedCollateralTokens[token] +\n      _lockedRedemptionTokens[token];\n    if (currentBalance < requiredBalance) {\n      revert InsufficientAvailableBalance(currentBalance, requiredBalance);\n    }\n    _lockedCollateralTokens[token] += amount;\n    emit CollateralTokensLocked(token, amount);\n  }\n\n  /**\n   * @dev Unlocks previously locked collateral tokens\n   * @param token The address of the token to unlock\n   * @param amount The amount to unlock\n   */\n  function unlockCollateralTokens(\n    address token,\n    uint256 amount\n  ) external override onlyCollateralManager whenNotPaused {\n    if (_lockedCollateralTokens[token] < amount) {\n      revert InsufficientLockedCollateral(\n        token,\n        _lockedCollateralTokens[token],\n        amount\n      );\n    }\n    _lockedCollateralTokens[token] -= amount;\n    emit CollateralTokensUnlocked(token, amount);\n  }\n\n  /**\n   * @notice Returns the available balance for a given token\n   * @dev Available balance = total balance - locked redemption tokens - locked collateral tokens\n   * @param token The address of the token to query\n   * @return The available balance of the token\n   */\n  function getAvailableBalance(\n    address token\n  ) external view override returns (uint256) {\n    uint256 totalBalance = IERC20(token).balanceOf(address(this));\n    uint256 lockedRedemptions = _lockedRedemptionTokens[token];\n    uint256 lockedCollateral = _lockedCollateralTokens[token];\n    uint256 depositFees = _totalDepositFeeAmount[token];\n\n    return\n      totalBalance > (lockedRedemptions + lockedCollateral + depositFees)\n        ? totalBalance - lockedRedemptions - lockedCollateral - depositFees\n        : 0;\n  }\n\n  // Modify the setShareToken function\n  function setShareToken(ShareToken token) external onlyRole(OPERATOR_ROLE) {\n    if (_shareTokenSet) {\n      revert ShareTokenAlreadySet();\n    }\n    shareToken = token;\n    _shareTokenSet = true;\n    emit ShareTokenSet(address(token));\n  }\n\n  // Add a storage gap for future upgrades\n  uint256[50] private __gap;\n}\n","deployed_bytecode":"0x6080604081815260048036101561001557600080fd5b600092833560e01c90816301ffc9a7146137005750806305db2f41146136c5578063061525371461366c57806306fdde03146135825780630df9ef2c146135225780630efe6a8b14613209578063156c2a6e146131e057806320483dd114613134578063205023d3146130f957806322b6fea914612fd957806323be345c14612fb0578063248a9ca314612f795780632b38e26614612f225780632ccbef8b14612d8d5780632e08ebcd14612d1c5780632e718ab714612ce15780632eebe78e14612cbd5780632f2ff15d14612c945780633278eb0414612c6b57806336568abe14612c24578063383e6d4a14612b6a5780633e5541f114612ab95780633f4ba83a14612a4257806340f797bb146129b65780634788a26b146129565780634b155b971461292d5780634efde8d01461290e5780634f1ef286146126d557806352d1902d1461266e5780635a8f00c81461261e5780635b17d04b146125b95780635c975abb14612588578063608fc37a146121fb578063635b6a3a1461219b57806363f926231461208157806366c4257b146120495780636c24a76f14611f635780636c9fa59e14611f3b57806375b238fc14611f00578063842a05d414611e775780638456cb5914611e0f57806384b594dc14611c405780638795feb814611adf5780638863e5c4146117a55780638dcfbfab146115ba5780639137c1771461157d57806391d148541461152b57806395d89b411461143757806399caf5dd1461120e5780639b18847e1461116d5780639f5bd0f3146110ba578063a217fddf1461109f578063a64b6e5f14610f52578063a819462514610d6a578063a981c7b414610d3d578063ad3cb1cc14610cf8578063b008690c14610a32578063b04b3f57146109f3578063b8b99b7a146109a5578063b8f82b2614610973578063beb96acf14610855578063c5cc6bb314610807578063c79445d0146107cc578063cc2b2523146107ad578063cf177dbc14610655578063d1f810a514610611578063d547741f146105c5578063e63ab1e91461058a578063f5b541a614610561578063f72c0d8b146105345763fade00fe1461033057600080fd5b3461044f57602090816003193601126104415780359061034e614255565b61035661422a565b6009546001600160a01b03908116330361052557821561050f5785541684516370a0823160e01b9081815230848201528581602481865afa801561050557859189916104d4575b501061045357509085916103b384600c54613f89565b600c55803b1561044f578383916103e093838951809681958294632770a7eb60e21b845230908401613eb0565b03925af180156104455761042d575b50507f0158b5c01453469bf562bebba531d45a08d8162682a2d56d652909caf8e9cbaa9251908152a1600160008051602061490a8339815191525580f35b610436906137c4565b6104415783386103ef565b8380fd5b85513d84823e3d90fd5b8280fd5b9380879395602488949851809981938252308a8301525afa9283156104c95792610493575b505163cf47918160e01b815292830152602482015260449150fd5b90915084813d83116104c2575b6104aa8183613823565b810103126104bd57604493519085610478565b600080fd5b503d6104a0565b8251903d90823e3d90fd5b809250878092503d83116104fe575b6104ed8183613823565b810103126104bd578490513861039d565b503d6104e3565b87513d8a823e3d90fd5b50602491845191633728b83d60e01b8352820152fd5b5083516367a3563f60e01b8152fd5b50503461055d578160031936011261055d576020905160008051602061484a8339815191528152f35b5080fd5b50503461055d578160031936011261055d57602090516000805160206148aa8339815191528152f35b50503461055d578160031936011261055d57602090517f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a8152f35b50903461044f578060031936011261044f5761060d913561060860016105e961376a565b938387526000805160206148ca83398151915260205286200154613a6e565b613cda565b5080f35b50503461055d578060031936011261055d5761065190610643610632613754565b61063a61422a565b60243590614363565b919492935194859485613929565b0390f35b503461044f578160031936011261044f5761066e613754565b6024359061067a614255565b61068261422a565b6009546001600160a01b0391908216330361079d5716928051926370a0823160e01b845230818501526020938481602481895afa908115610793578791610766575b50858752600d85526106ed6106dc8489205486614285565b878952600e87528489205490614285565b9081811061074d57505050907f3b3cc6e6e4f41ea6d60a8a018c24e335d06b91f3eaa9dfc6e7f51cd00155c4e49291848652600d8352808620610731838254614285565b905551908152a2600160008051602061490a8339815191525580f35b604493519263adb9e04360e01b84528301526024820152fd5b90508481813d831161078c575b61077d8183613823565b810103126104bd5751386106c4565b503d610773565b83513d89823e3d90fd5b84516367a3563f60e01b81528490fd5b50503461055d578160031936011261055d576020906005549051908152f35b50503461055d578160031936011261055d57602090517fe28434228950b641dbbc0178de89daa359a87c6ee0d8399aeace52a98fe902b98152f35b50503461055d578060031936011261055d57602091610824613754565b8261082d61376a565b6001600160a01b039283168452600f8652922091166000908152908352819020549051908152f35b503461044f5761086436613884565b91939061086f614255565b61087761422a565b6009546001600160a01b039590861633036109635785821695861561094c57841561093557811694858852600d6020528388205485811061091657505050916020916108fc827f466568d995c4d20c1611745da0ee5c713e401f183df24615614ad6ce33e67fce95878a52600d8652838a206108f4838254613f89565b9055876147e4565b51908152a3600160008051602061490a8339815191525580f35b8561093191865194859463162f9a1960e31b8652850161480b565b0390fd5b8351633728b83d60e01b8152808701869052602490fd5b8351630bc2c5df60e11b8152808701889052602490fd5b82516367a3563f60e01b81528590fd5b50503461055d578060031936011261055d5761065190610643610994613754565b61099c61422a565b60243590613fac565b50503461055d578060031936011261055d576020916109c2613754565b826109cb61376a565b6001600160a01b03928316845260108652922091166000908152908352819020549051908152f35b50503461055d578060031936011261055d57602090610a29610a13613754565b610a1b61376a565b90610a2461422a565b614746565b90519015158152f35b503461044f5760e036600319011261044f57610a4c613754565b906001600160401b03602435818111610cf457610a6c903690840161390b565b50604435818111610cf457610a84903690840161390b565b50610a8d613780565b926001600160a01b0392608435908482168083036104bd5760a435868116928382036104bd5760c435938885168095036104bd578a987ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a009a60ff8c54809c1c1615998b169a8b1580610ced575b6001809d149081610ce3575b159081610cda575b50610cca5767ffffffffffffffff1981168c178d558a610cab575b50610b32613df0565b610b3a613df0565b8a60008051602061490a83398151915255610b53613df0565b610b5b613df0565b610b63613df0565b6000805160206148ea833981519152805460ff19169055610b82613df0565b81891615610c9b5716938415610c8b5715610c7c5715610c6e578315610c60575086546001600160a01b0319908116909217875560068054610100600160a81b03191660089290921b610100600160a81b0316919091179055600780549091169091179055610c199190610c0990610bf983613aa1565b50610c0333613aa1565b50613b2f565b50610c1333613b2f565b50613bcd565b50610c22578380f35b815460ff60401b191690915590519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a13880808380f35b8951630538eaff60e51b8152fd5b8951637bfd2e8360e01b8152fd5b50895163eb32d3bf60e01b8152fd5b8b51630201aae160e21b81528390fd5b8c5163016ed19f60e21b81528490fd5b68ffffffffffffffffff191668010000000000000001178c5538610b29565b8d5163f92ee8a960e01b81528590fd5b90501538610b0e565b303b159150610b06565b508a610afa565b8580fd5b50503461055d578160031936011261055d57805161065191610d19826137ed565b60058252640352e302e360dc1b602083015251918291602083526020830190613844565b50503461055d578160031936011261055d57600654905160089190911c6001600160a01b03168152602090f35b5082903461055d578260031936011261055d57610d85613754565b92602490813590610d94614255565b610d9c61422a565b6009546001600160a01b039081163303610f4257808716948515610f2c578315610f175781875416908351956370a0823160e01b808852308389015260209788818481885afa908115610f0d579088918c91610edc575b5010610e6e5750505050828697610e5492877f3a19b6efdb4fa34812cbff59a94c0d953fa352016b0c438a40a5520d69b26492989952600b8752848a20610e3b848254613f89565b9055610e4983600c54613f89565b600c558954166147e4565b51908152a2600160008051602061490a8339815191525580f35b90898689808a95858451809a81938252308b8301525afa9283156104c95792610eab575b505163cf47918160e01b81529384015282015260449150fd5b90915085813d8311610ed5575b610ec28183613823565b810103126104bd57604494519086610e92565b503d610eb8565b8092508a8092503d8311610f06575b610ef58183613823565b810103126104bd578790518d610df3565b503d610eeb565b87513d8d823e3d90fd5b939450505191633728b83d60e01b8352820152fd5b8251630bc2c5df60e11b81529081018690528490fd5b81516367a3563f60e01b81528590fd5b5082903461055d57610f6336613884565b92610f6f929192614255565b610f7761422a565b6008546001600160a01b0392908316330361109057821691821561107a57831680156110645750831561104d5785516370a0823160e01b81523082820152602081602481865afa908115611043578691611012575b50848110610ff6575050610fe19394506147e4565b600160008051602061490a8339815191525580f35b865163adb9e04360e01b81529182015260248101849052604490fd5b90506020813d821161103b575b8161102c60209383613823565b810103126104bd575187610fcc565b3d915061101f565b87513d88823e3d90fd5b8551633728b83d60e01b8152908101849052602490fd5b8651630bc2c5df60e11b81529182015260249150fd5b5060249186519163961c9a4f60e01b8352820152fd5b50855163b693a60960e01b8152fd5b50503461055d578160031936011261055d5751908152602090f35b50503461055d5760208060031936011261044f576110d6613754565b926110df61422a565b6001600160a01b039384168152600a825282812083518154808252918352838320818501949192859190855b8181106111575750505082611121910383613823565b8451948186019282875251809352850193925b8281106111415785850386f35b8351871685529381019392810192600101611134565b82548a168452928401926001928301920161110b565b50913461120b578160031936011261120b57611187613754565b9161119061376a565b60018060a01b03809416938484526010602052828420911690816000526020528160002054938352600f60205281832090600052602052806000205483810392808512828512811690838613901516176111f857506060945081519384526020840152820152f35b634e487b7160e01b815260118652602490fd5b80fd5b50903461044f578060031936011261044f57611228613754565b9060243590611235614255565b61123d61422a565b6001600160a01b03831692831561142057821561140957331580156113f0575b6113d457508051636eb1769f60e11b8082526020959186818061128330338884016145bf565b0381895afa9081156113ca579085918991611399575b501061130d575050828552600f8452808520336000528452806000206112c0838254614285565b90556112ce823033866142b4565b519081527fdad7dfd8821ceb98a6dd83b8f330e604bd0e832f55ca902bbfadabde5e40132342933392a4600160008051602061490a8339815191525580f35b9480919583949593519384918252818061132a30338c84016145bf565b03915afa95861561138e579561135a575b505051630c95cf2760e11b81529283926109319291903390850161480b565b908093929550813d8311611387575b6113738183613823565b810103126104bd579051926109313861133b565b503d611369565b8351903d90823e3d90fd5b809250888092503d83116113c3575b6113b28183613823565b810103126104bd5784905138611299565b503d6113a8565b84513d8a823e3d90fd5b815163188fe79360e21b815290819061093190338389016145bf565b506113f961422a565b6114033382614746565b1561125d565b8151633728b83d60e01b8152808601849052602490fd5b815163961c9a4f60e01b8152808601859052602490fd5b50913461120b578060031936011261120b575080519060009060035491600183811c90808516948515611521575b602095868410811461150e578388528794939291879082156114ec5750506001146114ac575b5050610651929161149d910385613823565b51928284938452830190613844565b90859250600360005282600020916000925b8284106114d4575050508201018161149d61148b565b8054848a0186015288955087949093019281016114be565b60ff19168682015292151560051b8501909201925083915061149d905061148b565b634e487b7160e01b855260228952602485fd5b91607f1691611465565b503461044f578160031936011261044f578160209361154861376a565b923581526000805160206148ca8339815191528552209060018060a01b0316600052825260ff81600020541690519015158152f35b50503461055d5736600319011261120b576115b7611599613754565b6115a161376a565b906115aa61422a565b6115b26139b6565b6145e8565b80f35b5082903461055d578260031936011261055d576115d5613754565b92602435906115e2614255565b6115ea61422a565b6009546001600160a01b0390811633036117955780861693841561177e5783156117675785548351636eb1769f60e11b80825260209695949392841691878180611637308f838a016145bf565b0381865afa90811561175d579087918b9161172c575b50106116af5750505082610e54918798877f6926ad0f7f6f6814be2630ac9d46a2d1988f933254ad20700c1425aaf64a27a4989952600b8752848a20611694848254614285565b90556116a283600c54614285565b600c5530918a54166142b4565b8993508885888089948351968791825281806116ce308d8d84016145bf565b03915afa9283156104c957926116fa575b5051630c95cf2760e11b81529485946109319450850161480b565b90915083813d8311611725575b6117118183613823565b810103126104bd57610931925190866116df565b503d611707565b809250898092503d8311611756575b6117458183613823565b810103126104bd578690518c61164d565b503d61173b565b86513d8c823e3d90fd5b8251633728b83d60e01b8152908101849052602490fd5b82516313053d9360e21b8152908101859052602490fd5b81516367a3563f60e01b81528490fd5b503461044f57608036600319011261044f576117bf613754565b6024803592604435916117d0613780565b926117d9614255565b6117e161422a565b60015487516373bed91960e11b81526001600160a01b0386811686830152939160209190829082908590829089165afa908115611ad5578b91611ab8575b5015611aa85761182d61422a565b60065460ff811615611a98578815611a825789516313a9822560e31b8152888616878201819052949160081c86169083818681855afa9081156119fa578d91611a55575b5015611a3f578a5163146f4ea360e21b815295949392919082908790818061189c8f8f838f01613eb0565b03915afa928315611a35578c93611a04575b6118e09650826118be858d613f89565b8d8c8b8a6007541692519b8c9485938493633e5541f160e01b85528401613eb0565b03915afa9687156119fa578d976119cb575b508187106119b05750508261192692878b938e9a999897968b525261191b8c8a20918254614285565b9055309033906142b4565b845416803b156119ac57611951938580948a51968795869485936340c10f1960e01b85528401613eb0565b03925af1801561044557611998575b505061198060008051602061488a83398151915293519283923384614292565b0390a1600160008051602061490a8339815191525580f35b6119a1906137c4565b610441578338611960565b8480fd5b6044918891888e519363658ec5dd60e11b8552840152820152fd5b9096508281813d83116119f3575b6119e38183613823565b810103126104bd575195386118f2565b503d6119d9565b8c513d8f823e3d90fd5b92508186813d8311611a2e575b611a1b8183613823565b810103126104bd576118e09551926118ae565b503d611a11565b8b513d8e823e3d90fd5b8a51639d42b4b360e01b81528088018690528490fd5b611a759150843d8611611a7b575b611a6d8183613823565b810190613e63565b38611871565b503d611a63565b8951633728b83d60e01b81528087018a90528390fd5b895163bb60b89360e01b81528690fd5b885163110781d160e31b81528590fd5b611acf9150823d8411611a7b57611a6d8183613823565b3861181f565b8a513d8d823e3d90fd5b50903461044f578060031936011261044f57611af9613754565b92611b0261376a565b93611b0b614255565b611b1361422a565b7f6c0757dc3e6b28b2580c03fd9e96c274acf4f99d91fbec9b418fa1d70604ff1c94856000526020956000805160206148ca83398151915287528460002033600052875260ff85600020541615611c2257506001600160a01b03918216918215611c0b578116928315611bf45782815285875284812054958615611be657838252875284812055611ba6908590836147e4565b7fd74e462593ae4127bbc183389b3775357426f157e9625f81271612b86b8000a6858451868152a3600160008051602061490a8339815191525551908152f35b855163211b631760e21b8152fd5b8451630bc2c5df60e11b8152808701859052602490fd5b845163961c9a4f60e01b8152808701849052602490fd5b845163e2517d3f60e01b815233818801526024810191909152604490fd5b50903461044f57611c5036613884565b93909192611c5c61394e565b611c64614255565b611c6c61422a565b6001600160a01b0383811694908515611df8578615611de15781169384158015611dc8575b611dac575081516370a0823160e01b815230848201526020939084816024818a5afa908115611da2578991611d73575b50611cda611ceb91888b52600d8752858b205490613f89565b878a52600e8652848a205490613f89565b878110611d5757505090611d3b867ff7924cd170ae143405ff2557ce6b4615c3a29b30bcd8a70b49d4d0b3475efb0c9493878a5260108552838a20876000528552836000206108f4838254614285565b519485524294a4600160008051602061490a8339815191525580f35b835163adb9e04360e01b81529182015260248101879052604490fd5b90508481813d8311611d9b575b611d8a8183613823565b810103126104bd5751611cda611cc1565b503d611d80565b84513d8b823e3d90fd5b915163188fe79360e21b815292839261093192909184016145bf565b50611dd161422a565b611ddb8282614746565b15611c91565b8251633728b83d60e01b8152808501889052602490fd5b825163961c9a4f60e01b8152808501879052602490fd5b50503461055d578160031936011261055d5760207f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25891611e4d613a12565b611e5561422a565b6000805160206148ea833981519152805460ff1916600117905551338152a180f35b50903461044f57602036600319011261044f57611e92613754565b611e9a61422a565b611ea261394e565b6001600160a01b0316918215611ef25750600880546001600160a01b03191683179055519081527f507e88d0e3541203c8e7dba038a3e807ac9121f0872ed9ed895cd7f3358334eb90602090a180f35b9051630d432b0160e21b8152fd5b50503461055d578160031936011261055d57602090517fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217758152f35b50503461055d578160031936011261055d57905490516001600160a01b039091168152602090f35b503461044f576020928360031936011261120b576001600160a01b03611f87613754565b84516370a0823160e01b8152308582015291168582602481845afa91821561203f578392612010575b508252600d85528382205490600e8652848320549386528483205492611fdf84611fda8786614285565b614285565b821115612005575092611ff8611ff892611ffd95613f89565b613f89565b905b51908152f35b935050505090611fff565b9091508581813d8311612038575b6120288183613823565b810103126104bd57519038611fb0565b503d61201e565b85513d85823e3d90fd5b50503461055d57602036600319011261055d5760209181906001600160a01b03612071613754565b168152600b845220549051908152f35b503461044f578160031936011261044f5761209a613754565b600854602435916001600160a01b03918216330361218b576120ba61422a565b16928051926370a0823160e01b845230818501526020938481602481895afa90811561079357879161215e575b50858752600e85526121106120ff8489205486614285565b878952600d87528489205490614285565b9081811061074d57505050907f36bea377ee4a4c4516cc608cc232173faafbeb7ee10ad11c6420f2863a97644b9291848652600e8352808620612154838254614285565b905551908152a280f35b90508481813d8311612184575b6121758183613823565b810103126104bd5751386120e7565b503d61216b565b845163b693a60960e01b81528490fd5b503461044f57602036600319011261044f576121b5613754565b6121bd61422a565b6121c561394e565b6001600160a01b03169182156121ee575050600780546001600160a01b03191691909117905580f35b51630538eaff60e51b8152fd5b5082906020928360031936011261044f57813591612217614255565b61221f61422a565b60015482516373bed91960e11b815233838201526001600160a01b03949187908290602490829089165afa90811561257e578691612561575b50156125525734156125435760065460ff81161561253357849060081c1683519463e861e90760e01b865287868581855afa9586156125295787966124ed575b5084516313a9822560e31b815286821685820181905293908981602481875afa9081156124735789916124d0575b50156124b857888651809463146f4ea360e21b825281806122ea348d8c8401613eb0565b03915afa9081156124ae57889161247d575b61232c93508961230c8334613f89565b84600754168a8a51809881948293633e5541f160e01b84528d8401613eb0565b03915afa938415612473578994612444575b508084106124275750848899858a98999a525261235f878720918254614285565b9055845416803b156119ac5785516340c10f1960e01b8152918591839182908490829061238f90338b8401613eb0565b03925af1801561241d57908491612409575b5050803b1561044f578290845192838092630d0e30db60e41b825234905af180156123ff576123eb575b50815160008051602061488a833981519152908061198034873384614292565b6123f4906137c4565b61044f5782846123cb565b83513d84823e3d90fd5b612412906137c4565b61044f5782876123a1565b85513d86823e3d90fd5b93505050604493519263658ec5dd60e11b84528301526024820152fd5b9093508981813d831161246c575b61245c8183613823565b810103126104bd5751928a61233e565b503d612452565b87513d8b823e3d90fd5b90508883813d83116124a7575b6124948183613823565b810103126104bd5761232c9251906122fc565b503d61248a565b86513d8a823e3d90fd5b50509251639d42b4b360e01b81529182015260249150fd5b6124e791508a3d8c11611a7b57611a6d8183613823565b8a6122c6565b9095508781813d8311612522575b6125058183613823565b8101031261251e5751858116810361251e579488612298565b8680fd5b503d6124fb565b85513d89823e3d90fd5b835163bb60b89360e01b81528390fd5b509051633b903ec760e01b8152fd5b50905163110781d160e31b8152fd5b6125789150873d8911611a7b57611a6d8183613823565b87612258565b84513d88823e3d90fd5b50503461055d578160031936011261055d5760209060ff6000805160206148ea833981519152541690519015158152f35b503461044f57602036600319011261044f57803590811515809203610441576125e061422a565b6125e861394e565b600654928260ff851615151461260957505060ff169060ff19161760065580f35b91602492519163ca255b0b60e01b8352820152fd5b503461044f57602036600319011261044f576001600160a01b03612640613754565b16801561265a579282916020948252845220549051908152f35b602492519163961c9a4f60e01b8352820152fd5b50913461120b578060031936011261120b57507f00000000000000000000000006d4acc104b974cd99bf22e4572f48a051e596706001600160a01b031630036126c8576020905160008051602061486a8339815191528152f35b5163703e46dd60e11b8152fd5b50908060031936011261044f576126ea613754565b9060249384356001600160401b03811161055d573660238201121561055d5761271b903690878188013591016138d4565b6001600160a01b03937f00000000000000000000000006d4acc104b974cd99bf22e4572f48a051e5967085163081149081156128f2575b506128e25760008051602061484a83398151915294856000526020956000805160206148ca83398151915287528560002033600052875260ff866000205416156128c5575081169484516352d1902d60e01b8152818189818a5afa859181612896575b506127d05750505050505191634c9c8ce360e01b8352820152fd5b868996899260008051602061486a833981519152908181036128815750853b1561286c5780546001600160a01b0319168317905551869392917fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8580a2855115612850575050835161060d94839201845af461284a613d5d565b91613d8d565b9350935050503461286057505080f35b63b398979f60e01b8152fd5b5051634c9c8ce360e01b815291820152859150fd5b848a91845191632a87526960e21b8352820152fd5b9091508281813d83116128be575b6128ae8183613823565b81010312610cf4575190386127b5565b503d6128a4565b855163e2517d3f60e01b815233818a0152808a0191909152604490fd5b835163703e46dd60e11b81528690fd5b90508560008051602061486a8339815191525416141538612752565b50503461055d578160031936011261055d57602090600c549051908152f35b50503461055d578160031936011261055d5760015490516001600160a01b039091168152602090f35b503461044f57602036600319011261044f57612970613754565b61297861422a565b61298061394e565b6001600160a01b03169182156129a9575050600180546001600160a01b03191691909117905580f35b51630201aae160e21b8152fd5b50903461044f57602036600319011261044f5781356001600160a01b0381169290839003610441576129e661394e565b6011549160ff8316612a3557505082546001600160a01b0319168217835560ff19166001176011557fdb40a5259506fa101ac4485d4ccbd019c99ada5fb7212fe1254374f7a10e02dc8280a280f35b51630f4bac1b60e21b8152fd5b503461044f578260031936011261044f57612a5b613a12565b6000805160206148ea8339815191529081549060ff821615612aab575060ff19169055513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa90602090a180f35b8351638dfc202b60e01b8152fd5b5091903461055d578060031936011261055d576020612b1093612ada613754565b612ae261422a565b6007548451633e5541f160e01b81529687936001600160a01b03909216928492839291602435918401613eb0565b03915afa918215612b5f5791612b2b575b6020925051908152f35b90506020823d8211612b57575b81612b4560209383613823565b810103126104bd576020915190612b21565b3d9150612b38565b9051903d90823e3d90fd5b50903461044f578060031936011261044f57612b84613754565b6008546024359291906001600160a01b039081163303612c1457612ba661422a565b811693848652600e60205282862054848110612bf9575050507fbcb639e764c5cd7d736acef943167eb10be8fc46f9e33b29c69c89473fb79fd791602091848652600e8352808620612154838254613f89565b84610931918551948594631664bf6360e01b8652850161480b565b825163b693a60960e01b81528590fd5b5091903461055d578060031936011261055d57612c3f61376a565b90336001600160a01b03831603612c5c575061060d919235613cda565b5163334bd91960e11b81528390fd5b50503461055d578160031936011261055d5760095490516001600160a01b039091168152602090f35b50903461044f578060031936011261044f5761060d9135612cb860016105e961376a565b613c65565b50503461055d578160031936011261055d5760209060ff6006541690519015158152f35b50503461055d578160031936011261055d57602090517f85e8f2d6819d6b24108062d87ea08f54651bcb8960d98062d3faf96e7873b8b98152f35b503461044f57602036600319011261044f57612d36613754565b91612d3f61422a565b612d4761394e565b6001600160a01b03831615612d8057505060068054610100600160a81b03191660089290921b610100600160a81b031691909117905580f35b51637bfd2e8360e01b8152fd5b50903461044f57612d9d36613884565b93909192612da9614255565b612db161422a565b6008546001600160a01b03949085163303612f14578416938415612efd5783168015612ee857508415612ed2578051636eb1769f60e11b808252602091828180612dfe308a8a84016145bf565b03818a5afa908115611da2579088918a91612ea1575b5010612e275787610fe18830888a6142b4565b81908398949795985196879182528180612e44308d8d84016145bf565b03915afa9283156104c95792612e6f575051630c95cf2760e11b81529485946109319450850161480b565b90915083813d8311612e9a575b612e868183613823565b810103126104bd57610931925190386116df565b503d612e7c565b809250848092503d8311612ecb575b612eba8183613823565b810103126104bd5787905138612e14565b503d612eb0565b51633728b83d60e01b8152908101849052602490fd5b90516313053d9360e21b815291820152602490fd5b815163961c9a4f60e01b8152808401869052602490fd5b505163b693a60960e01b8152fd5b5091903461055d578060031936011261055d576020612b1093612f43613754565b612f4b61422a565b600754845163159c713360e11b81529687936001600160a01b03909216928492839291602435918401613eb0565b503461044f57602036600319011261044f57816020936001923581526000805160206148ca83398151915285522001549051908152f35b50503461055d578160031936011261055d5760085490516001600160a01b039091168152602090f35b50903461044f578060031936011261044f57612ff3613754565b91612ffc61376a565b9061300561422a565b61300d6139b6565b6001600160a01b0384811693908415612efd5783169485156130e05761303161422a565b61303b8482614746565b6130c75750838652600a6020528520805491600160401b8310156130b457508161306e91600161308d9594018155613796565b90919082549060031b9160018060a01b03809116831b921b1916179055565b7f2c79891dd909910a9ed2116eb868a4783a4abeb6da7c8dc217cd5b198b329b5d8380a380f35b634e487b7160e01b875260419052602486fd5b610931915193849363aebbe4f960e01b855284016145bf565b610931915193849363188fe79360e21b855284016145bf565b50503461055d578160031936011261055d57602090517f0792b37891b8244bb8149106fc05e84f10f266ef581c099bf3d880350e979b2f8152f35b50823461120b576020908160031936011261120b576001600160a01b03613159613754565b1690818152600d835282858220549460248751809581936370a0823160e01b835230908301525afa9081156131d55784916131a4575b6131999250613f89565b908351928352820152f35b50508181813d83116131ce575b6131bb8183613823565b810103126104bd5782613199915161318f565b503d6131b1565b8551903d90823e3d90fd5b50503461055d578160031936011261055d5760075490516001600160a01b039091168152602090f35b50913461120b57606036600319011261120b57613224613754565b92602493843591604435613236614255565b61323e61422a565b60015486516373bed91960e11b815233848201526020986001600160a01b0393929091908a9082908490829088165afa9081156135185788916134fb575b50156134eb5761328a61422a565b60065460ff8116156134db5786156134c657839060081c1698899289516313a9822560e31b815282818581898c1698898c8301525afa9081156134bc578a9161349f575b501561348957818a51809c63146f4ea360e21b825281806132f28d8d8d8401613eb0565b03915afa92831561347f578993613449575b88999a9b50826133188561333b9a9b613f89565b6007548e51633e5541f160e01b81529a8b92918a1691839182918f838f01613eb0565b03915afa97881561343f578b9861340c575b508188106133f15750509187918561337194838c525261191b8b8b20918254614285565b85541690813b15610cf45791859161339f938389518096819582946340c10f1960e01b845233908401613eb0565b03925af1801561241d576133ce575b5061198060008051602061488a8339815191529394519283923384614292565b60008051602061488a833981519152936133ea611980926137c4565b93506133ae565b6044918791898e519363658ec5dd60e11b8552840152820152fd5b9097508281813d8311613438575b6134248183613823565b810103126134345751963861334d565b8a80fd5b503d61341a565b8c513d8d823e3d90fd5b9250818b813d8311613478575b6134608183613823565b8101031261347457995198998a9992613304565b8880fd5b503d613456565b8a513d8b823e3d90fd5b8951639d42b4b360e01b81528087018590528390fd5b6134b69150833d8511611a7b57611a6d8183613823565b386132ce565b8b513d8c823e3d90fd5b508751633728b83d60e01b8152808501879052fd5b885163bb60b89360e01b81528590fd5b875163110781d160e31b81528490fd5b61351291508a3d8c11611a7b57611a6d8183613823565b3861327c565b89513d8a823e3d90fd5b503461044f57602036600319011261044f5761353c613754565b61354461422a565b61354c61394e565b6001600160a01b0316918215613575575050600980546001600160a01b03191691909117905580f35b516348db2b6f60e11b8152fd5b50913461120b578060031936011261120b578151918160025492600184811c91818616958615613662575b602096878510811461364f578899509688969785829a5291826000146136285750506001146135ea575b505050610651929161149d910385613823565b9190869350600283528383205b828410613610575050508201018161149d6106516135d7565b8054848a0186015288955087949093019281016135f7565b60ff19168782015293151560051b8601909301935084925061149d915061065190506135d7565b634e487b7160e01b835260228a52602483fd5b92607f16926135ad565b50503461055d578060031936011261055d57613686613754565b6001600160a01b039081168352600a6020528183208054602435949085101561120b57506020936136b691613796565b92905490519260031b1c168152f35b50503461055d578160031936011261055d57602090517f6c0757dc3e6b28b2580c03fd9e96c274acf4f99d91fbec9b418fa1d70604ff1c8152f35b9250503461044f57602036600319011261044f573563ffffffff60e01b811680910361044f5760209250637965db0b60e01b8114908115613743575b5015158152f35b6301ffc9a760e01b1490503861373c565b600435906001600160a01b03821682036104bd57565b602435906001600160a01b03821682036104bd57565b606435906001600160a01b03821682036104bd57565b80548210156137ae5760005260206000200190600090565b634e487b7160e01b600052603260045260246000fd5b6001600160401b0381116137d757604052565b634e487b7160e01b600052604160045260246000fd5b604081019081106001600160401b038211176137d757604052565b602081019081106001600160401b038211176137d757604052565b90601f801991011681019081106001600160401b038211176137d757604052565b919082519283825260005b848110613870575050826000602080949584010152601f8019910116010190565b60208183018101518483018201520161384f565b60609060031901126104bd576001600160a01b039060043582811681036104bd579160243590811681036104bd579060443590565b6001600160401b0381116137d757601f01601f191660200190565b9291926138e0826138b9565b916138ee6040519384613823565b8294818452818301116104bd578281602093846000960137010152565b9080601f830112156104bd57816020613926933591016138d4565b90565b9092608092613926959483526020830152151560408201528160608201520190613844565b3360009081527f448256db8f8fb95ee3eaaf89c1051414494e85cebb6057fcf996cc3d0ccfb45660205260409020546000805160206148aa8339815191529060ff16156139985750565b6044906040519063e2517d3f60e01b82523360048301526024820152fd5b3360009081527f4e5d4d14b1d64b65403760d275670011644f8f7998f1ef964b0082bdadeaa41460205260409020547f0792b37891b8244bb8149106fc05e84f10f266ef581c099bf3d880350e979b2f9060ff16156139985750565b3360009081527f75442b0a96088b5456bc4ed01394c96a4feec0f883c9494257d76b96ab1c9b6b60205260409020547f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a9060ff16156139985750565b806000526000805160206148ca83398151915260205260406000203360005260205260ff60406000205416156139985750565b6001600160a01b031660008181527fb7db2dd08fcb62d0c9e08c51941cae53c267786a0b75803fb7960902fc8ef97d60205260408120549091906000805160206148ca8339815191529060ff16613b2a578280526020526040822081835260205260408220600160ff19825416179055339160008051602061482a8339815191528180a4600190565b505090565b6001600160a01b031660008181527f448256db8f8fb95ee3eaaf89c1051414494e85cebb6057fcf996cc3d0ccfb45660205260408120549091906000805160206148aa833981519152906000805160206148ca8339815191529060ff16613bc7578184526020526040832082845260205260408320600160ff1982541617905560008051602061482a833981519152339380a4600190565b50505090565b6001600160a01b031660008181527fab71e3f32666744d246edff3f96e4bdafee2e9867098cdd118a979a7464786a8602052604081205490919060008051602061484a833981519152906000805160206148ca8339815191529060ff16613bc7578184526020526040832082845260205260408320600160ff1982541617905560008051602061482a833981519152339380a4600190565b906000918083526000805160206148ca83398151915280602052604084209260018060a01b03169283855260205260ff60408520541615600014613bc7578184526020526040832082845260205260408320600160ff1982541617905560008051602061482a833981519152339380a4600190565b906000918083526000805160206148ca83398151915280602052604084209260018060a01b03169283855260205260ff604085205416600014613bc757818452602052604083208284526020526040832060ff1981541690557ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b339380a4600190565b3d15613d88573d90613d6e826138b9565b91613d7c6040519384613823565b82523d6000602084013e565b606090565b90613db45750805115613da257805190602001fd5b604051630a12f52160e11b8152600490fd5b81511580613de7575b613dc5575090565b604051639996b31560e01b81526001600160a01b039091166004820152602490fd5b50803b15613dbd565b60ff7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460401c1615613e1f57565b604051631afcd79f60e31b8152600490fd5b60405190613e3e826137ed565b601682527511195c1bdcda5d081a5cc81b9bdd08195b98589b195960521b6020830152565b908160209103126104bd575180151581036104bd5790565b60405190613e88826137ed565b6019825278151bdad95b8819195c1bdcda5d081b9bdd08195b98589b1959603a1b6020830152565b6001600160a01b039091168152602081019190915260400190565b60009060033d11613ed857565b905060046000803e60005160e01c90565b600060443d1061392657604051600319913d83016004833e81516001600160401b03918282113d602484011117613f4657818401948551938411613f4e573d85010160208487010111613f46575061392692910160200190613823565b949350505050565b50949350505050565b60405190613f64826137ed565b60168252754572726f722063616c63756c6174696e67206665657360501b6020830152565b91908203918211613f9657565b634e487b7160e01b600052601160045260246000fd5b6006549160ff83161561421657604080516313a9822560e31b81526001600160a01b03848116600483015260209592949260081c8116918681602481865afa90811561420b576000916141ee575b50156141d75783156141a357858551809363146f4ea360e21b82528180614025898960048401613eb0565b03915afa60009281614174575b5061407d57505050505050614045613ecb565b6308c379a014614061575b600090600090600090613926613f57565b614069613ee9565b806140745750614050565b60009182918291565b6140ae9261408d87938096613f89565b9160075416908651809581948293633e5541f160e01b845260048401613eb0565b03915afa60009181614145575b5061412d5750506140ca613ecb565b6308c379a01461410f575b600092600092774572726f722063616c63756c6174696e672073686172657360401b6000935191614105836137ed565b6018835282015290565b614117613ee9565b8061412257506140d5565b600093849350839250565b909250926001915161413e81613808565b6000815290565b90918582813d831161416d575b61415c8183613823565b8101031261120b57505190386140bb565b503d614152565b90928782813d831161419c575b61418b8183613823565b8101031261120b5750519138614032565b503d614181565b505050506000926000926d125b9d985b1a5908185b5bdd5b9d60921b60009351916141cd836137ed565b600e835282015290565b505050505050600090600090600090613926613e7b565b6142059150873d8911611a7b57611a6d8183613823565b38613ffa565b86513d6000823e3d90fd5b505050600090600090600090613926613e31565b60ff6000805160206148ea833981519152541661424357565b60405163d93c066560e01b8152600490fd5b60008051602061490a83398151915260028154146142735760029055565b604051633ee5aeb560e01b8152600490fd5b91908201809211613f9657565b6001600160a01b03918216815291166020820152604081019190915260600190565b906142ea906142dc6142ef956040519586936323b872dd60e01b602086015260248501614292565b03601f198101845283613823565b6142f1565b565b60008061431a9260018060a01b03169360208151910182865af1614313613d5d565b9083613d8d565b8051908115159182614348575b50506143305750565b60249060405190635274afe760e01b82526004820152fd5b61435b9250602080918301019101613e63565b153880614327565b906006549160ff83161561421657604080516313a9822560e31b81526001600160a01b038381166004830152602095929460089390931c81169392918681602481885afa90811561420b576000916145a2575b50156141d757858215614566576143e992600092600754168751808096819463159c713360e11b83528960048401613eb0565b03915afa90918282614534575b505061446457505050614407613ecb565b6308c379a014614451575b6000926000927f4572726f722063616c63756c6174696e6720746f6b656e20616d6f756e7400006000935191614447836137ed565b601e835282015290565b614459613ee9565b806141225750614412565b9380916144889386918651809681948293637b897f3960e01b845260048401613eb0565b03915afa918291600093614503575b50506144dd5750506144a7613ecb565b6308c379a0146144c1575b90600090600090613926613f57565b6144c9613ee9565b806144d457506144b2565b90916000918291565b806144ea91949293614285565b90600192516144f881613808565b600081529193929190565b8181949293943d831161452d575b61451b8183613823565b8101031261120b575051903880614497565b503d614511565b909192508682813d831161455f575b61454d8183613823565b8101031261120b5750519038806143f6565b503d614543565b505050505060009260009274125b9d985b1a59081cda185c995cc8185b5bdd5b9d605a1b6000935191614598836137ed565b6015835282015290565b6145b99150873d8911611a7b57611a6d8183613823565b386143b6565b6001600160a01b0391821681529116602082015260400190565b6000198114613f965760010190565b90916001600160a01b03808316801561472e5781851691821561471257600090828252600a60205260408220825b8154808210156146f657838761462c8486613796565b929054600393841b1c161461464b575050614646906145d9565b614616565b9495969798509850600092919219988981019081116146e2579061306e836146766146849487613796565b905490881b1c169185613796565b81549788156146ce577f1c0cdcc74010449d4477f9576aaf31cee9e18d2611031462fcd5bf5329dec88e9596979801926146be8484613796565b81939154921b1b191690555580a3565b634e487b7160e01b85526031600452602485fd5b634e487b7160e01b86526011600452602486fd5b60405163188fe79360e21b8152806109318b8d600484016145bf565b60405163188fe79360e21b8152806109318789600484016145bf565b6024906040519063961c9a4f60e01b82526004820152fd5b9060018060a01b03806000931683526020600a815260408420604051808284829454938481520190885284882092885b868282106147cc5750505061478d92500382613823565b845b81518110156147c45783838260051b8401015116848616146147b9576147b4906145d9565b61478f565b505050505050600190565b505050505090565b85548916845260019586019587955093019201614776565b6142ea6142ef93926142dc60405194859263a9059cbb60e01b602085015260248401613eb0565b604091949392606082019560018060a01b031682526020820152015256fe2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e3360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8752a472e571a816aea92eec8dae9baf628e840f4929fbcc2d155e6233ff68a797667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b92902dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800cd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033009b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a2646970667358221220be2fce2831af35267343bb59637196e7fb5fc02321f7ed193c9efa949d4b67c464736f6c63430008140033","optimization_enabled":true,"verified_twin_address_hash":null,"is_verified":true,"compiler_settings":{"evmVersion":"paris","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":true,"runs":100},"remappings":[],"viaIR":true},"optimization_runs":100,"sourcify_repo_url":"https://repo.sourcify.dev/contracts/full_match/1/0x06d4ACC104b974cD99bF22e4572f48A051E59670/","decoded_constructor_args":null,"compiler_version":"0.8.20+commit.a1b79de6","is_verified_via_verifier_alliance":false,"verified_at":"2025-12-24T07:42:15.153577Z","implementations":[],"proxy_type":null,"external_libraries":[],"creation_bytecode":"0x60a08060405234620000d157306080527ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a009081549060ff8260401c16620000c257506001600160401b036002600160401b0319828216016200007c575b60405161495f9081620000d7823960805181818161268301526127260152f35b6001600160401b031990911681179091556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a13880806200005c565b63f92ee8a960e01b8152600490fd5b600080fdfe6080604081815260048036101561001557600080fd5b600092833560e01c90816301ffc9a7146137005750806305db2f41146136c5578063061525371461366c57806306fdde03146135825780630df9ef2c146135225780630efe6a8b14613209578063156c2a6e146131e057806320483dd114613134578063205023d3146130f957806322b6fea914612fd957806323be345c14612fb0578063248a9ca314612f795780632b38e26614612f225780632ccbef8b14612d8d5780632e08ebcd14612d1c5780632e718ab714612ce15780632eebe78e14612cbd5780632f2ff15d14612c945780633278eb0414612c6b57806336568abe14612c24578063383e6d4a14612b6a5780633e5541f114612ab95780633f4ba83a14612a4257806340f797bb146129b65780634788a26b146129565780634b155b971461292d5780634efde8d01461290e5780634f1ef286146126d557806352d1902d1461266e5780635a8f00c81461261e5780635b17d04b146125b95780635c975abb14612588578063608fc37a146121fb578063635b6a3a1461219b57806363f926231461208157806366c4257b146120495780636c24a76f14611f635780636c9fa59e14611f3b57806375b238fc14611f00578063842a05d414611e775780638456cb5914611e0f57806384b594dc14611c405780638795feb814611adf5780638863e5c4146117a55780638dcfbfab146115ba5780639137c1771461157d57806391d148541461152b57806395d89b411461143757806399caf5dd1461120e5780639b18847e1461116d5780639f5bd0f3146110ba578063a217fddf1461109f578063a64b6e5f14610f52578063a819462514610d6a578063a981c7b414610d3d578063ad3cb1cc14610cf8578063b008690c14610a32578063b04b3f57146109f3578063b8b99b7a146109a5578063b8f82b2614610973578063beb96acf14610855578063c5cc6bb314610807578063c79445d0146107cc578063cc2b2523146107ad578063cf177dbc14610655578063d1f810a514610611578063d547741f146105c5578063e63ab1e91461058a578063f5b541a614610561578063f72c0d8b146105345763fade00fe1461033057600080fd5b3461044f57602090816003193601126104415780359061034e614255565b61035661422a565b6009546001600160a01b03908116330361052557821561050f5785541684516370a0823160e01b9081815230848201528581602481865afa801561050557859189916104d4575b501061045357509085916103b384600c54613f89565b600c55803b1561044f578383916103e093838951809681958294632770a7eb60e21b845230908401613eb0565b03925af180156104455761042d575b50507f0158b5c01453469bf562bebba531d45a08d8162682a2d56d652909caf8e9cbaa9251908152a1600160008051602061490a8339815191525580f35b610436906137c4565b6104415783386103ef565b8380fd5b85513d84823e3d90fd5b8280fd5b9380879395602488949851809981938252308a8301525afa9283156104c95792610493575b505163cf47918160e01b815292830152602482015260449150fd5b90915084813d83116104c2575b6104aa8183613823565b810103126104bd57604493519085610478565b600080fd5b503d6104a0565b8251903d90823e3d90fd5b809250878092503d83116104fe575b6104ed8183613823565b810103126104bd578490513861039d565b503d6104e3565b87513d8a823e3d90fd5b50602491845191633728b83d60e01b8352820152fd5b5083516367a3563f60e01b8152fd5b50503461055d578160031936011261055d576020905160008051602061484a8339815191528152f35b5080fd5b50503461055d578160031936011261055d57602090516000805160206148aa8339815191528152f35b50503461055d578160031936011261055d57602090517f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a8152f35b50903461044f578060031936011261044f5761060d913561060860016105e961376a565b938387526000805160206148ca83398151915260205286200154613a6e565b613cda565b5080f35b50503461055d578060031936011261055d5761065190610643610632613754565b61063a61422a565b60243590614363565b919492935194859485613929565b0390f35b503461044f578160031936011261044f5761066e613754565b6024359061067a614255565b61068261422a565b6009546001600160a01b0391908216330361079d5716928051926370a0823160e01b845230818501526020938481602481895afa908115610793578791610766575b50858752600d85526106ed6106dc8489205486614285565b878952600e87528489205490614285565b9081811061074d57505050907f3b3cc6e6e4f41ea6d60a8a018c24e335d06b91f3eaa9dfc6e7f51cd00155c4e49291848652600d8352808620610731838254614285565b905551908152a2600160008051602061490a8339815191525580f35b604493519263adb9e04360e01b84528301526024820152fd5b90508481813d831161078c575b61077d8183613823565b810103126104bd5751386106c4565b503d610773565b83513d89823e3d90fd5b84516367a3563f60e01b81528490fd5b50503461055d578160031936011261055d576020906005549051908152f35b50503461055d578160031936011261055d57602090517fe28434228950b641dbbc0178de89daa359a87c6ee0d8399aeace52a98fe902b98152f35b50503461055d578060031936011261055d57602091610824613754565b8261082d61376a565b6001600160a01b039283168452600f8652922091166000908152908352819020549051908152f35b503461044f5761086436613884565b91939061086f614255565b61087761422a565b6009546001600160a01b039590861633036109635785821695861561094c57841561093557811694858852600d6020528388205485811061091657505050916020916108fc827f466568d995c4d20c1611745da0ee5c713e401f183df24615614ad6ce33e67fce95878a52600d8652838a206108f4838254613f89565b9055876147e4565b51908152a3600160008051602061490a8339815191525580f35b8561093191865194859463162f9a1960e31b8652850161480b565b0390fd5b8351633728b83d60e01b8152808701869052602490fd5b8351630bc2c5df60e11b8152808701889052602490fd5b82516367a3563f60e01b81528590fd5b50503461055d578060031936011261055d5761065190610643610994613754565b61099c61422a565b60243590613fac565b50503461055d578060031936011261055d576020916109c2613754565b826109cb61376a565b6001600160a01b03928316845260108652922091166000908152908352819020549051908152f35b50503461055d578060031936011261055d57602090610a29610a13613754565b610a1b61376a565b90610a2461422a565b614746565b90519015158152f35b503461044f5760e036600319011261044f57610a4c613754565b906001600160401b03602435818111610cf457610a6c903690840161390b565b50604435818111610cf457610a84903690840161390b565b50610a8d613780565b926001600160a01b0392608435908482168083036104bd5760a435868116928382036104bd5760c435938885168095036104bd578a987ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a009a60ff8c54809c1c1615998b169a8b1580610ced575b6001809d149081610ce3575b159081610cda575b50610cca5767ffffffffffffffff1981168c178d558a610cab575b50610b32613df0565b610b3a613df0565b8a60008051602061490a83398151915255610b53613df0565b610b5b613df0565b610b63613df0565b6000805160206148ea833981519152805460ff19169055610b82613df0565b81891615610c9b5716938415610c8b5715610c7c5715610c6e578315610c60575086546001600160a01b0319908116909217875560068054610100600160a81b03191660089290921b610100600160a81b0316919091179055600780549091169091179055610c199190610c0990610bf983613aa1565b50610c0333613aa1565b50613b2f565b50610c1333613b2f565b50613bcd565b50610c22578380f35b815460ff60401b191690915590519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a13880808380f35b8951630538eaff60e51b8152fd5b8951637bfd2e8360e01b8152fd5b50895163eb32d3bf60e01b8152fd5b8b51630201aae160e21b81528390fd5b8c5163016ed19f60e21b81528490fd5b68ffffffffffffffffff191668010000000000000001178c5538610b29565b8d5163f92ee8a960e01b81528590fd5b90501538610b0e565b303b159150610b06565b508a610afa565b8580fd5b50503461055d578160031936011261055d57805161065191610d19826137ed565b60058252640352e302e360dc1b602083015251918291602083526020830190613844565b50503461055d578160031936011261055d57600654905160089190911c6001600160a01b03168152602090f35b5082903461055d578260031936011261055d57610d85613754565b92602490813590610d94614255565b610d9c61422a565b6009546001600160a01b039081163303610f4257808716948515610f2c578315610f175781875416908351956370a0823160e01b808852308389015260209788818481885afa908115610f0d579088918c91610edc575b5010610e6e5750505050828697610e5492877f3a19b6efdb4fa34812cbff59a94c0d953fa352016b0c438a40a5520d69b26492989952600b8752848a20610e3b848254613f89565b9055610e4983600c54613f89565b600c558954166147e4565b51908152a2600160008051602061490a8339815191525580f35b90898689808a95858451809a81938252308b8301525afa9283156104c95792610eab575b505163cf47918160e01b81529384015282015260449150fd5b90915085813d8311610ed5575b610ec28183613823565b810103126104bd57604494519086610e92565b503d610eb8565b8092508a8092503d8311610f06575b610ef58183613823565b810103126104bd578790518d610df3565b503d610eeb565b87513d8d823e3d90fd5b939450505191633728b83d60e01b8352820152fd5b8251630bc2c5df60e11b81529081018690528490fd5b81516367a3563f60e01b81528590fd5b5082903461055d57610f6336613884565b92610f6f929192614255565b610f7761422a565b6008546001600160a01b0392908316330361109057821691821561107a57831680156110645750831561104d5785516370a0823160e01b81523082820152602081602481865afa908115611043578691611012575b50848110610ff6575050610fe19394506147e4565b600160008051602061490a8339815191525580f35b865163adb9e04360e01b81529182015260248101849052604490fd5b90506020813d821161103b575b8161102c60209383613823565b810103126104bd575187610fcc565b3d915061101f565b87513d88823e3d90fd5b8551633728b83d60e01b8152908101849052602490fd5b8651630bc2c5df60e11b81529182015260249150fd5b5060249186519163961c9a4f60e01b8352820152fd5b50855163b693a60960e01b8152fd5b50503461055d578160031936011261055d5751908152602090f35b50503461055d5760208060031936011261044f576110d6613754565b926110df61422a565b6001600160a01b039384168152600a825282812083518154808252918352838320818501949192859190855b8181106111575750505082611121910383613823565b8451948186019282875251809352850193925b8281106111415785850386f35b8351871685529381019392810192600101611134565b82548a168452928401926001928301920161110b565b50913461120b578160031936011261120b57611187613754565b9161119061376a565b60018060a01b03809416938484526010602052828420911690816000526020528160002054938352600f60205281832090600052602052806000205483810392808512828512811690838613901516176111f857506060945081519384526020840152820152f35b634e487b7160e01b815260118652602490fd5b80fd5b50903461044f578060031936011261044f57611228613754565b9060243590611235614255565b61123d61422a565b6001600160a01b03831692831561142057821561140957331580156113f0575b6113d457508051636eb1769f60e11b8082526020959186818061128330338884016145bf565b0381895afa9081156113ca579085918991611399575b501061130d575050828552600f8452808520336000528452806000206112c0838254614285565b90556112ce823033866142b4565b519081527fdad7dfd8821ceb98a6dd83b8f330e604bd0e832f55ca902bbfadabde5e40132342933392a4600160008051602061490a8339815191525580f35b9480919583949593519384918252818061132a30338c84016145bf565b03915afa95861561138e579561135a575b505051630c95cf2760e11b81529283926109319291903390850161480b565b908093929550813d8311611387575b6113738183613823565b810103126104bd579051926109313861133b565b503d611369565b8351903d90823e3d90fd5b809250888092503d83116113c3575b6113b28183613823565b810103126104bd5784905138611299565b503d6113a8565b84513d8a823e3d90fd5b815163188fe79360e21b815290819061093190338389016145bf565b506113f961422a565b6114033382614746565b1561125d565b8151633728b83d60e01b8152808601849052602490fd5b815163961c9a4f60e01b8152808601859052602490fd5b50913461120b578060031936011261120b575080519060009060035491600183811c90808516948515611521575b602095868410811461150e578388528794939291879082156114ec5750506001146114ac575b5050610651929161149d910385613823565b51928284938452830190613844565b90859250600360005282600020916000925b8284106114d4575050508201018161149d61148b565b8054848a0186015288955087949093019281016114be565b60ff19168682015292151560051b8501909201925083915061149d905061148b565b634e487b7160e01b855260228952602485fd5b91607f1691611465565b503461044f578160031936011261044f578160209361154861376a565b923581526000805160206148ca8339815191528552209060018060a01b0316600052825260ff81600020541690519015158152f35b50503461055d5736600319011261120b576115b7611599613754565b6115a161376a565b906115aa61422a565b6115b26139b6565b6145e8565b80f35b5082903461055d578260031936011261055d576115d5613754565b92602435906115e2614255565b6115ea61422a565b6009546001600160a01b0390811633036117955780861693841561177e5783156117675785548351636eb1769f60e11b80825260209695949392841691878180611637308f838a016145bf565b0381865afa90811561175d579087918b9161172c575b50106116af5750505082610e54918798877f6926ad0f7f6f6814be2630ac9d46a2d1988f933254ad20700c1425aaf64a27a4989952600b8752848a20611694848254614285565b90556116a283600c54614285565b600c5530918a54166142b4565b8993508885888089948351968791825281806116ce308d8d84016145bf565b03915afa9283156104c957926116fa575b5051630c95cf2760e11b81529485946109319450850161480b565b90915083813d8311611725575b6117118183613823565b810103126104bd57610931925190866116df565b503d611707565b809250898092503d8311611756575b6117458183613823565b810103126104bd578690518c61164d565b503d61173b565b86513d8c823e3d90fd5b8251633728b83d60e01b8152908101849052602490fd5b82516313053d9360e21b8152908101859052602490fd5b81516367a3563f60e01b81528490fd5b503461044f57608036600319011261044f576117bf613754565b6024803592604435916117d0613780565b926117d9614255565b6117e161422a565b60015487516373bed91960e11b81526001600160a01b0386811686830152939160209190829082908590829089165afa908115611ad5578b91611ab8575b5015611aa85761182d61422a565b60065460ff811615611a98578815611a825789516313a9822560e31b8152888616878201819052949160081c86169083818681855afa9081156119fa578d91611a55575b5015611a3f578a5163146f4ea360e21b815295949392919082908790818061189c8f8f838f01613eb0565b03915afa928315611a35578c93611a04575b6118e09650826118be858d613f89565b8d8c8b8a6007541692519b8c9485938493633e5541f160e01b85528401613eb0565b03915afa9687156119fa578d976119cb575b508187106119b05750508261192692878b938e9a999897968b525261191b8c8a20918254614285565b9055309033906142b4565b845416803b156119ac57611951938580948a51968795869485936340c10f1960e01b85528401613eb0565b03925af1801561044557611998575b505061198060008051602061488a83398151915293519283923384614292565b0390a1600160008051602061490a8339815191525580f35b6119a1906137c4565b610441578338611960565b8480fd5b6044918891888e519363658ec5dd60e11b8552840152820152fd5b9096508281813d83116119f3575b6119e38183613823565b810103126104bd575195386118f2565b503d6119d9565b8c513d8f823e3d90fd5b92508186813d8311611a2e575b611a1b8183613823565b810103126104bd576118e09551926118ae565b503d611a11565b8b513d8e823e3d90fd5b8a51639d42b4b360e01b81528088018690528490fd5b611a759150843d8611611a7b575b611a6d8183613823565b810190613e63565b38611871565b503d611a63565b8951633728b83d60e01b81528087018a90528390fd5b895163bb60b89360e01b81528690fd5b885163110781d160e31b81528590fd5b611acf9150823d8411611a7b57611a6d8183613823565b3861181f565b8a513d8d823e3d90fd5b50903461044f578060031936011261044f57611af9613754565b92611b0261376a565b93611b0b614255565b611b1361422a565b7f6c0757dc3e6b28b2580c03fd9e96c274acf4f99d91fbec9b418fa1d70604ff1c94856000526020956000805160206148ca83398151915287528460002033600052875260ff85600020541615611c2257506001600160a01b03918216918215611c0b578116928315611bf45782815285875284812054958615611be657838252875284812055611ba6908590836147e4565b7fd74e462593ae4127bbc183389b3775357426f157e9625f81271612b86b8000a6858451868152a3600160008051602061490a8339815191525551908152f35b855163211b631760e21b8152fd5b8451630bc2c5df60e11b8152808701859052602490fd5b845163961c9a4f60e01b8152808701849052602490fd5b845163e2517d3f60e01b815233818801526024810191909152604490fd5b50903461044f57611c5036613884565b93909192611c5c61394e565b611c64614255565b611c6c61422a565b6001600160a01b0383811694908515611df8578615611de15781169384158015611dc8575b611dac575081516370a0823160e01b815230848201526020939084816024818a5afa908115611da2578991611d73575b50611cda611ceb91888b52600d8752858b205490613f89565b878a52600e8652848a205490613f89565b878110611d5757505090611d3b867ff7924cd170ae143405ff2557ce6b4615c3a29b30bcd8a70b49d4d0b3475efb0c9493878a5260108552838a20876000528552836000206108f4838254614285565b519485524294a4600160008051602061490a8339815191525580f35b835163adb9e04360e01b81529182015260248101879052604490fd5b90508481813d8311611d9b575b611d8a8183613823565b810103126104bd5751611cda611cc1565b503d611d80565b84513d8b823e3d90fd5b915163188fe79360e21b815292839261093192909184016145bf565b50611dd161422a565b611ddb8282614746565b15611c91565b8251633728b83d60e01b8152808501889052602490fd5b825163961c9a4f60e01b8152808501879052602490fd5b50503461055d578160031936011261055d5760207f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25891611e4d613a12565b611e5561422a565b6000805160206148ea833981519152805460ff1916600117905551338152a180f35b50903461044f57602036600319011261044f57611e92613754565b611e9a61422a565b611ea261394e565b6001600160a01b0316918215611ef25750600880546001600160a01b03191683179055519081527f507e88d0e3541203c8e7dba038a3e807ac9121f0872ed9ed895cd7f3358334eb90602090a180f35b9051630d432b0160e21b8152fd5b50503461055d578160031936011261055d57602090517fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217758152f35b50503461055d578160031936011261055d57905490516001600160a01b039091168152602090f35b503461044f576020928360031936011261120b576001600160a01b03611f87613754565b84516370a0823160e01b8152308582015291168582602481845afa91821561203f578392612010575b508252600d85528382205490600e8652848320549386528483205492611fdf84611fda8786614285565b614285565b821115612005575092611ff8611ff892611ffd95613f89565b613f89565b905b51908152f35b935050505090611fff565b9091508581813d8311612038575b6120288183613823565b810103126104bd57519038611fb0565b503d61201e565b85513d85823e3d90fd5b50503461055d57602036600319011261055d5760209181906001600160a01b03612071613754565b168152600b845220549051908152f35b503461044f578160031936011261044f5761209a613754565b600854602435916001600160a01b03918216330361218b576120ba61422a565b16928051926370a0823160e01b845230818501526020938481602481895afa90811561079357879161215e575b50858752600e85526121106120ff8489205486614285565b878952600d87528489205490614285565b9081811061074d57505050907f36bea377ee4a4c4516cc608cc232173faafbeb7ee10ad11c6420f2863a97644b9291848652600e8352808620612154838254614285565b905551908152a280f35b90508481813d8311612184575b6121758183613823565b810103126104bd5751386120e7565b503d61216b565b845163b693a60960e01b81528490fd5b503461044f57602036600319011261044f576121b5613754565b6121bd61422a565b6121c561394e565b6001600160a01b03169182156121ee575050600780546001600160a01b03191691909117905580f35b51630538eaff60e51b8152fd5b5082906020928360031936011261044f57813591612217614255565b61221f61422a565b60015482516373bed91960e11b815233838201526001600160a01b03949187908290602490829089165afa90811561257e578691612561575b50156125525734156125435760065460ff81161561253357849060081c1683519463e861e90760e01b865287868581855afa9586156125295787966124ed575b5084516313a9822560e31b815286821685820181905293908981602481875afa9081156124735789916124d0575b50156124b857888651809463146f4ea360e21b825281806122ea348d8c8401613eb0565b03915afa9081156124ae57889161247d575b61232c93508961230c8334613f89565b84600754168a8a51809881948293633e5541f160e01b84528d8401613eb0565b03915afa938415612473578994612444575b508084106124275750848899858a98999a525261235f878720918254614285565b9055845416803b156119ac5785516340c10f1960e01b8152918591839182908490829061238f90338b8401613eb0565b03925af1801561241d57908491612409575b5050803b1561044f578290845192838092630d0e30db60e41b825234905af180156123ff576123eb575b50815160008051602061488a833981519152908061198034873384614292565b6123f4906137c4565b61044f5782846123cb565b83513d84823e3d90fd5b612412906137c4565b61044f5782876123a1565b85513d86823e3d90fd5b93505050604493519263658ec5dd60e11b84528301526024820152fd5b9093508981813d831161246c575b61245c8183613823565b810103126104bd5751928a61233e565b503d612452565b87513d8b823e3d90fd5b90508883813d83116124a7575b6124948183613823565b810103126104bd5761232c9251906122fc565b503d61248a565b86513d8a823e3d90fd5b50509251639d42b4b360e01b81529182015260249150fd5b6124e791508a3d8c11611a7b57611a6d8183613823565b8a6122c6565b9095508781813d8311612522575b6125058183613823565b8101031261251e5751858116810361251e579488612298565b8680fd5b503d6124fb565b85513d89823e3d90fd5b835163bb60b89360e01b81528390fd5b509051633b903ec760e01b8152fd5b50905163110781d160e31b8152fd5b6125789150873d8911611a7b57611a6d8183613823565b87612258565b84513d88823e3d90fd5b50503461055d578160031936011261055d5760209060ff6000805160206148ea833981519152541690519015158152f35b503461044f57602036600319011261044f57803590811515809203610441576125e061422a565b6125e861394e565b600654928260ff851615151461260957505060ff169060ff19161760065580f35b91602492519163ca255b0b60e01b8352820152fd5b503461044f57602036600319011261044f576001600160a01b03612640613754565b16801561265a579282916020948252845220549051908152f35b602492519163961c9a4f60e01b8352820152fd5b50913461120b578060031936011261120b57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031630036126c8576020905160008051602061486a8339815191528152f35b5163703e46dd60e11b8152fd5b50908060031936011261044f576126ea613754565b9060249384356001600160401b03811161055d573660238201121561055d5761271b903690878188013591016138d4565b6001600160a01b03937f000000000000000000000000000000000000000000000000000000000000000085163081149081156128f2575b506128e25760008051602061484a83398151915294856000526020956000805160206148ca83398151915287528560002033600052875260ff866000205416156128c5575081169484516352d1902d60e01b8152818189818a5afa859181612896575b506127d05750505050505191634c9c8ce360e01b8352820152fd5b868996899260008051602061486a833981519152908181036128815750853b1561286c5780546001600160a01b0319168317905551869392917fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8580a2855115612850575050835161060d94839201845af461284a613d5d565b91613d8d565b9350935050503461286057505080f35b63b398979f60e01b8152fd5b5051634c9c8ce360e01b815291820152859150fd5b848a91845191632a87526960e21b8352820152fd5b9091508281813d83116128be575b6128ae8183613823565b81010312610cf4575190386127b5565b503d6128a4565b855163e2517d3f60e01b815233818a0152808a0191909152604490fd5b835163703e46dd60e11b81528690fd5b90508560008051602061486a8339815191525416141538612752565b50503461055d578160031936011261055d57602090600c549051908152f35b50503461055d578160031936011261055d5760015490516001600160a01b039091168152602090f35b503461044f57602036600319011261044f57612970613754565b61297861422a565b61298061394e565b6001600160a01b03169182156129a9575050600180546001600160a01b03191691909117905580f35b51630201aae160e21b8152fd5b50903461044f57602036600319011261044f5781356001600160a01b0381169290839003610441576129e661394e565b6011549160ff8316612a3557505082546001600160a01b0319168217835560ff19166001176011557fdb40a5259506fa101ac4485d4ccbd019c99ada5fb7212fe1254374f7a10e02dc8280a280f35b51630f4bac1b60e21b8152fd5b503461044f578260031936011261044f57612a5b613a12565b6000805160206148ea8339815191529081549060ff821615612aab575060ff19169055513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa90602090a180f35b8351638dfc202b60e01b8152fd5b5091903461055d578060031936011261055d576020612b1093612ada613754565b612ae261422a565b6007548451633e5541f160e01b81529687936001600160a01b03909216928492839291602435918401613eb0565b03915afa918215612b5f5791612b2b575b6020925051908152f35b90506020823d8211612b57575b81612b4560209383613823565b810103126104bd576020915190612b21565b3d9150612b38565b9051903d90823e3d90fd5b50903461044f578060031936011261044f57612b84613754565b6008546024359291906001600160a01b039081163303612c1457612ba661422a565b811693848652600e60205282862054848110612bf9575050507fbcb639e764c5cd7d736acef943167eb10be8fc46f9e33b29c69c89473fb79fd791602091848652600e8352808620612154838254613f89565b84610931918551948594631664bf6360e01b8652850161480b565b825163b693a60960e01b81528590fd5b5091903461055d578060031936011261055d57612c3f61376a565b90336001600160a01b03831603612c5c575061060d919235613cda565b5163334bd91960e11b81528390fd5b50503461055d578160031936011261055d5760095490516001600160a01b039091168152602090f35b50903461044f578060031936011261044f5761060d9135612cb860016105e961376a565b613c65565b50503461055d578160031936011261055d5760209060ff6006541690519015158152f35b50503461055d578160031936011261055d57602090517f85e8f2d6819d6b24108062d87ea08f54651bcb8960d98062d3faf96e7873b8b98152f35b503461044f57602036600319011261044f57612d36613754565b91612d3f61422a565b612d4761394e565b6001600160a01b03831615612d8057505060068054610100600160a81b03191660089290921b610100600160a81b031691909117905580f35b51637bfd2e8360e01b8152fd5b50903461044f57612d9d36613884565b93909192612da9614255565b612db161422a565b6008546001600160a01b03949085163303612f14578416938415612efd5783168015612ee857508415612ed2578051636eb1769f60e11b808252602091828180612dfe308a8a84016145bf565b03818a5afa908115611da2579088918a91612ea1575b5010612e275787610fe18830888a6142b4565b81908398949795985196879182528180612e44308d8d84016145bf565b03915afa9283156104c95792612e6f575051630c95cf2760e11b81529485946109319450850161480b565b90915083813d8311612e9a575b612e868183613823565b810103126104bd57610931925190386116df565b503d612e7c565b809250848092503d8311612ecb575b612eba8183613823565b810103126104bd5787905138612e14565b503d612eb0565b51633728b83d60e01b8152908101849052602490fd5b90516313053d9360e21b815291820152602490fd5b815163961c9a4f60e01b8152808401869052602490fd5b505163b693a60960e01b8152fd5b5091903461055d578060031936011261055d576020612b1093612f43613754565b612f4b61422a565b600754845163159c713360e11b81529687936001600160a01b03909216928492839291602435918401613eb0565b503461044f57602036600319011261044f57816020936001923581526000805160206148ca83398151915285522001549051908152f35b50503461055d578160031936011261055d5760085490516001600160a01b039091168152602090f35b50903461044f578060031936011261044f57612ff3613754565b91612ffc61376a565b9061300561422a565b61300d6139b6565b6001600160a01b0384811693908415612efd5783169485156130e05761303161422a565b61303b8482614746565b6130c75750838652600a6020528520805491600160401b8310156130b457508161306e91600161308d9594018155613796565b90919082549060031b9160018060a01b03809116831b921b1916179055565b7f2c79891dd909910a9ed2116eb868a4783a4abeb6da7c8dc217cd5b198b329b5d8380a380f35b634e487b7160e01b875260419052602486fd5b610931915193849363aebbe4f960e01b855284016145bf565b610931915193849363188fe79360e21b855284016145bf565b50503461055d578160031936011261055d57602090517f0792b37891b8244bb8149106fc05e84f10f266ef581c099bf3d880350e979b2f8152f35b50823461120b576020908160031936011261120b576001600160a01b03613159613754565b1690818152600d835282858220549460248751809581936370a0823160e01b835230908301525afa9081156131d55784916131a4575b6131999250613f89565b908351928352820152f35b50508181813d83116131ce575b6131bb8183613823565b810103126104bd5782613199915161318f565b503d6131b1565b8551903d90823e3d90fd5b50503461055d578160031936011261055d5760075490516001600160a01b039091168152602090f35b50913461120b57606036600319011261120b57613224613754565b92602493843591604435613236614255565b61323e61422a565b60015486516373bed91960e11b815233848201526020986001600160a01b0393929091908a9082908490829088165afa9081156135185788916134fb575b50156134eb5761328a61422a565b60065460ff8116156134db5786156134c657839060081c1698899289516313a9822560e31b815282818581898c1698898c8301525afa9081156134bc578a9161349f575b501561348957818a51809c63146f4ea360e21b825281806132f28d8d8d8401613eb0565b03915afa92831561347f578993613449575b88999a9b50826133188561333b9a9b613f89565b6007548e51633e5541f160e01b81529a8b92918a1691839182918f838f01613eb0565b03915afa97881561343f578b9861340c575b508188106133f15750509187918561337194838c525261191b8b8b20918254614285565b85541690813b15610cf45791859161339f938389518096819582946340c10f1960e01b845233908401613eb0565b03925af1801561241d576133ce575b5061198060008051602061488a8339815191529394519283923384614292565b60008051602061488a833981519152936133ea611980926137c4565b93506133ae565b6044918791898e519363658ec5dd60e11b8552840152820152fd5b9097508281813d8311613438575b6134248183613823565b810103126134345751963861334d565b8a80fd5b503d61341a565b8c513d8d823e3d90fd5b9250818b813d8311613478575b6134608183613823565b8101031261347457995198998a9992613304565b8880fd5b503d613456565b8a513d8b823e3d90fd5b8951639d42b4b360e01b81528087018590528390fd5b6134b69150833d8511611a7b57611a6d8183613823565b386132ce565b8b513d8c823e3d90fd5b508751633728b83d60e01b8152808501879052fd5b885163bb60b89360e01b81528590fd5b875163110781d160e31b81528490fd5b61351291508a3d8c11611a7b57611a6d8183613823565b3861327c565b89513d8a823e3d90fd5b503461044f57602036600319011261044f5761353c613754565b61354461422a565b61354c61394e565b6001600160a01b0316918215613575575050600980546001600160a01b03191691909117905580f35b516348db2b6f60e11b8152fd5b50913461120b578060031936011261120b578151918160025492600184811c91818616958615613662575b602096878510811461364f578899509688969785829a5291826000146136285750506001146135ea575b505050610651929161149d910385613823565b9190869350600283528383205b828410613610575050508201018161149d6106516135d7565b8054848a0186015288955087949093019281016135f7565b60ff19168782015293151560051b8601909301935084925061149d915061065190506135d7565b634e487b7160e01b835260228a52602483fd5b92607f16926135ad565b50503461055d578060031936011261055d57613686613754565b6001600160a01b039081168352600a6020528183208054602435949085101561120b57506020936136b691613796565b92905490519260031b1c168152f35b50503461055d578160031936011261055d57602090517f6c0757dc3e6b28b2580c03fd9e96c274acf4f99d91fbec9b418fa1d70604ff1c8152f35b9250503461044f57602036600319011261044f573563ffffffff60e01b811680910361044f5760209250637965db0b60e01b8114908115613743575b5015158152f35b6301ffc9a760e01b1490503861373c565b600435906001600160a01b03821682036104bd57565b602435906001600160a01b03821682036104bd57565b606435906001600160a01b03821682036104bd57565b80548210156137ae5760005260206000200190600090565b634e487b7160e01b600052603260045260246000fd5b6001600160401b0381116137d757604052565b634e487b7160e01b600052604160045260246000fd5b604081019081106001600160401b038211176137d757604052565b602081019081106001600160401b038211176137d757604052565b90601f801991011681019081106001600160401b038211176137d757604052565b919082519283825260005b848110613870575050826000602080949584010152601f8019910116010190565b60208183018101518483018201520161384f565b60609060031901126104bd576001600160a01b039060043582811681036104bd579160243590811681036104bd579060443590565b6001600160401b0381116137d757601f01601f191660200190565b9291926138e0826138b9565b916138ee6040519384613823565b8294818452818301116104bd578281602093846000960137010152565b9080601f830112156104bd57816020613926933591016138d4565b90565b9092608092613926959483526020830152151560408201528160608201520190613844565b3360009081527f448256db8f8fb95ee3eaaf89c1051414494e85cebb6057fcf996cc3d0ccfb45660205260409020546000805160206148aa8339815191529060ff16156139985750565b6044906040519063e2517d3f60e01b82523360048301526024820152fd5b3360009081527f4e5d4d14b1d64b65403760d275670011644f8f7998f1ef964b0082bdadeaa41460205260409020547f0792b37891b8244bb8149106fc05e84f10f266ef581c099bf3d880350e979b2f9060ff16156139985750565b3360009081527f75442b0a96088b5456bc4ed01394c96a4feec0f883c9494257d76b96ab1c9b6b60205260409020547f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a9060ff16156139985750565b806000526000805160206148ca83398151915260205260406000203360005260205260ff60406000205416156139985750565b6001600160a01b031660008181527fb7db2dd08fcb62d0c9e08c51941cae53c267786a0b75803fb7960902fc8ef97d60205260408120549091906000805160206148ca8339815191529060ff16613b2a578280526020526040822081835260205260408220600160ff19825416179055339160008051602061482a8339815191528180a4600190565b505090565b6001600160a01b031660008181527f448256db8f8fb95ee3eaaf89c1051414494e85cebb6057fcf996cc3d0ccfb45660205260408120549091906000805160206148aa833981519152906000805160206148ca8339815191529060ff16613bc7578184526020526040832082845260205260408320600160ff1982541617905560008051602061482a833981519152339380a4600190565b50505090565b6001600160a01b031660008181527fab71e3f32666744d246edff3f96e4bdafee2e9867098cdd118a979a7464786a8602052604081205490919060008051602061484a833981519152906000805160206148ca8339815191529060ff16613bc7578184526020526040832082845260205260408320600160ff1982541617905560008051602061482a833981519152339380a4600190565b906000918083526000805160206148ca83398151915280602052604084209260018060a01b03169283855260205260ff60408520541615600014613bc7578184526020526040832082845260205260408320600160ff1982541617905560008051602061482a833981519152339380a4600190565b906000918083526000805160206148ca83398151915280602052604084209260018060a01b03169283855260205260ff604085205416600014613bc757818452602052604083208284526020526040832060ff1981541690557ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b339380a4600190565b3d15613d88573d90613d6e826138b9565b91613d7c6040519384613823565b82523d6000602084013e565b606090565b90613db45750805115613da257805190602001fd5b604051630a12f52160e11b8152600490fd5b81511580613de7575b613dc5575090565b604051639996b31560e01b81526001600160a01b039091166004820152602490fd5b50803b15613dbd565b60ff7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460401c1615613e1f57565b604051631afcd79f60e31b8152600490fd5b60405190613e3e826137ed565b601682527511195c1bdcda5d081a5cc81b9bdd08195b98589b195960521b6020830152565b908160209103126104bd575180151581036104bd5790565b60405190613e88826137ed565b6019825278151bdad95b8819195c1bdcda5d081b9bdd08195b98589b1959603a1b6020830152565b6001600160a01b039091168152602081019190915260400190565b60009060033d11613ed857565b905060046000803e60005160e01c90565b600060443d1061392657604051600319913d83016004833e81516001600160401b03918282113d602484011117613f4657818401948551938411613f4e573d85010160208487010111613f46575061392692910160200190613823565b949350505050565b50949350505050565b60405190613f64826137ed565b60168252754572726f722063616c63756c6174696e67206665657360501b6020830152565b91908203918211613f9657565b634e487b7160e01b600052601160045260246000fd5b6006549160ff83161561421657604080516313a9822560e31b81526001600160a01b03848116600483015260209592949260081c8116918681602481865afa90811561420b576000916141ee575b50156141d75783156141a357858551809363146f4ea360e21b82528180614025898960048401613eb0565b03915afa60009281614174575b5061407d57505050505050614045613ecb565b6308c379a014614061575b600090600090600090613926613f57565b614069613ee9565b806140745750614050565b60009182918291565b6140ae9261408d87938096613f89565b9160075416908651809581948293633e5541f160e01b845260048401613eb0565b03915afa60009181614145575b5061412d5750506140ca613ecb565b6308c379a01461410f575b600092600092774572726f722063616c63756c6174696e672073686172657360401b6000935191614105836137ed565b6018835282015290565b614117613ee9565b8061412257506140d5565b600093849350839250565b909250926001915161413e81613808565b6000815290565b90918582813d831161416d575b61415c8183613823565b8101031261120b57505190386140bb565b503d614152565b90928782813d831161419c575b61418b8183613823565b8101031261120b5750519138614032565b503d614181565b505050506000926000926d125b9d985b1a5908185b5bdd5b9d60921b60009351916141cd836137ed565b600e835282015290565b505050505050600090600090600090613926613e7b565b6142059150873d8911611a7b57611a6d8183613823565b38613ffa565b86513d6000823e3d90fd5b505050600090600090600090613926613e31565b60ff6000805160206148ea833981519152541661424357565b60405163d93c066560e01b8152600490fd5b60008051602061490a83398151915260028154146142735760029055565b604051633ee5aeb560e01b8152600490fd5b91908201809211613f9657565b6001600160a01b03918216815291166020820152604081019190915260600190565b906142ea906142dc6142ef956040519586936323b872dd60e01b602086015260248501614292565b03601f198101845283613823565b6142f1565b565b60008061431a9260018060a01b03169360208151910182865af1614313613d5d565b9083613d8d565b8051908115159182614348575b50506143305750565b60249060405190635274afe760e01b82526004820152fd5b61435b9250602080918301019101613e63565b153880614327565b906006549160ff83161561421657604080516313a9822560e31b81526001600160a01b038381166004830152602095929460089390931c81169392918681602481885afa90811561420b576000916145a2575b50156141d757858215614566576143e992600092600754168751808096819463159c713360e11b83528960048401613eb0565b03915afa90918282614534575b505061446457505050614407613ecb565b6308c379a014614451575b6000926000927f4572726f722063616c63756c6174696e6720746f6b656e20616d6f756e7400006000935191614447836137ed565b601e835282015290565b614459613ee9565b806141225750614412565b9380916144889386918651809681948293637b897f3960e01b845260048401613eb0565b03915afa918291600093614503575b50506144dd5750506144a7613ecb565b6308c379a0146144c1575b90600090600090613926613f57565b6144c9613ee9565b806144d457506144b2565b90916000918291565b806144ea91949293614285565b90600192516144f881613808565b600081529193929190565b8181949293943d831161452d575b61451b8183613823565b8101031261120b575051903880614497565b503d614511565b909192508682813d831161455f575b61454d8183613823565b8101031261120b5750519038806143f6565b503d614543565b505050505060009260009274125b9d985b1a59081cda185c995cc8185b5bdd5b9d605a1b6000935191614598836137ed565b6015835282015290565b6145b99150873d8911611a7b57611a6d8183613823565b386143b6565b6001600160a01b0391821681529116602082015260400190565b6000198114613f965760010190565b90916001600160a01b03808316801561472e5781851691821561471257600090828252600a60205260408220825b8154808210156146f657838761462c8486613796565b929054600393841b1c161461464b575050614646906145d9565b614616565b9495969798509850600092919219988981019081116146e2579061306e836146766146849487613796565b905490881b1c169185613796565b81549788156146ce577f1c0cdcc74010449d4477f9576aaf31cee9e18d2611031462fcd5bf5329dec88e9596979801926146be8484613796565b81939154921b1b191690555580a3565b634e487b7160e01b85526031600452602485fd5b634e487b7160e01b86526011600452602486fd5b60405163188fe79360e21b8152806109318b8d600484016145bf565b60405163188fe79360e21b8152806109318789600484016145bf565b6024906040519063961c9a4f60e01b82526004820152fd5b9060018060a01b03806000931683526020600a815260408420604051808284829454938481520190885284882092885b868282106147cc5750505061478d92500382613823565b845b81518110156147c45783838260051b8401015116848616146147b9576147b4906145d9565b61478f565b505050505050600190565b505050505090565b85548916845260019586019587955093019201614776565b6142ea6142ef93926142dc60405194859263a9059cbb60e01b602085015260248401613eb0565b604091949392606082019560018060a01b031682526020820152015256fe2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e3360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8752a472e571a816aea92eec8dae9baf628e840f4929fbcc2d155e6233ff68a797667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b92902dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800cd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033009b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a2646970667358221220be2fce2831af35267343bb59637196e7fb5fc02321f7ed193c9efa949d4b67c464736f6c63430008140033","name":"InsuranceCapitalLayer","is_blueprint":false,"license_type":"none","is_fully_verified":true,"is_verified_via_eth_bytecode_db":true,"language":"solidity","evm_version":"paris","can_be_visualized_via_sol2uml":true,"is_verified_via_sourcify":true,"additional_sources":[{"file_path":"@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/ERC1967/ERC1967Utils.sol)\n\npragma solidity ^0.8.20;\n\nimport {IBeacon} from \"../beacon/IBeacon.sol\";\nimport {Address} from \"../../utils/Address.sol\";\nimport {StorageSlot} from \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n */\nlibrary ERC1967Utils {\n    // We re-declare ERC-1967 events here because they can't be used directly from IERC1967.\n    // This will be fixed in Solidity 0.8.21. At that point we should remove these events.\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    /**\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 EIP1967 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 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 EIP1967) 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 EIP1967 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 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 EIP1967 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 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":"contracts/utils/ConvertDecimals.sol","source_code":"//SPDX-License-Identifier: ISC\npragma solidity 0.8.20;\n\nimport \"@openzeppelin/contracts/utils/math/Math.sol\";\n\n/**\n * @title ConvertDecimals\n * @author Lyra\n * @dev Contract to convert amounts to and from erc20 tokens to 18 dp.\n */\nlibrary ConvertDecimals {\n  /// @dev Converts amount from token native dp to 18 dp. This cuts off precision for decimals > 18.\n  function convertTo18(\n    uint amount,\n    uint8 decimals\n  ) internal pure returns (uint) {\n    return (amount * 1e18) / (10 ** decimals);\n  }\n\n  /// @dev Converts amount from 18dp to token.decimals(). This cuts off precision for decimals < 18.\n  function convertFrom18(\n    uint amount,\n    uint8 decimals\n  ) internal pure returns (uint) {\n    return (amount * (10 ** decimals)) / 1e18;\n  }\n\n  /// @dev Converts amount from a given precisionFactor to 18 dp. This cuts off precision for decimals > 18.\n  function normaliseTo18(\n    uint amount,\n    uint precisionFactor\n  ) internal pure returns (uint) {\n    return (amount * 1e18) / precisionFactor;\n  }\n\n  // Loses precision\n  /// @dev Converts amount from 18dp to the given precisionFactor. This cuts off precision for decimals < 18.\n  function normaliseFrom18(\n    uint amount,\n    uint precisionFactor\n  ) internal pure returns (uint) {\n    return (amount * precisionFactor) / 1e18;\n  }\n\n  /// @dev Ensure a value converted from 18dp is rounded up, to ensure the value requested is covered fully.\n  function convertFrom18AndRoundUp(\n    uint amount,\n    uint8 assetDecimals\n  ) internal pure returns (uint amountConverted) {\n    if (assetDecimals < 18) {\n      amount =\n        Math.ceilDiv(amount, 10 ** (18 - assetDecimals)) *\n        10 ** (18 - assetDecimals);\n    }\n    amountConverted = ConvertDecimals.convertFrom18(amount, assetDecimals);\n  }\n}\n"},{"file_path":"@openzeppelin/contracts/utils/Address.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n    /**\n     * @dev The ETH balance of the account is not enough to perform the operation.\n     */\n    error AddressInsufficientBalance(address account);\n\n    /**\n     * @dev There's no code at `target` (it is not a contract).\n     */\n    error AddressEmptyCode(address target);\n\n    /**\n     * @dev A call to an address target failed. The target may have reverted.\n     */\n    error FailedInnerCall();\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 AddressInsufficientBalance(address(this));\n        }\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        if (!success) {\n            revert FailedInnerCall();\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     * {FailedInnerCall} 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 AddressInsufficientBalance(address(this));\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 {FailedInnerCall}) in case of an\n     * 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 {FailedInnerCall} 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 {FailedInnerCall}.\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            /// @solidity memory-safe-assembly\n            assembly {\n                let returndata_size := mload(returndata)\n                revert(add(32, returndata), returndata_size)\n            }\n        } else {\n            revert FailedInnerCall();\n        }\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":"contracts/interfaces/IInsuranceCapitalLayer.sol","source_code":"//SPDX-License-Identifier: ISC\npragma solidity 0.8.20;\n\ninterface IInsuranceCapitalLayer {\n  enum RedeemRequestStatus {\n    REQUESTED,\n    CLAIMABLE,\n    CLAIMED,\n    CANCELLED\n  }\n  struct RedeemRequestQueue {\n    uint id;\n    address requester;\n    uint amount;\n    uint requestTime;\n    uint claimedTime;\n    RedeemRequestStatus status;\n    uint price18;\n  }\n  // function deposit(\n  //   address token,\n  //   uint256 amount,\n  //   address receiver,\n  //   bytes32[] calldata proof\n  // ) external;\n  // function processPrestakedDeposit(\n  //   address token,\n  //   uint amount,\n  //   address receiver,\n  //   bytes32[] calldata proof\n  // ) external;\n  function depositCollateralToPool(address poolAddress_, uint amount_) external;\n  function withdrawUSDCFromPool(address poolAddress_, uint amount_) external;\n\n  // function previewMint(\n  //   address token,\n  //   uint256 shares\n  // )\n  //   external\n  //   view\n  //   returns (\n  //     uint256 amount,\n  //     uint256 depositFees,\n  //     bool isAllowed,\n  //     string memory errorMessage\n  //   );\n\n  function addCustodian(address token, address custodian) external;\n  function removeCustodian(address token, address custodian) external;\n  function withdrawToCustodian(\n    address custodian,\n    address token,\n    uint256 amount\n  ) external;\n\n  function isCustodian(\n    address token,\n    address custodian\n  ) external view returns (bool);\n\n  function getCustodiansForToken(\n    address token\n  ) external view returns (address[] memory);\n}\n"},{"file_path":"@openzeppelin/contracts/access/IAccessControl.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n    /**\n     * @dev The `account` is missing a role.\n     */\n    error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n    /**\n     * @dev The caller of a function is not the expected one.\n     *\n     * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n     */\n    error AccessControlBadConfirmation();\n\n    /**\n     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n     *\n     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n     * {RoleAdminChanged} not being emitted signaling this.\n     */\n    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n    /**\n     * @dev Emitted when `account` is granted `role`.\n     *\n     * `sender` is the account that originated the contract call, an admin role\n     * bearer except when using {AccessControl-_setupRole}.\n     */\n    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n    /**\n     * @dev Emitted when `account` is revoked `role`.\n     *\n     * `sender` is the account that originated the contract call:\n     *   - if using `revokeRole`, it is the admin role bearer\n     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)\n     */\n    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n    /**\n     * @dev Returns `true` if `account` has been granted `role`.\n     */\n    function hasRole(bytes32 role, address account) external view returns (bool);\n\n    /**\n     * @dev Returns the admin role that controls `role`. See {grantRole} and\n     * {revokeRole}.\n     *\n     * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n     */\n    function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * If `account` had not been already granted `role`, emits a {RoleGranted}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     */\n    function grantRole(bytes32 role, address account) external;\n\n    /**\n     * @dev Revokes `role` from `account`.\n     *\n     * If `account` had been granted `role`, emits a {RoleRevoked} event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     */\n    function revokeRole(bytes32 role, address account) external;\n\n    /**\n     * @dev Revokes `role` from the calling account.\n     *\n     * Roles are often managed via {grantRole} and {revokeRole}: this function's\n     * purpose is to provide a mechanism for accounts to lose their privileges\n     * if they are compromised (such as when a trusted device is misplaced).\n     *\n     * If the calling account had been granted `role`, emits a {RoleRevoked}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must be `callerConfirmation`.\n     */\n    function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport {Initializable} from \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165Upgradeable is Initializable, IERC165 {\n    function __ERC165_init() internal onlyInitializing {\n    }\n\n    function __ERC165_init_unchained() internal onlyInitializing {\n    }\n    /**\n     * @dev See {IERC165-supportsInterface}.\n     */\n    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n        return interfaceId == type(IERC165).interfaceId;\n    }\n}\n"},{"file_path":"contracts/interfaces/IDepositTokenRegistry.sol","source_code":"//SPDX-License-Identifier: ISC\npragma solidity 0.8.20;\n\ninterface IDepositTokenRegistry {\n  struct TokenInfo {\n    bool isAccepted;\n    uint256 fixedDepositFee;\n    uint256 percentageDepositFee;\n    address priceOracle;\n    bool paused;\n    bool eligibleAsCollateral;\n    uint8 decimals;\n    string name;\n    string symbol;\n    uint256 defaultSlippageTolerance;\n    uint256 minDeposit;\n  }\n\n  function isDepositEnabled(address token) external view returns (bool);\n  function getTokenInfo(\n    address token\n  )\n    external\n    view\n    returns (\n      bool isAccepted,\n      uint256 fixedDepositFee,\n      uint256 percentageDepositFee,\n      address priceOracle,\n      bool paused,\n      string memory name,\n      string memory symbol,\n      uint256 slippage,\n      uint256 minDeposit,\n      uint256 decimals,\n      bool nativeToken\n    );\n\n  /// @notice Returns only the essential token information needed for share price calculations\n  /// @param token The address of the token to query\n  /// @return isAccepted Whether the token is accepted\n  /// @return paused Whether the token is paused\n  /// @return priceOracle The address of the price oracle for this token\n  /// @return decimals The number of decimals for the token\n  function getTokenPriceInfo(\n    address token\n  )\n    external\n    view\n    returns (bool isAccepted, bool paused, address priceOracle, uint8 decimals);\n\n  function getAcceptedTokens() external view returns (address[] memory);\n\n  function previewMintFees(\n    address token,\n    uint256 amount\n  ) external view returns (uint256);\n\n  function previewDepositFees(\n    address token,\n    uint256 amount\n  ) external view returns (uint256);\n\n  function isEligibleAsCollateral(address token) external view returns (bool);\n\n  function getCollateralTokens() external view returns (address[] memory);\n\n  function getWrappedNative() external view returns (address);\n}\n"},{"file_path":"contracts/interfaces/IDepositManager.sol","source_code":"//SPDX-License-Identifier:ISC\npragma solidity 0.8.20;\n\ninterface IDepositManager {\n  function deposit(address token, uint256 amount, uint256 minShares) external;\n\n  function processPrestakedDeposit(\n    address token,\n    uint amount,\n    uint256 minShares,\n    address receiver\n  ) external;\n\n  function previewDeposit(\n    address token,\n    uint256 amount\n  )\n    external\n    view\n    returns (\n      uint256 shares,\n      uint256 depositFees,\n      bool isAllowed,\n      string memory errorMessage\n    );\n\n  function previewMint(\n    address token,\n    uint256 shares\n  )\n    external\n    view\n    returns (\n      uint256 amount,\n      uint256 depositFees,\n      bool isAllowed,\n      string memory errorMessage\n    );\n\n  function setDepositEnabled(bool _depositEnabled) external;\n\n  function depositEnabled() external view returns (bool);\n\n  function convertToShares(\n    address token,\n    uint256 amount\n  ) external view returns (uint256);\n\n  function convertFromShares(\n    address token,\n    uint256 shares\n  ) external view returns (uint256);\n}\n"},{"file_path":"@openzeppelin/contracts/token/ERC20/ERC20.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"./IERC20.sol\";\nimport {IERC20Metadata} from \"./extensions/IERC20Metadata.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {IERC20Errors} from \"../../interfaces/draft-IERC6093.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 ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n */\nabstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {\n    mapping(address account => uint256) private _balances;\n\n    mapping(address account => mapping(address spender => uint256)) private _allowances;\n\n    uint256 private _totalSupply;\n\n    string private _name;\n    string private _symbol;\n\n    /**\n     * @dev Sets the values for {name} and {symbol}.\n     *\n     * All two of these values are immutable: they can only be set once during\n     * construction.\n     */\n    constructor(string memory name_, string memory symbol_) {\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        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        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    /**\n     * @dev See {IERC20-totalSupply}.\n     */\n    function totalSupply() public view virtual returns (uint256) {\n        return _totalSupply;\n    }\n\n    /**\n     * @dev See {IERC20-balanceOf}.\n     */\n    function balanceOf(address account) public view virtual returns (uint256) {\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    /**\n     * @dev See {IERC20-allowance}.\n     */\n    function allowance(address owner, address spender) public view virtual returns (uint256) {\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     * Emits an {Approval} event indicating the updated allowance. This is not\n     * required by the EIP. See the note at the beginning of {ERC20}.\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        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     * 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        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/proxy/beacon/IBeacon.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.20;\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/access/Ownable2Step.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable2Step.sol)\n\npragma solidity ^0.8.20;\n\nimport {Ownable} from \"./Ownable.sol\";\n\n/**\n * @dev Contract module which provides 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 specified at deployment time in the constructor for `Ownable`. This\n * can later be changed with {transferOwnership} and {acceptOwnership}.\n *\n * This module is used through inheritance. It will make available all functions\n * from parent (Ownable).\n */\nabstract contract Ownable2Step is Ownable {\n    address private _pendingOwner;\n\n    event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Returns the address of the pending owner.\n     */\n    function pendingOwner() public view virtual returns (address) {\n        return _pendingOwner;\n    }\n\n    /**\n     * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual override onlyOwner {\n        _pendingOwner = newOwner;\n        emit OwnershipTransferStarted(owner(), newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.\n     * Internal function without access restriction.\n     */\n    function _transferOwnership(address newOwner) internal virtual override {\n        delete _pendingOwner;\n        super._transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev The new owner accepts the ownership transfer.\n     */\n    function acceptOwnership() public virtual {\n        address sender = _msgSender();\n        if (pendingOwner() != sender) {\n            revert OwnableUnauthorizedAccount(sender);\n        }\n        _transferOwnership(sender);\n    }\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/token/ERC20/utils/SafeERC20.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../IERC20.sol\";\nimport {IERC20Permit} from \"../extensions/IERC20Permit.sol\";\nimport {Address} from \"../../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 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    using Address for address;\n\n    /**\n     * @dev An operation with an ERC20 token failed.\n     */\n    error SafeERC20FailedOperation(address token);\n\n    /**\n     * @dev Indicates a failed `decreaseAllowance` request.\n     */\n    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\n\n    /**\n     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     */\n    function safeTransfer(IERC20 token, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\n    }\n\n    /**\n     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n     */\n    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n    }\n\n    /**\n     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     */\n    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    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    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 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    function _callOptionalReturn(IERC20 token, bytes memory data) private {\n        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n        // the target address contains contract code and also asserts for success in the low-level call.\n\n        bytes memory returndata = address(token).functionCall(data);\n        if (returndata.length != 0 && !abi.decode(returndata, (bool))) {\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 silents catches all reverts and returns a bool instead.\n     */\n    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n        // and not revert is the subcall reverts.\n\n        (bool success, bytes memory returndata) = address(token).call(data);\n        return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;\n    }\n}\n"},{"file_path":"contracts/token/PoolToken.sol","source_code":"//SPDX-License-Identifier:ISC\npragma solidity 0.8.20;\n\nimport {ERC20} from \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport {Ownable2Step, Ownable} from \"@openzeppelin/contracts/access/Ownable2Step.sol\";\n\ncontract PoolToken is ERC20, Ownable2Step {\n  uint8 private _decimals;\n\n  constructor(\n    string memory name_,\n    string memory symbol_,\n    uint8 decimals_\n  ) ERC20(name_, symbol_) Ownable(msg.sender) Ownable2Step() {\n    _setupDecimals(decimals_);\n  }\n\n  function decimals() public view override returns (uint8) {\n    return _decimals;\n  }\n\n  function _setupDecimals(uint8 decimals_) internal {\n    _decimals = decimals_;\n  }\n\n  function mint(address to, uint amount) external onlyOwner {\n    _mint(to, amount);\n  }\n\n  function burn(address user, uint amount) external onlyOwner {\n    _burn(user, amount);\n  }\n}\n"},{"file_path":"contracts/errors/InsuranceCapitalLayerErrors.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.20;\n\n/**\n * @dev Error thrown when an operation is attempted by a user without KYC approval\n */\nerror OnlyApprovedKYCUser();\n\n/**\n * @dev Error thrown when an operation is attempted by an address other than the collateral manager\n */\nerror OnlyCollateralManager();\n\n/**\n * @dev Error thrown when attempting to deposit while deposits are disabled\n */\nerror DepositNotEnabled();\n\n/**\n * @dev Error thrown when attempting to deposit a token that is not enabled\n * @param token The token address that is not enabled for deposit\n */\nerror TokenNotEnabledForDeposit(address token);\n\n/**\n * @dev Error thrown when attempting to deposit native token with zero value\n */\nerror NoNativeTokenSent();\n\n/**\n * @dev Error thrown when an invalid token address is provided\n * @param token The invalid token address\n */\nerror InvalidToken(address token);\n\n/**\n * @dev Error thrown when an invalid amount is provided\n * @param amount The invalid amount\n */\nerror InvalidAmount(uint256 amount);\n\n/**\n * @dev Error thrown when an invalid custodian is provided for a token\n * @param custodian The invalid custodian address\n * @param token The token address\n */\nerror InvalidCustodian(address custodian, address token);\n\n/**\n * @dev Error thrown when trying to add a custodian that is already set for a token\n * @param custodian The custodian address\n * @param token The token address\n */\nerror CustodianAlreadySet(address custodian, address token);\n\n/**\n * @dev Error thrown when an insufficient allowance is provided\n * @param sender The sender address\n * @param allowance The current allowance\n * @param needed The required allowance\n */\nerror InsufficientAllowance(address sender, uint256 allowance, uint256 needed);\n\n/**\n * @dev Error thrown when an invalid admin address is provided\n */\nerror InvalidAdminAddress();\n\n/**\n * @dev Error thrown when an invalid KYC registry address is provided\n */\nerror InvalidKYCRegistryAddress();\n\n/**\n * @dev Error thrown when an invalid operator address is provided\n */\nerror InvalidOperatorAddress();\n\n/**\n * @dev Error thrown when an invalid registry address is provided\n */\nerror InvalidRegistryAddress();\n\n/**\n * @dev Error thrown when an invalid calculator address is provided\n */\nerror InvalidCalculatorAddress();\n\n/**\n * @dev Error thrown when an invalid collateral manager address is provided\n */\nerror InvalidCollateralManagerAddress();\n\n/**\n * @dev Error thrown when an invalid redemption manager address is provided\n */\nerror InvalidRedemptionManagerAddress();\n\n/**\n * @dev Error thrown when shares received is less than minimum expected\n * @param received The amount of shares received\n * @param minimum The minimum amount of shares expected\n */\nerror InsufficientShares(uint256 received, uint256 minimum);\n\n/**\n * @dev Error thrown when trying to set deposit state to its current value\n * @param depositEnabled The deposit enabled value\n */\nerror DepositStateAlreadySet(bool depositEnabled);\n\n/**\n * @dev Error thrown when an invalid recipient address is provided\n * @param recipient The invalid recipient address\n */\nerror InvalidRecipient(address recipient);\n\n/**\n * @dev Error thrown when attempting to claim fees when there are none\n */\nerror NoFeesToClaim();\n\n/**\n * @dev Error thrown when an operation is attempted by an address other than the redemption manager\n */\nerror OnlyRedemptionManager();\n\n/**\n * @dev Error thrown when trying to lock more tokens than are available\n * @param available The current available balance\n * @param required The required balance\n */\nerror InsufficientAvailableBalance(uint256 available, uint256 required);\n\n/**\n * @dev Error thrown when trying to unlock more collateral tokens than are locked\n * @param token The token address\n * @param locked The amount of tokens currently locked\n * @param requested The amount requested to unlock\n */\nerror InsufficientLockedCollateral(\n  address token,\n  uint256 locked,\n  uint256 requested\n);\n\n/**\n * @dev Error thrown when trying to transfer more redemption tokens than are locked\n * @param token The token address\n * @param locked The amount of tokens currently locked\n * @param requested The amount requested to transfer\n */\nerror InsufficientLockedRedeemableBalance(\n  address token,\n  uint256 locked,\n  uint256 requested\n);\n\n/**\n * @dev Error thrown when an invalid sender address is provided\n * @param sender The invalid sender address\n */\nerror InvalidSender(address sender);\n\n/**\n * @dev Error thrown when an insufficient balance is provided\n * @param balance The current balance\n * @param amount The required amount\n */\nerror InsufficientBalance(uint256 balance, uint256 amount);\n"},{"file_path":"@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Pausable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ContextUpgradeable} from \"../utils/ContextUpgradeable.sol\";\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\n    /// @custom:storage-location erc7201:openzeppelin.storage.Pausable\n    struct PausableStorage {\n        bool _paused;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Pausable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant PausableStorageLocation = 0xcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300;\n\n    function _getPausableStorage() private pure returns (PausableStorage storage $) {\n        assembly {\n            $.slot := PausableStorageLocation\n        }\n    }\n\n    /**\n     * @dev Emitted when the pause is triggered by `account`.\n     */\n    event Paused(address account);\n\n    /**\n     * @dev Emitted when the pause is lifted by `account`.\n     */\n    event Unpaused(address account);\n\n    /**\n     * @dev The operation failed because the contract is paused.\n     */\n    error EnforcedPause();\n\n    /**\n     * @dev The operation failed because the contract is not paused.\n     */\n    error ExpectedPause();\n\n    /**\n     * @dev Initializes the contract in unpaused state.\n     */\n    function __Pausable_init() internal onlyInitializing {\n        __Pausable_init_unchained();\n    }\n\n    function __Pausable_init_unchained() internal onlyInitializing {\n        PausableStorage storage $ = _getPausableStorage();\n        $._paused = false;\n    }\n\n    /**\n     * @dev Modifier to make a function callable only when the contract is not paused.\n     *\n     * Requirements:\n     *\n     * - The contract must not be paused.\n     */\n    modifier whenNotPaused() {\n        _requireNotPaused();\n        _;\n    }\n\n    /**\n     * @dev Modifier to make a function callable only when the contract is paused.\n     *\n     * Requirements:\n     *\n     * - The contract must be paused.\n     */\n    modifier whenPaused() {\n        _requirePaused();\n        _;\n    }\n\n    /**\n     * @dev Returns true if the contract is paused, and false otherwise.\n     */\n    function paused() public view virtual returns (bool) {\n        PausableStorage storage $ = _getPausableStorage();\n        return $._paused;\n    }\n\n    /**\n     * @dev Throws if the contract is paused.\n     */\n    function _requireNotPaused() internal view virtual {\n        if (paused()) {\n            revert EnforcedPause();\n        }\n    }\n\n    /**\n     * @dev Throws if the contract is not paused.\n     */\n    function _requirePaused() internal view virtual {\n        if (!paused()) {\n            revert ExpectedPause();\n        }\n    }\n\n    /**\n     * @dev Triggers stopped state.\n     *\n     * Requirements:\n     *\n     * - The contract must not be paused.\n     */\n    function _pause() internal virtual whenNotPaused {\n        PausableStorage storage $ = _getPausableStorage();\n        $._paused = true;\n        emit Paused(_msgSender());\n    }\n\n    /**\n     * @dev Returns to normal state.\n     *\n     * Requirements:\n     *\n     * - The contract must be paused.\n     */\n    function _unpause() internal virtual whenPaused {\n        PausableStorage storage $ = _getPausableStorage();\n        $._paused = false;\n        emit Unpaused(_msgSender());\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/utils/StorageSlot.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.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 ERC1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\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 */\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 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        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n     */\n    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n     */\n    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n     */\n    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `StringSlot` with member `value` located at `slot`.\n     */\n    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\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        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := store.slot\n        }\n    }\n\n    /**\n     * @dev Returns an `BytesSlot` with member `value` located at `slot`.\n     */\n    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\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        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := store.slot\n        }\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 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-upgradeable/token/ERC20/ERC20Upgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.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 ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\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     * All two of these values are immutable: they can only be set once during\n     * 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    /**\n     * @dev See {IERC20-totalSupply}.\n     */\n    function totalSupply() public view virtual returns (uint256) {\n        ERC20Storage storage $ = _getERC20Storage();\n        return $._totalSupply;\n    }\n\n    /**\n     * @dev See {IERC20-balanceOf}.\n     */\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    /**\n     * @dev See {IERC20-allowance}.\n     */\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     * Emits an {Approval} event indicating the updated allowance. This is not\n     * required by the EIP. See the note at the beginning of {ERC20}.\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     * 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":"contracts/interfaces/IRedemptionTokenHandler.sol","source_code":"// SPDX-License-Identifier: ISC\npragma solidity 0.8.20;\n\n/**\n * @title IRedemptionTokenHandler\n * @notice Interface for handling token operations in the redemption process\n * @dev This interface defines the methods for receiving, burning, and transferring tokens\n */\ninterface IRedemptionTokenHandler {\n  /**\n   * @notice Receives share tokens from a user into the contract\n   * @dev Called when a user requests redemption\n   * @param from The address sending the share tokens\n   * @param amount The amount of share tokens to receive\n   */\n  function receiveShareTokens(address from, uint256 amount) external;\n\n  /**\n   * @notice Burns share tokens from the contract\n   * @dev Called when a user claims their redemption\n   * @param amount The amount of share tokens to burn\n   */\n  function burnShareTokens(uint256 amount) external;\n\n  /**\n   * @notice Transfers redemption tokens to a user\n   * @dev Called when a user claims their redemption\n   * @param token The address of the redemption token to transfer\n   * @param to The address receiving the redemption tokens\n   * @param amount The amount of redemption tokens to transfer\n   */\n  function transferRedemptionTokens(\n    address token,\n    address to,\n    uint256 amount\n  ) external;\n\n  /**\n   * @notice Transfers share tokens back to a user\n   * @dev Called when a user cancels their redemption request\n   * @param to The address receiving the share tokens back\n   * @param amount The amount of share tokens to transfer back\n   */\n  function transferShareTokens(address to, uint256 amount) external;\n\n  /**\n   * @notice Locks redemption tokens for a round\n   * @dev Can only be called by the redemption manager\n   * @param token The token to lock\n   * @param amount The amount to lock\n   */\n  function lockRedemptionTokens(address token, uint256 amount) external;\n}\n"},{"file_path":"contracts/token/ShareToken.sol","source_code":"//SPDX-License-Identifier:ISC\npragma solidity 0.8.20;\n\nimport {ERC20Upgradeable} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\nimport {OwnableUpgradeable} from \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport {UUPSUpgradeable} from \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\nimport {AccessControlUpgradeable} from \"@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol\";\nimport {Initializable} from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport {IERC165} from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {IAccessControl} from \"@openzeppelin/contracts/access/IAccessControl.sol\";\n/**\n * @title ShareToken\n * @notice Upgradeable ERC20 token with role-based minting and burning capabilities\n * @dev This contract implements an upgradeable ERC20 token with the following fea ddtures:\n * - Role-based access control for minting and burning\n * - UUPS upgradeability pattern\n * - Secure upgrade process with safety checks\n *\n * Roles:\n * - DEFAULT_ADMIN_ROLE: Can grant and revoke all roles\n * - UPGRADER_ROLE: Can upgrade the contract implementation\n * - MINTER_ROLE: Can mint and burn tokens\n *\n * Storage layout:\n * - Initializable: uint8 private _initialized, uint8 private _initializing\n * - ContextUpgradeable: empty\n * - ERC20Upgradeable: mapping(address => uint256) private _balances, mapping(address => mapping(address => uint256)) private _allowances, uint256 private _totalSupply, string private _name, string private _symbol\n * - AccessControlUpgradeable: mapping(bytes32 => RoleData) private _roles\n * - UUPSUpgradeable: empty\n * - USDRE: uint8 private _decimals\n *\n * Gap sizes:\n * - ERC20Upgradeable: uint256[45]\n * - AccessControlUpgradeable: uint256[49]\n * - UUPSUpgradeable: uint256[50]\n * - USDRE: uint256[48]\n *\n * Security considerations:`\n * - Only addresses with UPGRADER_ROLE can upgrade the implementation`\n * - New implementations must support IERC20 and IAccessControl interfaces\n * - Storage layout must be preserved in upgrades\n * - Initializers are disabled in implementation contracts\n */\ncontract ShareToken is\n  Initializable,\n  ERC20Upgradeable,\n  AccessControlUpgradeable,\n  UUPSUpgradeable\n{\n  /// @notice Role that allows upgrading the contract implementation\n  bytes32 public constant UPGRADER_ROLE = keccak256(\"UPGRADER_ROLE\");\n  /// @notice Role that allows minting and burning tokens\n  bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n\n  /// @notice Token decimals (immutable after initialization)\n  uint8 private _decimals;\n\n  /// @dev Error thrown when an unsupported interface is detected\n  error UnsupportedInterface(string interfaceName);\n\n  /// @notice Emitted when UPGRADER_ROLE is granted to an account\n  event UpgraderRoleGranted(address indexed account);\n  /// @notice Emitted when the contract implementation is upgraded\n  event ShareTokenUpgraded(address indexed implementation);\n  /// @notice Emitted when MINTER_ROLE is granted to an account\n  event MinterRoleGranted(address indexed account);\n\n  /// @custom:oz-upgrades-unsafe-allow constructor\n  constructor() {\n    _disableInitializers();\n  }\n\n  /**\n   * @notice Initializes the ShareToken\n   * @dev Sets up initial roles and token parameters. Can only be called once.\n   * @param name_ The name of the token\n   * @param symbol_ The symbol of the token\n   * @param decimals_ The number of decimals for the token\n   * @param admin The address to receive the DEFAULT_ADMIN_ROLE and UPGRADER_ROLE\n   */\n  function initialize(\n    string memory name_,\n    string memory symbol_,\n    uint8 decimals_,\n    address admin\n  ) public initializer {\n    __ERC20_init(name_, symbol_);\n    __AccessControl_init();\n    __UUPSUpgradeable_init();\n\n    _decimals = decimals_;\n\n    // Set up admin roles\n    _grantRole(DEFAULT_ADMIN_ROLE, admin);\n    _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);\n    _grantRole(UPGRADER_ROLE, admin);\n    emit UpgraderRoleGranted(admin);\n  }\n\n  /// @notice Returns the number of decimals used for token amounts\n  function decimals() public view override returns (uint8) {\n    return _decimals;\n  }\n\n  /**\n   * @notice Mints new tokens\n   * @dev Only callable by addresses with MINTER_ROLE\n   * @param to The address to receive the minted tokens\n   * @param amount The amount of tokens to mint\n   */\n  function mint(address to, uint amount) external onlyRole(MINTER_ROLE) {\n    _mint(to, amount);\n  }\n\n  /**\n   * @notice Burns tokens from a user's balance\n   * @dev Only callable by addresses with MINTER_ROLE\n   * @param user The address to burn tokens from\n   * @param amount The amount of tokens to burn\n   */\n  function burn(address user, uint amount) external onlyRole(MINTER_ROLE) {\n    _burn(user, amount);\n  }\n\n  /**\n   * @notice Authorizes an upgrade to a new implementation\n   * @dev Includes safety checks for the new implementation\n   * - Verifies the new implementation is a contract\n   * - Verifies required interfaces are supported\n   * - Verifies initialization is properly disabled\n   * @param newImplementation Address of the new implementation\n   */\n  function _authorizeUpgrade(\n    address newImplementation\n  ) internal override onlyRole(UPGRADER_ROLE) {\n    // Verify the new implementation supports the required interfaces\n    if (\n      !IERC165(newImplementation).supportsInterface(type(IERC20).interfaceId)\n    ) {\n      revert UnsupportedInterface(\"IERC20\");\n    }\n    if (\n      !IERC165(newImplementation).supportsInterface(\n        type(IAccessControl).interfaceId\n      )\n    ) {\n      revert UnsupportedInterface(\"IAccessControl\");\n    }\n\n    emit ShareTokenUpgraded(newImplementation);\n  }\n\n  function supportsInterface(\n    bytes4 interfaceId\n  ) public view virtual override(AccessControlUpgradeable) returns (bool) {\n    return\n      interfaceId == type(IERC20).interfaceId ||\n      interfaceId == type(IAccessControl).interfaceId ||\n      super.supportsInterface(interfaceId);\n  }\n\n  /// @dev Reserved storage space for future upgrades\n  uint256[50] private __gap;\n}\n"},{"file_path":"@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 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":"contracts/interfaces/ICustodyManager.sol","source_code":"// SPDX-License-Identifier: ISC\npragma solidity 0.8.20;\n\ninterface ICustodyManager {\n  // Events\n  event CustodianAdded(\n    address indexed source,\n    address indexed token,\n    address indexed custodian\n  );\n\n  event CustodianRemoved(\n    address indexed source,\n    address indexed token,\n    address indexed custodian\n  );\n\n  event AssetWithdrawnToCustodian(\n    address indexed custodian,\n    address indexed token,\n    uint256 amount,\n    uint256 indexed timestamp\n  );\n\n  event AssetDepositedFromCustodian(\n    address indexed custodian,\n    address indexed token,\n    uint256 amount,\n    uint256 indexed timestamp\n  );\n\n  /**\n   * @dev Add a custodian for a specific token\n   * @param token The address of the token\n   * @param custodian The address of the custodian\n   */\n  function addCustodian(address token, address custodian) external;\n\n  /**\n   * @dev Remove a custodian for a specific token\n   * @param token The address of the token\n   * @param custodian The address of the custodian\n   */\n  function removeCustodian(address token, address custodian) external;\n\n  /**\n   * @dev Check if a custodian is valid for a token\n   * @param token The address of the token\n   * @param custodian The address of the custodian\n   * @return True if the custodian is valid for the token, false otherwise\n   */\n  function isCustodian(\n    address token,\n    address custodian\n  ) external view returns (bool);\n\n  /**\n   * @dev Get the list of custodians for a specific token\n   * @param token The address of the token\n   * @return An array of custodian addresses\n   */\n  function getCustodiansForToken(\n    address token\n  ) external view returns (address[] memory);\n\n  /**\n   * @dev Transfer a specified token and amount to the designated custodian\n   * @param custodian The address of the custodian\n   * @param token The address of the token to transfer\n   * @param amount The amount of tokens to transfer\n   */\n  function withdrawToCustodian(\n    address custodian,\n    address token,\n    uint256 amount\n  ) external;\n}\n"},{"file_path":"contracts/interfaces/IPool.sol","source_code":"//SPDX-License-Identifier: ISC\npragma solidity 0.8.20;\nimport {PoolToken} from \"../token/PoolToken.sol\";\n\ninterface IPool {\n  struct FeePercentage {\n    uint management;\n    uint performance;\n  }\n\n  /// @dev Get collateral limit amount\n  function getCollateralLimit() external view returns (uint);\n\n  function getTransferDate() external view returns (uint);\n\n  function requestCollateralReservation(\n    address token,\n    uint amount\n  ) external returns (uint256);\n  function requestCollateralTransfer(\n    address token,\n    uint amount\n  ) external returns (uint256);\n\n  function requestProfitReturn(\n    address token,\n    uint256 amount\n  ) external returns (uint256);\n\n  function cancelProfitReturn(uint256 requestId) external;\n\n  /// @dev Request an increase to the pool's collateral limit\n  function requestCollateralLimitIncrease(\n    uint256 requestedLimit\n  ) external returns (uint256);\n\n  /// @dev Cancel a pending collateral limit increase request\n  function cancelCollateralLimitIncrease(uint256 requestId) external;\n\n  /// @dev Update the pool's collateral limit (called by CollateralProvider after approval)\n  function updateCollateralLimit(uint256 newLimit) external;\n}\n"},{"file_path":"contracts/interfaces/ICollateralTokenHandler.sol","source_code":"// SPDX-License-Identifier: ISC\npragma solidity 0.8.20;\n\n/**\n * @title IInsuranceCapitalLayerTokenHandler\n * @dev Combined interface for transferring and receiving ERC20 tokens in InsuranceCapitalLayer.\n */\ninterface ICollateralTokenHandler {\n  /**\n   * @dev Transfers tokens from InsuranceCapitalLayer to a recipient.\n   * @param token The address of the ERC20 token.\n   * @param to The recipient address.\n   * @param amount The amount of tokens to transfer.\n   */\n  function transferTokens(address token, address to, uint256 amount) external;\n\n  /**\n   * @dev Receives tokens into InsuranceCapitalLayer from a sender.\n   * @param token The address of the ERC20 token.\n   * @param from The sender address.\n   * @param amount The amount of tokens to receive.\n   */\n  function receiveTokens(address token, address from, uint256 amount) external;\n\n  function getAvailableBalance(address token) external view returns (uint256);\n\n  /**\n   * @dev Locks collateral tokens to prevent them from being used for redemptions\n   * @param token The address of the token to lock\n   * @param amount The amount to lock\n   */\n  function lockCollateralTokens(address token, uint256 amount) external;\n\n  /**\n   * @dev Unlocks previously locked collateral tokens\n   * @param token The address of the token to unlock\n   * @param amount The amount to unlock\n   */\n  function unlockCollateralTokens(address token, uint256 amount) external;\n}\n"},{"file_path":"contracts/interfaces/ISharePriceCalculator.sol","source_code":"// SPDX-License-Identifier: ISC\npragma solidity 0.8.20;\n\ninterface ISharePriceCalculator {\n  event SharePriceSet(uint256 oldPrice, uint256 newPrice);\n\n  function setSharePrice(uint256 newPrice) external;\n  function convertToShares(\n    address token,\n    uint256 amount\n  ) external view returns (uint256);\n  function convertFromShares(\n    address token,\n    uint256 shares\n  ) external view returns (uint256);\n  function getSharePrice() external view returns (uint256);\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.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 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/utils/Context.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\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 Context {\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/interfaces/draft-IERC1822.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev ERC1822: 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.0.0) (interfaces/draft-IERC6093.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard ERC20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 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 ERC721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 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 EIP-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 ERC1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.\n */\ninterface IERC1155Errors {\n    /**\n     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param balance Current balance for the interacting account.\n     * @param needed Minimum amount required to perform a transfer.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC1155InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC1155InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC1155MissingApprovalForAll(address operator, address owner);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC1155InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC1155InvalidOperator(address operator);\n\n    /**\n     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n     * Used in batch transfers.\n     * @param idsLength Length of the array of token identifiers\n     * @param valuesLength Length of the array of token amounts\n     */\n    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n"},{"file_path":"@openzeppelin/contracts/token/ERC20/IERC20.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\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-upgradeable/proxy/utils/UUPSUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.20;\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 ERC1967) 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 ERC1167 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 ERC1822 {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 ERC1967-compliant implementation pointing to self.\n     * See {_onlyProxy}.\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 ERC1967.\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/proxy/utils/Initializable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.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 reininitialization) 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 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        assembly {\n            $.slot := INITIALIZABLE_STORAGE\n        }\n    }\n}\n"},{"file_path":"contracts/interfaces/IPoolRegistry.sol","source_code":"//SPDX-License-Identifier: ISC\npragma solidity 0.8.20;\n\ninterface IPoolRegistry {\n  event PoolRegistered(address poolAddress, address cellAddress);\n  event PoolUnregistered(address poolAddress, address cellAddress);\n\n  function registerPool(address poolAddress) external;\n  function unregisterPool(address poolAddress) external;\n  function isRegisteredPool(address poolAddress) external view returns (bool);\n  function hasCellRole(address cellAddress) external view returns (bool);\n  function getPoolsForCell(\n    address cellAddress\n  ) external view returns (address[] memory);\n  function isPoolOwnedByCell(\n    address cellAddress,\n    address poolAddress\n  ) 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.0.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n    /**\n     * @dev Muldiv operation overflow.\n     */\n    error MathOverflowedMulDiv();\n\n    enum Rounding {\n        Floor, // Toward negative infinity\n        Ceil, // Toward positive infinity\n        Trunc, // Toward zero\n        Expand // Away from zero\n    }\n\n    /**\n     * @dev Returns the addition of two unsigned integers, with an overflow flag.\n     */\n    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        unchecked {\n            uint256 c = a + b;\n            if (c < a) return (false, 0);\n            return (true, c);\n        }\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, with an overflow flag.\n     */\n    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        unchecked {\n            if (b > a) return (false, 0);\n            return (true, a - b);\n        }\n    }\n\n    /**\n     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n     */\n    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        unchecked {\n            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n            // benefit is lost if 'b' is also tested.\n            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n            if (a == 0) return (true, 0);\n            uint256 c = a * b;\n            if (c / a != b) return (false, 0);\n            return (true, c);\n        }\n    }\n\n    /**\n     * @dev Returns the division of two unsigned integers, with a division by zero flag.\n     */\n    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        unchecked {\n            if (b == 0) return (false, 0);\n            return (true, a / b);\n        }\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n     */\n    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        unchecked {\n            if (b == 0) return (false, 0);\n            return (true, a % b);\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 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 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            return a / b;\n        }\n\n        // (a + b - 1) / b can overflow on addition, so we distribute.\n        return a == 0 ? 0 : (a - 1) / b + 1;\n    }\n\n    /**\n     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\n     * denominator == 0.\n     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\n     * Uniswap Labs also under MIT license.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n        unchecked {\n            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n            // variables such that product = prod1 * 2^256 + prod0.\n            uint256 prod0 = x * y; // Least significant 256 bits of the product\n            uint256 prod1; // Most significant 256 bits of the product\n            assembly {\n                let mm := mulmod(x, y, not(0))\n                prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n            }\n\n            // Handle non-overflow cases, 256 by 256 division.\n            if (prod1 == 0) {\n                // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n                // The surrounding unchecked block does not change this fact.\n                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n                return prod0 / denominator;\n            }\n\n            // Make sure the result is less than 2^256. Also prevents denominator == 0.\n            if (denominator <= prod1) {\n                revert MathOverflowedMulDiv();\n            }\n\n            ///////////////////////////////////////////////\n            // 512 by 256 division.\n            ///////////////////////////////////////////////\n\n            // Make division exact by subtracting the remainder from [prod1 prod0].\n            uint256 remainder;\n            assembly {\n                // Compute remainder using mulmod.\n                remainder := mulmod(x, y, denominator)\n\n                // Subtract 256 bit number from 512 bit number.\n                prod1 := sub(prod1, gt(remainder, prod0))\n                prod0 := sub(prod0, remainder)\n            }\n\n            // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\n            // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\n\n            uint256 twos = denominator & (0 - denominator);\n            assembly {\n                // Divide denominator by twos.\n                denominator := div(denominator, twos)\n\n                // Divide [prod1 prod0] by twos.\n                prod0 := div(prod0, twos)\n\n                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n                twos := add(div(sub(0, twos), twos), 1)\n            }\n\n            // Shift in bits from prod1 into prod0.\n            prod0 |= prod1 * twos;\n\n            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n            // four bits. That is, denominator * inv = 1 mod 2^4.\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^8\n            inverse *= 2 - denominator * inverse; // inverse mod 2^16\n            inverse *= 2 - denominator * inverse; // inverse mod 2^32\n            inverse *= 2 - denominator * inverse; // inverse mod 2^64\n            inverse *= 2 - denominator * inverse; // inverse mod 2^128\n            inverse *= 2 - denominator * inverse; // inverse mod 2^256\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^256. Since the preconditions guarantee that the outcome is\n            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n            // is no longer required.\n            result = prod0 * inverse;\n            return result;\n        }\n    }\n\n    /**\n     * @notice 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        uint256 result = mulDiv(x, y, denominator);\n        if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {\n            result += 1;\n        }\n        return result;\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     * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n     */\n    function sqrt(uint256 a) internal pure returns (uint256) {\n        if (a == 0) {\n            return 0;\n        }\n\n        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n        //\n        // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n        //\n        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n        //\n        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n        uint256 result = 1 << (log2(a) >> 1);\n\n        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n        // into the expected uint128 result.\n        unchecked {\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            return min(result, a / result);\n        }\n    }\n\n    /**\n     * @notice 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 + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 2 of a positive value rounded towards zero.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >> 128 > 0) {\n                value >>= 128;\n                result += 128;\n            }\n            if (value >> 64 > 0) {\n                value >>= 64;\n                result += 64;\n            }\n            if (value >> 32 > 0) {\n                value >>= 32;\n                result += 32;\n            }\n            if (value >> 16 > 0) {\n                value >>= 16;\n                result += 16;\n            }\n            if (value >> 8 > 0) {\n                value >>= 8;\n                result += 8;\n            }\n            if (value >> 4 > 0) {\n                value >>= 4;\n                result += 4;\n            }\n            if (value >> 2 > 0) {\n                value >>= 2;\n                result += 2;\n            }\n            if (value >> 1 > 0) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log2(value);\n            return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);\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 + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 256 of a positive value rounded towards zero.\n     * Returns 0 if given 0.\n     *\n     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n     */\n    function log256(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >> 128 > 0) {\n                value >>= 128;\n                result += 16;\n            }\n            if (value >> 64 > 0) {\n                value >>= 64;\n                result += 8;\n            }\n            if (value >> 32 > 0) {\n                value >>= 32;\n                result += 4;\n            }\n            if (value >> 16 > 0) {\n                value >>= 16;\n                result += 2;\n            }\n            if (value >> 8 > 0) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log256(value);\n            return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);\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/access/Ownable.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 {Context} from \"../utils/Context.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 Ownable is Context {\n    address private _owner;\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    constructor(address initialOwner) {\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        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        address oldOwner = _owner;\n        _owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n}\n"},{"file_path":"contracts/interfaces/IWETH.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.20;\n\ninterface IWETH {\n  /**\n   * @dev Deposits Ether into the contract and mints WETH to the sender's address.\n   * The contract must be payable to accept ETH.\n   */\n  function deposit() external payable;\n\n  /**\n   * @dev Withdraws WETH from the sender's balance and sends Ether to the sender.\n   * @param amount The amount of WETH to withdraw (converted back to ETH).\n   */\n  function withdraw(uint256 amount) external;\n\n  /**\n   * @dev Returns the number of decimals used by the token.\n   * @return The number of decimals.\n   */\n  function decimals() external view returns (uint8);\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.20;\n\nimport {IAccessControl} from \"@openzeppelin/contracts/access/IAccessControl.sol\";\nimport {ContextUpgradeable} from \"../utils/ContextUpgradeable.sol\";\nimport {ERC165Upgradeable} from \"../utils/introspection/ERC165Upgradeable.sol\";\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n *     require(hasRole(MY_ROLE, msg.sender));\n *     ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControl, ERC165Upgradeable {\n    struct RoleData {\n        mapping(address account => bool) hasRole;\n        bytes32 adminRole;\n    }\n\n    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n\n    /// @custom:storage-location erc7201:openzeppelin.storage.AccessControl\n    struct AccessControlStorage {\n        mapping(bytes32 role => RoleData) _roles;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.AccessControl\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant AccessControlStorageLocation = 0x02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800;\n\n    function _getAccessControlStorage() private pure returns (AccessControlStorage storage $) {\n        assembly {\n            $.slot := AccessControlStorageLocation\n        }\n    }\n\n    /**\n     * @dev Modifier that checks that an account has a specific role. Reverts\n     * with an {AccessControlUnauthorizedAccount} error including the required role.\n     */\n    modifier onlyRole(bytes32 role) {\n        _checkRole(role);\n        _;\n    }\n\n    function __AccessControl_init() internal onlyInitializing {\n    }\n\n    function __AccessControl_init_unchained() internal onlyInitializing {\n    }\n    /**\n     * @dev See {IERC165-supportsInterface}.\n     */\n    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n    }\n\n    /**\n     * @dev Returns `true` if `account` has been granted `role`.\n     */\n    function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n        AccessControlStorage storage $ = _getAccessControlStorage();\n        return $._roles[role].hasRole[account];\n    }\n\n    /**\n     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n     * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n     */\n    function _checkRole(bytes32 role) internal view virtual {\n        _checkRole(role, _msgSender());\n    }\n\n    /**\n     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n     * is missing `role`.\n     */\n    function _checkRole(bytes32 role, address account) internal view virtual {\n        if (!hasRole(role, account)) {\n            revert AccessControlUnauthorizedAccount(account, role);\n        }\n    }\n\n    /**\n     * @dev Returns the admin role that controls `role`. See {grantRole} and\n     * {revokeRole}.\n     *\n     * To change a role's admin, use {_setRoleAdmin}.\n     */\n    function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n        AccessControlStorage storage $ = _getAccessControlStorage();\n        return $._roles[role].adminRole;\n    }\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * If `account` had not been already granted `role`, emits a {RoleGranted}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     *\n     * May emit a {RoleGranted} event.\n     */\n    function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n        _grantRole(role, account);\n    }\n\n    /**\n     * @dev Revokes `role` from `account`.\n     *\n     * If `account` had been granted `role`, emits a {RoleRevoked} event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     *\n     * May emit a {RoleRevoked} event.\n     */\n    function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n        _revokeRole(role, account);\n    }\n\n    /**\n     * @dev Revokes `role` from the calling account.\n     *\n     * Roles are often managed via {grantRole} and {revokeRole}: this function's\n     * purpose is to provide a mechanism for accounts to lose their privileges\n     * if they are compromised (such as when a trusted device is misplaced).\n     *\n     * If the calling account had been revoked `role`, emits a {RoleRevoked}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must be `callerConfirmation`.\n     *\n     * May emit a {RoleRevoked} event.\n     */\n    function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n        if (callerConfirmation != _msgSender()) {\n            revert AccessControlBadConfirmation();\n        }\n\n        _revokeRole(role, callerConfirmation);\n    }\n\n    /**\n     * @dev Sets `adminRole` as ``role``'s admin role.\n     *\n     * Emits a {RoleAdminChanged} event.\n     */\n    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n        AccessControlStorage storage $ = _getAccessControlStorage();\n        bytes32 previousAdminRole = getRoleAdmin(role);\n        $._roles[role].adminRole = adminRole;\n        emit RoleAdminChanged(role, previousAdminRole, adminRole);\n    }\n\n    /**\n     * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n     *\n     * Internal function without access restriction.\n     *\n     * May emit a {RoleGranted} event.\n     */\n    function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n        AccessControlStorage storage $ = _getAccessControlStorage();\n        if (!hasRole(role, account)) {\n            $._roles[role].hasRole[account] = true;\n            emit RoleGranted(role, account, _msgSender());\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\n     *\n     * Internal function without access restriction.\n     *\n     * May emit a {RoleRevoked} event.\n     */\n    function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n        AccessControlStorage storage $ = _getAccessControlStorage();\n        if (hasRole(role, account)) {\n            $._roles[role].hasRole[account] = false;\n            emit RoleRevoked(role, account, _msgSender());\n            return true;\n        } else {\n            return false;\n        }\n    }\n}\n"},{"file_path":"contracts/interfaces/IKYCRegistry.sol","source_code":"//SPDX-License-Identifier: ISC\npragma solidity 0.8.20;\n\ninterface IKYCRegistry {\n  // function isKYCUser(\n  //   bytes32[] calldata proof,\n  //   bytes32 leaf\n  // ) external view returns (bool);\n\n  function isKYCApproved(address user) external view returns (bool);\n}\n"},{"file_path":"contracts/interfaces/IDecentralizedFund.sol","source_code":"//SPDX-License-Identifier: ISC\npragma solidity 0.8.20;\n\ninterface IDecentralizedFund {}\n"},{"file_path":"@openzeppelin/contracts/utils/introspection/IERC165.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\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[EIP 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"}],"certified":false,"conflicting_implementations":null,"abi":[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"custodian","type":"address"},{"internalType":"address","name":"token","type":"address"}],"name":"CustodianAlreadySet","type":"error"},{"inputs":[],"name":"DepositNotEnabled","type":"error"},{"inputs":[{"internalType":"bool","name":"depositEnabled","type":"bool"}],"name":"DepositStateAlreadySet","type":"error"},{"inputs":[{"internalType":"address","name":"implementation","type":"address"}],"name":"ERC1967InvalidImplementation","type":"error"},{"inputs":[],"name":"ERC1967NonPayable","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"InsufficientAllowance","type":"error"},{"inputs":[{"internalType":"uint256","name":"available","type":"uint256"},{"internalType":"uint256","name":"required","type":"uint256"}],"name":"InsufficientAvailableBalance","type":"error"},{"inputs":[{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"locked","type":"uint256"},{"internalType":"uint256","name":"requested","type":"uint256"}],"name":"InsufficientLockedCollateral","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"locked","type":"uint256"},{"internalType":"uint256","name":"requested","type":"uint256"}],"name":"InsufficientLockedRedeemableBalance","type":"error"},{"inputs":[{"internalType":"uint256","name":"received","type":"uint256"},{"internalType":"uint256","name":"minimum","type":"uint256"}],"name":"InsufficientShares","type":"error"},{"inputs":[],"name":"InvalidAdminAddress","type":"error"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"InvalidAmount","type":"error"},{"inputs":[],"name":"InvalidCalculatorAddress","type":"error"},{"inputs":[],"name":"InvalidCollateralManagerAddress","type":"error"},{"inputs":[{"internalType":"address","name":"custodian","type":"address"},{"internalType":"address","name":"token","type":"address"}],"name":"InvalidCustodian","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"InvalidKYCRegistryAddress","type":"error"},{"inputs":[],"name":"InvalidOperatorAddress","type":"error"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"}],"name":"InvalidRecipient","type":"error"},{"inputs":[],"name":"InvalidRedemptionManagerAddress","type":"error"},{"inputs":[],"name":"InvalidRegistryAddress","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"InvalidSender","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"InvalidToken","type":"error"},{"inputs":[],"name":"NoFeesToClaim","type":"error"},{"inputs":[],"name":"NoNativeTokenSent","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[],"name":"OnlyApprovedKYCUser","type":"error"},{"inputs":[],"name":"OnlyCollateralManager","type":"error"},{"inputs":[],"name":"OnlyRedemptionManager","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"ShareTokenAlreadySet","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"TokenNotEnabledForDeposit","type":"error"},{"inputs":[],"name":"UUPSUnauthorizedCallContext","type":"error"},{"inputs":[{"internalType":"bytes32","name":"slot","type":"bytes32"}],"name":"UUPSUnsupportedProxiableUUID","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"custodian","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"AssetDepositedFromCustodian","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"custodian","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"AssetWithdrawnToCustodian","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"collateralManager","type":"address"}],"name":"CollateralManagerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"CollateralTokensLocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"CollateralTokensUnlocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"custodian","type":"address"}],"name":"CustodianAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"source","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"custodian","type":"address"}],"name":"CustodianAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"custodian","type":"address"}],"name":"CustodianRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"source","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"custodian","type":"address"}],"name":"CustodianRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"DepositFeeClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"pool","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"DepositedToPool","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RedemptionTokensLocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RedemptionTokensTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"}],"name":"ShareTokenSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ShareTokensBurned","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ShareTokensReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ShareTokensTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"pool","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawnFromPool","type":"event"},{"inputs":[],"name":"ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"COLLATERAL_MANAGER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CUSTODIAN_MANAGER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CUSTODIAN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEE_MANAGER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UPGRADER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UPGRADE_INTERFACE_VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"custodian","type":"address"}],"name":"addCustodian","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burnShareTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"recipient","type":"address"}],"name":"claimDepositFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"collateralManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractShareTokenBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"convertFromShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"convertToShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"custodians","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minShares","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"depositFromCustodian","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"minShares","type":"uint256"}],"name":"depositNative","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"depositTokenRegistry","outputs":[{"internalType":"contract IDepositTokenRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"getAvailableBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"custodian","type":"address"}],"name":"getCustodianNetPosition","outputs":[{"internalType":"uint256","name":"withdrawals","type":"uint256"},{"internalType":"uint256","name":"deposits","type":"uint256"},{"internalType":"int256","name":"netBalance","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"getCustodiansForToken","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"getRedemptionTokenStatus","outputs":[{"internalType":"uint256","name":"lockedAmount","type":"uint256"},{"internalType":"uint256","name":"availableAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"getTotalDepositFeeAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"custodian","type":"address"}],"name":"getTotalDepositsFromCustodian","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"custodian","type":"address"}],"name":"getTotalWithdrawalsToCustodian","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"initialAdmin_","type":"address"},{"internalType":"string","name":"tokenName","type":"string"},{"internalType":"string","name":"tokenSymbol","type":"string"},{"internalType":"address","name":"kycRegistry_","type":"address"},{"internalType":"address","name":"operator_","type":"address"},{"internalType":"address","name":"depositTokenRegistry_","type":"address"},{"internalType":"address","name":"_sharePriceCalculator","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"custodian","type":"address"}],"name":"isCustodian","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"kycRegistry","outputs":[{"internalType":"contract IKYCRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastClaimedDepositFeeAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"lockCollateralTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"lockRedemptionTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"previewDeposit","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"uint256","name":"depositFees","type":"uint256"},{"internalType":"bool","name":"isAllowed","type":"bool"},{"internalType":"string","name":"errorMessage","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"previewMint","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"depositFees","type":"uint256"},{"internalType":"bool","name":"isAllowed","type":"bool"},{"internalType":"string","name":"errorMessage","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minShares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"processPrestakedDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"receiveShareTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"receiveTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"redemptionManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"custodian","type":"address"}],"name":"removeCustodian","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_collateralManager","type":"address"}],"name":"setCollateralManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"depositEnabled_","type":"bool"}],"name":"setDepositEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"depositTokenRegistry_","type":"address"}],"name":"setDepositTokenRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"kycRegistry_","type":"address"}],"name":"setKycRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_redemptionManager","type":"address"}],"name":"setRedemptionManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sharePriceCalculator_","type":"address"}],"name":"setSharePriceCalculator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ShareToken","name":"token","type":"address"}],"name":"setShareToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sharePriceCalculator","outputs":[{"internalType":"contract ISharePriceCalculator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"shareToken","outputs":[{"internalType":"contract ShareToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferRedemptionTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferShareTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"unlockCollateralTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","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":[{"internalType":"address","name":"","type":"address"}],"name":"userRedemptionDeposits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"custodian","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawToCustodian","outputs":[],"stateMutability":"nonpayable","type":"function"}],"is_changed_bytecode":false,"is_partially_verified":false,"constructor_args":null}