creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "src/RestakingOperator.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.8.0 <0.9.0;\n\nimport { AccessManagedUpgradeable } from \"openzeppelin-upgradeable/access/manager/AccessManagedUpgradeable.sol\";\nimport { Initializable } from \"openzeppelin-upgradeable/proxy/utils/Initializable.sol\";\nimport { IDelegationManager } from \"eigenlayer/interfaces/IDelegationManager.sol\";\nimport { ISlasher } from \"eigenlayer/interfaces/ISlasher.sol\";\nimport { IRestakingOperator } from \"puffer/interface/IRestakingOperator.sol\";\nimport { Unauthorized, InvalidAddress } from \"puffer/Errors.sol\";\nimport { IPufferModuleManager } from \"puffer/interface/IPufferModuleManager.sol\";\nimport { IERC1271 } from \"@openzeppelin/contracts/interfaces/IERC1271.sol\";\nimport { ECDSA } from \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport { IRegistryCoordinator, IBLSApkRegistry } from \"eigenlayer-middleware/interfaces/IRegistryCoordinator.sol\";\nimport { IRegistryCoordinatorExtended } from \"puffer/interface/IRegistryCoordinatorExtended.sol\";\nimport { ISignatureUtils } from \"eigenlayer/interfaces/ISignatureUtils.sol\";\n\n/**\n * @title RestakingOperator\n * @author Puffer Finance\n * @notice PufferModule\n * @custom:security-contact security@puffer.fi\n */\ncontract RestakingOperator is IRestakingOperator, IERC1271, Initializable, AccessManagedUpgradeable {\n    // keccak256(abi.encode(uint256(keccak256(\"RestakingOperator.storage\")) - 1)) & ~bytes32(uint256(0xff))\n    // slither-disable-next-line unused-state\n    bytes32 private constant _RESTAKING_OPERATOR_STORAGE =\n        0x2182a68f8e463a6b4c76f5de5bb25b7b51ccc88cb3b9ba6c251c356b50555100;\n\n    // bytes4(keccak256(\"isValidSignature(bytes32,bytes)\")\n    bytes4 internal constant _EIP1271_MAGIC_VALUE = 0x1626ba7e;\n    // Invalid signature value (EIP-1271)\n    bytes4 internal constant _EIP1271_INVALID_VALUE = 0xffffffff;\n\n    /**\n     * @custom:storage-location erc7201:RestakingOperator.storage\n     * @dev +-----------------------------------------------------------+\n     *      |                                                           |\n     *      | DO NOT CHANGE, REORDER, REMOVE EXISTING STORAGE VARIABLES |\n     *      |                                                           |\n     *      +-----------------------------------------------------------+\n     */\n    struct RestakingOperatorStorage {\n        mapping(bytes32 digestHash => address signer) hashSigners;\n    }\n\n    /**\n     * @dev Upgradeable contract from EigenLayer\n     */\n    IDelegationManager public immutable override EIGEN_DELEGATION_MANAGER;\n\n    /**\n     * @dev Upgradeable contract from EigenLayer\n     */\n    ISlasher public immutable override EIGEN_SLASHER;\n\n    /**\n     * @dev Upgradeable Puffer Module Manager\n     */\n    IPufferModuleManager public immutable PUFFER_MODULE_MANAGER;\n\n    modifier onlyPufferModuleManager() {\n        if (msg.sender != address(PUFFER_MODULE_MANAGER)) {\n            revert Unauthorized();\n        }\n        _;\n    }\n\n    // We use constructor to set the immutable variables\n    constructor(IDelegationManager delegationManager, ISlasher slasher, IPufferModuleManager moduleManager) {\n        if (address(delegationManager) == address(0)) {\n            revert InvalidAddress();\n        }\n        if (address(slasher) == address(0)) {\n            revert InvalidAddress();\n        }\n        if (address(moduleManager) == address(0)) {\n            revert InvalidAddress();\n        }\n        EIGEN_DELEGATION_MANAGER = delegationManager;\n        EIGEN_SLASHER = slasher;\n        PUFFER_MODULE_MANAGER = moduleManager;\n        _disableInitializers();\n    }\n\n    function initialize(\n        address initialAuthority,\n        IDelegationManager.OperatorDetails calldata operatorDetails,\n        string calldata metadataURI\n    ) external initializer {\n        __AccessManaged_init(initialAuthority);\n        EIGEN_DELEGATION_MANAGER.registerAsOperator(operatorDetails, metadataURI);\n    }\n\n    /**\n     * @inheritdoc IRestakingOperator\n     * @dev Restricted to the PufferModuleManager\n     */\n    function optIntoSlashing(address slasher) external virtual onlyPufferModuleManager {\n        EIGEN_SLASHER.optIntoSlashing(slasher);\n    }\n\n    /**\n     * @inheritdoc IRestakingOperator\n     * @dev Restricted to the PufferModuleManager\n     */\n    function modifyOperatorDetails(IDelegationManager.OperatorDetails calldata newOperatorDetails)\n        external\n        virtual\n        onlyPufferModuleManager\n    {\n        EIGEN_DELEGATION_MANAGER.modifyOperatorDetails(newOperatorDetails);\n    }\n\n    /**\n     * @inheritdoc IRestakingOperator\n     * @dev Restricted to the PufferModuleManager\n     */\n    function updateOperatorMetadataURI(string calldata metadataURI) external virtual onlyPufferModuleManager {\n        EIGEN_DELEGATION_MANAGER.updateOperatorMetadataURI(metadataURI);\n    }\n\n    /**\n     * @inheritdoc IRestakingOperator\n     * @dev Restricted to the PufferModuleManager\n     */\n    function updateSignatureProof(bytes32 digestHash, address signer) external virtual onlyPufferModuleManager {\n        RestakingOperatorStorage storage $ = _getRestakingOperatorStorage();\n\n        $.hashSigners[digestHash] = signer;\n    }\n\n    /**\n     * @inheritdoc IRestakingOperator\n     * @dev Restricted to the PufferModuleManager\n     */\n    function registerOperatorToAVS(\n        address avsRegistryCoordinator,\n        bytes calldata quorumNumbers,\n        string calldata socket,\n        IBLSApkRegistry.PubkeyRegistrationParams calldata params,\n        ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature\n    ) external virtual onlyPufferModuleManager {\n        IRegistryCoordinatorExtended(avsRegistryCoordinator).registerOperator({\n            quorumNumbers: quorumNumbers,\n            socket: socket,\n            params: params,\n            operatorSignature: operatorSignature\n        });\n    }\n\n    /**\n     * @inheritdoc IRestakingOperator\n     * @dev Restricted to the PufferModuleManager\n     */\n    function registerOperatorToAVSWithChurn(\n        address avsRegistryCoordinator,\n        bytes calldata quorumNumbers,\n        string calldata socket,\n        IBLSApkRegistry.PubkeyRegistrationParams calldata params,\n        IRegistryCoordinator.OperatorKickParam[] calldata operatorKickParams,\n        ISignatureUtils.SignatureWithSaltAndExpiry memory churnApproverSignature,\n        ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature\n    ) external virtual onlyPufferModuleManager {\n        IRegistryCoordinatorExtended(avsRegistryCoordinator).registerOperatorWithChurn({\n            quorumNumbers: quorumNumbers,\n            socket: socket,\n            params: params,\n            operatorKickParams: operatorKickParams,\n            churnApproverSignature: churnApproverSignature,\n            operatorSignature: operatorSignature\n        });\n    }\n\n    /**\n     * @inheritdoc IRestakingOperator\n     * @dev Restricted to the PufferModuleManager\n     */\n    function deregisterOperatorFromAVS(address avsRegistryCoordinator, bytes calldata quorumNumbers)\n        external\n        virtual\n        onlyPufferModuleManager\n    {\n        IRegistryCoordinatorExtended(avsRegistryCoordinator).deregisterOperator(quorumNumbers);\n    }\n\n    /**\n     * @inheritdoc IRestakingOperator\n     * @dev Restricted to the PufferModuleManager\n     */\n    function updateOperatorAVSSocket(address avsRegistryCoordinator, string memory socket)\n        external\n        virtual\n        onlyPufferModuleManager\n    {\n        IRegistryCoordinatorExtended(avsRegistryCoordinator).updateSocket(socket);\n    }\n\n    /**\n     * @notice Verifies that the signer is the owner of the signing contract.\n     */\n    function isValidSignature(bytes32 digestHash, bytes calldata signature) external view override returns (bytes4) {\n        RestakingOperatorStorage storage $ = _getRestakingOperatorStorage();\n\n        address signer = $.hashSigners[digestHash];\n\n        // Validate signatures\n        if (signer != address(0) && ECDSA.recover(digestHash, signature) == signer) {\n            return _EIP1271_MAGIC_VALUE;\n        } else {\n            return _EIP1271_INVALID_VALUE;\n        }\n    }\n\n    function _getRestakingOperatorStorage() internal pure returns (RestakingOperatorStorage storage $) {\n        // solhint-disable-next-line\n        assembly {\n            $.slot := _RESTAKING_OPERATOR_STORAGE\n        }\n    }\n}\n"
      },
      "lib/openzeppelin-contracts-upgradeable/contracts/access/manager/AccessManagedUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/manager/AccessManaged.sol)\n\npragma solidity ^0.8.20;\n\nimport {IAuthority} from \"@openzeppelin/contracts/access/manager/IAuthority.sol\";\nimport {AuthorityUtils} from \"@openzeppelin/contracts/access/manager/AuthorityUtils.sol\";\nimport {IAccessManager} from \"@openzeppelin/contracts/access/manager/IAccessManager.sol\";\nimport {IAccessManaged} from \"@openzeppelin/contracts/access/manager/IAccessManaged.sol\";\nimport {ContextUpgradeable} from \"../../utils/ContextUpgradeable.sol\";\nimport {Initializable} from \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev This contract module makes available a {restricted} modifier. Functions decorated with this modifier will be\n * permissioned according to an \"authority\": a contract like {AccessManager} that follows the {IAuthority} interface,\n * implementing a policy that allows certain callers to access certain functions.\n *\n * IMPORTANT: The `restricted` modifier should never be used on `internal` functions, judiciously used in `public`\n * functions, and ideally only used in `external` functions. See {restricted}.\n */\nabstract contract AccessManagedUpgradeable is Initializable, ContextUpgradeable, IAccessManaged {\n    /// @custom:storage-location erc7201:openzeppelin.storage.AccessManaged\n    struct AccessManagedStorage {\n        address _authority;\n\n        bool _consumingSchedule;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.AccessManaged\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant AccessManagedStorageLocation = 0xf3177357ab46d8af007ab3fdb9af81da189e1068fefdc0073dca88a2cab40a00;\n\n    function _getAccessManagedStorage() private pure returns (AccessManagedStorage storage $) {\n        assembly {\n            $.slot := AccessManagedStorageLocation\n        }\n    }\n\n    /**\n     * @dev Initializes the contract connected to an initial authority.\n     */\n    function __AccessManaged_init(address initialAuthority) internal onlyInitializing {\n        __AccessManaged_init_unchained(initialAuthority);\n    }\n\n    function __AccessManaged_init_unchained(address initialAuthority) internal onlyInitializing {\n        _setAuthority(initialAuthority);\n    }\n\n    /**\n     * @dev Restricts access to a function as defined by the connected Authority for this contract and the\n     * caller and selector of the function that entered the contract.\n     *\n     * [IMPORTANT]\n     * ====\n     * In general, this modifier should only be used on `external` functions. It is okay to use it on `public`\n     * functions that are used as external entry points and are not called internally. Unless you know what you're\n     * doing, it should never be used on `internal` functions. Failure to follow these rules can have critical security\n     * implications! This is because the permissions are determined by the function that entered the contract, i.e. the\n     * function at the bottom of the call stack, and not the function where the modifier is visible in the source code.\n     * ====\n     *\n     * [WARNING]\n     * ====\n     * Avoid adding this modifier to the https://docs.soliditylang.org/en/v0.8.20/contracts.html#receive-ether-function[`receive()`]\n     * function or the https://docs.soliditylang.org/en/v0.8.20/contracts.html#fallback-function[`fallback()`]. These\n     * functions are the only execution paths where a function selector cannot be unambiguosly determined from the calldata\n     * since the selector defaults to `0x00000000` in the `receive()` function and similarly in the `fallback()` function\n     * if no calldata is provided. (See {_checkCanCall}).\n     *\n     * The `receive()` function will always panic whereas the `fallback()` may panic depending on the calldata length.\n     * ====\n     */\n    modifier restricted() {\n        _checkCanCall(_msgSender(), _msgData());\n        _;\n    }\n\n    /// @inheritdoc IAccessManaged\n    function authority() public view virtual returns (address) {\n        AccessManagedStorage storage $ = _getAccessManagedStorage();\n        return $._authority;\n    }\n\n    /// @inheritdoc IAccessManaged\n    function setAuthority(address newAuthority) public virtual {\n        address caller = _msgSender();\n        if (caller != authority()) {\n            revert AccessManagedUnauthorized(caller);\n        }\n        if (newAuthority.code.length == 0) {\n            revert AccessManagedInvalidAuthority(newAuthority);\n        }\n        _setAuthority(newAuthority);\n    }\n\n    /// @inheritdoc IAccessManaged\n    function isConsumingScheduledOp() public view returns (bytes4) {\n        AccessManagedStorage storage $ = _getAccessManagedStorage();\n        return $._consumingSchedule ? this.isConsumingScheduledOp.selector : bytes4(0);\n    }\n\n    /**\n     * @dev Transfers control to a new authority. Internal function with no access restriction. Allows bypassing the\n     * permissions set by the current authority.\n     */\n    function _setAuthority(address newAuthority) internal virtual {\n        AccessManagedStorage storage $ = _getAccessManagedStorage();\n        $._authority = newAuthority;\n        emit AuthorityUpdated(newAuthority);\n    }\n\n    /**\n     * @dev Reverts if the caller is not allowed to call the function identified by a selector. Panics if the calldata\n     * is less than 4 bytes long.\n     */\n    function _checkCanCall(address caller, bytes calldata data) internal virtual {\n        AccessManagedStorage storage $ = _getAccessManagedStorage();\n        (bool immediate, uint32 delay) = AuthorityUtils.canCallWithDelay(\n            authority(),\n            caller,\n            address(this),\n            bytes4(data[0:4])\n        );\n        if (!immediate) {\n            if (delay > 0) {\n                $._consumingSchedule = true;\n                IAccessManager(authority()).consumeScheduledOp(caller, data);\n                $._consumingSchedule = false;\n            } else {\n                revert AccessManagedUnauthorized(caller);\n            }\n        }\n    }\n}\n"
      },
      "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol": {
        "content": "// 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"
      },
      "lib/eigenlayer-contracts/src/contracts/interfaces/IDelegationManager.sol": {
        "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.5.0;\n\nimport \"./IStrategy.sol\";\nimport \"./ISignatureUtils.sol\";\nimport \"./IStrategyManager.sol\";\n\n/**\n * @title DelegationManager\n * @author Layr Labs, Inc.\n * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service\n * @notice  This is the contract for delegation in EigenLayer. The main functionalities of this contract are\n * - enabling anyone to register as an operator in EigenLayer\n * - allowing operators to specify parameters related to stakers who delegate to them\n * - enabling any staker to delegate its stake to the operator of its choice (a given staker can only delegate to a single operator at a time)\n * - enabling a staker to undelegate its assets from the operator it is delegated to (performed as part of the withdrawal process, initiated through the StrategyManager)\n */\ninterface IDelegationManager is ISignatureUtils {\n    // @notice Struct used for storing information about a single operator who has registered with EigenLayer\n    struct OperatorDetails {\n        // @notice address to receive the rewards that the operator earns via serving applications built on EigenLayer.\n        address earningsReceiver;\n        /**\n         * @notice Address to verify signatures when a staker wishes to delegate to the operator, as well as controlling \"forced undelegations\".\n         * @dev Signature verification follows these rules:\n         * 1) If this address is left as address(0), then any staker will be free to delegate to the operator, i.e. no signature verification will be performed.\n         * 2) If this address is an EOA (i.e. it has no code), then we follow standard ECDSA signature verification for delegations to the operator.\n         * 3) If this address is a contract (i.e. it has code) then we forward a call to the contract and verify that it returns the correct EIP-1271 \"magic value\".\n         */\n        address delegationApprover;\n        /**\n         * @notice A minimum delay -- measured in blocks -- enforced between:\n         * 1) the operator signalling their intent to register for a service, via calling `Slasher.optIntoSlashing`\n         * and\n         * 2) the operator completing registration for the service, via the service ultimately calling `Slasher.recordFirstStakeUpdate`\n         * @dev note that for a specific operator, this value *cannot decrease*, i.e. if the operator wishes to modify their OperatorDetails,\n         * then they are only allowed to either increase this value or keep it the same.\n         */\n        uint32 stakerOptOutWindowBlocks;\n    }\n\n    /**\n     * @notice Abstract struct used in calculating an EIP712 signature for a staker to approve that they (the staker themselves) delegate to a specific operator.\n     * @dev Used in computing the `STAKER_DELEGATION_TYPEHASH` and as a reference in the computation of the stakerDigestHash in the `delegateToBySignature` function.\n     */\n    struct StakerDelegation {\n        // the staker who is delegating\n        address staker;\n        // the operator being delegated to\n        address operator;\n        // the staker's nonce\n        uint256 nonce;\n        // the expiration timestamp (UTC) of the signature\n        uint256 expiry;\n    }\n\n    /**\n     * @notice Abstract struct used in calculating an EIP712 signature for an operator's delegationApprover to approve that a specific staker delegate to the operator.\n     * @dev Used in computing the `DELEGATION_APPROVAL_TYPEHASH` and as a reference in the computation of the approverDigestHash in the `_delegate` function.\n     */\n    struct DelegationApproval {\n        // the staker who is delegating\n        address staker;\n        // the operator being delegated to\n        address operator;\n        // the operator's provided salt\n        bytes32 salt;\n        // the expiration timestamp (UTC) of the signature\n        uint256 expiry;\n    }\n\n    /**\n     * Struct type used to specify an existing queued withdrawal. Rather than storing the entire struct, only a hash is stored.\n     * In functions that operate on existing queued withdrawals -- e.g. completeQueuedWithdrawal`, the data is resubmitted and the hash of the submitted\n     * data is computed by `calculateWithdrawalRoot` and checked against the stored hash in order to confirm the integrity of the submitted data.\n     */\n    struct Withdrawal {\n        // The address that originated the Withdrawal\n        address staker;\n        // The address that the staker was delegated to at the time that the Withdrawal was created\n        address delegatedTo;\n        // The address that can complete the Withdrawal + will receive funds when completing the withdrawal\n        address withdrawer;\n        // Nonce used to guarantee that otherwise identical withdrawals have unique hashes\n        uint256 nonce;\n        // Block number when the Withdrawal was created\n        uint32 startBlock;\n        // Array of strategies that the Withdrawal contains\n        IStrategy[] strategies;\n        // Array containing the amount of shares in each Strategy in the `strategies` array\n        uint256[] shares;\n    }\n\n    struct QueuedWithdrawalParams {\n        // Array of strategies that the QueuedWithdrawal contains\n        IStrategy[] strategies;\n        // Array containing the amount of shares in each Strategy in the `strategies` array\n        uint256[] shares;\n        // The address of the withdrawer\n        address withdrawer;\n    }\n\n    // @notice Emitted when a new operator registers in EigenLayer and provides their OperatorDetails.\n    event OperatorRegistered(address indexed operator, OperatorDetails operatorDetails);\n\n    /// @notice Emitted when an operator updates their OperatorDetails to @param newOperatorDetails\n    event OperatorDetailsModified(address indexed operator, OperatorDetails newOperatorDetails);\n\n    /**\n     * @notice Emitted when @param operator indicates that they are updating their MetadataURI string\n     * @dev Note that these strings are *never stored in storage* and are instead purely emitted in events for off-chain indexing\n     */\n    event OperatorMetadataURIUpdated(address indexed operator, string metadataURI);\n\n    /// @notice Emitted whenever an operator's shares are increased for a given strategy. Note that shares is the delta in the operator's shares.\n    event OperatorSharesIncreased(address indexed operator, address staker, IStrategy strategy, uint256 shares);\n\n    /// @notice Emitted whenever an operator's shares are decreased for a given strategy. Note that shares is the delta in the operator's shares.\n    event OperatorSharesDecreased(address indexed operator, address staker, IStrategy strategy, uint256 shares);\n\n    /// @notice Emitted when @param staker delegates to @param operator.\n    event StakerDelegated(address indexed staker, address indexed operator);\n\n    /// @notice Emitted when @param staker undelegates from @param operator.\n    event StakerUndelegated(address indexed staker, address indexed operator);\n\n    /// @notice Emitted when @param staker is undelegated via a call not originating from the staker themself\n    event StakerForceUndelegated(address indexed staker, address indexed operator);\n\n    /**\n     * @notice Emitted when a new withdrawal is queued.\n     * @param withdrawalRoot Is the hash of the `withdrawal`.\n     * @param withdrawal Is the withdrawal itself.\n     */\n    event WithdrawalQueued(bytes32 withdrawalRoot, Withdrawal withdrawal);\n\n    /// @notice Emitted when a queued withdrawal is completed\n    event WithdrawalCompleted(bytes32 withdrawalRoot);\n\n    /// @notice Emitted when a queued withdrawal is *migrated* from the StrategyManager to the DelegationManager\n    event WithdrawalMigrated(bytes32 oldWithdrawalRoot, bytes32 newWithdrawalRoot);\n    \n    /// @notice Emitted when the `minWithdrawalDelayBlocks` variable is modified from `previousValue` to `newValue`.\n    event MinWithdrawalDelayBlocksSet(uint256 previousValue, uint256 newValue);\n\n    /// @notice Emitted when the `strategyWithdrawalDelayBlocks` variable is modified from `previousValue` to `newValue`.\n    event StrategyWithdrawalDelayBlocksSet(IStrategy strategy, uint256 previousValue, uint256 newValue);\n\n    /**\n     * @notice Registers the caller as an operator in EigenLayer.\n     * @param registeringOperatorDetails is the `OperatorDetails` for the operator.\n     * @param metadataURI is a URI for the operator's metadata, i.e. a link providing more details on the operator.\n     *\n     * @dev Once an operator is registered, they cannot 'deregister' as an operator, and they will forever be considered \"delegated to themself\".\n     * @dev This function will revert if the caller attempts to set their `earningsReceiver` to address(0).\n     * @dev Note that the `metadataURI` is *never stored * and is only emitted in the `OperatorMetadataURIUpdated` event\n     */\n    function registerAsOperator(\n        OperatorDetails calldata registeringOperatorDetails,\n        string calldata metadataURI\n    ) external;\n\n    /**\n     * @notice Updates an operator's stored `OperatorDetails`.\n     * @param newOperatorDetails is the updated `OperatorDetails` for the operator, to replace their current OperatorDetails`.\n     *\n     * @dev The caller must have previously registered as an operator in EigenLayer.\n     * @dev This function will revert if the caller attempts to set their `earningsReceiver` to address(0).\n     */\n    function modifyOperatorDetails(OperatorDetails calldata newOperatorDetails) external;\n\n    /**\n     * @notice Called by an operator to emit an `OperatorMetadataURIUpdated` event indicating the information has updated.\n     * @param metadataURI The URI for metadata associated with an operator\n     * @dev Note that the `metadataURI` is *never stored * and is only emitted in the `OperatorMetadataURIUpdated` event\n     */\n    function updateOperatorMetadataURI(string calldata metadataURI) external;\n\n    /**\n     * @notice Caller delegates their stake to an operator.\n     * @param operator The account (`msg.sender`) is delegating its assets to for use in serving applications built on EigenLayer.\n     * @param approverSignatureAndExpiry Verifies the operator approves of this delegation\n     * @param approverSalt A unique single use value tied to an individual signature.\n     * @dev The approverSignatureAndExpiry is used in the event that:\n     *          1) the operator's `delegationApprover` address is set to a non-zero value.\n     *                  AND\n     *          2) neither the operator nor their `delegationApprover` is the `msg.sender`, since in the event that the operator\n     *             or their delegationApprover is the `msg.sender`, then approval is assumed.\n     * @dev In the event that `approverSignatureAndExpiry` is not checked, its content is ignored entirely; it's recommended to use an empty input\n     * in this case to save on complexity + gas costs\n     */\n    function delegateTo(\n        address operator,\n        SignatureWithExpiry memory approverSignatureAndExpiry,\n        bytes32 approverSalt\n    ) external;\n\n    /**\n     * @notice Caller delegates a staker's stake to an operator with valid signatures from both parties.\n     * @param staker The account delegating stake to an `operator` account\n     * @param operator The account (`staker`) is delegating its assets to for use in serving applications built on EigenLayer.\n     * @param stakerSignatureAndExpiry Signed data from the staker authorizing delegating stake to an operator\n     * @param approverSignatureAndExpiry is a parameter that will be used for verifying that the operator approves of this delegation action in the event that:\n     * @param approverSalt Is a salt used to help guarantee signature uniqueness. Each salt can only be used once by a given approver.\n     *\n     * @dev If `staker` is an EOA, then `stakerSignature` is verified to be a valid ECDSA stakerSignature from `staker`, indicating their intention for this action.\n     * @dev If `staker` is a contract, then `stakerSignature` will be checked according to EIP-1271.\n     * @dev the operator's `delegationApprover` address is set to a non-zero value.\n     * @dev neither the operator nor their `delegationApprover` is the `msg.sender`, since in the event that the operator or their delegationApprover\n     * is the `msg.sender`, then approval is assumed.\n     * @dev This function will revert if the current `block.timestamp` is equal to or exceeds the expiry\n     * @dev In the case that `approverSignatureAndExpiry` is not checked, its content is ignored entirely; it's recommended to use an empty input\n     * in this case to save on complexity + gas costs\n     */\n    function delegateToBySignature(\n        address staker,\n        address operator,\n        SignatureWithExpiry memory stakerSignatureAndExpiry,\n        SignatureWithExpiry memory approverSignatureAndExpiry,\n        bytes32 approverSalt\n    ) external;\n\n    /**\n     * @notice Undelegates the staker from the operator who they are delegated to. Puts the staker into the \"undelegation limbo\" mode of the EigenPodManager\n     * and queues a withdrawal of all of the staker's shares in the StrategyManager (to the staker), if necessary.\n     * @param staker The account to be undelegated.\n     * @return withdrawalRoot The root of the newly queued withdrawal, if a withdrawal was queued. Otherwise just bytes32(0).\n     *\n     * @dev Reverts if the `staker` is also an operator, since operators are not allowed to undelegate from themselves.\n     * @dev Reverts if the caller is not the staker, nor the operator who the staker is delegated to, nor the operator's specified \"delegationApprover\"\n     * @dev Reverts if the `staker` is already undelegated.\n     */\n    function undelegate(address staker) external returns (bytes32[] memory withdrawalRoot);\n\n    /**\n     * Allows a staker to withdraw some shares. Withdrawn shares/strategies are immediately removed\n     * from the staker. If the staker is delegated, withdrawn shares/strategies are also removed from\n     * their operator.\n     *\n     * All withdrawn shares/strategies are placed in a queue and can be fully withdrawn after a delay.\n     */\n    function queueWithdrawals(\n        QueuedWithdrawalParams[] calldata queuedWithdrawalParams\n    ) external returns (bytes32[] memory);\n\n    /**\n     * @notice Used to complete the specified `withdrawal`. The caller must match `withdrawal.withdrawer`\n     * @param withdrawal The Withdrawal to complete.\n     * @param tokens Array in which the i-th entry specifies the `token` input to the 'withdraw' function of the i-th Strategy in the `withdrawal.strategies` array.\n     * This input can be provided with zero length if `receiveAsTokens` is set to 'false' (since in that case, this input will be unused)\n     * @param middlewareTimesIndex is the index in the operator that the staker who triggered the withdrawal was delegated to's middleware times array\n     * @param receiveAsTokens If true, the shares specified in the withdrawal will be withdrawn from the specified strategies themselves\n     * and sent to the caller, through calls to `withdrawal.strategies[i].withdraw`. If false, then the shares in the specified strategies\n     * will simply be transferred to the caller directly.\n     * @dev middlewareTimesIndex should be calculated off chain before calling this function by finding the first index that satisfies `slasher.canWithdraw`\n     * @dev beaconChainETHStrategy shares are non-transferrable, so if `receiveAsTokens = false` and `withdrawal.withdrawer != withdrawal.staker`, note that\n     * any beaconChainETHStrategy shares in the `withdrawal` will be _returned to the staker_, rather than transferred to the withdrawer, unlike shares in\n     * any other strategies, which will be transferred to the withdrawer.\n     */\n    function completeQueuedWithdrawal(\n        Withdrawal calldata withdrawal,\n        IERC20[] calldata tokens,\n        uint256 middlewareTimesIndex,\n        bool receiveAsTokens\n    ) external;\n\n    /**\n     * @notice Array-ified version of `completeQueuedWithdrawal`.\n     * Used to complete the specified `withdrawals`. The function caller must match `withdrawals[...].withdrawer`\n     * @param withdrawals The Withdrawals to complete.\n     * @param tokens Array of tokens for each Withdrawal. See `completeQueuedWithdrawal` for the usage of a single array.\n     * @param middlewareTimesIndexes One index to reference per Withdrawal. See `completeQueuedWithdrawal` for the usage of a single index.\n     * @param receiveAsTokens Whether or not to complete each withdrawal as tokens. See `completeQueuedWithdrawal` for the usage of a single boolean.\n     * @dev See `completeQueuedWithdrawal` for relevant dev tags\n     */\n    function completeQueuedWithdrawals(\n        Withdrawal[] calldata withdrawals,\n        IERC20[][] calldata tokens,\n        uint256[] calldata middlewareTimesIndexes,\n        bool[] calldata receiveAsTokens\n    ) external;\n\n    /**\n     * @notice Increases a staker's delegated share balance in a strategy.\n     * @param staker The address to increase the delegated shares for their operator.\n     * @param strategy The strategy in which to increase the delegated shares.\n     * @param shares The number of shares to increase.\n     *\n     * @dev *If the staker is actively delegated*, then increases the `staker`'s delegated shares in `strategy` by `shares`. Otherwise does nothing.\n     * @dev Callable only by the StrategyManager or EigenPodManager.\n     */\n    function increaseDelegatedShares(\n        address staker,\n        IStrategy strategy,\n        uint256 shares\n    ) external;\n\n    /**\n     * @notice Decreases a staker's delegated share balance in a strategy.\n     * @param staker The address to increase the delegated shares for their operator.\n     * @param strategy The strategy in which to decrease the delegated shares.\n     * @param shares The number of shares to decrease.\n     *\n     * @dev *If the staker is actively delegated*, then decreases the `staker`'s delegated shares in `strategy` by `shares`. Otherwise does nothing.\n     * @dev Callable only by the StrategyManager or EigenPodManager.\n     */\n    function decreaseDelegatedShares(\n        address staker,\n        IStrategy strategy,\n        uint256 shares\n    ) external;\n\n    /**\n     * @notice returns the address of the operator that `staker` is delegated to.\n     * @notice Mapping: staker => operator whom the staker is currently delegated to.\n     * @dev Note that returning address(0) indicates that the staker is not actively delegated to any operator.\n     */\n    function delegatedTo(address staker) external view returns (address);\n\n    /**\n     * @notice Returns the OperatorDetails struct associated with an `operator`.\n     */\n    function operatorDetails(address operator) external view returns (OperatorDetails memory);\n\n    /*\n     * @notice Returns the earnings receiver address for an operator\n     */\n    function earningsReceiver(address operator) external view returns (address);\n\n    /**\n     * @notice Returns the delegationApprover account for an operator\n     */\n    function delegationApprover(address operator) external view returns (address);\n\n    /**\n     * @notice Returns the stakerOptOutWindowBlocks for an operator\n     */\n    function stakerOptOutWindowBlocks(address operator) external view returns (uint256);\n\n    /**\n     * @notice Given array of strategies, returns array of shares for the operator\n     */\n    function getOperatorShares(\n        address operator,\n        IStrategy[] memory strategies\n    ) external view returns (uint256[] memory);\n\n    /**\n     * @notice Given a list of strategies, return the minimum number of blocks that must pass to withdraw\n     * from all the inputted strategies. Return value is >= minWithdrawalDelayBlocks as this is the global min withdrawal delay.\n     * @param strategies The strategies to check withdrawal delays for\n     */\n    function getWithdrawalDelay(IStrategy[] calldata strategies) external view returns (uint256);\n\n    /**\n     * @notice returns the total number of shares in `strategy` that are delegated to `operator`.\n     * @notice Mapping: operator => strategy => total number of shares in the strategy delegated to the operator.\n     * @dev By design, the following invariant should hold for each Strategy:\n     * (operator's shares in delegation manager) = sum (shares above zero of all stakers delegated to operator)\n     * = sum (delegateable shares of all stakers delegated to the operator)\n     */\n    function operatorShares(address operator, IStrategy strategy) external view returns (uint256);\n\n    /**\n     * @notice Returns 'true' if `staker` *is* actively delegated, and 'false' otherwise.\n     */\n    function isDelegated(address staker) external view returns (bool);\n\n    /**\n     * @notice Returns true is an operator has previously registered for delegation.\n     */\n    function isOperator(address operator) external view returns (bool);\n\n    /// @notice Mapping: staker => number of signed delegation nonces (used in `delegateToBySignature`) from the staker that the contract has already checked\n    function stakerNonce(address staker) external view returns (uint256);\n\n    /**\n     * @notice Mapping: delegationApprover => 32-byte salt => whether or not the salt has already been used by the delegationApprover.\n     * @dev Salts are used in the `delegateTo` and `delegateToBySignature` functions. Note that these functions only process the delegationApprover's\n     * signature + the provided salt if the operator being delegated to has specified a nonzero address as their `delegationApprover`.\n     */\n    function delegationApproverSaltIsSpent(address _delegationApprover, bytes32 salt) external view returns (bool);\n\n    /**\n     * @notice Minimum delay enforced by this contract for completing queued withdrawals. Measured in blocks, and adjustable by this contract's owner,\n     * up to a maximum of `MAX_WITHDRAWAL_DELAY_BLOCKS`. Minimum value is 0 (i.e. no delay enforced).\n     * Note that strategies each have a separate withdrawal delay, which can be greater than this value. So the minimum number of blocks that must pass\n     * to withdraw a strategy is MAX(minWithdrawalDelayBlocks, strategyWithdrawalDelayBlocks[strategy])\n     */\n    function minWithdrawalDelayBlocks() external view returns (uint256);\n\n    /**\n     * @notice Minimum delay enforced by this contract per Strategy for completing queued withdrawals. Measured in blocks, and adjustable by this contract's owner,\n     * up to a maximum of `MAX_WITHDRAWAL_DELAY_BLOCKS`. Minimum value is 0 (i.e. no delay enforced).\n     */\n    function strategyWithdrawalDelayBlocks(IStrategy strategy) external view returns (uint256);\n\n    /**\n     * @notice Calculates the digestHash for a `staker` to sign to delegate to an `operator`\n     * @param staker The signing staker\n     * @param operator The operator who is being delegated to\n     * @param expiry The desired expiry time of the staker's signature\n     */\n    function calculateCurrentStakerDelegationDigestHash(\n        address staker,\n        address operator,\n        uint256 expiry\n    ) external view returns (bytes32);\n\n    /**\n     * @notice Calculates the digest hash to be signed and used in the `delegateToBySignature` function\n     * @param staker The signing staker\n     * @param _stakerNonce The nonce of the staker. In practice we use the staker's current nonce, stored at `stakerNonce[staker]`\n     * @param operator The operator who is being delegated to\n     * @param expiry The desired expiry time of the staker's signature\n     */\n    function calculateStakerDelegationDigestHash(\n        address staker,\n        uint256 _stakerNonce,\n        address operator,\n        uint256 expiry\n    ) external view returns (bytes32);\n\n    /**\n     * @notice Calculates the digest hash to be signed by the operator's delegationApprove and used in the `delegateTo` and `delegateToBySignature` functions.\n     * @param staker The account delegating their stake\n     * @param operator The account receiving delegated stake\n     * @param _delegationApprover the operator's `delegationApprover` who will be signing the delegationHash (in general)\n     * @param approverSalt A unique and single use value associated with the approver signature.\n     * @param expiry Time after which the approver's signature becomes invalid\n     */\n    function calculateDelegationApprovalDigestHash(\n        address staker,\n        address operator,\n        address _delegationApprover,\n        bytes32 approverSalt,\n        uint256 expiry\n    ) external view returns (bytes32);\n\n    /// @notice The EIP-712 typehash for the contract's domain\n    function DOMAIN_TYPEHASH() external view returns (bytes32);\n\n    /// @notice The EIP-712 typehash for the StakerDelegation struct used by the contract\n    function STAKER_DELEGATION_TYPEHASH() external view returns (bytes32);\n\n    /// @notice The EIP-712 typehash for the DelegationApproval struct used by the contract\n    function DELEGATION_APPROVAL_TYPEHASH() external view returns (bytes32);\n\n    /**\n     * @notice Getter function for the current EIP-712 domain separator for this contract.\n     *\n     * @dev The domain separator will change in the event of a fork that changes the ChainID.\n     * @dev By introducing a domain separator the DApp developers are guaranteed that there can be no signature collision.\n     * for more detailed information please read EIP-712.\n     */\n    function domainSeparator() external view returns (bytes32);\n    \n    /// @notice Mapping: staker => cumulative number of queued withdrawals they have ever initiated.\n    /// @dev This only increments (doesn't decrement), and is used to help ensure that otherwise identical withdrawals have unique hashes.\n    function cumulativeWithdrawalsQueued(address staker) external view returns (uint256);\n\n    /// @notice Returns the keccak256 hash of `withdrawal`.\n    function calculateWithdrawalRoot(Withdrawal memory withdrawal) external pure returns (bytes32);\n\n    function migrateQueuedWithdrawals(IStrategyManager.DeprecatedStruct_QueuedWithdrawal[] memory withdrawalsToQueue) external;\n}\n"
      },
      "lib/eigenlayer-contracts/src/contracts/interfaces/ISlasher.sol": {
        "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.5.0;\n\nimport \"./IStrategyManager.sol\";\nimport \"./IDelegationManager.sol\";\n\n/**\n * @title Interface for the primary 'slashing' contract for EigenLayer.\n * @author Layr Labs, Inc.\n * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service\n * @notice See the `Slasher` contract itself for implementation details.\n */\ninterface ISlasher {\n    // struct used to store information about the current state of an operator's obligations to middlewares they are serving\n    struct MiddlewareTimes {\n        // The update block for the middleware whose most recent update was earliest, i.e. the 'stalest' update out of all middlewares the operator is serving\n        uint32 stalestUpdateBlock;\n        // The latest 'serveUntilBlock' from all of the middleware that the operator is serving\n        uint32 latestServeUntilBlock;\n    }\n\n    // struct used to store details relevant to a single middleware that an operator has opted-in to serving\n    struct MiddlewareDetails {\n        // the block at which the contract begins being able to finalize the operator's registration with the service via calling `recordFirstStakeUpdate`\n        uint32 registrationMayBeginAtBlock;\n        // the block before which the contract is allowed to slash the user\n        uint32 contractCanSlashOperatorUntilBlock;\n        // the block at which the middleware's view of the operator's stake was most recently updated\n        uint32 latestUpdateBlock;\n    }\n\n    /// @notice Emitted when a middleware times is added to `operator`'s array.\n    event MiddlewareTimesAdded(\n        address operator,\n        uint256 index,\n        uint32 stalestUpdateBlock,\n        uint32 latestServeUntilBlock\n    );\n\n    /// @notice Emitted when `operator` begins to allow `contractAddress` to slash them.\n    event OptedIntoSlashing(address indexed operator, address indexed contractAddress);\n\n    /// @notice Emitted when `contractAddress` signals that it will no longer be able to slash `operator` after the `contractCanSlashOperatorUntilBlock`.\n    event SlashingAbilityRevoked(\n        address indexed operator,\n        address indexed contractAddress,\n        uint32 contractCanSlashOperatorUntilBlock\n    );\n\n    /**\n     * @notice Emitted when `slashingContract` 'freezes' the `slashedOperator`.\n     * @dev The `slashingContract` must have permission to slash the `slashedOperator`, i.e. `canSlash(slasherOperator, slashingContract)` must return 'true'.\n     */\n    event OperatorFrozen(address indexed slashedOperator, address indexed slashingContract);\n\n    /// @notice Emitted when `previouslySlashedAddress` is 'unfrozen', allowing them to again move deposited funds within EigenLayer.\n    event FrozenStatusReset(address indexed previouslySlashedAddress);\n\n    /**\n     * @notice Gives the `contractAddress` permission to slash the funds of the caller.\n     * @dev Typically, this function must be called prior to registering for a middleware.\n     */\n    function optIntoSlashing(address contractAddress) external;\n\n    /**\n     * @notice Used for 'slashing' a certain operator.\n     * @param toBeFrozen The operator to be frozen.\n     * @dev Technically the operator is 'frozen' (hence the name of this function), and then subject to slashing pending a decision by a human-in-the-loop.\n     * @dev The operator must have previously given the caller (which should be a contract) the ability to slash them, through a call to `optIntoSlashing`.\n     */\n    function freezeOperator(address toBeFrozen) external;\n\n    /**\n     * @notice Removes the 'frozen' status from each of the `frozenAddresses`\n     * @dev Callable only by the contract owner (i.e. governance).\n     */\n    function resetFrozenStatus(address[] calldata frozenAddresses) external;\n\n    /**\n     * @notice this function is a called by middlewares during an operator's registration to make sure the operator's stake at registration\n     *         is slashable until serveUntil\n     * @param operator the operator whose stake update is being recorded\n     * @param serveUntilBlock the block until which the operator's stake at the current block is slashable\n     * @dev adds the middleware's slashing contract to the operator's linked list\n     */\n    function recordFirstStakeUpdate(address operator, uint32 serveUntilBlock) external;\n\n    /**\n     * @notice this function is a called by middlewares during a stake update for an operator (perhaps to free pending withdrawals)\n     *         to make sure the operator's stake at updateBlock is slashable until serveUntil\n     * @param operator the operator whose stake update is being recorded\n     * @param updateBlock the block for which the stake update is being recorded\n     * @param serveUntilBlock the block until which the operator's stake at updateBlock is slashable\n     * @param insertAfter the element of the operators linked list that the currently updating middleware should be inserted after\n     * @dev insertAfter should be calculated offchain before making the transaction that calls this. this is subject to race conditions,\n     *      but it is anticipated to be rare and not detrimental.\n     */\n    function recordStakeUpdate(\n        address operator,\n        uint32 updateBlock,\n        uint32 serveUntilBlock,\n        uint256 insertAfter\n    ) external;\n\n    /**\n     * @notice this function is a called by middlewares during an operator's deregistration to make sure the operator's stake at deregistration\n     *         is slashable until serveUntil\n     * @param operator the operator whose stake update is being recorded\n     * @param serveUntilBlock the block until which the operator's stake at the current block is slashable\n     * @dev removes the middleware's slashing contract to the operator's linked list and revokes the middleware's (i.e. caller's) ability to\n     * slash `operator` once `serveUntil` is reached\n     */\n    function recordLastStakeUpdateAndRevokeSlashingAbility(address operator, uint32 serveUntilBlock) external;\n\n    /// @notice The StrategyManager contract of EigenLayer\n    function strategyManager() external view returns (IStrategyManager);\n\n    /// @notice The DelegationManager contract of EigenLayer\n    function delegation() external view returns (IDelegationManager);\n\n    /**\n     * @notice Used to determine whether `staker` is actively 'frozen'. If a staker is frozen, then they are potentially subject to\n     * slashing of their funds, and cannot cannot deposit or withdraw from the strategyManager until the slashing process is completed\n     * and the staker's status is reset (to 'unfrozen').\n     * @param staker The staker of interest.\n     * @return Returns 'true' if `staker` themselves has their status set to frozen, OR if the staker is delegated\n     * to an operator who has their status set to frozen. Otherwise returns 'false'.\n     */\n    function isFrozen(address staker) external view returns (bool);\n\n    /// @notice Returns true if `slashingContract` is currently allowed to slash `toBeSlashed`.\n    function canSlash(address toBeSlashed, address slashingContract) external view returns (bool);\n\n    /// @notice Returns the block until which `serviceContract` is allowed to slash the `operator`.\n    function contractCanSlashOperatorUntilBlock(\n        address operator,\n        address serviceContract\n    ) external view returns (uint32);\n\n    /// @notice Returns the block at which the `serviceContract` last updated its view of the `operator`'s stake\n    function latestUpdateBlock(address operator, address serviceContract) external view returns (uint32);\n\n    /// @notice A search routine for finding the correct input value of `insertAfter` to `recordStakeUpdate` / `_updateMiddlewareList`.\n    function getCorrectValueForInsertAfter(address operator, uint32 updateBlock) external view returns (uint256);\n\n    /**\n     * @notice Returns 'true' if `operator` can currently complete a withdrawal started at the `withdrawalStartBlock`, with `middlewareTimesIndex` used\n     * to specify the index of a `MiddlewareTimes` struct in the operator's list (i.e. an index in `operatorToMiddlewareTimes[operator]`). The specified\n     * struct is consulted as proof of the `operator`'s ability (or lack thereof) to complete the withdrawal.\n     * This function will return 'false' if the operator cannot currently complete a withdrawal started at the `withdrawalStartBlock`, *or* in the event\n     * that an incorrect `middlewareTimesIndex` is supplied, even if one or more correct inputs exist.\n     * @param operator Either the operator who queued the withdrawal themselves, or if the withdrawing party is a staker who delegated to an operator,\n     * this address is the operator *who the staker was delegated to* at the time of the `withdrawalStartBlock`.\n     * @param withdrawalStartBlock The block number at which the withdrawal was initiated.\n     * @param middlewareTimesIndex Indicates an index in `operatorToMiddlewareTimes[operator]` to consult as proof of the `operator`'s ability to withdraw\n     * @dev The correct `middlewareTimesIndex` input should be computable off-chain.\n     */\n    function canWithdraw(\n        address operator,\n        uint32 withdrawalStartBlock,\n        uint256 middlewareTimesIndex\n    ) external returns (bool);\n\n    /**\n     * operator =>\n     *  [\n     *      (\n     *          the least recent update block of all of the middlewares it's serving/served,\n     *          latest time that the stake bonded at that update needed to serve until\n     *      )\n     *  ]\n     */\n    function operatorToMiddlewareTimes(\n        address operator,\n        uint256 arrayIndex\n    ) external view returns (MiddlewareTimes memory);\n\n    /// @notice Getter function for fetching `operatorToMiddlewareTimes[operator].length`\n    function middlewareTimesLength(address operator) external view returns (uint256);\n\n    /// @notice Getter function for fetching `operatorToMiddlewareTimes[operator][index].stalestUpdateBlock`.\n    function getMiddlewareTimesIndexStalestUpdateBlock(address operator, uint32 index) external view returns (uint32);\n\n    /// @notice Getter function for fetching `operatorToMiddlewareTimes[operator][index].latestServeUntil`.\n    function getMiddlewareTimesIndexServeUntilBlock(address operator, uint32 index) external view returns (uint32);\n\n    /// @notice Getter function for fetching `_operatorToWhitelistedContractsByUpdate[operator].size`.\n    function operatorWhitelistedContractsLinkedListSize(address operator) external view returns (uint256);\n\n    /// @notice Getter function for fetching a single node in the operator's linked list (`_operatorToWhitelistedContractsByUpdate[operator]`).\n    function operatorWhitelistedContractsLinkedListEntry(\n        address operator,\n        address node\n    ) external view returns (bool, uint256, uint256);\n}\n"
      },
      "src/interface/IRestakingOperator.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.8.0 <0.9.0;\n\nimport { IDelegationManager } from \"eigenlayer/interfaces/IDelegationManager.sol\";\nimport { ISlasher } from \"eigenlayer/interfaces/ISlasher.sol\";\nimport { IRegistryCoordinator, IBLSApkRegistry } from \"eigenlayer-middleware/interfaces/IRegistryCoordinator.sol\";\nimport { ISignatureUtils } from \"eigenlayer/interfaces/ISignatureUtils.sol\";\n\n/**\n * @title IRestakingOperator\n * @author Puffer Finance\n * @custom:security-contact security@puffer.fi\n */\ninterface IRestakingOperator {\n    /**\n     * @notice Returns the EigenLayer's DelegationManager\n     */\n    function EIGEN_DELEGATION_MANAGER() external view returns (IDelegationManager);\n\n    /**\n     * @notice Returns the EigenLayer's Slasher\n     */\n    function EIGEN_SLASHER() external view returns (ISlasher);\n\n    /**\n     * @notice Modify the operator details\n     * @param newOperatorDetails is the struct with new operator details\n     * @dev Restricted to the PufferModuleManager\n     */\n    function modifyOperatorDetails(IDelegationManager.OperatorDetails calldata newOperatorDetails) external;\n\n    /**\n     * @notice Opts the restaking operator into slashing by the slasher\n     * @param slasher is the address of the slasher contract to opt into\n     * @dev Restricted to the PufferModuleManager\n     */\n    function optIntoSlashing(address slasher) external;\n\n    /**\n     * @notice Updates the operator's metadata URI\n     * @param metadataURI is the URI of the operator's metadata\n     * @dev Restricted to the PufferModuleManager\n     */\n    function updateOperatorMetadataURI(string calldata metadataURI) external;\n\n    /**\n     * @notice Updates a signature proof by setting the signer address of the message hash\n     * @param digestHash is message hash\n     * @param signer is the signer address\n     * @dev Restricted to the PufferModuleManager\n     */\n    function updateSignatureProof(bytes32 digestHash, address signer) external;\n\n    /**\n     * @notice Registers msg.sender as an operator for one or more quorums. If any quorum exceeds its maximum\n     * operator capacity after the operator is registered, this method will fail.\n     * @param avsRegistryCoordinator the avs registry coordinator address\n     * @param quorumNumbers is an ordered byte array containing the quorum numbers being registered for\n     * @param socket is the socket of the operator (typically an IP address)\n     * @param params contains the G1 & G2 public keys of the operator, and a signature proving their ownership\n     * @param operatorSignature is the signature of the operator used by the AVS to register the operator in the delegation manager\n     * @dev `params` is ignored if the caller has previously registered a public key\n     * @dev `operatorSignature` is ignored if the operator's status is already REGISTERED\n     */\n    function registerOperatorToAVS(\n        address avsRegistryCoordinator,\n        bytes calldata quorumNumbers,\n        string calldata socket,\n        IBLSApkRegistry.PubkeyRegistrationParams calldata params,\n        ISignatureUtils.SignatureWithSaltAndExpiry calldata operatorSignature\n    ) external;\n\n    /**\n     * @notice Registers msg.sender as an operator for one or more quorums. If any quorum reaches its maximum operator\n     * capacity, `operatorKickParams` is used to replace an old operator with the new one.\n     * @param avsRegistryCoordinator the avs registry coordinator address\n     * @param quorumNumbers is an ordered byte array containing the quorum numbers being registered for\n     * @param params contains the G1 & G2 public keys of the operator, and a signature proving their ownership\n     * @param operatorKickParams used to determine which operator is removed to maintain quorum capacity as the\n     * operator registers for quorums\n     * @param churnApproverSignature is the signature of the churnApprover over the `operatorKickParams`\n     * @param operatorSignature is the signature of the operator used by the AVS to register the operator in the delegation manager\n     * @dev `params` is ignored if the caller has previously registered a public key\n     * @dev `operatorSignature` is ignored if the operator's status is already REGISTERED\n     */\n    function registerOperatorToAVSWithChurn(\n        address avsRegistryCoordinator,\n        bytes calldata quorumNumbers,\n        string calldata socket,\n        IBLSApkRegistry.PubkeyRegistrationParams calldata params,\n        IRegistryCoordinator.OperatorKickParam[] calldata operatorKickParams,\n        ISignatureUtils.SignatureWithSaltAndExpiry calldata churnApproverSignature,\n        ISignatureUtils.SignatureWithSaltAndExpiry calldata operatorSignature\n    ) external;\n\n    /**\n     * @notice Deregisters the caller from one or more quorums\n     * @param avsRegistryCoordinator the avs registry coordinator address\n     * @param quorumNumbers is an ordered byte array containing the quorum numbers being deregistered from\n     */\n    function deregisterOperatorFromAVS(address avsRegistryCoordinator, bytes calldata quorumNumbers) external;\n\n    /**\n     * @notice Updates the socket of the msg.sender given they are a registered operator\n     * @param avsRegistryCoordinator the avs registry coordinator address\n     * @param socket is the new socket of the operator\n     */\n    function updateOperatorAVSSocket(address avsRegistryCoordinator, string memory socket) external;\n}\n"
      },
      "src/Errors.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.8.0 <0.9.0;\n\n/**\n * @notice Thrown when the operation is not authorized\n * @dev Signature \"0x82b42900\"\n */\nerror Unauthorized();\n\n/**\n * @notice Thrown if the address supplied is not valid\n * @dev Signature \"0xe6c4247b\"\n */\nerror InvalidAddress();\n"
      },
      "src/interface/IPufferModuleManager.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.8.0 <0.9.0;\n\nimport { IPufferModule } from \"puffer/interface/IPufferModule.sol\";\nimport { IRestakingOperator } from \"puffer/interface/IRestakingOperator.sol\";\nimport { IDelegationManager } from \"eigenlayer/interfaces/IDelegationManager.sol\";\nimport { ISignatureUtils } from \"eigenlayer/interfaces/ISignatureUtils.sol\";\nimport { BeaconChainProofs } from \"eigenlayer/libraries/BeaconChainProofs.sol\";\nimport { IERC20 } from \"openzeppelin/token/ERC20/IERC20.sol\";\nimport { IRegistryCoordinator, IBLSApkRegistry } from \"eigenlayer-middleware/interfaces/IRegistryCoordinator.sol\";\n\n/**\n * @title IPufferModuleManager\n * @author Puffer Finance\n * @custom:security-contact security@puffer.fi\n */\ninterface IPufferModuleManager {\n    /**\n     * @notice Thrown if the module name is not allowed\n     */\n    error ForbiddenModuleName();\n\n    /**\n     * @notice Emitted when a Restaking Operator is opted into a slasher\n     * @param restakingOperator is the address of the restaking operator\n     * @param slasher is the address of the slasher contract\n     * @dev Signature \"0xfaf85fa92e9a913f582def722d9da998852ef6cd2fc7715266e3c3b16495c7ac\"\n     */\n    event RestakingOperatorOptedInSlasher(address indexed restakingOperator, address indexed slasher);\n\n    /**\n     * @notice Emitted when the Restaking Operator is created\n     * @param restakingOperator is the address of the restaking operator\n     * @param operatorDetails is the struct with new operator details\n     * @dev Signature \"0xbb6c366230e589c402e164f680d07db88a6c1d4dda4dd2dcbab5528c09a6b046\"\n     */\n    event RestakingOperatorCreated(\n        address indexed restakingOperator, IDelegationManager.OperatorDetails operatorDetails\n    );\n\n    /**\n     * @notice Emitted when the Restaking Operator is modified\n     * @param restakingOperator is the address of the restaking operator\n     * @param newOperatorDetails is the struct with new operator details\n     * @dev Signature \"0xee78237d6444cc6c9083c1ef31a82b0feac23fbdf0cf52d7b0ed66dfa5f7f9f2\"\n     */\n    event RestakingOperatorModified(\n        address indexed restakingOperator, IDelegationManager.OperatorDetails newOperatorDetails\n    );\n\n    /**\n     * @notice Emitted when the Withdrawals are queued\n     * @param moduleName is the name of the module\n     * @param shareAmount is the amount of shares\n     * @dev Signature \"0xfa1bd67700189b28b5a9085170838266813878ca3237b31a33358644a22a2f0e\"\n     */\n    event WithdrawalsQueued(bytes32 indexed moduleName, uint256 shareAmount, bytes32 withdrawalRoot);\n\n    /**\n     * @notice Emitted when the verify and process withdrawals is called\n     * @param moduleName is the name of the module\n     * @param withdrawalFields are the fields of the withdrawals being proven\n     * @param validatorFields are the fields of the validators being proven\n     * @dev Signature \"0x3f91dfbadd893521ffbbd43362750081af349f220002e6bfb4ffb3c00735f8ac\"\n     */\n    event VerifiedAndProcessedWithdrawals(\n        bytes32 indexed moduleName, bytes32[][] validatorFields, bytes32[][] withdrawalFields\n    );\n\n    /**\n     * @notice Emitted when the Restaking Operator is updated with a new metadata URI\n     * @param restakingOperator is the address of the restaking operator\n     * @param metadataURI is the new URI of the operator's metadata\n     * @dev Signature \"0x4cb1b839d29c7a6f051ae51c7b439f2f8f991de54a4b5906503a06a0892ba2c4\"\n     */\n    event RestakingOperatorMetadataURIUpdated(address indexed restakingOperator, string metadataURI);\n\n    /**\n     * @notice Emitted when the Puffer Module is delegated\n     * @param moduleName the module name to be delegated\n     * @param operator the operator to delegate to\n     * @dev Signature \"0xfa610363b3f4985bba03612919e946ac0bccf11c8e067255de41e530f8cc0997\"\n     */\n    event PufferModuleDelegated(bytes32 indexed moduleName, address operator);\n\n    /**\n     * @notice Emitted when the Puffer Module is undelegated\n     * @param moduleName the module name to be undelegated\n     * @dev Signature \"0x4651591b511cac27601595cefbb19b2f0a04ec7b9348230f44a1309b9d70a8c9\"\n     */\n    event PufferModuleUndelegated(bytes32 indexed moduleName);\n\n    /**\n     * @notice Emitted when the restaking operator avs signature proof is updated\n     * @param restakingOperator is the address of the restaking operator\n     * @param digestHash is the message hash\n     * @param signer is the address of the signature signer\n     * @dev Signature \"0x3a6a179c72e503b78f992c3aa1a8d451c366c446c086cee5a811a3d03445a62f\"\n     */\n    event AVSRegistrationSignatureProofUpdated(address indexed restakingOperator, bytes32 digestHash, address signer);\n\n    /**\n     * @notice Emitted when a Node Operator verifies withdrawal credentials\n     * @param moduleName is the name of the module\n     * @param validatorIndices is the indices of the validators\n     * @dev Signature \"0x6722c9fd02a30e38d993af1ef931e54d0c24d0eae5eba68982773ce120b8ddee\"\n     */\n    event ValidatorCredentialsVerified(bytes32 indexed moduleName, uint40[] validatorIndices);\n\n    /**\n     * @notice Emitted when ETH is withdrawn from EigenPod to a PufferModule\n     * @param moduleName is the name of the module\n     * @param amountToWithdraw is the amount of ETH to withdrawn\n     * @dev Signature \"0xcc72a3059fae624886e4da6e0b98e575d8cb4f7ea47e3986b5b60182621b7e22\"\n     */\n    event NonBeaconChainETHBalanceWithdrawn(bytes32 indexed moduleName, uint256 amountToWithdraw);\n\n    /**\n     * @notice Emitted when the withdrawals are completed\n     * @param moduleName is the name of the module\n     * @param sharesWithdrawn is the shares withdrawn\n     * @dev Signature \"0x46ca5934f7ca805e7fbdc05e90e3ecbea495c41e35ba48e24f053c0c3d25af1e\"\n     */\n    event CompletedQueuedWithdrawals(bytes32 indexed moduleName, uint256 sharesWithdrawn);\n\n    /**\n     * @notice Emitted when the Restaking Operator is registered to an AVS\n     * @param restakingOperator is the address of the restaking operator\n     * @param avsRegistryCoordinator the avs registry coordinator address\n     * @param quorumNumbers is an ordered byte array containing the quorum numbers being registered for\n     * @param socket is the socket of the operator (typically an IP address)\n     * @dev Signature \"0x4651591b511cac27601595cefbb19b2f0a04ec7b9348230f44a1309b9d70a8c9\"\n     */\n    event RestakingOperatorRegisteredToAVS(\n        IRestakingOperator restakingOperator, address avsRegistryCoordinator, bytes quorumNumbers, string socket\n    );\n\n    /**\n     * @notice Emitted when the Restaking Operator is registered to an AVS\n     * @param restakingOperator is the address of the restaking operator\n     * @param avsRegistryCoordinator the avs registry coordinator address\n     * @param quorumNumbers is an ordered byte array containing the quorum numbers being registered for\n     * @param socket is the socket of the operator (typically an IP address)\n     * @param operatorKickParams used to determine which operator is removed to maintain quorum capacity as the\n     * operator registers for quorums\n     * @dev Signature \"0x4651591b511cac27601595cefbb19b2f0a04ec7b9348230f44a1309b9d70a8c9\"\n     */\n    event RestakingOperatorRegisteredToAVSWithChurn(\n        IRestakingOperator restakingOperator,\n        address avsRegistryCoordinator,\n        bytes quorumNumbers,\n        string socket,\n        IRegistryCoordinator.OperatorKickParam[] operatorKickParams\n    );\n\n    /**\n     * @notice Emitted when the Restaking Operator is deregistered from an AVS\n     * @param restakingOperator is the address of the restaking operator\n     * @param avsRegistryCoordinator the avs registry coordinator address\n     * @param quorumNumbers is an ordered byte array containing the quorum numbers being deregistered from\n     * @dev Signature \"0x4651591b511cac27601595cefbb19b2f0a04ec7b9348230f44a1309b9d70a8c9\"\n     */\n    event RestakingOperatorDeregisteredFromAVS(\n        IRestakingOperator restakingOperator, address avsRegistryCoordinator, bytes quorumNumbers\n    );\n\n    /**\n     * @notice Emitted when the Restaking Operator AVS Socket is updated\n     * @param restakingOperator is the address of the restaking operator\n     * @param avsRegistryCoordinator the avs registry coordinator address\n     * @param socket is the new socket of the operator\n     * @dev Signature \"0x4651591b511cac27601595cefbb19b2f0a04ec7b9348230f44a1309b9d70a8c9\"\n     */\n    event RestakingOperatorAVSSocketUpdated(\n        IRestakingOperator restakingOperator, address avsRegistryCoordinator, string socket\n    );\n\n    /**\n     * @notice Returns the Puffer Module beacon address\n     */\n    function PUFFER_MODULE_BEACON() external view returns (address);\n\n    /**\n     * @notice Returns the Restaking Operator beacon address\n     */\n    function RESTAKING_OPERATOR_BEACON() external view returns (address);\n\n    /**\n     * @notice Returns the Puffer Protocol address\n     */\n    function PUFFER_PROTOCOL() external view returns (address);\n\n    /**\n     * @notice Create a new Restaking Operator\n     * @param metadataURI is a URI for the operator's metadata, i.e. a link providing more details on the operator.\n     *\n     * @param delegationApprover Address to verify signatures when a staker wishes to delegate to the operator, as well as controlling \"forced undelegations\".\n     *\n     * @dev See IDelegationManager(EigenLayer) for more details about the other parameters\n     * @dev Signature verification follows these rules:\n     * 1) If this address is left as address(0), then any staker will be free to delegate to the operator, i.e. no signature verification will be performed.\n     * 2) If this address is an EOA (i.e. it has no code), then we follow standard ECDSA signature verification for delegations to the operator.\n     * 3) If this address is a contract (i.e. it has code) then we forward a call to the contract and verify that it returns the correct EIP-1271 \"magic value\".\n     * @return module The newly created Puffer module\n     */\n    function createNewRestakingOperator(\n        string memory metadataURI,\n        address delegationApprover,\n        uint32 stakerOptOutWindowBlocks\n    ) external returns (IRestakingOperator module);\n\n    /**\n     * @notice Create a new Puffer module\n     * @dev This function creates a new Puffer module with the given module name\n     * @param moduleName The name of the module\n     * @return module The newly created Puffer module\n     */\n    function createNewPufferModule(bytes32 moduleName) external returns (IPufferModule module);\n\n    /**\n     * @notice Calls the modifyOperatorDetails function on the restaking operator\n     * @param restakingOperator is the address of the restaking operator\n     * @dev See IDelegationManager(EigenLayer) for more details about the other parameters\n     * @dev Restricted to the DAO\n     */\n    function callModifyOperatorDetails(\n        IRestakingOperator restakingOperator,\n        IDelegationManager.OperatorDetails calldata newOperatorDetails\n    ) external;\n\n    /**\n     * @notice Calls the verifyAndProcessWithdrawals function from the PufferModule `moduleName` with the given parameters\n     * @dev See IEigenPod(EigenLayer) for more details about the other parameters\n     */\n    function callVerifyAndProcessWithdrawals(\n        bytes32 moduleName,\n        uint64 oracleTimestamp,\n        BeaconChainProofs.StateRootProof calldata stateRootProof,\n        BeaconChainProofs.WithdrawalProof[] calldata withdrawalProofs,\n        bytes[] calldata validatorFieldsProofs,\n        bytes32[][] calldata validatorFields,\n        bytes32[][] calldata withdrawalFields\n    ) external;\n\n    /**\n     * @notice Calls `queueWithdrawals` from the PufferModule `moduleName`\n     * @param moduleName is the name of the module\n     * @param sharesAmount is the amount of shares to withdraw\n     */\n    function callQueueWithdrawals(bytes32 moduleName, uint256 sharesAmount) external;\n\n    /**\n     * @notice Calls `completeQueuedWithdrawals` from the PufferModule `moduleName`\n     * @dev See IDelegationManager(EigenLayer) for more details about the other parameters\n     */\n    function callCompleteQueuedWithdrawals(\n        bytes32 moduleName,\n        IDelegationManager.Withdrawal[] calldata withdrawals,\n        IERC20[][] calldata tokens,\n        uint256[] calldata middlewareTimesIndexes,\n        bool[] calldata receiveAsTokens\n    ) external;\n\n    /**\n     * @notice Calls `verifyWithdrawalCredentials` from the PufferModule `moduleName` with the given parameters\n     * @dev See IEigenPod(EigenLayer) for more details about the other parameters\n     */\n    function callVerifyWithdrawalCredentials(\n        bytes32 moduleName,\n        uint64 oracleTimestamp,\n        BeaconChainProofs.StateRootProof calldata stateRootProof,\n        uint40[] calldata validatorIndices,\n        bytes[] calldata validatorFieldsProofs,\n        bytes32[][] calldata validatorFields\n    ) external;\n\n    /**\n     * @notice Withdraws ETH from EigenPod to `moduleName`\n     * @param amountToWithdraw is the amount of ETH to withdraw\n     */\n    function callWithdrawNonBeaconChainETHBalanceWei(bytes32 moduleName, uint256 amountToWithdraw) external;\n\n    /**\n     * @notice Calls the optIntoSlashing function on the restaking operator\n     * @param restakingOperator is the address of the restaking operator\n     * @param slasher is the address of the slasher contract to opt into\n     * @dev Restricted to the DAO\n     */\n    function callOptIntoSlashing(IRestakingOperator restakingOperator, address slasher) external;\n\n    /**\n     * @notice Calls the updateOperatorMetadataURI function on the restaking operator\n     * @param restakingOperator is the address of the restaking operator\n     * @param metadataURI is the URI of the operator's metadata\n     * @dev Restricted to the DAO\n     */\n    function callUpdateMetadataURI(IRestakingOperator restakingOperator, string calldata metadataURI) external;\n\n    /**\n     * @notice Calls the callDelegateTo function on the target module\n     * @param moduleName is the name of the module\n     * @param operator is the address of the restaking operator\n     * @param approverSignatureAndExpiry the signature of the delegation approver\n     * @param approverSalt salt for the signature\n     * @dev Restricted to the DAO\n     */\n    function callDelegateTo(\n        bytes32 moduleName,\n        address operator,\n        ISignatureUtils.SignatureWithExpiry calldata approverSignatureAndExpiry,\n        bytes32 approverSalt\n    ) external;\n\n    /**\n     * @notice Calls the callUndelegate function on the target module\n     * @param moduleName is the name of the module\n     * @dev Restricted to the DAO\n     */\n    function callUndelegate(bytes32 moduleName) external returns (bytes32[] memory withdrawalRoot);\n\n    /**\n     * @notice Updates AVS registration signature proof\n     * @param restakingOperator is the address of the restaking operator\n     * @param digestHash is the message hash\n     * @param signer is the address of the signature signer\n     * @dev Restricted to the DAO\n     */\n    function updateAVSRegistrationSignatureProof(\n        IRestakingOperator restakingOperator,\n        bytes32 digestHash,\n        address signer\n    ) external;\n\n    /**\n     * @notice Registers msg.sender as an operator for one or more quorums. If any quorum exceeds its maximum\n     * operator capacity after the operator is registered, this method will fail.\n     * @param restakingOperator is the address of the restaking operator\n     * @param avsRegistryCoordinator the avs registry coordinator address\n     * @param quorumNumbers is an ordered byte array containing the quorum numbers being registered for\n     * @param socket is the socket of the operator (typically an IP address)\n     * @param params contains the G1 & G2 public keys of the operator, and a signature proving their ownership\n     * @param operatorSignature is the signature of the operator used by the AVS to register the operator in the delegation manager\n     * @dev Restricted to the DAO\n     */\n    function callRegisterOperatorToAVS(\n        IRestakingOperator restakingOperator,\n        address avsRegistryCoordinator,\n        bytes calldata quorumNumbers,\n        string calldata socket,\n        IBLSApkRegistry.PubkeyRegistrationParams calldata params,\n        ISignatureUtils.SignatureWithSaltAndExpiry calldata operatorSignature\n    ) external;\n\n    /**\n     * @notice Registers msg.sender as an operator for one or more quorums. If any quorum reaches its maximum operator\n     * capacity, `operatorKickParams` is used to replace an old operator with the new one.\n     * @param restakingOperator is the address of the restaking operator\n     * @param avsRegistryCoordinator the avs registry coordinator address\n     * @param quorumNumbers is an ordered byte array containing the quorum numbers being registered for\n     * @param socket is the socket of the operator (typically an IP address)\n     * @param params contains the G1 & G2 public keys of the operator, and a signature proving their ownership\n     * @param operatorKickParams used to determine which operator is removed to maintain quorum capacity as the\n     * operator registers for quorums\n     * @param churnApproverSignature is the signature of the churnApprover over the `operatorKickParams`\n     * @param operatorSignature is the signature of the operator used by the AVS to register the operator in the delegation manager\n     * @dev Restricted to the DAO\n     */\n    function callRegisterOperatorToAVSWithChurn(\n        IRestakingOperator restakingOperator,\n        address avsRegistryCoordinator,\n        bytes calldata quorumNumbers,\n        string calldata socket,\n        IBLSApkRegistry.PubkeyRegistrationParams calldata params,\n        IRegistryCoordinator.OperatorKickParam[] calldata operatorKickParams,\n        ISignatureUtils.SignatureWithSaltAndExpiry calldata churnApproverSignature,\n        ISignatureUtils.SignatureWithSaltAndExpiry calldata operatorSignature\n    ) external;\n\n    /**\n     * @notice Deregisters the caller from one or more quorums\n     * @param restakingOperator is the address of the restaking operator\n     * @param avsRegistryCoordinator the avs registry coordinator address\n     * @param quorumNumbers is an ordered byte array containing the quorum numbers being deregistered from\n     * @dev Restricted to the DAO\n     */\n    function callDeregisterOperatorFromAVS(\n        IRestakingOperator restakingOperator,\n        address avsRegistryCoordinator,\n        bytes calldata quorumNumbers\n    ) external;\n\n    /**\n     * @notice Updates the socket of the msg.sender given they are a registered operator\n     * @param restakingOperator is the address of the restaking operator\n     * @param avsRegistryCoordinator the avs registry coordinator address\n     * @param socket is the new socket of the operator\n     * @dev Restricted to the DAO\n     */\n    function callUpdateOperatorAVSSocket(\n        IRestakingOperator restakingOperator,\n        address avsRegistryCoordinator,\n        string memory socket\n    ) external;\n}\n"
      },
      "lib/openzeppelin-contracts/contracts/interfaces/IERC1271.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1271.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC1271 standard signature validation method for\n * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].\n */\ninterface IERC1271 {\n    /**\n     * @dev Should return whether the signature provided is valid for the provided data\n     * @param hash      Hash of the data to be signed\n     * @param signature Signature byte array associated with _data\n     */\n    function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);\n}\n"
      },
      "lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSA {\n    enum RecoverError {\n        NoError,\n        InvalidSignature,\n        InvalidSignatureLength,\n        InvalidSignatureS\n    }\n\n    /**\n     * @dev The signature derives the `address(0)`.\n     */\n    error ECDSAInvalidSignature();\n\n    /**\n     * @dev The signature has an invalid length.\n     */\n    error ECDSAInvalidSignatureLength(uint256 length);\n\n    /**\n     * @dev The signature has an S value that is in the upper half order.\n     */\n    error ECDSAInvalidSignatureS(bytes32 s);\n\n    /**\n     * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\n     * return address(0) without also returning an error description. Errors are documented using an enum (error type)\n     * and a bytes32 providing additional information about the error.\n     *\n     * If no error is returned, then the address can be used for verification purposes.\n     *\n     * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:\n     * this function rejects them by requiring the `s` value to be in the lower\n     * half order, and the `v` value to be either 27 or 28.\n     *\n     * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n     * verification to be secure: it is possible to craft signatures that\n     * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n     * this is by receiving a hash of the original message (which may otherwise\n     * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.\n     *\n     * Documentation for signature generation:\n     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n     */\n    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError, bytes32) {\n        if (signature.length == 65) {\n            bytes32 r;\n            bytes32 s;\n            uint8 v;\n            // ecrecover takes the signature parameters, and the only way to get them\n            // currently is to use assembly.\n            /// @solidity memory-safe-assembly\n            assembly {\n                r := mload(add(signature, 0x20))\n                s := mload(add(signature, 0x40))\n                v := byte(0, mload(add(signature, 0x60)))\n            }\n            return tryRecover(hash, v, r, s);\n        } else {\n            return (address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length));\n        }\n    }\n\n    /**\n     * @dev Returns the address that signed a hashed message (`hash`) with\n     * `signature`. This address can then be used for verification purposes.\n     *\n     * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:\n     * this function rejects them by requiring the `s` value to be in the lower\n     * half order, and the `v` value to be either 27 or 28.\n     *\n     * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n     * verification to be secure: it is possible to craft signatures that\n     * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n     * this is by receiving a hash of the original message (which may otherwise\n     * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.\n     */\n    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\n        _throwError(error, errorArg);\n        return recovered;\n    }\n\n    /**\n     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n     *\n     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\n     */\n    function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError, bytes32) {\n        unchecked {\n            bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n            // We do not check for an overflow here since the shift operation results in 0 or 1.\n            uint8 v = uint8((uint256(vs) >> 255) + 27);\n            return tryRecover(hash, v, r, s);\n        }\n    }\n\n    /**\n     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n     */\n    function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\n        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\n        _throwError(error, errorArg);\n        return recovered;\n    }\n\n    /**\n     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n     * `r` and `s` signature fields separately.\n     */\n    function tryRecover(\n        bytes32 hash,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) internal pure returns (address, RecoverError, bytes32) {\n        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n        // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n        //\n        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n        // these malleable signatures as well.\n        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n            return (address(0), RecoverError.InvalidSignatureS, s);\n        }\n\n        // If the signature is valid (and not malleable), return the signer address\n        address signer = ecrecover(hash, v, r, s);\n        if (signer == address(0)) {\n            return (address(0), RecoverError.InvalidSignature, bytes32(0));\n        }\n\n        return (signer, RecoverError.NoError, bytes32(0));\n    }\n\n    /**\n     * @dev Overload of {ECDSA-recover} that receives the `v`,\n     * `r` and `s` signature fields separately.\n     */\n    function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {\n        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, v, r, s);\n        _throwError(error, errorArg);\n        return recovered;\n    }\n\n    /**\n     * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\n     */\n    function _throwError(RecoverError error, bytes32 errorArg) private pure {\n        if (error == RecoverError.NoError) {\n            return; // no error: do nothing\n        } else if (error == RecoverError.InvalidSignature) {\n            revert ECDSAInvalidSignature();\n        } else if (error == RecoverError.InvalidSignatureLength) {\n            revert ECDSAInvalidSignatureLength(uint256(errorArg));\n        } else if (error == RecoverError.InvalidSignatureS) {\n            revert ECDSAInvalidSignatureS(errorArg);\n        }\n    }\n}\n"
      },
      "lib/eigenlayer-middleware/src/interfaces/IRegistryCoordinator.sol": {
        "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity ^0.8.12;\n\nimport {IBLSApkRegistry} from \"./IBLSApkRegistry.sol\";\nimport {IStakeRegistry} from \"./IStakeRegistry.sol\";\nimport {IIndexRegistry} from \"./IIndexRegistry.sol\";\nimport {BN254} from \"../libraries/BN254.sol\";\n\n/**\n * @title Interface for a contract that coordinates between various registries for an AVS.\n * @author Layr Labs, Inc.\n */\ninterface IRegistryCoordinator {\n    // EVENTS\n\n    /// Emits when an operator is registered\n    event OperatorRegistered(address indexed operator, bytes32 indexed operatorId);\n\n    /// Emits when an operator is deregistered\n    event OperatorDeregistered(address indexed operator, bytes32 indexed operatorId);\n\n    event OperatorSetParamsUpdated(uint8 indexed quorumNumber, OperatorSetParam operatorSetParams);\n\n    event ChurnApproverUpdated(address prevChurnApprover, address newChurnApprover);\n\n    event EjectorUpdated(address prevEjector, address newEjector);\n\n    /// @notice emitted when all the operators for a quorum are updated at once\n    event QuorumBlockNumberUpdated(uint8 indexed quorumNumber, uint256 blocknumber);\n\n    // DATA STRUCTURES\n    enum OperatorStatus\n    {\n        // default is NEVER_REGISTERED\n        NEVER_REGISTERED,\n        REGISTERED,\n        DEREGISTERED\n    }\n\n    // STRUCTS\n\n    /**\n     * @notice Data structure for storing info on operators\n     */\n    struct OperatorInfo {\n        // the id of the operator, which is likely the keccak256 hash of the operator's public key if using BLSRegistry\n        bytes32 operatorId;\n        // indicates whether the operator is actively registered for serving the middleware or not\n        OperatorStatus status;\n    }\n\n    /**\n     * @notice Data structure for storing info on quorum bitmap updates where the `quorumBitmap` is the bitmap of the \n     * quorums the operator is registered for starting at (inclusive)`updateBlockNumber` and ending at (exclusive) `nextUpdateBlockNumber`\n     * @dev nextUpdateBlockNumber is initialized to 0 for the latest update\n     */\n    struct QuorumBitmapUpdate {\n        uint32 updateBlockNumber;\n        uint32 nextUpdateBlockNumber;\n        uint192 quorumBitmap;\n    }\n\n    /**\n     * @notice Data structure for storing operator set params for a given quorum. Specifically the \n     * `maxOperatorCount` is the maximum number of operators that can be registered for the quorum,\n     * `kickBIPsOfOperatorStake` is the basis points of a new operator needs to have of an operator they are trying to kick from the quorum,\n     * and `kickBIPsOfTotalStake` is the basis points of the total stake of the quorum that an operator needs to be below to be kicked.\n     */ \n     struct OperatorSetParam {\n        uint32 maxOperatorCount;\n        uint16 kickBIPsOfOperatorStake;\n        uint16 kickBIPsOfTotalStake;\n    }\n\n    /**\n     * @notice Data structure for the parameters needed to kick an operator from a quorum with number `quorumNumber`, used during registration churn.\n     * `operator` is the address of the operator to kick\n     */\n    struct OperatorKickParam {\n        uint8 quorumNumber;\n        address operator;\n    }\n\n    /// @notice Returns the operator set params for the given `quorumNumber`\n    function getOperatorSetParams(uint8 quorumNumber) external view returns (OperatorSetParam memory);\n    /// @notice the Stake registry contract that will keep track of operators' stakes\n    function stakeRegistry() external view returns (IStakeRegistry);\n    /// @notice the BLS Aggregate Pubkey Registry contract that will keep track of operators' BLS aggregate pubkeys per quorum\n    function blsApkRegistry() external view returns (IBLSApkRegistry);\n    /// @notice the index Registry contract that will keep track of operators' indexes\n    function indexRegistry() external view returns (IIndexRegistry);\n\n    /**\n     * @notice Ejects the provided operator from the provided quorums from the AVS\n     * @param operator is the operator to eject\n     * @param quorumNumbers are the quorum numbers to eject the operator from\n     */\n    function ejectOperator(\n        address operator, \n        bytes calldata quorumNumbers\n    ) external;\n\n    /// @notice Returns the number of quorums the registry coordinator has created\n    function quorumCount() external view returns (uint8);\n\n    /// @notice Returns the operator struct for the given `operator`\n    function getOperator(address operator) external view returns (OperatorInfo memory);\n\n    /// @notice Returns the operatorId for the given `operator`\n    function getOperatorId(address operator) external view returns (bytes32);\n\n    /// @notice Returns the operator address for the given `operatorId`\n    function getOperatorFromId(bytes32 operatorId) external view returns (address operator);\n\n    /// @notice Returns the status for the given `operator`\n    function getOperatorStatus(address operator) external view returns (IRegistryCoordinator.OperatorStatus);\n\n    /// @notice Returns the indices of the quorumBitmaps for the provided `operatorIds` at the given `blockNumber`\n    function getQuorumBitmapIndicesAtBlockNumber(uint32 blockNumber, bytes32[] memory operatorIds) external view returns (uint32[] memory);\n\n    /**\n     * @notice Returns the quorum bitmap for the given `operatorId` at the given `blockNumber` via the `index`\n     * @dev reverts if `index` is incorrect \n     */ \n    function getQuorumBitmapAtBlockNumberByIndex(bytes32 operatorId, uint32 blockNumber, uint256 index) external view returns (uint192);\n\n    /// @notice Returns the `index`th entry in the operator with `operatorId`'s bitmap history\n    function getQuorumBitmapUpdateByIndex(bytes32 operatorId, uint256 index) external view returns (QuorumBitmapUpdate memory);\n\n    /// @notice Returns the current quorum bitmap for the given `operatorId`\n    function getCurrentQuorumBitmap(bytes32 operatorId) external view returns (uint192);\n\n    /// @notice Returns the length of the quorum bitmap history for the given `operatorId`\n    function getQuorumBitmapHistoryLength(bytes32 operatorId) external view returns (uint256);\n\n    /// @notice Returns the registry at the desired index\n    function registries(uint256) external view returns (address);\n\n    /// @notice Returns the number of registries\n    function numRegistries() external view returns (uint256);\n\n    /**\n     * @notice Returns the message hash that an operator must sign to register their BLS public key.\n     * @param operator is the address of the operator registering their BLS public key\n     */\n    function pubkeyRegistrationMessageHash(address operator) external view returns (BN254.G1Point memory);\n\n    /// @notice returns the blocknumber the quorum was last updated all at once for all operators\n    function quorumUpdateBlockNumber(uint8 quorumNumber) external view returns (uint256);\n\n    /// @notice The owner of the registry coordinator\n    function owner() external view returns (address);\n}\n"
      },
      "src/interface/IRegistryCoordinatorExtended.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.8.0 <0.9.0;\n\nimport { IRegistryCoordinator, IBLSApkRegistry } from \"eigenlayer-middleware/interfaces/IRegistryCoordinator.sol\";\nimport { ISignatureUtils } from \"eigenlayer/interfaces/ISignatureUtils.sol\";\n\ninterface IRegistryCoordinatorExtended is IRegistryCoordinator {\n    /**\n     * @notice Registers msg.sender as an operator for one or more quorums. If any quorum exceeds its maximum\n     * operator capacity after the operator is registered, this method will fail.\n     * @param quorumNumbers is an ordered byte array containing the quorum numbers being registered for\n     * @param socket is the socket of the operator (typically an IP address)\n     * @param params contains the G1 & G2 public keys of the operator, and a signature proving their ownership\n     * @param operatorSignature is the signature of the operator used by the AVS to register the operator in the delegation manager\n     * @dev `params` is ignored if the caller has previously registered a public key\n     * @dev `operatorSignature` is ignored if the operator's status is already REGISTERED\n     */\n    function registerOperator(\n        bytes calldata quorumNumbers,\n        string calldata socket,\n        IBLSApkRegistry.PubkeyRegistrationParams calldata params,\n        ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature\n    ) external;\n\n    /**\n     * @notice Registers msg.sender as an operator for one or more quorums. If any quorum reaches its maximum operator\n     * capacity, `operatorKickParams` is used to replace an old operator with the new one.\n     * @param quorumNumbers is an ordered byte array containing the quorum numbers being registered for\n     * @param params contains the G1 & G2 public keys of the operator, and a signature proving their ownership\n     * @param operatorKickParams used to determine which operator is removed to maintain quorum capacity as the\n     * operator registers for quorums\n     * @param churnApproverSignature is the signature of the churnApprover over the `operatorKickParams`\n     * @param operatorSignature is the signature of the operator used by the AVS to register the operator in the delegation manager\n     * @dev `params` is ignored if the caller has previously registered a public key\n     * @dev `operatorSignature` is ignored if the operator's status is already REGISTERED\n     */\n    function registerOperatorWithChurn(\n        bytes calldata quorumNumbers,\n        string calldata socket,\n        IBLSApkRegistry.PubkeyRegistrationParams calldata params,\n        IRegistryCoordinator.OperatorKickParam[] calldata operatorKickParams,\n        ISignatureUtils.SignatureWithSaltAndExpiry memory churnApproverSignature,\n        ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature\n    ) external;\n\n    /**\n     * @notice Deregisters the caller from one or more quorums\n     * @param quorumNumbers is an ordered byte array containing the quorum numbers being deregistered from\n     */\n    function deregisterOperator(bytes calldata quorumNumbers) external;\n\n    /**\n     * @notice Updates the socket of the msg.sender given they are a registered operator\n     * @param socket is the new socket of the operator\n     */\n    function updateSocket(string memory socket) external;\n}\n"
      },
      "lib/eigenlayer-contracts/src/contracts/interfaces/ISignatureUtils.sol": {
        "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.5.0;\n\n/**\n * @title The interface for common signature utilities.\n * @author Layr Labs, Inc.\n * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service\n */\ninterface ISignatureUtils {\n    // @notice Struct that bundles together a signature and an expiration time for the signature. Used primarily for stack management.\n    struct SignatureWithExpiry {\n        // the signature itself, formatted as a single bytes object\n        bytes signature;\n        // the expiration timestamp (UTC) of the signature\n        uint256 expiry;\n    }\n\n    // @notice Struct that bundles together a signature, a salt for uniqueness, and an expiration time for the signature. Used primarily for stack management.\n    struct SignatureWithSaltAndExpiry {\n        // the signature itself, formatted as a single bytes object\n        bytes signature;\n        // the salt used to generate the signature\n        bytes32 salt;\n        // the expiration timestamp (UTC) of the signature\n        uint256 expiry;\n    }\n}"
      },
      "lib/openzeppelin-contracts/contracts/access/manager/IAuthority.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/manager/IAuthority.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard interface for permissioning originally defined in Dappsys.\n */\ninterface IAuthority {\n    /**\n     * @dev Returns true if the caller can invoke on a target the function identified by a function selector.\n     */\n    function canCall(address caller, address target, bytes4 selector) external view returns (bool allowed);\n}\n"
      },
      "lib/openzeppelin-contracts/contracts/access/manager/AuthorityUtils.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/manager/AuthorityUtils.sol)\n\npragma solidity ^0.8.20;\n\nimport {IAuthority} from \"./IAuthority.sol\";\n\nlibrary AuthorityUtils {\n    /**\n     * @dev Since `AccessManager` implements an extended IAuthority interface, invoking `canCall` with backwards compatibility\n     * for the preexisting `IAuthority` interface requires special care to avoid reverting on insufficient return data.\n     * This helper function takes care of invoking `canCall` in a backwards compatible way without reverting.\n     */\n    function canCallWithDelay(\n        address authority,\n        address caller,\n        address target,\n        bytes4 selector\n    ) internal view returns (bool immediate, uint32 delay) {\n        (bool success, bytes memory data) = authority.staticcall(\n            abi.encodeCall(IAuthority.canCall, (caller, target, selector))\n        );\n        if (success) {\n            if (data.length >= 0x40) {\n                (immediate, delay) = abi.decode(data, (bool, uint32));\n            } else if (data.length >= 0x20) {\n                immediate = abi.decode(data, (bool));\n            }\n        }\n        return (immediate, delay);\n    }\n}\n"
      },
      "lib/openzeppelin-contracts/contracts/access/manager/IAccessManager.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/manager/IAccessManager.sol)\n\npragma solidity ^0.8.20;\n\nimport {IAccessManaged} from \"./IAccessManaged.sol\";\nimport {Time} from \"../../utils/types/Time.sol\";\n\ninterface IAccessManager {\n    /**\n     * @dev A delayed operation was scheduled.\n     */\n    event OperationScheduled(\n        bytes32 indexed operationId,\n        uint32 indexed nonce,\n        uint48 schedule,\n        address caller,\n        address target,\n        bytes data\n    );\n\n    /**\n     * @dev A scheduled operation was executed.\n     */\n    event OperationExecuted(bytes32 indexed operationId, uint32 indexed nonce);\n\n    /**\n     * @dev A scheduled operation was canceled.\n     */\n    event OperationCanceled(bytes32 indexed operationId, uint32 indexed nonce);\n\n    /**\n     * @dev Informational labelling for a roleId.\n     */\n    event RoleLabel(uint64 indexed roleId, string label);\n\n    /**\n     * @dev Emitted when `account` is granted `roleId`.\n     *\n     * NOTE: The meaning of the `since` argument depends on the `newMember` argument.\n     * If the role is granted to a new member, the `since` argument indicates when the account becomes a member of the role,\n     * otherwise it indicates the execution delay for this account and roleId is updated.\n     */\n    event RoleGranted(uint64 indexed roleId, address indexed account, uint32 delay, uint48 since, bool newMember);\n\n    /**\n     * @dev Emitted when `account` membership or `roleId` is revoked. Unlike granting, revoking is instantaneous.\n     */\n    event RoleRevoked(uint64 indexed roleId, address indexed account);\n\n    /**\n     * @dev Role acting as admin over a given `roleId` is updated.\n     */\n    event RoleAdminChanged(uint64 indexed roleId, uint64 indexed admin);\n\n    /**\n     * @dev Role acting as guardian over a given `roleId` is updated.\n     */\n    event RoleGuardianChanged(uint64 indexed roleId, uint64 indexed guardian);\n\n    /**\n     * @dev Grant delay for a given `roleId` will be updated to `delay` when `since` is reached.\n     */\n    event RoleGrantDelayChanged(uint64 indexed roleId, uint32 delay, uint48 since);\n\n    /**\n     * @dev Target mode is updated (true = closed, false = open).\n     */\n    event TargetClosed(address indexed target, bool closed);\n\n    /**\n     * @dev Role required to invoke `selector` on `target` is updated to `roleId`.\n     */\n    event TargetFunctionRoleUpdated(address indexed target, bytes4 selector, uint64 indexed roleId);\n\n    /**\n     * @dev Admin delay for a given `target` will be updated to `delay` when `since` is reached.\n     */\n    event TargetAdminDelayUpdated(address indexed target, uint32 delay, uint48 since);\n\n    error AccessManagerAlreadyScheduled(bytes32 operationId);\n    error AccessManagerNotScheduled(bytes32 operationId);\n    error AccessManagerNotReady(bytes32 operationId);\n    error AccessManagerExpired(bytes32 operationId);\n    error AccessManagerLockedAccount(address account);\n    error AccessManagerLockedRole(uint64 roleId);\n    error AccessManagerBadConfirmation();\n    error AccessManagerUnauthorizedAccount(address msgsender, uint64 roleId);\n    error AccessManagerUnauthorizedCall(address caller, address target, bytes4 selector);\n    error AccessManagerUnauthorizedConsume(address target);\n    error AccessManagerUnauthorizedCancel(address msgsender, address caller, address target, bytes4 selector);\n    error AccessManagerInvalidInitialAdmin(address initialAdmin);\n\n    /**\n     * @dev Check if an address (`caller`) is authorised to call a given function on a given contract directly (with\n     * no restriction). Additionally, it returns the delay needed to perform the call indirectly through the {schedule}\n     * & {execute} workflow.\n     *\n     * This function is usually called by the targeted contract to control immediate execution of restricted functions.\n     * Therefore we only return true if the call can be performed without any delay. If the call is subject to a\n     * previously set delay (not zero), then the function should return false and the caller should schedule the operation\n     * for future execution.\n     *\n     * If `immediate` is true, the delay can be disregarded and the operation can be immediately executed, otherwise\n     * the operation can be executed if and only if delay is greater than 0.\n     *\n     * NOTE: The IAuthority interface does not include the `uint32` delay. This is an extension of that interface that\n     * is backward compatible. Some contracts may thus ignore the second return argument. In that case they will fail\n     * to identify the indirect workflow, and will consider calls that require a delay to be forbidden.\n     *\n     * NOTE: This function does not report the permissions of this manager itself. These are defined by the\n     * {_canCallSelf} function instead.\n     */\n    function canCall(\n        address caller,\n        address target,\n        bytes4 selector\n    ) external view returns (bool allowed, uint32 delay);\n\n    /**\n     * @dev Expiration delay for scheduled proposals. Defaults to 1 week.\n     *\n     * IMPORTANT: Avoid overriding the expiration with 0. Otherwise every contract proposal will be expired immediately,\n     * disabling any scheduling usage.\n     */\n    function expiration() external view returns (uint32);\n\n    /**\n     * @dev Minimum setback for all delay updates, with the exception of execution delays. It\n     * can be increased without setback (and reset via {revokeRole} in the case event of an\n     * accidental increase). Defaults to 5 days.\n     */\n    function minSetback() external view returns (uint32);\n\n    /**\n     * @dev Get whether the contract is closed disabling any access. Otherwise role permissions are applied.\n     */\n    function isTargetClosed(address target) external view returns (bool);\n\n    /**\n     * @dev Get the role required to call a function.\n     */\n    function getTargetFunctionRole(address target, bytes4 selector) external view returns (uint64);\n\n    /**\n     * @dev Get the admin delay for a target contract. Changes to contract configuration are subject to this delay.\n     */\n    function getTargetAdminDelay(address target) external view returns (uint32);\n\n    /**\n     * @dev Get the id of the role that acts as an admin for the given role.\n     *\n     * The admin permission is required to grant the role, revoke the role and update the execution delay to execute\n     * an operation that is restricted to this role.\n     */\n    function getRoleAdmin(uint64 roleId) external view returns (uint64);\n\n    /**\n     * @dev Get the role that acts as a guardian for a given role.\n     *\n     * The guardian permission allows canceling operations that have been scheduled under the role.\n     */\n    function getRoleGuardian(uint64 roleId) external view returns (uint64);\n\n    /**\n     * @dev Get the role current grant delay.\n     *\n     * Its value may change at any point without an event emitted following a call to {setGrantDelay}.\n     * Changes to this value, including effect timepoint are notified in advance by the {RoleGrantDelayChanged} event.\n     */\n    function getRoleGrantDelay(uint64 roleId) external view returns (uint32);\n\n    /**\n     * @dev Get the access details for a given account for a given role. These details include the timepoint at which\n     * membership becomes active, and the delay applied to all operation by this user that requires this permission\n     * level.\n     *\n     * Returns:\n     * [0] Timestamp at which the account membership becomes valid. 0 means role is not granted.\n     * [1] Current execution delay for the account.\n     * [2] Pending execution delay for the account.\n     * [3] Timestamp at which the pending execution delay will become active. 0 means no delay update is scheduled.\n     */\n    function getAccess(uint64 roleId, address account) external view returns (uint48, uint32, uint32, uint48);\n\n    /**\n     * @dev Check if a given account currently has the permission level corresponding to a given role. Note that this\n     * permission might be associated with an execution delay. {getAccess} can provide more details.\n     */\n    function hasRole(uint64 roleId, address account) external view returns (bool, uint32);\n\n    /**\n     * @dev Give a label to a role, for improved role discoverability by UIs.\n     *\n     * Requirements:\n     *\n     * - the caller must be a global admin\n     *\n     * Emits a {RoleLabel} event.\n     */\n    function labelRole(uint64 roleId, string calldata label) external;\n\n    /**\n     * @dev Add `account` to `roleId`, or change its execution delay.\n     *\n     * This gives the account the authorization to call any function that is restricted to this role. An optional\n     * execution delay (in seconds) can be set. If that delay is non 0, the user is required to schedule any operation\n     * that is restricted to members of this role. The user will only be able to execute the operation after the delay has\n     * passed, before it has expired. During this period, admin and guardians can cancel the operation (see {cancel}).\n     *\n     * If the account has already been granted this role, the execution delay will be updated. This update is not\n     * immediate and follows the delay rules. For example, if a user currently has a delay of 3 hours, and this is\n     * called to reduce that delay to 1 hour, the new delay will take some time to take effect, enforcing that any\n     * operation executed in the 3 hours that follows this update was indeed scheduled before this update.\n     *\n     * Requirements:\n     *\n     * - the caller must be an admin for the role (see {getRoleAdmin})\n     * - granted role must not be the `PUBLIC_ROLE`\n     *\n     * Emits a {RoleGranted} event.\n     */\n    function grantRole(uint64 roleId, address account, uint32 executionDelay) external;\n\n    /**\n     * @dev Remove an account from a role, with immediate effect. If the account does not have the role, this call has\n     * no effect.\n     *\n     * Requirements:\n     *\n     * - the caller must be an admin for the role (see {getRoleAdmin})\n     * - revoked role must not be the `PUBLIC_ROLE`\n     *\n     * Emits a {RoleRevoked} event if the account had the role.\n     */\n    function revokeRole(uint64 roleId, address account) external;\n\n    /**\n     * @dev Renounce role permissions for the calling account with immediate effect. If the sender is not in\n     * the role this call has no effect.\n     *\n     * Requirements:\n     *\n     * - the caller must be `callerConfirmation`.\n     *\n     * Emits a {RoleRevoked} event if the account had the role.\n     */\n    function renounceRole(uint64 roleId, address callerConfirmation) external;\n\n    /**\n     * @dev Change admin role for a given role.\n     *\n     * Requirements:\n     *\n     * - the caller must be a global admin\n     *\n     * Emits a {RoleAdminChanged} event\n     */\n    function setRoleAdmin(uint64 roleId, uint64 admin) external;\n\n    /**\n     * @dev Change guardian role for a given role.\n     *\n     * Requirements:\n     *\n     * - the caller must be a global admin\n     *\n     * Emits a {RoleGuardianChanged} event\n     */\n    function setRoleGuardian(uint64 roleId, uint64 guardian) external;\n\n    /**\n     * @dev Update the delay for granting a `roleId`.\n     *\n     * Requirements:\n     *\n     * - the caller must be a global admin\n     *\n     * Emits a {RoleGrantDelayChanged} event.\n     */\n    function setGrantDelay(uint64 roleId, uint32 newDelay) external;\n\n    /**\n     * @dev Set the role required to call functions identified by the `selectors` in the `target` contract.\n     *\n     * Requirements:\n     *\n     * - the caller must be a global admin\n     *\n     * Emits a {TargetFunctionRoleUpdated} event per selector.\n     */\n    function setTargetFunctionRole(address target, bytes4[] calldata selectors, uint64 roleId) external;\n\n    /**\n     * @dev Set the delay for changing the configuration of a given target contract.\n     *\n     * Requirements:\n     *\n     * - the caller must be a global admin\n     *\n     * Emits a {TargetAdminDelayUpdated} event.\n     */\n    function setTargetAdminDelay(address target, uint32 newDelay) external;\n\n    /**\n     * @dev Set the closed flag for a contract.\n     *\n     * Requirements:\n     *\n     * - the caller must be a global admin\n     *\n     * Emits a {TargetClosed} event.\n     */\n    function setTargetClosed(address target, bool closed) external;\n\n    /**\n     * @dev Return the timepoint at which a scheduled operation will be ready for execution. This returns 0 if the\n     * operation is not yet scheduled, has expired, was executed, or was canceled.\n     */\n    function getSchedule(bytes32 id) external view returns (uint48);\n\n    /**\n     * @dev Return the nonce for the latest scheduled operation with a given id. Returns 0 if the operation has never\n     * been scheduled.\n     */\n    function getNonce(bytes32 id) external view returns (uint32);\n\n    /**\n     * @dev Schedule a delayed operation for future execution, and return the operation identifier. It is possible to\n     * choose the timestamp at which the operation becomes executable as long as it satisfies the execution delays\n     * required for the caller. The special value zero will automatically set the earliest possible time.\n     *\n     * Returns the `operationId` that was scheduled. Since this value is a hash of the parameters, it can reoccur when\n     * the same parameters are used; if this is relevant, the returned `nonce` can be used to uniquely identify this\n     * scheduled operation from other occurrences of the same `operationId` in invocations of {execute} and {cancel}.\n     *\n     * Emits a {OperationScheduled} event.\n     *\n     * NOTE: It is not possible to concurrently schedule more than one operation with the same `target` and `data`. If\n     * this is necessary, a random byte can be appended to `data` to act as a salt that will be ignored by the target\n     * contract if it is using standard Solidity ABI encoding.\n     */\n    function schedule(address target, bytes calldata data, uint48 when) external returns (bytes32, uint32);\n\n    /**\n     * @dev Execute a function that is delay restricted, provided it was properly scheduled beforehand, or the\n     * execution delay is 0.\n     *\n     * Returns the nonce that identifies the previously scheduled operation that is executed, or 0 if the\n     * operation wasn't previously scheduled (if the caller doesn't have an execution delay).\n     *\n     * Emits an {OperationExecuted} event only if the call was scheduled and delayed.\n     */\n    function execute(address target, bytes calldata data) external payable returns (uint32);\n\n    /**\n     * @dev Cancel a scheduled (delayed) operation. Returns the nonce that identifies the previously scheduled\n     * operation that is cancelled.\n     *\n     * Requirements:\n     *\n     * - the caller must be the proposer, a guardian of the targeted function, or a global admin\n     *\n     * Emits a {OperationCanceled} event.\n     */\n    function cancel(address caller, address target, bytes calldata data) external returns (uint32);\n\n    /**\n     * @dev Consume a scheduled operation targeting the caller. If such an operation exists, mark it as consumed\n     * (emit an {OperationExecuted} event and clean the state). Otherwise, throw an error.\n     *\n     * This is useful for contract that want to enforce that calls targeting them were scheduled on the manager,\n     * with all the verifications that it implies.\n     *\n     * Emit a {OperationExecuted} event.\n     */\n    function consumeScheduledOp(address caller, bytes calldata data) external;\n\n    /**\n     * @dev Hashing function for delayed operations.\n     */\n    function hashOperation(address caller, address target, bytes calldata data) external view returns (bytes32);\n\n    /**\n     * @dev Changes the authority of a target managed by this manager instance.\n     *\n     * Requirements:\n     *\n     * - the caller must be a global admin\n     */\n    function updateAuthority(address target, address newAuthority) external;\n}\n"
      },
      "lib/openzeppelin-contracts/contracts/access/manager/IAccessManaged.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/manager/IAccessManaged.sol)\n\npragma solidity ^0.8.20;\n\ninterface IAccessManaged {\n    /**\n     * @dev Authority that manages this contract was updated.\n     */\n    event AuthorityUpdated(address authority);\n\n    error AccessManagedUnauthorized(address caller);\n    error AccessManagedRequiredDelay(address caller, uint32 delay);\n    error AccessManagedInvalidAuthority(address authority);\n\n    /**\n     * @dev Returns the current authority.\n     */\n    function authority() external view returns (address);\n\n    /**\n     * @dev Transfers control to a new authority. The caller must be the current authority.\n     */\n    function setAuthority(address) external;\n\n    /**\n     * @dev Returns true only in the context of a delayed restricted call, at the moment that the scheduled operation is\n     * being consumed. Prevents denial of service for delayed restricted calls in the case that the contract performs\n     * attacker controlled calls.\n     */\n    function isConsumingScheduledOp() external view returns (bytes4);\n}\n"
      },
      "lib/openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (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"
      },
      "lib/eigenlayer-contracts/src/contracts/interfaces/IStrategy.sol": {
        "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.5.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\n/**\n * @title Minimal interface for an `Strategy` contract.\n * @author Layr Labs, Inc.\n * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service\n * @notice Custom `Strategy` implementations may expand extensively on this interface.\n */\ninterface IStrategy {\n    /**\n     * @notice Used to deposit tokens into this Strategy\n     * @param token is the ERC20 token being deposited\n     * @param amount is the amount of token being deposited\n     * @dev This function is only callable by the strategyManager contract. It is invoked inside of the strategyManager's\n     * `depositIntoStrategy` function, and individual share balances are recorded in the strategyManager as well.\n     * @return newShares is the number of new shares issued at the current exchange ratio.\n     */\n    function deposit(IERC20 token, uint256 amount) external returns (uint256);\n\n    /**\n     * @notice Used to withdraw tokens from this Strategy, to the `recipient`'s address\n     * @param recipient is the address to receive the withdrawn funds\n     * @param token is the ERC20 token being transferred out\n     * @param amountShares is the amount of shares being withdrawn\n     * @dev This function is only callable by the strategyManager contract. It is invoked inside of the strategyManager's\n     * other functions, and individual share balances are recorded in the strategyManager as well.\n     */\n    function withdraw(address recipient, IERC20 token, uint256 amountShares) external;\n\n    /**\n     * @notice Used to convert a number of shares to the equivalent amount of underlying tokens for this strategy.\n     * @notice In contrast to `sharesToUnderlyingView`, this function **may** make state modifications\n     * @param amountShares is the amount of shares to calculate its conversion into the underlying token\n     * @return The amount of underlying tokens corresponding to the input `amountShares`\n     * @dev Implementation for these functions in particular may vary significantly for different strategies\n     */\n    function sharesToUnderlying(uint256 amountShares) external returns (uint256);\n\n    /**\n     * @notice Used to convert an amount of underlying tokens to the equivalent amount of shares in this strategy.\n     * @notice In contrast to `underlyingToSharesView`, this function **may** make state modifications\n     * @param amountUnderlying is the amount of `underlyingToken` to calculate its conversion into strategy shares\n     * @return The amount of underlying tokens corresponding to the input `amountShares`\n     * @dev Implementation for these functions in particular may vary significantly for different strategies\n     */\n    function underlyingToShares(uint256 amountUnderlying) external returns (uint256);\n\n    /**\n     * @notice convenience function for fetching the current underlying value of all of the `user`'s shares in\n     * this strategy. In contrast to `userUnderlyingView`, this function **may** make state modifications\n     */\n    function userUnderlying(address user) external returns (uint256);\n\n    /**\n     * @notice convenience function for fetching the current total shares of `user` in this strategy, by\n     * querying the `strategyManager` contract\n     */\n    function shares(address user) external view returns (uint256);\n\n    /**\n     * @notice Used to convert a number of shares to the equivalent amount of underlying tokens for this strategy.\n     * @notice In contrast to `sharesToUnderlying`, this function guarantees no state modifications\n     * @param amountShares is the amount of shares to calculate its conversion into the underlying token\n     * @return The amount of shares corresponding to the input `amountUnderlying`\n     * @dev Implementation for these functions in particular may vary significantly for different strategies\n     */\n    function sharesToUnderlyingView(uint256 amountShares) external view returns (uint256);\n\n    /**\n     * @notice Used to convert an amount of underlying tokens to the equivalent amount of shares in this strategy.\n     * @notice In contrast to `underlyingToShares`, this function guarantees no state modifications\n     * @param amountUnderlying is the amount of `underlyingToken` to calculate its conversion into strategy shares\n     * @return The amount of shares corresponding to the input `amountUnderlying`\n     * @dev Implementation for these functions in particular may vary significantly for different strategies\n     */\n    function underlyingToSharesView(uint256 amountUnderlying) external view returns (uint256);\n\n    /**\n     * @notice convenience function for fetching the current underlying value of all of the `user`'s shares in\n     * this strategy. In contrast to `userUnderlying`, this function guarantees no state modifications\n     */\n    function userUnderlyingView(address user) external view returns (uint256);\n\n    /// @notice The underlying token for shares in this Strategy\n    function underlyingToken() external view returns (IERC20);\n\n    /// @notice The total number of extant shares in this Strategy\n    function totalShares() external view returns (uint256);\n\n    /// @notice Returns either a brief string explaining the strategy's goal & purpose, or a link to metadata that explains in more detail.\n    function explanation() external view returns (string memory);\n}\n"
      },
      "lib/eigenlayer-contracts/src/contracts/interfaces/IStrategyManager.sol": {
        "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.5.0;\n\nimport \"./IStrategy.sol\";\nimport \"./ISlasher.sol\";\nimport \"./IDelegationManager.sol\";\nimport \"./IEigenPodManager.sol\";\n\n/**\n * @title Interface for the primary entrypoint for funds into EigenLayer.\n * @author Layr Labs, Inc.\n * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service\n * @notice See the `StrategyManager` contract itself for implementation details.\n */\ninterface IStrategyManager {\n    /**\n     * @notice Emitted when a new deposit occurs on behalf of `staker`.\n     * @param staker Is the staker who is depositing funds into EigenLayer.\n     * @param strategy Is the strategy that `staker` has deposited into.\n     * @param token Is the token that `staker` deposited.\n     * @param shares Is the number of new shares `staker` has been granted in `strategy`.\n     */\n    event Deposit(address staker, IERC20 token, IStrategy strategy, uint256 shares);\n\n    /// @notice Emitted when `thirdPartyTransfersForbidden` is updated for a strategy and value by the owner\n    event UpdatedThirdPartyTransfersForbidden(IStrategy strategy, bool value);\n\n    /// @notice Emitted when the `strategyWhitelister` is changed\n    event StrategyWhitelisterChanged(address previousAddress, address newAddress);\n\n    /// @notice Emitted when a strategy is added to the approved list of strategies for deposit\n    event StrategyAddedToDepositWhitelist(IStrategy strategy);\n\n    /// @notice Emitted when a strategy is removed from the approved list of strategies for deposit\n    event StrategyRemovedFromDepositWhitelist(IStrategy strategy);\n\n    /**\n     * @notice Deposits `amount` of `token` into the specified `strategy`, with the resultant shares credited to `msg.sender`\n     * @param strategy is the specified strategy where deposit is to be made,\n     * @param token is the denomination in which the deposit is to be made,\n     * @param amount is the amount of token to be deposited in the strategy by the staker\n     * @return shares The amount of new shares in the `strategy` created as part of the action.\n     * @dev The `msg.sender` must have previously approved this contract to transfer at least `amount` of `token` on their behalf.\n     * @dev Cannot be called by an address that is 'frozen' (this function will revert if the `msg.sender` is frozen).\n     *\n     * WARNING: Depositing tokens that allow reentrancy (eg. ERC-777) into a strategy is not recommended.  This can lead to attack vectors\n     *          where the token balance and corresponding strategy shares are not in sync upon reentrancy.\n     */\n    function depositIntoStrategy(IStrategy strategy, IERC20 token, uint256 amount) external returns (uint256 shares);\n\n    /**\n     * @notice Used for depositing an asset into the specified strategy with the resultant shares credited to `staker`,\n     * who must sign off on the action.\n     * Note that the assets are transferred out/from the `msg.sender`, not from the `staker`; this function is explicitly designed\n     * purely to help one address deposit 'for' another.\n     * @param strategy is the specified strategy where deposit is to be made,\n     * @param token is the denomination in which the deposit is to be made,\n     * @param amount is the amount of token to be deposited in the strategy by the staker\n     * @param staker the staker that the deposited assets will be credited to\n     * @param expiry the timestamp at which the signature expires\n     * @param signature is a valid signature from the `staker`. either an ECDSA signature if the `staker` is an EOA, or data to forward\n     * following EIP-1271 if the `staker` is a contract\n     * @return shares The amount of new shares in the `strategy` created as part of the action.\n     * @dev The `msg.sender` must have previously approved this contract to transfer at least `amount` of `token` on their behalf.\n     * @dev A signature is required for this function to eliminate the possibility of griefing attacks, specifically those\n     * targeting stakers who may be attempting to undelegate.\n     * @dev Cannot be called if thirdPartyTransfersForbidden is set to true for this strategy\n     *\n     *  WARNING: Depositing tokens that allow reentrancy (eg. ERC-777) into a strategy is not recommended.  This can lead to attack vectors\n     *          where the token balance and corresponding strategy shares are not in sync upon reentrancy\n     */\n    function depositIntoStrategyWithSignature(\n        IStrategy strategy,\n        IERC20 token,\n        uint256 amount,\n        address staker,\n        uint256 expiry,\n        bytes memory signature\n    ) external returns (uint256 shares);\n\n    /// @notice Used by the DelegationManager to remove a Staker's shares from a particular strategy when entering the withdrawal queue\n    function removeShares(address staker, IStrategy strategy, uint256 shares) external;\n\n    /// @notice Used by the DelegationManager to award a Staker some shares that have passed through the withdrawal queue\n    function addShares(address staker, IERC20 token, IStrategy strategy, uint256 shares) external;\n    \n    /// @notice Used by the DelegationManager to convert withdrawn shares to tokens and send them to a recipient\n    function withdrawSharesAsTokens(address recipient, IStrategy strategy, uint256 shares, IERC20 token) external;\n\n    /// @notice Returns the current shares of `user` in `strategy`\n    function stakerStrategyShares(address user, IStrategy strategy) external view returns (uint256 shares);\n\n    /**\n     * @notice Get all details on the staker's deposits and corresponding shares\n     * @return (staker's strategies, shares in these strategies)\n     */\n    function getDeposits(address staker) external view returns (IStrategy[] memory, uint256[] memory);\n\n    /// @notice Simple getter function that returns `stakerStrategyList[staker].length`.\n    function stakerStrategyListLength(address staker) external view returns (uint256);\n\n    /**\n     * @notice Owner-only function that adds the provided Strategies to the 'whitelist' of strategies that stakers can deposit into\n     * @param strategiesToWhitelist Strategies that will be added to the `strategyIsWhitelistedForDeposit` mapping (if they aren't in it already)\n     * @param thirdPartyTransfersForbiddenValues bool values to set `thirdPartyTransfersForbidden` to for each strategy\n     */\n    function addStrategiesToDepositWhitelist(\n        IStrategy[] calldata strategiesToWhitelist,\n        bool[] calldata thirdPartyTransfersForbiddenValues\n    ) external;\n\n    /**\n     * @notice Owner-only function that removes the provided Strategies from the 'whitelist' of strategies that stakers can deposit into\n     * @param strategiesToRemoveFromWhitelist Strategies that will be removed to the `strategyIsWhitelistedForDeposit` mapping (if they are in it)\n     */\n    function removeStrategiesFromDepositWhitelist(IStrategy[] calldata strategiesToRemoveFromWhitelist) external;\n\n    /// @notice Returns the single, central Delegation contract of EigenLayer\n    function delegation() external view returns (IDelegationManager);\n\n    /// @notice Returns the single, central Slasher contract of EigenLayer\n    function slasher() external view returns (ISlasher);\n\n    /// @notice Returns the EigenPodManager contract of EigenLayer\n    function eigenPodManager() external view returns (IEigenPodManager);\n\n    /// @notice Returns the address of the `strategyWhitelister`\n    function strategyWhitelister() external view returns (address);\n\n    /**\n     * @notice Returns bool for whether or not `strategy` enables credit transfers. i.e enabling\n     * depositIntoStrategyWithSignature calls or queueing withdrawals to a different address than the staker.\n     */\n    function thirdPartyTransfersForbidden(IStrategy strategy) external view returns (bool);\n\n// LIMITED BACKWARDS-COMPATIBILITY FOR DEPRECATED FUNCTIONALITY\n    // packed struct for queued withdrawals; helps deal with stack-too-deep errors\n    struct DeprecatedStruct_WithdrawerAndNonce {\n        address withdrawer;\n        uint96 nonce;\n    }\n\n    /**\n     * Struct type used to specify an existing queued withdrawal. Rather than storing the entire struct, only a hash is stored.\n     * In functions that operate on existing queued withdrawals -- e.g. `startQueuedWithdrawalWaitingPeriod` or `completeQueuedWithdrawal`,\n     * the data is resubmitted and the hash of the submitted data is computed by `calculateWithdrawalRoot` and checked against the\n     * stored hash in order to confirm the integrity of the submitted data.\n     */\n    struct DeprecatedStruct_QueuedWithdrawal {\n        IStrategy[] strategies;\n        uint256[] shares;\n        address staker;\n        DeprecatedStruct_WithdrawerAndNonce withdrawerAndNonce;\n        uint32 withdrawalStartBlock;\n        address delegatedAddress;\n    }\n\n    function migrateQueuedWithdrawal(DeprecatedStruct_QueuedWithdrawal memory queuedWithdrawal) external returns (bool, bytes32);\n\n    function calculateWithdrawalRoot(DeprecatedStruct_QueuedWithdrawal memory queuedWithdrawal) external pure returns (bytes32);\n}\n"
      },
      "src/interface/IPufferModule.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.8.0 <0.9.0;\n\nimport { ISignatureUtils } from \"eigenlayer/interfaces/ISignatureUtils.sol\";\nimport { BeaconChainProofs } from \"eigenlayer/libraries/BeaconChainProofs.sol\";\nimport { IDelegationManager } from \"eigenlayer/interfaces/IDelegationManager.sol\";\nimport { IERC20 } from \"openzeppelin/token/ERC20/IERC20.sol\";\n\n/**\n * @title IPufferModule\n * @author Puffer Finance\n * @custom:security-contact security@puffer.fi\n */\ninterface IPufferModule {\n    /**\n     * @notice Thrown if the rewards are already claimed for a `blockNumber`\n     * @dev Signature \"0xa9214540\"\n     */\n    error AlreadyClaimed(uint256 blockNumber, address node);\n\n    /**\n     * @notice Thrown if guardians try to post root for an invalid block number\n     * @dev Signature \"0x9f4aafbe\"\n     */\n    error InvalidBlockNumber(uint256 blockNumber);\n\n    /**\n     * @notice Thrown if the there is nothing to be claimed for the provided information\n     * @dev Signature \"0x64ab3466\"\n     */\n    error NothingToClaim(address node);\n\n    /**\n     * @notice Emitted when the rewards MerkleRoot `root` for a `blockNumber` is posted\n     */\n    event RewardsRootPosted(uint256 indexed blockNumber, bytes32 root);\n\n    /**\n     * @notice Emits when rewards are claimed\n     * @param node is the node address\n     * @param amount is the amount claimed in wei\n     */\n    event RewardsClaimed(address indexed node, uint256 amount);\n\n    /**\n     * @notice Returns the Withdrawal credentials for that module\n     */\n    function getWithdrawalCredentials() external view returns (bytes memory);\n\n    /**\n     * @notice Returns the module name\n     */\n    function NAME() external view returns (bytes32);\n\n    /**\n     * @notice Starts the validator\n     */\n    function callStake(bytes calldata pubKey, bytes calldata signature, bytes32 depositDataRoot) external payable;\n\n    /**\n     * @notice Calls the delegateTo function on the EigenLayer delegation manager\n     * @param operator is the address of the restaking operator\n     * @param approverSignatureAndExpiry the signature of the delegation approver\n     * @param approverSalt salt for the signature\n     * @dev Restricted to the DAO\n     */\n    function callDelegateTo(\n        address operator,\n        ISignatureUtils.SignatureWithExpiry calldata approverSignatureAndExpiry,\n        bytes32 approverSalt\n    ) external;\n\n    /**\n     * @notice Calls the undelegate function on the EigenLayer delegation manager\n     * @dev Restricted to the DAO\n     */\n    function callUndelegate() external returns (bytes32[] memory withdrawalRoot);\n\n    /**\n     * @notice Returns the EigenPod address owned by the module\n     */\n    function getEigenPod() external view returns (address);\n\n    /**\n     * @notice Queues the withdrawal from EigenLayer for the Beacon Chain strategy\n     * @dev Restricted to PufferModuleManager\n     */\n    function queueWithdrawals(uint256 shareAmount) external returns (bytes32[] memory);\n\n    /**\n     * @notice Verifies and processes the withdrawals\n     */\n    function verifyAndProcessWithdrawals(\n        uint64 oracleTimestamp,\n        BeaconChainProofs.StateRootProof calldata stateRootProof,\n        BeaconChainProofs.WithdrawalProof[] calldata withdrawalProofs,\n        bytes[] calldata validatorFieldsProofs,\n        bytes32[][] calldata validatorFields,\n        bytes32[][] calldata withdrawalFields\n    ) external;\n\n    /**\n     * @notice Verifies the withdrawal credentials\n     */\n    function verifyWithdrawalCredentials(\n        uint64 oracleTimestamp,\n        BeaconChainProofs.StateRootProof calldata stateRootProof,\n        uint40[] calldata validatorIndices,\n        bytes[] calldata validatorFieldsProofs,\n        bytes32[][] calldata validatorFields\n    ) external;\n\n    /**\n     * @notice Completes the queued withdrawals\n     */\n    function completeQueuedWithdrawals(\n        IDelegationManager.Withdrawal[] calldata withdrawals,\n        IERC20[][] calldata tokens,\n        uint256[] calldata middlewareTimesIndexes,\n        bool[] calldata receiveAsTokens\n    ) external;\n\n    /**\n     * @notice Withdraws the non beacon chain ETH balance\n     */\n    function withdrawNonBeaconChainETHBalanceWei(uint256 amountToWithdraw) external;\n\n    /**\n     * @notice Function callable only by PufferProtocol\n     * @param to is the destination address\n     * @param amount is the ETH amount in wei\n     * @param data is the calldata\n     */\n    function call(address to, uint256 amount, bytes calldata data)\n        external\n        returns (bool success, bytes memory response);\n}\n"
      },
      "lib/eigenlayer-contracts/src/contracts/libraries/BeaconChainProofs.sol": {
        "content": "// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity ^0.8.0;\n\nimport \"./Merkle.sol\";\nimport \"../libraries/Endian.sol\";\n\n//Utility library for parsing and PHASE0 beacon chain block headers\n//SSZ Spec: https://github.com/ethereum/consensus-specs/blob/dev/ssz/simple-serialize.md#merkleization\n//BeaconBlockHeader Spec: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#beaconblockheader\n//BeaconState Spec: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#beaconstate\nlibrary BeaconChainProofs {\n    // constants are the number of fields and the heights of the different merkle trees used in merkleizing beacon chain containers\n    uint256 internal constant BEACON_BLOCK_HEADER_FIELD_TREE_HEIGHT = 3;\n\n    uint256 internal constant BEACON_BLOCK_BODY_FIELD_TREE_HEIGHT = 4;\n\n    uint256 internal constant BEACON_STATE_FIELD_TREE_HEIGHT = 5;\n\n    uint256 internal constant VALIDATOR_FIELD_TREE_HEIGHT = 3;\n\n    //Note: changed in the deneb hard fork from 4->5\n    uint256 internal constant EXECUTION_PAYLOAD_HEADER_FIELD_TREE_HEIGHT_DENEB = 5;\n    uint256 internal constant EXECUTION_PAYLOAD_HEADER_FIELD_TREE_HEIGHT_CAPELLA = 4;\n\n    // SLOTS_PER_HISTORICAL_ROOT = 2**13, so tree height is 13\n    uint256 internal constant BLOCK_ROOTS_TREE_HEIGHT = 13;\n\n    //HISTORICAL_ROOTS_LIMIT = 2**24, so tree height is 24\n    uint256 internal constant HISTORICAL_SUMMARIES_TREE_HEIGHT = 24;\n\n    //Index of block_summary_root in historical_summary container\n    uint256 internal constant BLOCK_SUMMARY_ROOT_INDEX = 0;\n\n    // tree height for hash tree of an individual withdrawal container\n    uint256 internal constant WITHDRAWAL_FIELD_TREE_HEIGHT = 2;\n\n    uint256 internal constant VALIDATOR_TREE_HEIGHT = 40;\n\n    // MAX_WITHDRAWALS_PER_PAYLOAD = 2**4, making tree height = 4\n    uint256 internal constant WITHDRAWALS_TREE_HEIGHT = 4;\n\n    //in beacon block body https://github.com/ethereum/consensus-specs/blob/dev/specs/capella/beacon-chain.md#beaconblockbody\n    uint256 internal constant EXECUTION_PAYLOAD_INDEX = 9;\n\n    // in beacon block header https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#beaconblockheader\n    uint256 internal constant SLOT_INDEX = 0;\n    uint256 internal constant STATE_ROOT_INDEX = 3;\n    uint256 internal constant BODY_ROOT_INDEX = 4;\n    // in beacon state https://github.com/ethereum/consensus-specs/blob/dev/specs/capella/beacon-chain.md#beaconstate\n    uint256 internal constant VALIDATOR_TREE_ROOT_INDEX = 11;\n    uint256 internal constant HISTORICAL_SUMMARIES_INDEX = 27;\n\n    // in validator https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#validator\n    uint256 internal constant VALIDATOR_PUBKEY_INDEX = 0;\n    uint256 internal constant VALIDATOR_WITHDRAWAL_CREDENTIALS_INDEX = 1;\n    uint256 internal constant VALIDATOR_BALANCE_INDEX = 2;\n    uint256 internal constant VALIDATOR_WITHDRAWABLE_EPOCH_INDEX = 7;\n\n    // in execution payload header\n    uint256 internal constant TIMESTAMP_INDEX = 9;\n\n    //in execution payload\n    uint256 internal constant WITHDRAWALS_INDEX = 14;\n\n    // in withdrawal\n    uint256 internal constant WITHDRAWAL_VALIDATOR_INDEX_INDEX = 1;\n    uint256 internal constant WITHDRAWAL_VALIDATOR_AMOUNT_INDEX = 3;\n\n    //Misc Constants\n\n    /// @notice The number of slots each epoch in the beacon chain\n    uint64 internal constant SLOTS_PER_EPOCH = 32;\n\n    /// @notice The number of seconds in a slot in the beacon chain\n    uint64 internal constant SECONDS_PER_SLOT = 12;\n\n    /// @notice Number of seconds per epoch: 384 == 32 slots/epoch * 12 seconds/slot \n    uint64 internal constant SECONDS_PER_EPOCH = SLOTS_PER_EPOCH * SECONDS_PER_SLOT;\n\n    bytes8 internal constant UINT64_MASK = 0xffffffffffffffff;\n\n    /// @notice This struct contains the merkle proofs and leaves needed to verify a partial/full withdrawal\n    struct WithdrawalProof {\n        bytes withdrawalProof;\n        bytes slotProof;\n        bytes executionPayloadProof;\n        bytes timestampProof;\n        bytes historicalSummaryBlockRootProof;\n        uint64 blockRootIndex;\n        uint64 historicalSummaryIndex;\n        uint64 withdrawalIndex;\n        bytes32 blockRoot;\n        bytes32 slotRoot;\n        bytes32 timestampRoot;\n        bytes32 executionPayloadRoot;\n    }\n\n    /// @notice This struct contains the root and proof for verifying the state root against the oracle block root\n    struct StateRootProof {\n        bytes32 beaconStateRoot;\n        bytes proof;\n    }\n\n    /**\n     * @notice This function verifies merkle proofs of the fields of a certain validator against a beacon chain state root\n     * @param validatorIndex the index of the proven validator\n     * @param beaconStateRoot is the beacon chain state root to be proven against.\n     * @param validatorFieldsProof is the data used in proving the validator's fields\n     * @param validatorFields the claimed fields of the validator\n     */\n    function verifyValidatorFields(\n        bytes32 beaconStateRoot,\n        bytes32[] calldata validatorFields,\n        bytes calldata validatorFieldsProof,\n        uint40 validatorIndex\n    ) internal view {\n        require(\n            validatorFields.length == 2 ** VALIDATOR_FIELD_TREE_HEIGHT,\n            \"BeaconChainProofs.verifyValidatorFields: Validator fields has incorrect length\"\n        );\n\n        /**\n         * Note: the length of the validator merkle proof is BeaconChainProofs.VALIDATOR_TREE_HEIGHT + 1.\n         * There is an additional layer added by hashing the root with the length of the validator list\n         */\n        require(\n            validatorFieldsProof.length == 32 * ((VALIDATOR_TREE_HEIGHT + 1) + BEACON_STATE_FIELD_TREE_HEIGHT),\n            \"BeaconChainProofs.verifyValidatorFields: Proof has incorrect length\"\n        );\n        uint256 index = (VALIDATOR_TREE_ROOT_INDEX << (VALIDATOR_TREE_HEIGHT + 1)) | uint256(validatorIndex);\n        // merkleize the validatorFields to get the leaf to prove\n        bytes32 validatorRoot = Merkle.merkleizeSha256(validatorFields);\n\n        // verify the proof of the validatorRoot against the beaconStateRoot\n        require(\n            Merkle.verifyInclusionSha256({\n                proof: validatorFieldsProof,\n                root: beaconStateRoot,\n                leaf: validatorRoot,\n                index: index\n            }),\n            \"BeaconChainProofs.verifyValidatorFields: Invalid merkle proof\"\n        );\n    }\n\n    /**\n     * @notice This function verifies the latestBlockHeader against the state root. the latestBlockHeader is\n     * a tracked in the beacon state.\n     * @param beaconStateRoot is the beacon chain state root to be proven against.\n     * @param stateRootProof is the provided merkle proof\n     * @param latestBlockRoot is hashtree root of the latest block header in the beacon state\n     */\n    function verifyStateRootAgainstLatestBlockRoot(\n        bytes32 latestBlockRoot,\n        bytes32 beaconStateRoot,\n        bytes calldata stateRootProof\n    ) internal view {\n        require(\n            stateRootProof.length == 32 * (BEACON_BLOCK_HEADER_FIELD_TREE_HEIGHT),\n            \"BeaconChainProofs.verifyStateRootAgainstLatestBlockRoot: Proof has incorrect length\"\n        );\n        //Next we verify the slot against the blockRoot\n        require(\n            Merkle.verifyInclusionSha256({\n                proof: stateRootProof,\n                root: latestBlockRoot,\n                leaf: beaconStateRoot,\n                index: STATE_ROOT_INDEX\n            }),\n            \"BeaconChainProofs.verifyStateRootAgainstLatestBlockRoot: Invalid latest block header root merkle proof\"\n        );\n    }\n\n    /**\n     * @notice This function verifies the slot and the withdrawal fields for a given withdrawal\n     * @param withdrawalProof is the provided set of merkle proofs\n     * @param withdrawalFields is the serialized withdrawal container to be proven\n     */\n    function verifyWithdrawal(\n        bytes32 beaconStateRoot,\n        bytes32[] calldata withdrawalFields,\n        WithdrawalProof calldata withdrawalProof,\n        uint64 denebForkTimestamp\n    ) internal view {\n        require(\n            withdrawalFields.length == 2 ** WITHDRAWAL_FIELD_TREE_HEIGHT,\n            \"BeaconChainProofs.verifyWithdrawal: withdrawalFields has incorrect length\"\n        );\n\n        require(\n            withdrawalProof.blockRootIndex < 2 ** BLOCK_ROOTS_TREE_HEIGHT,\n            \"BeaconChainProofs.verifyWithdrawal: blockRootIndex is too large\"\n        );\n        require(\n            withdrawalProof.withdrawalIndex < 2 ** WITHDRAWALS_TREE_HEIGHT,\n            \"BeaconChainProofs.verifyWithdrawal: withdrawalIndex is too large\"\n        );\n\n        require(\n            withdrawalProof.historicalSummaryIndex < 2 ** HISTORICAL_SUMMARIES_TREE_HEIGHT,\n            \"BeaconChainProofs.verifyWithdrawal: historicalSummaryIndex is too large\"\n        );\n\n        //Note: post deneb hard fork, the number of exection payload header fields increased from 15->17, adding an extra level to the tree height\n        uint256 executionPayloadHeaderFieldTreeHeight = (getWithdrawalTimestamp(withdrawalProof) < denebForkTimestamp) ? EXECUTION_PAYLOAD_HEADER_FIELD_TREE_HEIGHT_CAPELLA : EXECUTION_PAYLOAD_HEADER_FIELD_TREE_HEIGHT_DENEB;\n        require(\n            withdrawalProof.withdrawalProof.length ==\n                32 * (executionPayloadHeaderFieldTreeHeight + WITHDRAWALS_TREE_HEIGHT + 1),\n            \"BeaconChainProofs.verifyWithdrawal: withdrawalProof has incorrect length\"\n        );\n        require(\n            withdrawalProof.executionPayloadProof.length ==\n                32 * (BEACON_BLOCK_HEADER_FIELD_TREE_HEIGHT + BEACON_BLOCK_BODY_FIELD_TREE_HEIGHT),\n            \"BeaconChainProofs.verifyWithdrawal: executionPayloadProof has incorrect length\"\n        );\n        require(\n            withdrawalProof.slotProof.length == 32 * (BEACON_BLOCK_HEADER_FIELD_TREE_HEIGHT),\n            \"BeaconChainProofs.verifyWithdrawal: slotProof has incorrect length\"\n        );\n        require(\n            withdrawalProof.timestampProof.length == 32 * (executionPayloadHeaderFieldTreeHeight),\n            \"BeaconChainProofs.verifyWithdrawal: timestampProof has incorrect length\"\n        );\n\n        require(\n            withdrawalProof.historicalSummaryBlockRootProof.length ==\n                32 *\n                    (BEACON_STATE_FIELD_TREE_HEIGHT +\n                        (HISTORICAL_SUMMARIES_TREE_HEIGHT + 1) +\n                        1 +\n                        (BLOCK_ROOTS_TREE_HEIGHT)),\n            \"BeaconChainProofs.verifyWithdrawal: historicalSummaryBlockRootProof has incorrect length\"\n        );\n        /**\n         * Note: Here, the \"1\" in \"1 + (BLOCK_ROOTS_TREE_HEIGHT)\" signifies that extra step of choosing the \"block_root_summary\" within the individual\n         * \"historical_summary\". Everywhere else it signifies merkelize_with_mixin, where the length of an array is hashed with the root of the array,\n         * but not here.\n         */\n        uint256 historicalBlockHeaderIndex = (HISTORICAL_SUMMARIES_INDEX <<\n            ((HISTORICAL_SUMMARIES_TREE_HEIGHT + 1) + 1 + (BLOCK_ROOTS_TREE_HEIGHT))) |\n            (uint256(withdrawalProof.historicalSummaryIndex) << (1 + (BLOCK_ROOTS_TREE_HEIGHT))) |\n            (BLOCK_SUMMARY_ROOT_INDEX << (BLOCK_ROOTS_TREE_HEIGHT)) |\n            uint256(withdrawalProof.blockRootIndex);\n\n        require(\n            Merkle.verifyInclusionSha256({\n                proof: withdrawalProof.historicalSummaryBlockRootProof,\n                root: beaconStateRoot,\n                leaf: withdrawalProof.blockRoot,\n                index: historicalBlockHeaderIndex\n            }),\n            \"BeaconChainProofs.verifyWithdrawal: Invalid historicalsummary merkle proof\"\n        );\n\n        //Next we verify the slot against the blockRoot\n        require(\n            Merkle.verifyInclusionSha256({\n                proof: withdrawalProof.slotProof,\n                root: withdrawalProof.blockRoot,\n                leaf: withdrawalProof.slotRoot,\n                index: SLOT_INDEX\n            }),\n            \"BeaconChainProofs.verifyWithdrawal: Invalid slot merkle proof\"\n        );\n\n        {\n            // Next we verify the executionPayloadRoot against the blockRoot\n            uint256 executionPayloadIndex = (BODY_ROOT_INDEX << (BEACON_BLOCK_BODY_FIELD_TREE_HEIGHT)) |\n                EXECUTION_PAYLOAD_INDEX;\n            require(\n                Merkle.verifyInclusionSha256({\n                    proof: withdrawalProof.executionPayloadProof,\n                    root: withdrawalProof.blockRoot,\n                    leaf: withdrawalProof.executionPayloadRoot,\n                    index: executionPayloadIndex\n                }),\n                \"BeaconChainProofs.verifyWithdrawal: Invalid executionPayload merkle proof\"\n            );\n        }\n\n        // Next we verify the timestampRoot against the executionPayload root\n        require(\n            Merkle.verifyInclusionSha256({\n                proof: withdrawalProof.timestampProof,\n                root: withdrawalProof.executionPayloadRoot,\n                leaf: withdrawalProof.timestampRoot,\n                index: TIMESTAMP_INDEX\n            }),\n            \"BeaconChainProofs.verifyWithdrawal: Invalid timestamp merkle proof\"\n        );\n\n        {\n            /**\n             * Next we verify the withdrawal fields against the executionPayloadRoot:\n             * First we compute the withdrawal_index, then we merkleize the \n             * withdrawalFields container to calculate the withdrawalRoot.\n             *\n             * Note: Merkleization of the withdrawals root tree uses MerkleizeWithMixin, i.e., the length of the array is hashed with the root of\n             * the array.  Thus we shift the WITHDRAWALS_INDEX over by WITHDRAWALS_TREE_HEIGHT + 1 and not just WITHDRAWALS_TREE_HEIGHT.\n             */\n            uint256 withdrawalIndex = (WITHDRAWALS_INDEX << (WITHDRAWALS_TREE_HEIGHT + 1)) |\n                uint256(withdrawalProof.withdrawalIndex);\n            bytes32 withdrawalRoot = Merkle.merkleizeSha256(withdrawalFields);\n            require(\n                Merkle.verifyInclusionSha256({\n                    proof: withdrawalProof.withdrawalProof,\n                    root: withdrawalProof.executionPayloadRoot,\n                    leaf: withdrawalRoot,\n                    index: withdrawalIndex\n                }),\n                \"BeaconChainProofs.verifyWithdrawal: Invalid withdrawal merkle proof\"\n            );\n        }\n    }\n\n    /**\n     * @notice This function replicates the ssz hashing of a validator's pubkey, outlined below:\n     *  hh := ssz.NewHasher()\n     *  hh.PutBytes(validatorPubkey[:])\n     *  validatorPubkeyHash := hh.Hash()\n     *  hh.Reset()\n     */\n    function hashValidatorBLSPubkey(bytes memory validatorPubkey) internal pure returns (bytes32 pubkeyHash) {\n        require(validatorPubkey.length == 48, \"Input should be 48 bytes in length\");\n        return sha256(abi.encodePacked(validatorPubkey, bytes16(0)));\n    }\n\n    /**\n     * @dev Retrieve the withdrawal timestamp\n     */\n    function getWithdrawalTimestamp(WithdrawalProof memory withdrawalProof) internal pure returns (uint64) {\n        return\n            Endian.fromLittleEndianUint64(withdrawalProof.timestampRoot);\n    }\n\n    /**\n     * @dev Converts the withdrawal's slot to an epoch\n     */\n    function getWithdrawalEpoch(WithdrawalProof memory withdrawalProof) internal pure returns (uint64) {\n        return\n            Endian.fromLittleEndianUint64(withdrawalProof.slotRoot) / SLOTS_PER_EPOCH;\n    }\n\n    /**\n     * Indices for validator fields (refer to consensus specs):\n     * 0: pubkey\n     * 1: withdrawal credentials\n     * 2: effective balance\n     * 3: slashed?\n     * 4: activation elligibility epoch\n     * 5: activation epoch\n     * 6: exit epoch\n     * 7: withdrawable epoch\n     */\n\n    /**\n     * @dev Retrieves a validator's pubkey hash\n     */\n    function getPubkeyHash(bytes32[] memory validatorFields) internal pure returns (bytes32) {\n        return \n            validatorFields[VALIDATOR_PUBKEY_INDEX];\n    }\n\n    function getWithdrawalCredentials(bytes32[] memory validatorFields) internal pure returns (bytes32) {\n        return\n            validatorFields[VALIDATOR_WITHDRAWAL_CREDENTIALS_INDEX];\n    }\n\n    /**\n     * @dev Retrieves a validator's effective balance (in gwei)\n     */\n    function getEffectiveBalanceGwei(bytes32[] memory validatorFields) internal pure returns (uint64) {\n        return \n            Endian.fromLittleEndianUint64(validatorFields[VALIDATOR_BALANCE_INDEX]);\n    }\n\n    /**\n     * @dev Retrieves a validator's withdrawable epoch\n     */\n    function getWithdrawableEpoch(bytes32[] memory validatorFields) internal pure returns (uint64) {\n        return \n            Endian.fromLittleEndianUint64(validatorFields[VALIDATOR_WITHDRAWABLE_EPOCH_INDEX]);\n    }\n\n    /**\n     * Indices for withdrawal fields (refer to consensus specs):\n     * 0: withdrawal index\n     * 1: validator index\n     * 2: execution address\n     * 3: withdrawal amount\n     */\n\n    /**\n     * @dev Retrieves a withdrawal's validator index\n     */\n    function getValidatorIndex(bytes32[] memory withdrawalFields) internal pure returns (uint40) {\n        return \n            uint40(Endian.fromLittleEndianUint64(withdrawalFields[WITHDRAWAL_VALIDATOR_INDEX_INDEX]));\n    }\n\n    /**\n     * @dev Retrieves a withdrawal's withdrawal amount (in gwei)\n     */\n    function getWithdrawalAmountGwei(bytes32[] memory withdrawalFields) internal pure returns (uint64) {\n        return\n            Endian.fromLittleEndianUint64(withdrawalFields[WITHDRAWAL_VALIDATOR_AMOUNT_INDEX]);\n    }\n}\n"
      },
      "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol": {
        "content": "// 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"
      },
      "lib/eigenlayer-middleware/src/interfaces/IBLSApkRegistry.sol": {
        "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity ^0.8.12;\n\nimport {IRegistry} from \"./IRegistry.sol\";\n\nimport {BN254} from \"../libraries/BN254.sol\";\n\n/**\n * @title Minimal interface for a registry that keeps track of aggregate operator public keys across many quorums.\n * @author Layr Labs, Inc.\n */\ninterface IBLSApkRegistry is IRegistry {\n    // STRUCTS\n    /// @notice Data structure used to track the history of the Aggregate Public Key of all operators\n    struct ApkUpdate {\n        // first 24 bytes of keccak256(apk_x0, apk_x1, apk_y0, apk_y1)\n        bytes24 apkHash;\n        // block number at which the update occurred\n        uint32 updateBlockNumber;\n        // block number at which the next update occurred\n        uint32 nextUpdateBlockNumber;\n    }\n\n    /**\n     * @notice Struct used when registering a new public key\n     * @param pubkeyRegistrationSignature is the registration message signed by the private key of the operator\n     * @param pubkeyG1 is the corresponding G1 public key of the operator \n     * @param pubkeyG2 is the corresponding G2 public key of the operator\n     */     \n    struct PubkeyRegistrationParams {\n        BN254.G1Point pubkeyRegistrationSignature;\n        BN254.G1Point pubkeyG1;\n        BN254.G2Point pubkeyG2;\n    }\n\n    // EVENTS\n    /// @notice Emitted when `operator` registers with the public keys `pubkeyG1` and `pubkeyG2`.\n    event NewPubkeyRegistration(address indexed operator, BN254.G1Point pubkeyG1, BN254.G2Point pubkeyG2);\n\n    // @notice Emitted when a new operator pubkey is registered for a set of quorums\n    event OperatorAddedToQuorums(\n        address operator,\n        bytes32 operatorId,\n        bytes quorumNumbers\n    );\n\n    // @notice Emitted when an operator pubkey is removed from a set of quorums\n    event OperatorRemovedFromQuorums(\n        address operator, \n        bytes32 operatorId,\n        bytes quorumNumbers\n    );\n\n    /**\n     * @notice Registers the `operator`'s pubkey for the specified `quorumNumbers`.\n     * @param operator The address of the operator to register.\n     * @param quorumNumbers The quorum numbers the operator is registering for, where each byte is an 8 bit integer quorumNumber.\n     * @dev access restricted to the RegistryCoordinator\n     * @dev Preconditions (these are assumed, not validated in this contract):\n     *         1) `quorumNumbers` has no duplicates\n     *         2) `quorumNumbers.length` != 0\n     *         3) `quorumNumbers` is ordered in ascending order\n     *         4) the operator is not already registered\n     */\n    function registerOperator(address operator, bytes calldata quorumNumbers) external;\n\n    /**\n     * @notice Deregisters the `operator`'s pubkey for the specified `quorumNumbers`.\n     * @param operator The address of the operator to deregister.\n     * @param quorumNumbers The quorum numbers the operator is deregistering from, where each byte is an 8 bit integer quorumNumber.\n     * @dev access restricted to the RegistryCoordinator\n     * @dev Preconditions (these are assumed, not validated in this contract):\n     *         1) `quorumNumbers` has no duplicates\n     *         2) `quorumNumbers.length` != 0\n     *         3) `quorumNumbers` is ordered in ascending order\n     *         4) the operator is not already deregistered\n     *         5) `quorumNumbers` is a subset of the quorumNumbers that the operator is registered for\n     */ \n    function deregisterOperator(address operator, bytes calldata quorumNumbers) external;\n    \n    /**\n     * @notice Initializes a new quorum by pushing its first apk update\n     * @param quorumNumber The number of the new quorum\n     */\n    function initializeQuorum(uint8 quorumNumber) external;\n\n    /**\n     * @notice mapping from operator address to pubkey hash.\n     * Returns *zero* if the `operator` has never registered, and otherwise returns the hash of the public key of the operator.\n     */\n    function operatorToPubkeyHash(address operator) external view returns (bytes32);\n\n    /**\n     * @notice mapping from pubkey hash to operator address.\n     * Returns *zero* if no operator has ever registered the public key corresponding to `pubkeyHash`,\n     * and otherwise returns the (unique) registered operator who owns the BLS public key that is the preimage of `pubkeyHash`.\n     */\n    function pubkeyHashToOperator(bytes32 pubkeyHash) external view returns (address);\n\n    /**\n     * @notice Called by the RegistryCoordinator register an operator as the owner of a BLS public key.\n     * @param operator is the operator for whom the key is being registered\n     * @param params contains the G1 & G2 public keys of the operator, and a signature proving their ownership\n     * @param pubkeyRegistrationMessageHash is a hash that the operator must sign to prove key ownership\n     */\n    function registerBLSPublicKey(\n        address operator,\n        PubkeyRegistrationParams calldata params,\n        BN254.G1Point calldata pubkeyRegistrationMessageHash\n    ) external returns (bytes32 operatorId);\n\n    /**\n     * @notice Returns the pubkey and pubkey hash of an operator\n     * @dev Reverts if the operator has not registered a valid pubkey\n     */\n    function getRegisteredPubkey(address operator) external view returns (BN254.G1Point memory, bytes32);\n\n    /// @notice Returns the current APK for the provided `quorumNumber `\n    function getApk(uint8 quorumNumber) external view returns (BN254.G1Point memory);\n\n    /// @notice Returns the index of the quorumApk index at `blockNumber` for the provided `quorumNumber`\n    function getApkIndicesAtBlockNumber(bytes calldata quorumNumbers, uint256 blockNumber) external view returns(uint32[] memory);\n\n    /// @notice Returns the `ApkUpdate` struct at `index` in the list of APK updates for the `quorumNumber`\n    function getApkUpdateAtIndex(uint8 quorumNumber, uint256 index) external view returns (ApkUpdate memory);\n\n    /// @notice Returns the operator address for the given `pubkeyHash`\n    function getOperatorFromPubkeyHash(bytes32 pubkeyHash) external view returns (address);\n\n    /**\n     * @notice get 24 byte hash of the apk of `quorumNumber` at `blockNumber` using the provided `index`;\n     * called by checkSignatures in BLSSignatureChecker.sol.\n     * @param quorumNumber is the quorum whose ApkHash is being retrieved\n     * @param blockNumber is the number of the block for which the latest ApkHash will be retrieved\n     * @param index is the index of the apkUpdate being retrieved from the list of quorum apkUpdates in storage\n     */\n    function getApkHashAtBlockNumberAndIndex(uint8 quorumNumber, uint32 blockNumber, uint256 index) external view returns (bytes24);\n\n    /// @notice returns the ID used to identify the `operator` within this AVS.\n    /// @dev Returns zero in the event that the `operator` has never registered for the AVS\n    function getOperatorId(address operator) external view returns (bytes32);\n}\n"
      },
      "lib/eigenlayer-middleware/src/interfaces/IStakeRegistry.sol": {
        "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity ^0.8.12;\n\nimport {IDelegationManager} from \"eigenlayer-contracts/src/contracts/interfaces/IDelegationManager.sol\";\nimport {IStrategy} from \"eigenlayer-contracts/src/contracts/interfaces/IStrategy.sol\";\n\nimport {IRegistry} from \"./IRegistry.sol\";\n\n/**\n * @title Interface for a `Registry` that keeps track of stakes of operators for up to 256 quorums.\n * @author Layr Labs, Inc.\n */\ninterface IStakeRegistry is IRegistry {\n    \n    // DATA STRUCTURES\n\n    /// @notice struct used to store the stakes of an individual operator or the sum of all operators' stakes, for storage\n    struct StakeUpdate {\n        // the block number at which the stake amounts were updated and stored\n        uint32 updateBlockNumber;\n        // the block number at which the *next update* occurred.\n        /// @notice This entry has the value **0** until another update takes place.\n        uint32 nextUpdateBlockNumber;\n        // stake weight for the quorum\n        uint96 stake;\n    }\n\n    /**\n     * @notice In weighing a particular strategy, the amount of underlying asset for that strategy is\n     * multiplied by its multiplier, then divided by WEIGHTING_DIVISOR\n     */\n    struct StrategyParams {\n        IStrategy strategy;\n        uint96 multiplier;\n    }\n\n    // EVENTS\n\n    /// @notice emitted whenever the stake of `operator` is updated\n    event OperatorStakeUpdate(\n        bytes32 indexed operatorId,\n        uint8 quorumNumber,\n        uint96 stake\n    );\n    /// @notice emitted when the minimum stake for a quorum is updated\n    event MinimumStakeForQuorumUpdated(uint8 indexed quorumNumber, uint96 minimumStake);\n    /// @notice emitted when a new quorum is created\n    event QuorumCreated(uint8 indexed quorumNumber);\n    /// @notice emitted when `strategy` has been added to the array at `strategyParams[quorumNumber]`\n    event StrategyAddedToQuorum(uint8 indexed quorumNumber, IStrategy strategy);\n    /// @notice emitted when `strategy` has removed from the array at `strategyParams[quorumNumber]`\n    event StrategyRemovedFromQuorum(uint8 indexed quorumNumber, IStrategy strategy);\n    /// @notice emitted when `strategy` has its `multiplier` updated in the array at `strategyParams[quorumNumber]`\n    event StrategyMultiplierUpdated(uint8 indexed quorumNumber, IStrategy strategy, uint256 multiplier);\n\n    /**\n     * @notice Registers the `operator` with `operatorId` for the specified `quorumNumbers`.\n     * @param operator The address of the operator to register.\n     * @param operatorId The id of the operator to register.\n     * @param quorumNumbers The quorum numbers the operator is registering for, where each byte is an 8 bit integer quorumNumber.\n     * @return The operator's current stake for each quorum, and the total stake for each quorum\n     * @dev access restricted to the RegistryCoordinator\n     * @dev Preconditions (these are assumed, not validated in this contract):\n     *         1) `quorumNumbers` has no duplicates\n     *         2) `quorumNumbers.length` != 0\n     *         3) `quorumNumbers` is ordered in ascending order\n     *         4) the operator is not already registered\n     */\n    function registerOperator(\n        address operator, \n        bytes32 operatorId, \n        bytes memory quorumNumbers\n    ) external returns (uint96[] memory, uint96[] memory);\n\n    /**\n     * @notice Deregisters the operator with `operatorId` for the specified `quorumNumbers`.\n     * @param operatorId The id of the operator to deregister.\n     * @param quorumNumbers The quorum numbers the operator is deregistering from, where each byte is an 8 bit integer quorumNumber.\n     * @dev access restricted to the RegistryCoordinator\n     * @dev Preconditions (these are assumed, not validated in this contract):\n     *         1) `quorumNumbers` has no duplicates\n     *         2) `quorumNumbers.length` != 0\n     *         3) `quorumNumbers` is ordered in ascending order\n     *         4) the operator is not already deregistered\n     *         5) `quorumNumbers` is a subset of the quorumNumbers that the operator is registered for\n     */\n    function deregisterOperator(bytes32 operatorId, bytes memory quorumNumbers) external;\n\n    /**\n     * @notice Initialize a new quorum created by the registry coordinator by setting strategies, weights, and minimum stake\n     */\n    function initializeQuorum(uint8 quorumNumber, uint96 minimumStake, StrategyParams[] memory strategyParams) external;\n\n    /// @notice Adds new strategies and the associated multipliers to the @param quorumNumber.\n    function addStrategies(\n        uint8 quorumNumber,\n        StrategyParams[] memory strategyParams\n    ) external;\n\n    /**\n     * @notice This function is used for removing strategies and their associated weights from the\n     * mapping strategyParams for a specific @param quorumNumber.\n     * @dev higher indices should be *first* in the list of @param indicesToRemove, since otherwise\n     * the removal of lower index entries will cause a shift in the indices of the other strategiesToRemove\n     */\n    function removeStrategies(uint8 quorumNumber, uint256[] calldata indicesToRemove) external;\n\n    /**\n     * @notice This function is used for modifying the weights of strategies that are already in the\n     * mapping strategyParams for a specific\n     * @param quorumNumber is the quorum number to change the strategy for\n     * @param strategyIndices are the indices of the strategies to change\n     * @param newMultipliers are the new multipliers for the strategies\n     */\n    function modifyStrategyParams(\n        uint8 quorumNumber,\n        uint256[] calldata strategyIndices,\n        uint96[] calldata newMultipliers\n    ) external;\n\n    /// @notice Constant used as a divisor in calculating weights.\n    function WEIGHTING_DIVISOR() external pure returns (uint256);\n\n    /// @notice Returns the EigenLayer delegation manager contract.\n    function delegation() external view returns (IDelegationManager);\n\n    /// @notice In order to register for a quorum i, an operator must have at least `minimumStakeForQuorum[i]`\n    function minimumStakeForQuorum(uint8 quorumNumber) external view returns (uint96);\n\n    /// @notice Returns the length of the dynamic array stored in `strategyParams[quorumNumber]`.\n    function strategyParamsLength(uint8 quorumNumber) external view returns (uint256);\n\n    /// @notice Returns the strategy and weight multiplier for the `index`'th strategy in the quorum `quorumNumber`\n    function strategyParamsByIndex(\n        uint8 quorumNumber,\n        uint256 index\n    ) external view returns (StrategyParams memory);\n\n    /**\n     * @notice This function computes the total weight of the @param operator in the quorum @param quorumNumber.\n     * @dev reverts in the case that `quorumNumber` is greater than or equal to `quorumCount`\n     */\n    function weightOfOperatorForQuorum(uint8 quorumNumber, address operator) external view returns (uint96);\n\n    /**\n     * @notice Returns the entire `operatorIdToStakeHistory[operatorId][quorumNumber]` array.\n     * @param operatorId The id of the operator of interest.\n     * @param quorumNumber The quorum number to get the stake for.\n     */\n    function getStakeHistory(bytes32 operatorId, uint8 quorumNumber) external view returns (StakeUpdate[] memory);\n\n    function getTotalStakeHistoryLength(uint8 quorumNumber) external view returns (uint256);\n\n    /**\n     * @notice Returns the `index`-th entry in the dynamic array of total stake, `totalStakeHistory` for quorum `quorumNumber`.\n     * @param quorumNumber The quorum number to get the stake for.\n     * @param index Array index for lookup, within the dynamic array `totalStakeHistory[quorumNumber]`.\n     */\n    function getTotalStakeUpdateAtIndex(uint8 quorumNumber, uint256 index) external view returns (StakeUpdate memory);\n\n    /// @notice Returns the indices of the operator stakes for the provided `quorumNumber` at the given `blockNumber`\n    function getStakeUpdateIndexAtBlockNumber(bytes32 operatorId, uint8 quorumNumber, uint32 blockNumber)\n        external\n        view\n        returns (uint32);\n\n    /// @notice Returns the indices of the total stakes for the provided `quorumNumbers` at the given `blockNumber`\n    function getTotalStakeIndicesAtBlockNumber(uint32 blockNumber, bytes calldata quorumNumbers) external view returns(uint32[] memory) ;\n\n    /**\n     * @notice Returns the `index`-th entry in the `operatorIdToStakeHistory[operatorId][quorumNumber]` array.\n     * @param quorumNumber The quorum number to get the stake for.\n     * @param operatorId The id of the operator of interest.\n     * @param index Array index for lookup, within the dynamic array `operatorIdToStakeHistory[operatorId][quorumNumber]`.\n     * @dev Function will revert if `index` is out-of-bounds.\n     */\n    function getStakeUpdateAtIndex(uint8 quorumNumber, bytes32 operatorId, uint256 index)\n        external\n        view\n        returns (StakeUpdate memory);\n\n    /**\n     * @notice Returns the most recent stake weight for the `operatorId` for a certain quorum\n     * @dev Function returns an StakeUpdate struct with **every entry equal to 0** in the event that the operator has no stake history\n     */\n    function getLatestStakeUpdate(bytes32 operatorId, uint8 quorumNumber) external view returns (StakeUpdate memory);\n\n    /**\n     * @notice Returns the stake weight corresponding to `operatorId` for quorum `quorumNumber`, at the\n     * `index`-th entry in the `operatorIdToStakeHistory[operatorId][quorumNumber]` array if the entry \n     * corresponds to the operator's stake at `blockNumber`. Reverts otherwise.\n     * @param quorumNumber The quorum number to get the stake for.\n     * @param operatorId The id of the operator of interest.\n     * @param index Array index for lookup, within the dynamic array `operatorIdToStakeHistory[operatorId][quorumNumber]`.\n     * @param blockNumber Block number to make sure the stake is from.\n     * @dev Function will revert if `index` is out-of-bounds.\n     * @dev used the BLSSignatureChecker to get past stakes of signing operators\n     */\n    function getStakeAtBlockNumberAndIndex(uint8 quorumNumber, uint32 blockNumber, bytes32 operatorId, uint256 index)\n        external\n        view\n        returns (uint96);\n\n    /**\n     * @notice Returns the total stake weight for quorum `quorumNumber`, at the `index`-th entry in the \n     * `totalStakeHistory[quorumNumber]` array if the entry corresponds to the total stake at `blockNumber`. \n     * Reverts otherwise.\n     * @param quorumNumber The quorum number to get the stake for.\n     * @param index Array index for lookup, within the dynamic array `totalStakeHistory[quorumNumber]`.\n     * @param blockNumber Block number to make sure the stake is from.\n     * @dev Function will revert if `index` is out-of-bounds.\n     * @dev used the BLSSignatureChecker to get past stakes of signing operators\n     */\n    function getTotalStakeAtBlockNumberFromIndex(uint8 quorumNumber, uint32 blockNumber, uint256 index) external view returns (uint96);\n\n    /**\n     * @notice Returns the most recent stake weight for the `operatorId` for quorum `quorumNumber`\n     * @dev Function returns weight of **0** in the event that the operator has no stake history\n     */\n    function getCurrentStake(bytes32 operatorId, uint8 quorumNumber) external view returns (uint96);\n\n    /// @notice Returns the stake of the operator for the provided `quorumNumber` at the given `blockNumber`\n    function getStakeAtBlockNumber(bytes32 operatorId, uint8 quorumNumber, uint32 blockNumber)\n        external\n        view\n        returns (uint96);\n\n    /**\n     * @notice Returns the stake weight from the latest entry in `_totalStakeHistory` for quorum `quorumNumber`.\n     * @dev Will revert if `_totalStakeHistory[quorumNumber]` is empty.\n     */\n    function getCurrentTotalStake(uint8 quorumNumber) external view returns (uint96);\n\n    /**\n     * @notice Called by the registry coordinator to update an operator's stake for one\n     * or more quorums.\n     *\n     * If the operator no longer has the minimum stake required for a quorum, they are\n     * added to the\n     * @return A bitmap of quorums where the operator no longer meets the minimum stake\n     * and should be deregistered.\n     */\n    function updateOperatorStake(\n        address operator, \n        bytes32 operatorId, \n        bytes calldata quorumNumbers\n    ) external returns (uint192);\n}\n"
      },
      "lib/eigenlayer-middleware/src/interfaces/IIndexRegistry.sol": {
        "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity ^0.8.12;\n\nimport {IRegistry} from \"./IRegistry.sol\";\n\n/**\n * @title Interface for a `Registry`-type contract that keeps track of an ordered list of operators for up to 256 quorums.\n * @author Layr Labs, Inc.\n */\ninterface IIndexRegistry is IRegistry {\n    // EVENTS\n    \n    // emitted when an operator's index in the ordered operator list for the quorum with number `quorumNumber` is updated\n    event QuorumIndexUpdate(bytes32 indexed operatorId, uint8 quorumNumber, uint32 newOperatorIndex);\n\n    // DATA STRUCTURES\n\n    // struct used to give definitive ordering to operators at each blockNumber. \n    struct OperatorUpdate {\n        // blockNumber number from which `operatorIndex` was the operators index\n        // the operator's index is the first entry such that `blockNumber >= entry.fromBlockNumber`\n        uint32 fromBlockNumber;\n        // the operator at this index\n        bytes32 operatorId;\n    }\n\n    // struct used to denote the number of operators in a quorum at a given blockNumber\n    struct QuorumUpdate {\n        // The total number of operators at a `blockNumber` is the first entry such that `blockNumber >= entry.fromBlockNumber`\n        uint32 fromBlockNumber;\n        // The number of operators at `fromBlockNumber`\n        uint32 numOperators;\n    }\n\n    /**\n     * @notice Registers the operator with the specified `operatorId` for the quorums specified by `quorumNumbers`.\n     * @param operatorId is the id of the operator that is being registered\n     * @param quorumNumbers is the quorum numbers the operator is registered for\n     * @return numOperatorsPerQuorum is a list of the number of operators (including the registering operator) in each of the quorums the operator is registered for\n     * @dev access restricted to the RegistryCoordinator\n     * @dev Preconditions (these are assumed, not validated in this contract):\n     *         1) `quorumNumbers` has no duplicates\n     *         2) `quorumNumbers.length` != 0\n     *         3) `quorumNumbers` is ordered in ascending order\n     *         4) the operator is not already registered\n     */\n    function registerOperator(bytes32 operatorId, bytes calldata quorumNumbers) external returns(uint32[] memory);\n\n    /**\n     * @notice Deregisters the operator with the specified `operatorId` for the quorums specified by `quorumNumbers`.\n     * @param operatorId is the id of the operator that is being deregistered\n     * @param quorumNumbers is the quorum numbers the operator is deregistered for\n     * @dev access restricted to the RegistryCoordinator\n     * @dev Preconditions (these are assumed, not validated in this contract):\n     *         1) `quorumNumbers` has no duplicates\n     *         2) `quorumNumbers.length` != 0\n     *         3) `quorumNumbers` is ordered in ascending order\n     *         4) the operator is not already deregistered\n     *         5) `quorumNumbers` is a subset of the quorumNumbers that the operator is registered for\n     */\n    function deregisterOperator(bytes32 operatorId, bytes calldata quorumNumbers) external;\n\n    /**\n     * @notice Initialize a quorum by pushing its first quorum update\n     * @param quorumNumber The number of the new quorum\n     */\n    function initializeQuorum(uint8 quorumNumber) external;\n\n    /// @notice Returns the OperatorUpdate entry for the specified `operatorIndex` and `quorumNumber` at the specified `arrayIndex`\n    function getOperatorUpdateAtIndex(\n        uint8 quorumNumber,\n        uint32 operatorIndex,\n        uint32 arrayIndex\n    ) external view returns (OperatorUpdate memory);\n\n    /// @notice Returns the QuorumUpdate entry for the specified `quorumNumber` at the specified `quorumIndex`\n    function getQuorumUpdateAtIndex(uint8 quorumNumber, uint32 quorumIndex) external view returns (QuorumUpdate memory);\n\n    /// @notice Returns the most recent OperatorUpdate entry for the specified quorumNumber and operatorIndex\n    function getLatestOperatorUpdate(uint8 quorumNumber, uint32 operatorIndex) external view returns (OperatorUpdate memory);\n\n    /// @notice Returns the most recent QuorumUpdate entry for the specified quorumNumber\n    function getLatestQuorumUpdate(uint8 quorumNumber) external view returns (QuorumUpdate memory);\n\n    /// @notice Returns the current number of operators of this service for `quorumNumber`.\n    function totalOperatorsForQuorum(uint8 quorumNumber) external view returns (uint32);\n\n    /// @notice Returns an ordered list of operators of the services for the given `quorumNumber` at the given `blockNumber`\n    function getOperatorListAtBlockNumber(uint8 quorumNumber, uint32 blockNumber) external view returns (bytes32[] memory);\n}\n"
      },
      "lib/eigenlayer-middleware/src/libraries/BN254.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// several functions are taken or adapted from https://github.com/HarryR/solcrypto/blob/master/contracts/altbn128.sol (MIT license):\n// Copyright 2017 Christian Reitwiessner\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n// IN THE SOFTWARE.\n\n// The remainder of the code in this library is written by LayrLabs Inc. and is also under an MIT license\n\npragma solidity ^0.8.12;\n\n/**\n * @title Library for operations on the BN254 elliptic curve.\n * @author Layr Labs, Inc.\n * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service\n * @notice Contains BN254 parameters, common operations (addition, scalar mul, pairing), and BLS signature functionality.\n */\nlibrary BN254 {\n    // modulus for the underlying field F_p of the elliptic curve\n    uint256 internal constant FP_MODULUS =\n        21888242871839275222246405745257275088696311157297823662689037894645226208583;\n    // modulus for the underlying field F_r of the elliptic curve\n    uint256 internal constant FR_MODULUS =\n        21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n    struct G1Point {\n        uint256 X;\n        uint256 Y;\n    }\n\n    // Encoding of field elements is: X[1] * i + X[0]\n    struct G2Point {\n        uint256[2] X;\n        uint256[2] Y;\n    }\n\n    function generatorG1() internal pure returns (G1Point memory) {\n        return G1Point(1, 2);\n    }\n\n    // generator of group G2\n    /// @dev Generator point in F_q2 is of the form: (x0 + ix1, y0 + iy1).\n    uint256 internal constant G2x1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;\n    uint256 internal constant G2x0 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;\n    uint256 internal constant G2y1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;\n    uint256 internal constant G2y0 = 8495653923123431417604973247489272438418190587263600148770280649306958101930;\n\n    /// @notice returns the G2 generator\n    /// @dev mind the ordering of the 1s and 0s!\n    ///      this is because of the (unknown to us) convention used in the bn254 pairing precompile contract\n    ///      \"Elements a * i + b of F_p^2 are encoded as two elements of F_p, (a, b).\"\n    ///      https://github.com/ethereum/EIPs/blob/master/EIPS/eip-197.md#encoding\n    function generatorG2() internal pure returns (G2Point memory) {\n        return G2Point([G2x1, G2x0], [G2y1, G2y0]);\n    }\n\n    // negation of the generator of group G2\n    /// @dev Generator point in F_q2 is of the form: (x0 + ix1, y0 + iy1).\n    uint256 internal constant nG2x1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;\n    uint256 internal constant nG2x0 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;\n    uint256 internal constant nG2y1 = 17805874995975841540914202342111839520379459829704422454583296818431106115052;\n    uint256 internal constant nG2y0 = 13392588948715843804641432497768002650278120570034223513918757245338268106653;\n\n    function negGeneratorG2() internal pure returns (G2Point memory) {\n        return G2Point([nG2x1, nG2x0], [nG2y1, nG2y0]);\n    }\n\n    bytes32 internal constant powersOfTauMerkleRoot =\n        0x22c998e49752bbb1918ba87d6d59dd0e83620a311ba91dd4b2cc84990b31b56f;\n\n    /**\n     * @param p Some point in G1.\n     * @return The negation of `p`, i.e. p.plus(p.negate()) should be zero.\n     */\n    function negate(G1Point memory p) internal pure returns (G1Point memory) {\n        // The prime q in the base field F_q for G1\n        if (p.X == 0 && p.Y == 0) {\n            return G1Point(0, 0);\n        } else {\n            return G1Point(p.X, FP_MODULUS - (p.Y % FP_MODULUS));\n        }\n    }\n\n    /**\n     * @return r the sum of two points of G1\n     */\n    function plus(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\n        uint256[4] memory input;\n        input[0] = p1.X;\n        input[1] = p1.Y;\n        input[2] = p2.X;\n        input[3] = p2.Y;\n        bool success;\n\n        // solium-disable-next-line security/no-inline-assembly\n        assembly {\n            success := staticcall(sub(gas(), 2000), 6, input, 0x80, r, 0x40)\n            // Use \"invalid\" to make gas estimation work\n            switch success\n            case 0 {\n                invalid()\n            }\n        }\n\n        require(success, \"ec-add-failed\");\n    }\n\n    /**\n     * @notice an optimized ecMul implementation that takes O(log_2(s)) ecAdds\n     * @param p the point to multiply\n     * @param s the scalar to multiply by\n     * @dev this function is only safe to use if the scalar is 9 bits or less\n     */ \n    function scalar_mul_tiny(BN254.G1Point memory p, uint16 s) internal view returns (BN254.G1Point memory) {\n        require(s < 2**9, \"scalar-too-large\");\n\n        // if s is 1 return p\n        if(s == 1) {\n            return p;\n        }\n\n        // the accumulated product to return\n        BN254.G1Point memory acc = BN254.G1Point(0, 0);\n        // the 2^n*p to add to the accumulated product in each iteration\n        BN254.G1Point memory p2n = p;\n        // value of most significant bit\n        uint16 m = 1;\n        // index of most significant bit\n        uint8 i = 0;\n\n        //loop until we reach the most significant bit\n        while(s >= m){\n            unchecked {\n                // if the  current bit is 1, add the 2^n*p to the accumulated product\n                if ((s >> i) & 1 == 1) {\n                    acc = plus(acc, p2n);\n                }\n                // double the 2^n*p for the next iteration\n                p2n = plus(p2n, p2n);\n\n                // increment the index and double the value of the most significant bit\n                m <<= 1;\n                ++i;\n            }\n        }\n        \n        // return the accumulated product\n        return acc;\n    }\n\n    /**\n     * @return r the product of a point on G1 and a scalar, i.e.\n     *         p == p.scalar_mul(1) and p.plus(p) == p.scalar_mul(2) for all\n     *         points p.\n     */\n    function scalar_mul(G1Point memory p, uint256 s) internal view returns (G1Point memory r) {\n        uint256[3] memory input;\n        input[0] = p.X;\n        input[1] = p.Y;\n        input[2] = s;\n        bool success;\n        // solium-disable-next-line security/no-inline-assembly\n        assembly {\n            success := staticcall(sub(gas(), 2000), 7, input, 0x60, r, 0x40)\n            // Use \"invalid\" to make gas estimation work\n            switch success\n            case 0 {\n                invalid()\n            }\n        }\n        require(success, \"ec-mul-failed\");\n    }\n\n    /**\n     *  @return The result of computing the pairing check\n     *         e(p1[0], p2[0]) *  .... * e(p1[n], p2[n]) == 1\n     *         For example,\n     *         pairing([P1(), P1().negate()], [P2(), P2()]) should return true.\n     */\n    function pairing(\n        G1Point memory a1,\n        G2Point memory a2,\n        G1Point memory b1,\n        G2Point memory b2\n    ) internal view returns (bool) {\n        G1Point[2] memory p1 = [a1, b1];\n        G2Point[2] memory p2 = [a2, b2];\n\n        uint256[12] memory input;\n\n        for (uint256 i = 0; i < 2; i++) {\n            uint256 j = i * 6;\n            input[j + 0] = p1[i].X;\n            input[j + 1] = p1[i].Y;\n            input[j + 2] = p2[i].X[0];\n            input[j + 3] = p2[i].X[1];\n            input[j + 4] = p2[i].Y[0];\n            input[j + 5] = p2[i].Y[1];\n        }\n\n        uint256[1] memory out;\n        bool success;\n\n        // solium-disable-next-line security/no-inline-assembly\n        assembly {\n            success := staticcall(sub(gas(), 2000), 8, input, mul(12, 0x20), out, 0x20)\n            // Use \"invalid\" to make gas estimation work\n            switch success\n            case 0 {\n                invalid()\n            }\n        }\n\n        require(success, \"pairing-opcode-failed\");\n\n        return out[0] != 0;\n    }\n\n    /**\n     * @notice This function is functionally the same as pairing(), however it specifies a gas limit\n     *         the user can set, as a precompile may use the entire gas budget if it reverts.\n     */\n    function safePairing(\n        G1Point memory a1,\n        G2Point memory a2,\n        G1Point memory b1,\n        G2Point memory b2,\n        uint256 pairingGas\n    ) internal view returns (bool, bool) {\n        G1Point[2] memory p1 = [a1, b1];\n        G2Point[2] memory p2 = [a2, b2];\n\n        uint256[12] memory input;\n\n        for (uint256 i = 0; i < 2; i++) {\n            uint256 j = i * 6;\n            input[j + 0] = p1[i].X;\n            input[j + 1] = p1[i].Y;\n            input[j + 2] = p2[i].X[0];\n            input[j + 3] = p2[i].X[1];\n            input[j + 4] = p2[i].Y[0];\n            input[j + 5] = p2[i].Y[1];\n        }\n\n        uint256[1] memory out;\n        bool success;\n\n        // solium-disable-next-line security/no-inline-assembly\n        assembly {\n            success := staticcall(pairingGas, 8, input, mul(12, 0x20), out, 0x20)\n        }\n\n        //Out is the output of the pairing precompile, either 0 or 1 based on whether the two pairings are equal.\n        //Success is true if the precompile actually goes through (aka all inputs are valid)\n\n        return (success, out[0] != 0);\n    }\n\n    /// @return hashedG1 the keccak256 hash of the G1 Point\n    /// @dev used for BLS signatures\n    function hashG1Point(BN254.G1Point memory pk) internal pure returns (bytes32 hashedG1) {\n        assembly {\n            mstore(0, mload(pk))\n            mstore(0x20, mload(add(0x20, pk)))\n            hashedG1 := keccak256(0, 0x40)\n        }\n    }\n\n    /// @return the keccak256 hash of the G2 Point\n    /// @dev used for BLS signatures\n    function hashG2Point(\n        BN254.G2Point memory pk\n    ) internal pure returns (bytes32) {\n        return keccak256(abi.encodePacked(pk.X[0], pk.X[1], pk.Y[0], pk.Y[1]));\n    }\n\n    /**\n     * @notice adapted from https://github.com/HarryR/solcrypto/blob/master/contracts/altbn128.sol\n     */\n    function hashToG1(bytes32 _x) internal view returns (G1Point memory) {\n        uint256 beta = 0;\n        uint256 y = 0;\n\n        uint256 x = uint256(_x) % FP_MODULUS;\n\n        while (true) {\n            (beta, y) = findYFromX(x);\n\n            // y^2 == beta\n            if( beta == mulmod(y, y, FP_MODULUS) ) {\n                return G1Point(x, y);\n            }\n\n            x = addmod(x, 1, FP_MODULUS);\n        }\n        return G1Point(0, 0);\n    }\n\n    /**\n     * Given X, find Y\n     *\n     *   where y = sqrt(x^3 + b)\n     *\n     * Returns: (x^3 + b), y\n     */\n    function findYFromX(uint256 x) internal view returns (uint256, uint256) {\n        // beta = (x^3 + b) % p\n        uint256 beta = addmod(mulmod(mulmod(x, x, FP_MODULUS), x, FP_MODULUS), 3, FP_MODULUS);\n\n        // y^2 = x^3 + b\n        // this acts like: y = sqrt(beta) = beta^((p+1) / 4)\n        uint256 y = expMod(beta, 0xc19139cb84c680a6e14116da060561765e05aa45a1c72a34f082305b61f3f52, FP_MODULUS);\n\n        return (beta, y);\n    }\n\n    function expMod(uint256 _base, uint256 _exponent, uint256 _modulus) internal view returns (uint256 retval) {\n        bool success;\n        uint256[1] memory output;\n        uint[6] memory input;\n        input[0] = 0x20; // baseLen = new(big.Int).SetBytes(getData(input, 0, 32))\n        input[1] = 0x20; // expLen  = new(big.Int).SetBytes(getData(input, 32, 32))\n        input[2] = 0x20; // modLen  = new(big.Int).SetBytes(getData(input, 64, 32))\n        input[3] = _base;\n        input[4] = _exponent;\n        input[5] = _modulus;\n        assembly {\n            success := staticcall(sub(gas(), 2000), 5, input, 0xc0, output, 0x20)\n            // Use \"invalid\" to make gas estimation work\n            switch success\n            case 0 {\n                invalid()\n            }\n        }\n        require(success, \"BN254.expMod: call failure\");\n        return output[0];\n    }\n}\n"
      },
      "lib/openzeppelin-contracts/contracts/utils/types/Time.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/types/Time.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"../math/Math.sol\";\nimport {SafeCast} from \"../math/SafeCast.sol\";\n\n/**\n * @dev This library provides helpers for manipulating time-related objects.\n *\n * It uses the following types:\n * - `uint48` for timepoints\n * - `uint32` for durations\n *\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\n * - additional helper functions\n */\nlibrary Time {\n    using Time for *;\n\n    /**\n     * @dev Get the block timestamp as a Timepoint.\n     */\n    function timestamp() internal view returns (uint48) {\n        return SafeCast.toUint48(block.timestamp);\n    }\n\n    /**\n     * @dev Get the block number as a Timepoint.\n     */\n    function blockNumber() internal view returns (uint48) {\n        return SafeCast.toUint48(block.number);\n    }\n\n    // ==================================================== Delay =====================================================\n    /**\n     * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\n     * future. The \"effect\" timepoint describes when the transitions happens from the \"old\" value to the \"new\" value.\n     * This allows updating the delay applied to some operation while keeping some guarantees.\n     *\n     * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\n     * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\n     * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\n     * still apply for some time.\n     *\n     *\n     * The `Delay` type is 112 bits long, and packs the following:\n     *\n     * ```\n     *   | [uint48]: effect date (timepoint)\n     *   |           | [uint32]: value before (duration)\n     *   ↓           ↓       ↓ [uint32]: value after (duration)\n     * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\n     * ```\n     *\n     * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\n     * supported.\n     */\n    type Delay is uint112;\n\n    /**\n     * @dev Wrap a duration into a Delay to add the one-step \"update in the future\" feature\n     */\n    function toDelay(uint32 duration) internal pure returns (Delay) {\n        return Delay.wrap(duration);\n    }\n\n    /**\n     * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\n     * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\n     */\n    function _getFullAt(Delay self, uint48 timepoint) private pure returns (uint32, uint32, uint48) {\n        (uint32 valueBefore, uint32 valueAfter, uint48 effect) = self.unpack();\n        return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\n    }\n\n    /**\n     * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\n     * effect timepoint is 0, then the pending value should not be considered.\n     */\n    function getFull(Delay self) internal view returns (uint32, uint32, uint48) {\n        return _getFullAt(self, timestamp());\n    }\n\n    /**\n     * @dev Get the current value.\n     */\n    function get(Delay self) internal view returns (uint32) {\n        (uint32 delay, , ) = self.getFull();\n        return delay;\n    }\n\n    /**\n     * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\n     * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\n     * new delay becomes effective.\n     */\n    function withUpdate(\n        Delay self,\n        uint32 newValue,\n        uint32 minSetback\n    ) internal view returns (Delay updatedDelay, uint48 effect) {\n        uint32 value = self.get();\n        uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\n        effect = timestamp() + setback;\n        return (pack(value, newValue, effect), effect);\n    }\n\n    /**\n     * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\n     */\n    function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n        uint112 raw = Delay.unwrap(self);\n\n        valueAfter = uint32(raw);\n        valueBefore = uint32(raw >> 32);\n        effect = uint48(raw >> 64);\n\n        return (valueBefore, valueAfter, effect);\n    }\n\n    /**\n     * @dev pack the components into a Delay object.\n     */\n    function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\n        return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\n    }\n}\n"
      },
      "lib/eigenlayer-contracts/src/contracts/interfaces/IEigenPodManager.sol": {
        "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.5.0;\n\nimport \"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\";\nimport \"./IETHPOSDeposit.sol\";\nimport \"./IStrategyManager.sol\";\nimport \"./IEigenPod.sol\";\nimport \"./IBeaconChainOracle.sol\";\nimport \"./IPausable.sol\";\nimport \"./ISlasher.sol\";\nimport \"./IStrategy.sol\";\n\n/**\n * @title Interface for factory that creates and manages solo staking pods that have their withdrawal credentials pointed to EigenLayer.\n * @author Layr Labs, Inc.\n * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service\n */\n\ninterface IEigenPodManager is IPausable {\n    /// @notice Emitted to notify the update of the beaconChainOracle address\n    event BeaconOracleUpdated(address indexed newOracleAddress);\n\n    /// @notice Emitted to notify the deployment of an EigenPod\n    event PodDeployed(address indexed eigenPod, address indexed podOwner);\n\n    /// @notice Emitted to notify a deposit of beacon chain ETH recorded in the strategy manager\n    event BeaconChainETHDeposited(address indexed podOwner, uint256 amount);\n\n    /// @notice Emitted when the balance of an EigenPod is updated\n    event PodSharesUpdated(address indexed podOwner, int256 sharesDelta);\n\n    /// @notice Emitted when a withdrawal of beacon chain ETH is completed\n    event BeaconChainETHWithdrawalCompleted(\n        address indexed podOwner,\n        uint256 shares,\n        uint96 nonce,\n        address delegatedAddress,\n        address withdrawer,\n        bytes32 withdrawalRoot\n    );\n\n    event DenebForkTimestampUpdated(uint64 newValue);\n\n    /**\n     * @notice Creates an EigenPod for the sender.\n     * @dev Function will revert if the `msg.sender` already has an EigenPod.\n     * @dev Returns EigenPod address \n     */\n    function createPod() external returns (address);\n\n    /**\n     * @notice Stakes for a new beacon chain validator on the sender's EigenPod.\n     * Also creates an EigenPod for the sender if they don't have one already.\n     * @param pubkey The 48 bytes public key of the beacon chain validator.\n     * @param signature The validator's signature of the deposit data.\n     * @param depositDataRoot The root/hash of the deposit data for the validator's deposit.\n     */\n    function stake(bytes calldata pubkey, bytes calldata signature, bytes32 depositDataRoot) external payable;\n\n    /**\n     * @notice Changes the `podOwner`'s shares by `sharesDelta` and performs a call to the DelegationManager\n     * to ensure that delegated shares are also tracked correctly\n     * @param podOwner is the pod owner whose balance is being updated.\n     * @param sharesDelta is the change in podOwner's beaconChainETHStrategy shares\n     * @dev Callable only by the podOwner's EigenPod contract.\n     * @dev Reverts if `sharesDelta` is not a whole Gwei amount\n     */\n    function recordBeaconChainETHBalanceUpdate(address podOwner, int256 sharesDelta) external;\n\n    /**\n     * @notice Updates the oracle contract that provides the beacon chain state root\n     * @param newBeaconChainOracle is the new oracle contract being pointed to\n     * @dev Callable only by the owner of this contract (i.e. governance)\n     */\n    function updateBeaconChainOracle(IBeaconChainOracle newBeaconChainOracle) external;\n\n    /// @notice Returns the address of the `podOwner`'s EigenPod if it has been deployed.\n    function ownerToPod(address podOwner) external view returns (IEigenPod);\n\n    /// @notice Returns the address of the `podOwner`'s EigenPod (whether it is deployed yet or not).\n    function getPod(address podOwner) external view returns (IEigenPod);\n\n    /// @notice The ETH2 Deposit Contract\n    function ethPOS() external view returns (IETHPOSDeposit);\n\n    /// @notice Beacon proxy to which the EigenPods point\n    function eigenPodBeacon() external view returns (IBeacon);\n\n    /// @notice Oracle contract that provides updates to the beacon chain's state\n    function beaconChainOracle() external view returns (IBeaconChainOracle);\n\n    /// @notice Returns the beacon block root at `timestamp`. Reverts if the Beacon block root at `timestamp` has not yet been finalized.\n    function getBlockRootAtTimestamp(uint64 timestamp) external view returns (bytes32);\n\n    /// @notice EigenLayer's StrategyManager contract\n    function strategyManager() external view returns (IStrategyManager);\n\n    /// @notice EigenLayer's Slasher contract\n    function slasher() external view returns (ISlasher);\n\n    /// @notice Returns 'true' if the `podOwner` has created an EigenPod, and 'false' otherwise.\n    function hasPod(address podOwner) external view returns (bool);\n\n    /// @notice Returns the number of EigenPods that have been created\n    function numPods() external view returns (uint256);\n\n    /**\n     * @notice Mapping from Pod owner owner to the number of shares they have in the virtual beacon chain ETH strategy.\n     * @dev The share amount can become negative. This is necessary to accommodate the fact that a pod owner's virtual beacon chain ETH shares can\n     * decrease between the pod owner queuing and completing a withdrawal.\n     * When the pod owner's shares would otherwise increase, this \"deficit\" is decreased first _instead_.\n     * Likewise, when a withdrawal is completed, this \"deficit\" is decreased and the withdrawal amount is decreased; We can think of this\n     * as the withdrawal \"paying off the deficit\".\n     */\n    function podOwnerShares(address podOwner) external view returns (int256);\n\n    /// @notice returns canonical, virtual beaconChainETH strategy\n    function beaconChainETHStrategy() external view returns (IStrategy);\n\n    /**\n     * @notice Used by the DelegationManager to remove a pod owner's shares while they're in the withdrawal queue.\n     * Simply decreases the `podOwner`'s shares by `shares`, down to a minimum of zero.\n     * @dev This function reverts if it would result in `podOwnerShares[podOwner]` being less than zero, i.e. it is forbidden for this function to\n     * result in the `podOwner` incurring a \"share deficit\". This behavior prevents a Staker from queuing a withdrawal which improperly removes excessive\n     * shares from the operator to whom the staker is delegated.\n     * @dev Reverts if `shares` is not a whole Gwei amount\n     */\n    function removeShares(address podOwner, uint256 shares) external;\n\n    /**\n     * @notice Increases the `podOwner`'s shares by `shares`, paying off deficit if possible.\n     * Used by the DelegationManager to award a pod owner shares on exiting the withdrawal queue\n     * @dev Returns the number of shares added to `podOwnerShares[podOwner]` above zero, which will be less than the `shares` input\n     * in the event that the podOwner has an existing shares deficit (i.e. `podOwnerShares[podOwner]` starts below zero)\n     * @dev Reverts if `shares` is not a whole Gwei amount\n     */\n    function addShares(address podOwner, uint256 shares) external returns (uint256);\n\n    /**\n     * @notice Used by the DelegationManager to complete a withdrawal, sending tokens to some destination address\n     * @dev Prioritizes decreasing the podOwner's share deficit, if they have one\n     * @dev Reverts if `shares` is not a whole Gwei amount\n     */\n    function withdrawSharesAsTokens(address podOwner, address destination, uint256 shares) external;\n\n    /**\n     * @notice the deneb hard fork timestamp used to determine which proof path to use for proving a withdrawal\n     */\n    function denebForkTimestamp() external view returns (uint64);\n\n     /**\n     * setting the deneb hard fork timestamp by the eigenPodManager owner\n     * @dev this function is designed to be called twice.  Once, it is set to type(uint64).max \n     * prior to the actual deneb fork timestamp being set, and then the second time it is set \n     * to the actual deneb fork timestamp.\n     */\n    function setDenebForkTimestamp(uint64 newDenebForkTimestamp) external;\n\n}\n"
      },
      "lib/eigenlayer-contracts/src/contracts/libraries/Merkle.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// Adapted from OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/MerkleProof.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev These functions deal with verification of Merkle Tree proofs.\n *\n * The tree and the proofs can be generated using our\n * https://github.com/OpenZeppelin/merkle-tree[JavaScript library].\n * You will find a quickstart guide in the readme.\n *\n * WARNING: You should avoid using leaf values that are 64 bytes long prior to\n * hashing, or use a hash function other than keccak256 for hashing leaves.\n * This is because the concatenation of a sorted pair of internal nodes in\n * the merkle tree could be reinterpreted as a leaf value.\n * OpenZeppelin's JavaScript library generates merkle trees that are safe\n * against this attack out of the box.\n */\nlibrary Merkle {\n    /**\n     * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up\n     * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt\n     * hash matches the root of the tree. The tree is built assuming `leaf` is\n     * the 0 indexed `index`'th leaf from the bottom left of the tree.\n     *\n     * Note this is for a Merkle tree using the keccak/sha3 hash function\n     */\n    function verifyInclusionKeccak(\n        bytes memory proof,\n        bytes32 root,\n        bytes32 leaf,\n        uint256 index\n    ) internal pure returns (bool) {\n        return processInclusionProofKeccak(proof, leaf, index) == root;\n    }\n\n    /**\n     * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up\n     * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt\n     * hash matches the root of the tree. The tree is built assuming `leaf` is\n     * the 0 indexed `index`'th leaf from the bottom left of the tree.\n     *\n     * _Available since v4.4._\n     *\n     * Note this is for a Merkle tree using the keccak/sha3 hash function\n     */\n    function processInclusionProofKeccak(\n        bytes memory proof,\n        bytes32 leaf,\n        uint256 index\n    ) internal pure returns (bytes32) {\n        require(\n            proof.length != 0 && proof.length % 32 == 0,\n            \"Merkle.processInclusionProofKeccak: proof length should be a non-zero multiple of 32\"\n        );\n        bytes32 computedHash = leaf;\n        for (uint256 i = 32; i <= proof.length; i += 32) {\n            if (index % 2 == 0) {\n                // if ith bit of index is 0, then computedHash is a left sibling\n                assembly {\n                    mstore(0x00, computedHash)\n                    mstore(0x20, mload(add(proof, i)))\n                    computedHash := keccak256(0x00, 0x40)\n                    index := div(index, 2)\n                }\n            } else {\n                // if ith bit of index is 1, then computedHash is a right sibling\n                assembly {\n                    mstore(0x00, mload(add(proof, i)))\n                    mstore(0x20, computedHash)\n                    computedHash := keccak256(0x00, 0x40)\n                    index := div(index, 2)\n                }\n            }\n        }\n        return computedHash;\n    }\n\n    /**\n     * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up\n     * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt\n     * hash matches the root of the tree. The tree is built assuming `leaf` is\n     * the 0 indexed `index`'th leaf from the bottom left of the tree.\n     *\n     * Note this is for a Merkle tree using the sha256 hash function\n     */\n    function verifyInclusionSha256(\n        bytes memory proof,\n        bytes32 root,\n        bytes32 leaf,\n        uint256 index\n    ) internal view returns (bool) {\n        return processInclusionProofSha256(proof, leaf, index) == root;\n    }\n\n    /**\n     * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up\n     * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt\n     * hash matches the root of the tree. The tree is built assuming `leaf` is\n     * the 0 indexed `index`'th leaf from the bottom left of the tree.\n     *\n     * _Available since v4.4._\n     *\n     * Note this is for a Merkle tree using the sha256 hash function\n     */\n    function processInclusionProofSha256(\n        bytes memory proof,\n        bytes32 leaf,\n        uint256 index\n    ) internal view returns (bytes32) {\n        require(\n            proof.length != 0 && proof.length % 32 == 0,\n            \"Merkle.processInclusionProofSha256: proof length should be a non-zero multiple of 32\"\n        );\n        bytes32[1] memory computedHash = [leaf];\n        for (uint256 i = 32; i <= proof.length; i += 32) {\n            if (index % 2 == 0) {\n                // if ith bit of index is 0, then computedHash is a left sibling\n                assembly {\n                    mstore(0x00, mload(computedHash))\n                    mstore(0x20, mload(add(proof, i)))\n                    if iszero(staticcall(sub(gas(), 2000), 2, 0x00, 0x40, computedHash, 0x20)) {\n                        revert(0, 0)\n                    }\n                    index := div(index, 2)\n                }\n            } else {\n                // if ith bit of index is 1, then computedHash is a right sibling\n                assembly {\n                    mstore(0x00, mload(add(proof, i)))\n                    mstore(0x20, mload(computedHash))\n                    if iszero(staticcall(sub(gas(), 2000), 2, 0x00, 0x40, computedHash, 0x20)) {\n                        revert(0, 0)\n                    }\n                    index := div(index, 2)\n                }\n            }\n        }\n        return computedHash[0];\n    }\n\n    /**\n     @notice this function returns the merkle root of a tree created from a set of leaves using sha256 as its hash function\n     @param leaves the leaves of the merkle tree\n     @return The computed Merkle root of the tree.\n     @dev A pre-condition to this function is that leaves.length is a power of two.  If not, the function will merkleize the inputs incorrectly.\n     */\n    function merkleizeSha256(bytes32[] memory leaves) internal pure returns (bytes32) {\n        //there are half as many nodes in the layer above the leaves\n        uint256 numNodesInLayer = leaves.length / 2;\n        //create a layer to store the internal nodes\n        bytes32[] memory layer = new bytes32[](numNodesInLayer);\n        //fill the layer with the pairwise hashes of the leaves\n        for (uint256 i = 0; i < numNodesInLayer; i++) {\n            layer[i] = sha256(abi.encodePacked(leaves[2 * i], leaves[2 * i + 1]));\n        }\n        //the next layer above has half as many nodes\n        numNodesInLayer /= 2;\n        //while we haven't computed the root\n        while (numNodesInLayer != 0) {\n            //overwrite the first numNodesInLayer nodes in layer with the pairwise hashes of their children\n            for (uint256 i = 0; i < numNodesInLayer; i++) {\n                layer[i] = sha256(abi.encodePacked(layer[2 * i], layer[2 * i + 1]));\n            }\n            //the next layer above has half as many nodes\n            numNodesInLayer /= 2;\n        }\n        //the first node in the layer is the root\n        return layer[0];\n    }\n}\n"
      },
      "lib/eigenlayer-contracts/src/contracts/libraries/Endian.sol": {
        "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity ^0.8.0;\n\nlibrary Endian {\n    /**\n     * @notice Converts a little endian-formatted uint64 to a big endian-formatted uint64\n     * @param lenum little endian-formatted uint64 input, provided as 'bytes32' type\n     * @return n The big endian-formatted uint64\n     * @dev Note that the input is formatted as a 'bytes32' type (i.e. 256 bits), but it is immediately truncated to a uint64 (i.e. 64 bits)\n     * through a right-shift/shr operation.\n     */\n    function fromLittleEndianUint64(bytes32 lenum) internal pure returns (uint64 n) {\n        // the number needs to be stored in little-endian encoding (ie in bytes 0-8)\n        n = uint64(uint256(lenum >> 192));\n        return\n            (n >> 56) |\n            ((0x00FF000000000000 & n) >> 40) |\n            ((0x0000FF0000000000 & n) >> 24) |\n            ((0x000000FF00000000 & n) >> 8) |\n            ((0x00000000FF000000 & n) << 8) |\n            ((0x0000000000FF0000 & n) << 24) |\n            ((0x000000000000FF00 & n) << 40) |\n            ((0x00000000000000FF & n) << 56);\n    }\n}\n"
      },
      "lib/eigenlayer-middleware/src/interfaces/IRegistry.sol": {
        "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.5.0;\n\n/**\n * @title Minimal interface for a `Registry`-type contract.\n * @author Layr Labs, Inc.\n * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service\n * @notice Functions related to the registration process itself have been intentionally excluded\n * because their function signatures may vary significantly.\n */\ninterface IRegistry {\n    function registryCoordinator() external view returns (address);\n}\n"
      },
      "lib/openzeppelin-contracts/contracts/utils/math/Math.sol": {
        "content": "// 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"
      },
      "lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeCast {\n    /**\n     * @dev Value doesn't fit in an uint of `bits` size.\n     */\n    error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\n\n    /**\n     * @dev An int value doesn't fit in an uint of `bits` size.\n     */\n    error SafeCastOverflowedIntToUint(int256 value);\n\n    /**\n     * @dev Value doesn't fit in an int of `bits` size.\n     */\n    error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\n\n    /**\n     * @dev An uint value doesn't fit in an int of `bits` size.\n     */\n    error SafeCastOverflowedUintToInt(uint256 value);\n\n    /**\n     * @dev Returns the downcasted uint248 from uint256, reverting on\n     * overflow (when the input is greater than largest uint248).\n     *\n     * Counterpart to Solidity's `uint248` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 248 bits\n     */\n    function toUint248(uint256 value) internal pure returns (uint248) {\n        if (value > type(uint248).max) {\n            revert SafeCastOverflowedUintDowncast(248, value);\n        }\n        return uint248(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint240 from uint256, reverting on\n     * overflow (when the input is greater than largest uint240).\n     *\n     * Counterpart to Solidity's `uint240` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 240 bits\n     */\n    function toUint240(uint256 value) internal pure returns (uint240) {\n        if (value > type(uint240).max) {\n            revert SafeCastOverflowedUintDowncast(240, value);\n        }\n        return uint240(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint232 from uint256, reverting on\n     * overflow (when the input is greater than largest uint232).\n     *\n     * Counterpart to Solidity's `uint232` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 232 bits\n     */\n    function toUint232(uint256 value) internal pure returns (uint232) {\n        if (value > type(uint232).max) {\n            revert SafeCastOverflowedUintDowncast(232, value);\n        }\n        return uint232(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint224 from uint256, reverting on\n     * overflow (when the input is greater than largest uint224).\n     *\n     * Counterpart to Solidity's `uint224` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 224 bits\n     */\n    function toUint224(uint256 value) internal pure returns (uint224) {\n        if (value > type(uint224).max) {\n            revert SafeCastOverflowedUintDowncast(224, value);\n        }\n        return uint224(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint216 from uint256, reverting on\n     * overflow (when the input is greater than largest uint216).\n     *\n     * Counterpart to Solidity's `uint216` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 216 bits\n     */\n    function toUint216(uint256 value) internal pure returns (uint216) {\n        if (value > type(uint216).max) {\n            revert SafeCastOverflowedUintDowncast(216, value);\n        }\n        return uint216(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint208 from uint256, reverting on\n     * overflow (when the input is greater than largest uint208).\n     *\n     * Counterpart to Solidity's `uint208` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 208 bits\n     */\n    function toUint208(uint256 value) internal pure returns (uint208) {\n        if (value > type(uint208).max) {\n            revert SafeCastOverflowedUintDowncast(208, value);\n        }\n        return uint208(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint200 from uint256, reverting on\n     * overflow (when the input is greater than largest uint200).\n     *\n     * Counterpart to Solidity's `uint200` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 200 bits\n     */\n    function toUint200(uint256 value) internal pure returns (uint200) {\n        if (value > type(uint200).max) {\n            revert SafeCastOverflowedUintDowncast(200, value);\n        }\n        return uint200(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint192 from uint256, reverting on\n     * overflow (when the input is greater than largest uint192).\n     *\n     * Counterpart to Solidity's `uint192` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 192 bits\n     */\n    function toUint192(uint256 value) internal pure returns (uint192) {\n        if (value > type(uint192).max) {\n            revert SafeCastOverflowedUintDowncast(192, value);\n        }\n        return uint192(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint184 from uint256, reverting on\n     * overflow (when the input is greater than largest uint184).\n     *\n     * Counterpart to Solidity's `uint184` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 184 bits\n     */\n    function toUint184(uint256 value) internal pure returns (uint184) {\n        if (value > type(uint184).max) {\n            revert SafeCastOverflowedUintDowncast(184, value);\n        }\n        return uint184(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint176 from uint256, reverting on\n     * overflow (when the input is greater than largest uint176).\n     *\n     * Counterpart to Solidity's `uint176` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 176 bits\n     */\n    function toUint176(uint256 value) internal pure returns (uint176) {\n        if (value > type(uint176).max) {\n            revert SafeCastOverflowedUintDowncast(176, value);\n        }\n        return uint176(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint168 from uint256, reverting on\n     * overflow (when the input is greater than largest uint168).\n     *\n     * Counterpart to Solidity's `uint168` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 168 bits\n     */\n    function toUint168(uint256 value) internal pure returns (uint168) {\n        if (value > type(uint168).max) {\n            revert SafeCastOverflowedUintDowncast(168, value);\n        }\n        return uint168(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint160 from uint256, reverting on\n     * overflow (when the input is greater than largest uint160).\n     *\n     * Counterpart to Solidity's `uint160` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 160 bits\n     */\n    function toUint160(uint256 value) internal pure returns (uint160) {\n        if (value > type(uint160).max) {\n            revert SafeCastOverflowedUintDowncast(160, value);\n        }\n        return uint160(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint152 from uint256, reverting on\n     * overflow (when the input is greater than largest uint152).\n     *\n     * Counterpart to Solidity's `uint152` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 152 bits\n     */\n    function toUint152(uint256 value) internal pure returns (uint152) {\n        if (value > type(uint152).max) {\n            revert SafeCastOverflowedUintDowncast(152, value);\n        }\n        return uint152(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint144 from uint256, reverting on\n     * overflow (when the input is greater than largest uint144).\n     *\n     * Counterpart to Solidity's `uint144` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 144 bits\n     */\n    function toUint144(uint256 value) internal pure returns (uint144) {\n        if (value > type(uint144).max) {\n            revert SafeCastOverflowedUintDowncast(144, value);\n        }\n        return uint144(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint136 from uint256, reverting on\n     * overflow (when the input is greater than largest uint136).\n     *\n     * Counterpart to Solidity's `uint136` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 136 bits\n     */\n    function toUint136(uint256 value) internal pure returns (uint136) {\n        if (value > type(uint136).max) {\n            revert SafeCastOverflowedUintDowncast(136, value);\n        }\n        return uint136(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint128 from uint256, reverting on\n     * overflow (when the input is greater than largest uint128).\n     *\n     * Counterpart to Solidity's `uint128` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 128 bits\n     */\n    function toUint128(uint256 value) internal pure returns (uint128) {\n        if (value > type(uint128).max) {\n            revert SafeCastOverflowedUintDowncast(128, value);\n        }\n        return uint128(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint120 from uint256, reverting on\n     * overflow (when the input is greater than largest uint120).\n     *\n     * Counterpart to Solidity's `uint120` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 120 bits\n     */\n    function toUint120(uint256 value) internal pure returns (uint120) {\n        if (value > type(uint120).max) {\n            revert SafeCastOverflowedUintDowncast(120, value);\n        }\n        return uint120(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint112 from uint256, reverting on\n     * overflow (when the input is greater than largest uint112).\n     *\n     * Counterpart to Solidity's `uint112` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 112 bits\n     */\n    function toUint112(uint256 value) internal pure returns (uint112) {\n        if (value > type(uint112).max) {\n            revert SafeCastOverflowedUintDowncast(112, value);\n        }\n        return uint112(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint104 from uint256, reverting on\n     * overflow (when the input is greater than largest uint104).\n     *\n     * Counterpart to Solidity's `uint104` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 104 bits\n     */\n    function toUint104(uint256 value) internal pure returns (uint104) {\n        if (value > type(uint104).max) {\n            revert SafeCastOverflowedUintDowncast(104, value);\n        }\n        return uint104(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint96 from uint256, reverting on\n     * overflow (when the input is greater than largest uint96).\n     *\n     * Counterpart to Solidity's `uint96` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 96 bits\n     */\n    function toUint96(uint256 value) internal pure returns (uint96) {\n        if (value > type(uint96).max) {\n            revert SafeCastOverflowedUintDowncast(96, value);\n        }\n        return uint96(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint88 from uint256, reverting on\n     * overflow (when the input is greater than largest uint88).\n     *\n     * Counterpart to Solidity's `uint88` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 88 bits\n     */\n    function toUint88(uint256 value) internal pure returns (uint88) {\n        if (value > type(uint88).max) {\n            revert SafeCastOverflowedUintDowncast(88, value);\n        }\n        return uint88(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint80 from uint256, reverting on\n     * overflow (when the input is greater than largest uint80).\n     *\n     * Counterpart to Solidity's `uint80` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 80 bits\n     */\n    function toUint80(uint256 value) internal pure returns (uint80) {\n        if (value > type(uint80).max) {\n            revert SafeCastOverflowedUintDowncast(80, value);\n        }\n        return uint80(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint72 from uint256, reverting on\n     * overflow (when the input is greater than largest uint72).\n     *\n     * Counterpart to Solidity's `uint72` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 72 bits\n     */\n    function toUint72(uint256 value) internal pure returns (uint72) {\n        if (value > type(uint72).max) {\n            revert SafeCastOverflowedUintDowncast(72, value);\n        }\n        return uint72(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint64 from uint256, reverting on\n     * overflow (when the input is greater than largest uint64).\n     *\n     * Counterpart to Solidity's `uint64` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 64 bits\n     */\n    function toUint64(uint256 value) internal pure returns (uint64) {\n        if (value > type(uint64).max) {\n            revert SafeCastOverflowedUintDowncast(64, value);\n        }\n        return uint64(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint56 from uint256, reverting on\n     * overflow (when the input is greater than largest uint56).\n     *\n     * Counterpart to Solidity's `uint56` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 56 bits\n     */\n    function toUint56(uint256 value) internal pure returns (uint56) {\n        if (value > type(uint56).max) {\n            revert SafeCastOverflowedUintDowncast(56, value);\n        }\n        return uint56(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint48 from uint256, reverting on\n     * overflow (when the input is greater than largest uint48).\n     *\n     * Counterpart to Solidity's `uint48` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 48 bits\n     */\n    function toUint48(uint256 value) internal pure returns (uint48) {\n        if (value > type(uint48).max) {\n            revert SafeCastOverflowedUintDowncast(48, value);\n        }\n        return uint48(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint40 from uint256, reverting on\n     * overflow (when the input is greater than largest uint40).\n     *\n     * Counterpart to Solidity's `uint40` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 40 bits\n     */\n    function toUint40(uint256 value) internal pure returns (uint40) {\n        if (value > type(uint40).max) {\n            revert SafeCastOverflowedUintDowncast(40, value);\n        }\n        return uint40(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint32 from uint256, reverting on\n     * overflow (when the input is greater than largest uint32).\n     *\n     * Counterpart to Solidity's `uint32` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 32 bits\n     */\n    function toUint32(uint256 value) internal pure returns (uint32) {\n        if (value > type(uint32).max) {\n            revert SafeCastOverflowedUintDowncast(32, value);\n        }\n        return uint32(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint24 from uint256, reverting on\n     * overflow (when the input is greater than largest uint24).\n     *\n     * Counterpart to Solidity's `uint24` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 24 bits\n     */\n    function toUint24(uint256 value) internal pure returns (uint24) {\n        if (value > type(uint24).max) {\n            revert SafeCastOverflowedUintDowncast(24, value);\n        }\n        return uint24(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint16 from uint256, reverting on\n     * overflow (when the input is greater than largest uint16).\n     *\n     * Counterpart to Solidity's `uint16` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 16 bits\n     */\n    function toUint16(uint256 value) internal pure returns (uint16) {\n        if (value > type(uint16).max) {\n            revert SafeCastOverflowedUintDowncast(16, value);\n        }\n        return uint16(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint8 from uint256, reverting on\n     * overflow (when the input is greater than largest uint8).\n     *\n     * Counterpart to Solidity's `uint8` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 8 bits\n     */\n    function toUint8(uint256 value) internal pure returns (uint8) {\n        if (value > type(uint8).max) {\n            revert SafeCastOverflowedUintDowncast(8, value);\n        }\n        return uint8(value);\n    }\n\n    /**\n     * @dev Converts a signed int256 into an unsigned uint256.\n     *\n     * Requirements:\n     *\n     * - input must be greater than or equal to 0.\n     */\n    function toUint256(int256 value) internal pure returns (uint256) {\n        if (value < 0) {\n            revert SafeCastOverflowedIntToUint(value);\n        }\n        return uint256(value);\n    }\n\n    /**\n     * @dev Returns the downcasted int248 from int256, reverting on\n     * overflow (when the input is less than smallest int248 or\n     * greater than largest int248).\n     *\n     * Counterpart to Solidity's `int248` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 248 bits\n     */\n    function toInt248(int256 value) internal pure returns (int248 downcasted) {\n        downcasted = int248(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(248, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int240 from int256, reverting on\n     * overflow (when the input is less than smallest int240 or\n     * greater than largest int240).\n     *\n     * Counterpart to Solidity's `int240` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 240 bits\n     */\n    function toInt240(int256 value) internal pure returns (int240 downcasted) {\n        downcasted = int240(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(240, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int232 from int256, reverting on\n     * overflow (when the input is less than smallest int232 or\n     * greater than largest int232).\n     *\n     * Counterpart to Solidity's `int232` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 232 bits\n     */\n    function toInt232(int256 value) internal pure returns (int232 downcasted) {\n        downcasted = int232(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(232, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int224 from int256, reverting on\n     * overflow (when the input is less than smallest int224 or\n     * greater than largest int224).\n     *\n     * Counterpart to Solidity's `int224` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 224 bits\n     */\n    function toInt224(int256 value) internal pure returns (int224 downcasted) {\n        downcasted = int224(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(224, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int216 from int256, reverting on\n     * overflow (when the input is less than smallest int216 or\n     * greater than largest int216).\n     *\n     * Counterpart to Solidity's `int216` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 216 bits\n     */\n    function toInt216(int256 value) internal pure returns (int216 downcasted) {\n        downcasted = int216(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(216, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int208 from int256, reverting on\n     * overflow (when the input is less than smallest int208 or\n     * greater than largest int208).\n     *\n     * Counterpart to Solidity's `int208` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 208 bits\n     */\n    function toInt208(int256 value) internal pure returns (int208 downcasted) {\n        downcasted = int208(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(208, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int200 from int256, reverting on\n     * overflow (when the input is less than smallest int200 or\n     * greater than largest int200).\n     *\n     * Counterpart to Solidity's `int200` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 200 bits\n     */\n    function toInt200(int256 value) internal pure returns (int200 downcasted) {\n        downcasted = int200(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(200, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int192 from int256, reverting on\n     * overflow (when the input is less than smallest int192 or\n     * greater than largest int192).\n     *\n     * Counterpart to Solidity's `int192` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 192 bits\n     */\n    function toInt192(int256 value) internal pure returns (int192 downcasted) {\n        downcasted = int192(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(192, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int184 from int256, reverting on\n     * overflow (when the input is less than smallest int184 or\n     * greater than largest int184).\n     *\n     * Counterpart to Solidity's `int184` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 184 bits\n     */\n    function toInt184(int256 value) internal pure returns (int184 downcasted) {\n        downcasted = int184(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(184, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int176 from int256, reverting on\n     * overflow (when the input is less than smallest int176 or\n     * greater than largest int176).\n     *\n     * Counterpart to Solidity's `int176` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 176 bits\n     */\n    function toInt176(int256 value) internal pure returns (int176 downcasted) {\n        downcasted = int176(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(176, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int168 from int256, reverting on\n     * overflow (when the input is less than smallest int168 or\n     * greater than largest int168).\n     *\n     * Counterpart to Solidity's `int168` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 168 bits\n     */\n    function toInt168(int256 value) internal pure returns (int168 downcasted) {\n        downcasted = int168(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(168, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int160 from int256, reverting on\n     * overflow (when the input is less than smallest int160 or\n     * greater than largest int160).\n     *\n     * Counterpart to Solidity's `int160` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 160 bits\n     */\n    function toInt160(int256 value) internal pure returns (int160 downcasted) {\n        downcasted = int160(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(160, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int152 from int256, reverting on\n     * overflow (when the input is less than smallest int152 or\n     * greater than largest int152).\n     *\n     * Counterpart to Solidity's `int152` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 152 bits\n     */\n    function toInt152(int256 value) internal pure returns (int152 downcasted) {\n        downcasted = int152(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(152, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int144 from int256, reverting on\n     * overflow (when the input is less than smallest int144 or\n     * greater than largest int144).\n     *\n     * Counterpart to Solidity's `int144` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 144 bits\n     */\n    function toInt144(int256 value) internal pure returns (int144 downcasted) {\n        downcasted = int144(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(144, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int136 from int256, reverting on\n     * overflow (when the input is less than smallest int136 or\n     * greater than largest int136).\n     *\n     * Counterpart to Solidity's `int136` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 136 bits\n     */\n    function toInt136(int256 value) internal pure returns (int136 downcasted) {\n        downcasted = int136(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(136, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int128 from int256, reverting on\n     * overflow (when the input is less than smallest int128 or\n     * greater than largest int128).\n     *\n     * Counterpart to Solidity's `int128` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 128 bits\n     */\n    function toInt128(int256 value) internal pure returns (int128 downcasted) {\n        downcasted = int128(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(128, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int120 from int256, reverting on\n     * overflow (when the input is less than smallest int120 or\n     * greater than largest int120).\n     *\n     * Counterpart to Solidity's `int120` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 120 bits\n     */\n    function toInt120(int256 value) internal pure returns (int120 downcasted) {\n        downcasted = int120(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(120, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int112 from int256, reverting on\n     * overflow (when the input is less than smallest int112 or\n     * greater than largest int112).\n     *\n     * Counterpart to Solidity's `int112` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 112 bits\n     */\n    function toInt112(int256 value) internal pure returns (int112 downcasted) {\n        downcasted = int112(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(112, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int104 from int256, reverting on\n     * overflow (when the input is less than smallest int104 or\n     * greater than largest int104).\n     *\n     * Counterpart to Solidity's `int104` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 104 bits\n     */\n    function toInt104(int256 value) internal pure returns (int104 downcasted) {\n        downcasted = int104(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(104, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int96 from int256, reverting on\n     * overflow (when the input is less than smallest int96 or\n     * greater than largest int96).\n     *\n     * Counterpart to Solidity's `int96` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 96 bits\n     */\n    function toInt96(int256 value) internal pure returns (int96 downcasted) {\n        downcasted = int96(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(96, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int88 from int256, reverting on\n     * overflow (when the input is less than smallest int88 or\n     * greater than largest int88).\n     *\n     * Counterpart to Solidity's `int88` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 88 bits\n     */\n    function toInt88(int256 value) internal pure returns (int88 downcasted) {\n        downcasted = int88(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(88, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int80 from int256, reverting on\n     * overflow (when the input is less than smallest int80 or\n     * greater than largest int80).\n     *\n     * Counterpart to Solidity's `int80` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 80 bits\n     */\n    function toInt80(int256 value) internal pure returns (int80 downcasted) {\n        downcasted = int80(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(80, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int72 from int256, reverting on\n     * overflow (when the input is less than smallest int72 or\n     * greater than largest int72).\n     *\n     * Counterpart to Solidity's `int72` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 72 bits\n     */\n    function toInt72(int256 value) internal pure returns (int72 downcasted) {\n        downcasted = int72(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(72, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int64 from int256, reverting on\n     * overflow (when the input is less than smallest int64 or\n     * greater than largest int64).\n     *\n     * Counterpart to Solidity's `int64` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 64 bits\n     */\n    function toInt64(int256 value) internal pure returns (int64 downcasted) {\n        downcasted = int64(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(64, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int56 from int256, reverting on\n     * overflow (when the input is less than smallest int56 or\n     * greater than largest int56).\n     *\n     * Counterpart to Solidity's `int56` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 56 bits\n     */\n    function toInt56(int256 value) internal pure returns (int56 downcasted) {\n        downcasted = int56(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(56, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int48 from int256, reverting on\n     * overflow (when the input is less than smallest int48 or\n     * greater than largest int48).\n     *\n     * Counterpart to Solidity's `int48` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 48 bits\n     */\n    function toInt48(int256 value) internal pure returns (int48 downcasted) {\n        downcasted = int48(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(48, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int40 from int256, reverting on\n     * overflow (when the input is less than smallest int40 or\n     * greater than largest int40).\n     *\n     * Counterpart to Solidity's `int40` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 40 bits\n     */\n    function toInt40(int256 value) internal pure returns (int40 downcasted) {\n        downcasted = int40(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(40, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int32 from int256, reverting on\n     * overflow (when the input is less than smallest int32 or\n     * greater than largest int32).\n     *\n     * Counterpart to Solidity's `int32` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 32 bits\n     */\n    function toInt32(int256 value) internal pure returns (int32 downcasted) {\n        downcasted = int32(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(32, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int24 from int256, reverting on\n     * overflow (when the input is less than smallest int24 or\n     * greater than largest int24).\n     *\n     * Counterpart to Solidity's `int24` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 24 bits\n     */\n    function toInt24(int256 value) internal pure returns (int24 downcasted) {\n        downcasted = int24(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(24, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int16 from int256, reverting on\n     * overflow (when the input is less than smallest int16 or\n     * greater than largest int16).\n     *\n     * Counterpart to Solidity's `int16` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 16 bits\n     */\n    function toInt16(int256 value) internal pure returns (int16 downcasted) {\n        downcasted = int16(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(16, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int8 from int256, reverting on\n     * overflow (when the input is less than smallest int8 or\n     * greater than largest int8).\n     *\n     * Counterpart to Solidity's `int8` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 8 bits\n     */\n    function toInt8(int256 value) internal pure returns (int8 downcasted) {\n        downcasted = int8(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(8, value);\n        }\n    }\n\n    /**\n     * @dev Converts an unsigned uint256 into a signed int256.\n     *\n     * Requirements:\n     *\n     * - input must be less than or equal to maxInt256.\n     */\n    function toInt256(uint256 value) internal pure returns (int256) {\n        // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n        if (value > uint256(type(int256).max)) {\n            revert SafeCastOverflowedUintToInt(value);\n        }\n        return int256(value);\n    }\n}\n"
      },
      "lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol": {
        "content": "// 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"
      },
      "lib/eigenlayer-contracts/src/contracts/interfaces/IETHPOSDeposit.sol": {
        "content": "// ┏━━━┓━┏┓━┏┓━━┏━━━┓━━┏━━━┓━━━━┏━━━┓━━━━━━━━━━━━━━━━━━━┏┓━━━━━┏━━━┓━━━━━━━━━┏┓━━━━━━━━━━━━━━┏┓━\n// ┃┏━━┛┏┛┗┓┃┃━━┃┏━┓┃━━┃┏━┓┃━━━━┗┓┏┓┃━━━━━━━━━━━━━━━━━━┏┛┗┓━━━━┃┏━┓┃━━━━━━━━┏┛┗┓━━━━━━━━━━━━┏┛┗┓\n// ┃┗━━┓┗┓┏┛┃┗━┓┗┛┏┛┃━━┃┃━┃┃━━━━━┃┃┃┃┏━━┓┏━━┓┏━━┓┏━━┓┏┓┗┓┏┛━━━━┃┃━┗┛┏━━┓┏━┓━┗┓┏┛┏━┓┏━━┓━┏━━┓┗┓┏┛\n// ┃┏━━┛━┃┃━┃┏┓┃┏━┛┏┛━━┃┃━┃┃━━━━━┃┃┃┃┃┏┓┃┃┏┓┃┃┏┓┃┃━━┫┣┫━┃┃━━━━━┃┃━┏┓┃┏┓┃┃┏┓┓━┃┃━┃┏┛┗━┓┃━┃┏━┛━┃┃━\n// ┃┗━━┓━┃┗┓┃┃┃┃┃┃┗━┓┏┓┃┗━┛┃━━━━┏┛┗┛┃┃┃━┫┃┗┛┃┃┗┛┃┣━━┃┃┃━┃┗┓━━━━┃┗━┛┃┃┗┛┃┃┃┃┃━┃┗┓┃┃━┃┗┛┗┓┃┗━┓━┃┗┓\n// ┗━━━┛━┗━┛┗┛┗┛┗━━━┛┗┛┗━━━┛━━━━┗━━━┛┗━━┛┃┏━┛┗━━┛┗━━┛┗┛━┗━┛━━━━┗━━━┛┗━━┛┗┛┗┛━┗━┛┗┛━┗━━━┛┗━━┛━┗━┛\n// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┃┃━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┗┛━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n// SPDX-License-Identifier: CC0-1.0\n\npragma solidity >=0.5.0;\n\n// This interface is designed to be compatible with the Vyper version.\n/// @notice This is the Ethereum 2.0 deposit contract interface.\n/// For more information see the Phase 0 specification under https://github.com/ethereum/eth2.0-specs\ninterface IETHPOSDeposit {\n    /// @notice A processed deposit event.\n    event DepositEvent(bytes pubkey, bytes withdrawal_credentials, bytes amount, bytes signature, bytes index);\n\n    /// @notice Submit a Phase 0 DepositData object.\n    /// @param pubkey A BLS12-381 public key.\n    /// @param withdrawal_credentials Commitment to a public key for withdrawals.\n    /// @param signature A BLS12-381 signature.\n    /// @param deposit_data_root The SHA-256 hash of the SSZ-encoded DepositData object.\n    /// Used as a protection against malformed input.\n    function deposit(\n        bytes calldata pubkey,\n        bytes calldata withdrawal_credentials,\n        bytes calldata signature,\n        bytes32 deposit_data_root\n    ) external payable;\n\n    /// @notice Query the current deposit root hash.\n    /// @return The deposit root hash.\n    function get_deposit_root() external view returns (bytes32);\n\n    /// @notice Query the current deposit count.\n    /// @return The deposit count encoded as a little endian 64-bit number.\n    function get_deposit_count() external view returns (bytes memory);\n}\n"
      },
      "lib/eigenlayer-contracts/src/contracts/interfaces/IEigenPod.sol": {
        "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.5.0;\n\nimport \"../libraries/BeaconChainProofs.sol\";\nimport \"./IEigenPodManager.sol\";\nimport \"./IBeaconChainOracle.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\n/**\n * @title The implementation contract used for restaking beacon chain ETH on EigenLayer\n * @author Layr Labs, Inc.\n * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service\n * @notice The main functionalities are:\n * - creating new ETH validators with their withdrawal credentials pointed to this contract\n * - proving from beacon chain state roots that withdrawal credentials are pointed to this contract\n * - proving from beacon chain state roots the balances of ETH validators with their withdrawal credentials\n *   pointed to this contract\n * - updating aggregate balances in the EigenPodManager\n * - withdrawing eth when withdrawals are initiated\n * @dev Note that all beacon chain balances are stored as gwei within the beacon chain datastructures. We choose\n *   to account balances in terms of gwei in the EigenPod contract and convert to wei when making calls to other contracts\n */\ninterface IEigenPod {\n    enum VALIDATOR_STATUS {\n        INACTIVE, // doesnt exist\n        ACTIVE, // staked on ethpos and withdrawal credentials are pointed to the EigenPod\n        WITHDRAWN // withdrawn from the Beacon Chain\n    }\n\n    struct ValidatorInfo {\n        // index of the validator in the beacon chain\n        uint64 validatorIndex;\n        // amount of beacon chain ETH restaked on EigenLayer in gwei\n        uint64 restakedBalanceGwei;\n        //timestamp of the validator's most recent balance update\n        uint64 mostRecentBalanceUpdateTimestamp;\n        // status of the validator\n        VALIDATOR_STATUS status;\n    }\n\n    /**\n     * @notice struct used to store amounts related to proven withdrawals in memory. Used to help\n     * manage stack depth and optimize the number of external calls, when batching withdrawal operations.\n     */\n    struct VerifiedWithdrawal {\n        // amount to send to a podOwner from a proven withdrawal\n        uint256 amountToSendGwei;\n        // difference in shares to be recorded in the eigenPodManager, as a result of the withdrawal\n        int256 sharesDeltaGwei;\n    }\n\n\n    enum PARTIAL_WITHDRAWAL_CLAIM_STATUS {\n        REDEEMED,\n        PENDING,\n        FAILED\n    }\n\n    /// @notice Emitted when an ETH validator stakes via this eigenPod\n    event EigenPodStaked(bytes pubkey);\n\n    /// @notice Emitted when an ETH validator's withdrawal credentials are successfully verified to be pointed to this eigenPod\n    event ValidatorRestaked(uint40 validatorIndex);\n\n    /// @notice Emitted when an ETH validator's  balance is proven to be updated.  Here newValidatorBalanceGwei\n    //  is the validator's balance that is credited on EigenLayer.\n    event ValidatorBalanceUpdated(uint40 validatorIndex, uint64 balanceTimestamp, uint64 newValidatorBalanceGwei);\n\n    /// @notice Emitted when an ETH validator is prove to have withdrawn from the beacon chain\n    event FullWithdrawalRedeemed(\n        uint40 validatorIndex,\n        uint64 withdrawalTimestamp,\n        address indexed recipient,\n        uint64 withdrawalAmountGwei\n    );\n\n    /// @notice Emitted when a partial withdrawal claim is successfully redeemed\n    event PartialWithdrawalRedeemed(\n        uint40 validatorIndex,\n        uint64 withdrawalTimestamp,\n        address indexed recipient,\n        uint64 partialWithdrawalAmountGwei\n    );\n\n    /// @notice Emitted when restaked beacon chain ETH is withdrawn from the eigenPod.\n    event RestakedBeaconChainETHWithdrawn(address indexed recipient, uint256 amount);\n\n    /// @notice Emitted when podOwner enables restaking\n    event RestakingActivated(address indexed podOwner);\n\n    /// @notice Emitted when ETH is received via the `receive` fallback\n    event NonBeaconChainETHReceived(uint256 amountReceived);\n\n    /// @notice Emitted when ETH that was previously received via the `receive` fallback is withdrawn\n    event NonBeaconChainETHWithdrawn(address indexed recipient, uint256 amountWithdrawn);\n\n\n    /// @notice The max amount of eth, in gwei, that can be restaked per validator\n    function MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR() external view returns (uint64);\n\n    /// @notice the amount of execution layer ETH in this contract that is staked in EigenLayer (i.e. withdrawn from beaconchain but not EigenLayer),\n    function withdrawableRestakedExecutionLayerGwei() external view returns (uint64);\n\n    /// @notice any ETH deposited into the EigenPod contract via the `receive` fallback function\n    function nonBeaconChainETHBalanceWei() external view returns (uint256);\n\n    /// @notice Used to initialize the pointers to contracts crucial to the pod's functionality, in beacon proxy construction from EigenPodManager\n    function initialize(address owner) external;\n\n    /// @notice Called by EigenPodManager when the owner wants to create another ETH validator.\n    function stake(bytes calldata pubkey, bytes calldata signature, bytes32 depositDataRoot) external payable;\n\n    /**\n     * @notice Transfers `amountWei` in ether from this contract to the specified `recipient` address\n     * @notice Called by EigenPodManager to withdrawBeaconChainETH that has been added to the EigenPod's balance due to a withdrawal from the beacon chain.\n     * @dev The podOwner must have already proved sufficient withdrawals, so that this pod's `withdrawableRestakedExecutionLayerGwei` exceeds the\n     * `amountWei` input (when converted to GWEI).\n     * @dev Reverts if `amountWei` is not a whole Gwei amount\n     */\n    function withdrawRestakedBeaconChainETH(address recipient, uint256 amount) external;\n\n    /// @notice The single EigenPodManager for EigenLayer\n    function eigenPodManager() external view returns (IEigenPodManager);\n\n    /// @notice The owner of this EigenPod\n    function podOwner() external view returns (address);\n\n    /// @notice an indicator of whether or not the podOwner has ever \"fully restaked\" by successfully calling `verifyCorrectWithdrawalCredentials`.\n    function hasRestaked() external view returns (bool);\n\n    /**\n     * @notice The latest timestamp at which the pod owner withdrew the balance of the pod, via calling `withdrawBeforeRestaking`.\n     * @dev This variable is only updated when the `withdrawBeforeRestaking` function is called, which can only occur before `hasRestaked` is set to true for this pod.\n     * Proofs for this pod are only valid against Beacon Chain state roots corresponding to timestamps after the stored `mostRecentWithdrawalTimestamp`.\n     */\n    function mostRecentWithdrawalTimestamp() external view returns (uint64);\n\n    /// @notice Returns the validatorInfo struct for the provided pubkeyHash\n    function validatorPubkeyHashToInfo(bytes32 validatorPubkeyHash) external view returns (ValidatorInfo memory);\n\n    /// @notice Returns the validatorInfo struct for the provided pubkey\n    function validatorPubkeyToInfo(bytes calldata validatorPubkey) external view returns (ValidatorInfo memory);\n\n    ///@notice mapping that tracks proven withdrawals\n    function provenWithdrawal(bytes32 validatorPubkeyHash, uint64 slot) external view returns (bool);\n\n    /// @notice This returns the status of a given validator\n    function validatorStatus(bytes32 pubkeyHash) external view returns (VALIDATOR_STATUS);\n\n    /// @notice This returns the status of a given validator pubkey\n    function validatorStatus(bytes calldata validatorPubkey) external view returns (VALIDATOR_STATUS);\n\n    /**\n     * @notice This function verifies that the withdrawal credentials of validator(s) owned by the podOwner are pointed to\n     * this contract. It also verifies the effective balance  of the validator.  It verifies the provided proof of the ETH validator against the beacon chain state\n     * root, marks the validator as 'active' in EigenLayer, and credits the restaked ETH in Eigenlayer.\n     * @param oracleTimestamp is the Beacon Chain timestamp whose state root the `proof` will be proven against.\n     * @param validatorIndices is the list of indices of the validators being proven, refer to consensus specs\n     * @param withdrawalCredentialProofs is an array of proofs, where each proof proves each ETH validator's balance and withdrawal credentials\n     * against a beacon chain state root\n     * @param validatorFields are the fields of the \"Validator Container\", refer to consensus specs\n     * for details: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#validator\n     */\n    function verifyWithdrawalCredentials(\n        uint64 oracleTimestamp,\n        BeaconChainProofs.StateRootProof calldata stateRootProof,\n        uint40[] calldata validatorIndices,\n        bytes[] calldata withdrawalCredentialProofs,\n        bytes32[][] calldata validatorFields\n    )\n        external;\n\n    /**\n     * @notice This function records an update (either increase or decrease) in the pod's balance in the StrategyManager.  \n               It also verifies a merkle proof of the validator's current beacon chain balance.  \n     * @param oracleTimestamp The oracleTimestamp whose state root the `proof` will be proven against.\n     *        Must be within `VERIFY_BALANCE_UPDATE_WINDOW_SECONDS` of the current block.\n     * @param validatorIndices is the list of indices of the validators being proven, refer to consensus specs \n     * @param validatorFieldsProofs proofs against the `beaconStateRoot` for each validator in `validatorFields`\n     * @param validatorFields are the fields of the \"Validator Container\", refer to consensus specs\n     * @dev For more details on the Beacon Chain spec, see: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#validator\n     */\n    function verifyBalanceUpdates(\n        uint64 oracleTimestamp,\n        uint40[] calldata validatorIndices,\n        BeaconChainProofs.StateRootProof calldata stateRootProof,\n        bytes[] calldata validatorFieldsProofs,\n        bytes32[][] calldata validatorFields\n    ) external;\n\n    /**\n     * @notice This function records full and partial withdrawals on behalf of one of the Ethereum validators for this EigenPod\n     * @param oracleTimestamp is the timestamp of the oracle slot that the withdrawal is being proven against\n     * @param withdrawalProofs is the information needed to check the veracity of the block numbers and withdrawals being proven\n     * @param validatorFieldsProofs is the proof of the validator's fields' in the validator tree\n     * @param withdrawalFields are the fields of the withdrawals being proven\n     * @param validatorFields are the fields of the validators being proven\n     */\n    function verifyAndProcessWithdrawals(\n        uint64 oracleTimestamp,\n        BeaconChainProofs.StateRootProof calldata stateRootProof,\n        BeaconChainProofs.WithdrawalProof[] calldata withdrawalProofs,\n        bytes[] calldata validatorFieldsProofs,\n        bytes32[][] calldata validatorFields,\n        bytes32[][] calldata withdrawalFields\n    ) external;\n\n    /**\n     * @notice Called by the pod owner to activate restaking by withdrawing\n     * all existing ETH from the pod and preventing further withdrawals via\n     * \"withdrawBeforeRestaking()\"\n     */\n    function activateRestaking() external;\n\n    /// @notice Called by the pod owner to withdraw the balance of the pod when `hasRestaked` is set to false\n    function withdrawBeforeRestaking() external;\n\n    /// @notice Called by the pod owner to withdraw the nonBeaconChainETHBalanceWei\n    function withdrawNonBeaconChainETHBalanceWei(address recipient, uint256 amountToWithdraw) external;\n\n    /// @notice called by owner of a pod to remove any ERC20s deposited in the pod\n    function recoverTokens(IERC20[] memory tokenList, uint256[] memory amountsToWithdraw, address recipient) external;\n}\n"
      },
      "lib/eigenlayer-contracts/src/contracts/interfaces/IBeaconChainOracle.sol": {
        "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.5.0;\n\n/**\n * @title Interface for the BeaconStateOracle contract.\n * @author Layr Labs, Inc.\n * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service\n */\ninterface IBeaconChainOracle {\n    /// @notice The block number to state root mapping.\n    function timestampToBlockRoot(uint256 timestamp) external view returns (bytes32);\n}\n"
      },
      "lib/eigenlayer-contracts/src/contracts/interfaces/IPausable.sol": {
        "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.5.0;\n\nimport \"../interfaces/IPauserRegistry.sol\";\n\n/**\n * @title Adds pausability to a contract, with pausing & unpausing controlled by the `pauser` and `unpauser` of a PauserRegistry contract.\n * @author Layr Labs, Inc.\n * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service\n * @notice Contracts that inherit from this contract may define their own `pause` and `unpause` (and/or related) functions.\n * These functions should be permissioned as \"onlyPauser\" which defers to a `PauserRegistry` for determining access control.\n * @dev Pausability is implemented using a uint256, which allows up to 256 different single bit-flags; each bit can potentially pause different functionality.\n * Inspiration for this was taken from the NearBridge design here https://etherscan.io/address/0x3FEFc5A4B1c02f21cBc8D3613643ba0635b9a873#code.\n * For the `pause` and `unpause` functions we've implemented, if you pause, you can only flip (any number of) switches to on/1 (aka \"paused\"), and if you unpause,\n * you can only flip (any number of) switches to off/0 (aka \"paused\").\n * If you want a pauseXYZ function that just flips a single bit / \"pausing flag\", it will:\n * 1) 'bit-wise and' (aka `&`) a flag with the current paused state (as a uint256)\n * 2) update the paused state to this new value\n * @dev We note as well that we have chosen to identify flags by their *bit index* as opposed to their numerical value, so, e.g. defining `DEPOSITS_PAUSED = 3`\n * indicates specifically that if the *third bit* of `_paused` is flipped -- i.e. it is a '1' -- then deposits should be paused\n */\n\ninterface IPausable {\n    /// @notice Emitted when the `pauserRegistry` is set to `newPauserRegistry`.\n    event PauserRegistrySet(IPauserRegistry pauserRegistry, IPauserRegistry newPauserRegistry);\n\n    /// @notice Emitted when the pause is triggered by `account`, and changed to `newPausedStatus`.\n    event Paused(address indexed account, uint256 newPausedStatus);\n\n    /// @notice Emitted when the pause is lifted by `account`, and changed to `newPausedStatus`.\n    event Unpaused(address indexed account, uint256 newPausedStatus);\n    \n    /// @notice Address of the `PauserRegistry` contract that this contract defers to for determining access control (for pausing).\n    function pauserRegistry() external view returns (IPauserRegistry);\n\n    /**\n     * @notice This function is used to pause an EigenLayer contract's functionality.\n     * It is permissioned to the `pauser` address, which is expected to be a low threshold multisig.\n     * @param newPausedStatus represents the new value for `_paused` to take, which means it may flip several bits at once.\n     * @dev This function can only pause functionality, and thus cannot 'unflip' any bit in `_paused` from 1 to 0.\n     */\n    function pause(uint256 newPausedStatus) external;\n\n    /**\n     * @notice Alias for `pause(type(uint256).max)`.\n     */\n    function pauseAll() external;\n\n    /**\n     * @notice This function is used to unpause an EigenLayer contract's functionality.\n     * It is permissioned to the `unpauser` address, which is expected to be a high threshold multisig or governance contract.\n     * @param newPausedStatus represents the new value for `_paused` to take, which means it may flip several bits at once.\n     * @dev This function can only unpause functionality, and thus cannot 'flip' any bit in `_paused` from 0 to 1.\n     */\n    function unpause(uint256 newPausedStatus) external;\n\n    /// @notice Returns the current paused status as a uint256.\n    function paused() external view returns (uint256);\n\n    /// @notice Returns 'true' if the `indexed`th bit of `_paused` is 1, and 'false' otherwise\n    function paused(uint8 index) external view returns (bool);\n\n    /// @notice Allows the unpauser to set a new pauser registry\n    function setPauserRegistry(IPauserRegistry newPauserRegistry) external;\n}\n"
      },
      "lib/eigenlayer-contracts/src/contracts/interfaces/IPauserRegistry.sol": {
        "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.5.0;\n\n/**\n * @title Interface for the `PauserRegistry` contract.\n * @author Layr Labs, Inc.\n * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service\n */\ninterface IPauserRegistry {\n    event PauserStatusChanged(address pauser, bool canPause);\n\n    event UnpauserChanged(address previousUnpauser, address newUnpauser);\n    \n    /// @notice Mapping of addresses to whether they hold the pauser role.\n    function isPauser(address pauser) external view returns (bool);\n\n    /// @notice Unique address that holds the unpauser role. Capable of changing *both* the pauser and unpauser addresses.\n    function unpauser() external view returns (address);\n}\n"
      }
    },
    "settings": {
      "remappings": [
        "ds-test/=lib/forge-std/lib/ds-test/src/",
        "erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
        "forge-std/=lib/forge-std/src/",
        "openzeppelin/=lib/openzeppelin-contracts/contracts/",
        "@openzeppelin/=lib/openzeppelin-contracts/",
        "openzeppelin-upgrades/=lib/openzeppelin-contracts-upgradeable/contracts/",
        "@openzeppelin-upgrades/=lib/openzeppelin-contracts-upgradeable/",
        "eigenlayer/=lib/eigenlayer-contracts/src/contracts/",
        "eigenlayer-middleware/=lib/eigenlayer-middleware/src/",
        "eigenlayer-test/=lib/eigenlayer-contracts/src/test/",
        "openzeppelin-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
        "puffer/=src/",
        "script/=script/",
        "rave/=lib/rave/src/",
        "rave-test/=lib/rave/test/",
        "murky/=lib/murky/src/",
        "pufETH/=lib/pufETH/src/",
        "pufETHTest/=lib/pufETH/test/",
        "pufETHScript/=lib/pufETH/script/",
        "@openzeppelin-contracts-upgradeable/=lib/pufETH/lib/openzeppelin-contracts-upgradeable/contracts/",
        "@openzeppelin-upgrades/=lib/eigenlayer-contracts/lib/openzeppelin-contracts-upgradeable/",
        "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
        "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
        "ERC4626/=lib/pufETH/lib/properties/lib/ERC4626/contracts/",
        "eigenlayer-contracts/=lib/eigenlayer-contracts/",
        "ens-contracts/=lib/rave/lib/ens-contracts/contracts/",
        "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
        "openzeppelin-contracts/=lib/openzeppelin-contracts/",
        "properties/=lib/pufETH/lib/properties/contracts/",
        "solady/=lib/pufETH/lib/solady/src/",
        "solmate/=lib/pufETH/lib/properties/lib/solmate/src/"
      ],
      "optimizer": {
        "enabled": true,
        "runs": 200
      },
      "metadata": {
        "useLiteralContent": false,
        "bytecodeHash": "none",
        "appendCBOR": false
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "evmVersion": "cancun",
      "viaIR": false,
      "libraries": {}
    }
  }}