creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "src/helpers/EtherFiViewer.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nimport \"@openzeppelin-upgradeable/contracts/proxy/utils/Initializable.sol\";\nimport \"@openzeppelin-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol\";\nimport \"@openzeppelin-upgradeable/contracts/access/OwnableUpgradeable.sol\";\n\nimport \"src/interfaces/IEtherFiNodesManager.sol\";\n\nimport \"src/helpers/AddressProvider.sol\";\n\ncontract EtherFiViewer is Initializable, OwnableUpgradeable, UUPSUpgradeable {\n\n    AddressProvider addressProvider;\n\n    IEtherFiNodesManager nodesManager;\n\n    function initialize(address _addressProvider) external initializer {\n        __Ownable_init();\n        __UUPSUpgradeable_init();\n\n        addressProvider = AddressProvider(_addressProvider);\n\n        nodesManager = IEtherFiNodesManager(addressProvider.getContractAddress(\"EtherFiNodesManager\"));\n    }\n\n    function _getEtherFiNode(uint256 _validatorId) internal view returns (IEtherFiNode) {\n        return IEtherFiNode(nodesManager.etherfiNodeAddress(_validatorId));\n    }\n\n    function EtherFiNodesManager_etherFiNodeAddress(uint256[] memory _validatorIds) external view returns (address[] memory _etherFiNodeAddresses) {\n        _etherFiNodeAddresses = new address[](_validatorIds.length);\n\n        for (uint256 i = 0; i < _validatorIds.length; i++) {\n            _etherFiNodeAddresses[i] = address(_getEtherFiNode(_validatorIds[i]));\n        }\n    }\n\n    function EtherFiNodesManager_splitBalanceInExecutionLayer(uint256[] memory _validatorIds) external view returns (uint256[] memory _withdrawalSafe, uint256[] memory _eigenPod, uint256[] memory _delayedWithdrawalRouter) {\n        _withdrawalSafe = new uint256[](_validatorIds.length);\n        _eigenPod = new uint256[](_validatorIds.length);\n        _delayedWithdrawalRouter = new uint256[](_validatorIds.length);\n\n        for (uint256 i = 0; i < _validatorIds.length; i++) {\n            (_withdrawalSafe[i], _eigenPod[i], _delayedWithdrawalRouter[i]) = _getEtherFiNode(_validatorIds[i]).splitBalanceInExecutionLayer();\n        }\n    }\n\n    function EtherFiNodesManager_withdrawableBalanceInExecutionLayer(uint256[] memory _validatorIds) external view returns (uint256[] memory _withdrawableBalance) {\n        _withdrawableBalance = new uint256[](_validatorIds.length);\n\n        for (uint256 i = 0; i < _validatorIds.length; i++) {\n            _withdrawableBalance[i] = _getEtherFiNode(_validatorIds[i]).withdrawableBalanceInExecutionLayer();\n        }\n    }\n\n    function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}\n\n}"
      },
      "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\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 * ```\n * contract MyToken is ERC20Upgradeable {\n *     function initialize() initializer public {\n *         __ERC20_init(\"MyToken\", \"MTK\");\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 Indicates that the contract has been initialized.\n     * @custom:oz-retyped-from bool\n     */\n    uint8 private _initialized;\n\n    /**\n     * @dev Indicates that the contract is in the process of being initialized.\n     */\n    bool private _initializing;\n\n    /**\n     * @dev Triggered when the contract has been initialized or reinitialized.\n     */\n    event Initialized(uint8 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 functions marked with `initializer` can be nested in the context of a\n     * constructor.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier initializer() {\n        bool isTopLevelCall = !_initializing;\n        require(\n            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n            \"Initializable: contract is already initialized\"\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 255 will prevent any future reinitialization.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier reinitializer(uint8 version) {\n        require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\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        require(_initializing, \"Initializable: contract is not initializing\");\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        require(!_initializing, \"Initializable: contract is initializing\");\n        if (_initialized < type(uint8).max) {\n            _initialized = type(uint8).max;\n            emit Initialized(type(uint8).max);\n        }\n    }\n\n    /**\n     * @dev Returns the highest version that has been initialized. See {reinitializer}.\n     */\n    function _getInitializedVersion() internal view returns (uint8) {\n        return _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 _initializing;\n    }\n}\n"
      },
      "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../ERC1967/ERC1967UpgradeUpgradeable.sol\";\nimport \"./Initializable.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n *\n * _Available since v4.1._\n */\nabstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {\n    function __UUPSUpgradeable_init() internal onlyInitializing {\n    }\n\n    function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\n    }\n    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\n    address private immutable __self = address(this);\n\n    /**\n     * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n     * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\n     * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n     * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n     * fail.\n     */\n    modifier onlyProxy() {\n        require(address(this) != __self, \"Function must be called through delegatecall\");\n        require(_getImplementation() == __self, \"Function must be called through active proxy\");\n        _;\n    }\n\n    /**\n     * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n     * callable on the implementing contract but not through proxies.\n     */\n    modifier notDelegated() {\n        require(address(this) == __self, \"UUPSUpgradeable: must not be called through delegatecall\");\n        _;\n    }\n\n    /**\n     * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\n     * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\n     *\n     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n     * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\n     */\n    function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\n        return _IMPLEMENTATION_SLOT;\n    }\n\n    /**\n     * @dev Upgrade the implementation of the proxy to `newImplementation`.\n     *\n     * Calls {_authorizeUpgrade}.\n     *\n     * Emits an {Upgraded} event.\n     */\n    function upgradeTo(address newImplementation) external virtual onlyProxy {\n        _authorizeUpgrade(newImplementation);\n        _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\n    }\n\n    /**\n     * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n     * encoded in `data`.\n     *\n     * Calls {_authorizeUpgrade}.\n     *\n     * Emits an {Upgraded} event.\n     */\n    function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\n        _authorizeUpgrade(newImplementation);\n        _upgradeToAndCallUUPS(newImplementation, data, true);\n    }\n\n    /**\n     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n     * {upgradeTo} and {upgradeToAndCall}.\n     *\n     * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n     *\n     * ```solidity\n     * function _authorizeUpgrade(address) internal override onlyOwner {}\n     * ```\n     */\n    function _authorizeUpgrade(address newImplementation) internal virtual;\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[50] private __gap;\n}\n"
      },
      "lib/openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n    address private _owner;\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the deployer as the initial owner.\n     */\n    function __Ownable_init() internal onlyInitializing {\n        __Ownable_init_unchained();\n    }\n\n    function __Ownable_init_unchained() internal onlyInitializing {\n        _transferOwnership(_msgSender());\n    }\n\n    /**\n     * @dev Throws if called by any account other than the owner.\n     */\n    modifier onlyOwner() {\n        _checkOwner();\n        _;\n    }\n\n    /**\n     * @dev Returns the address of the current owner.\n     */\n    function owner() public view virtual returns (address) {\n        return _owner;\n    }\n\n    /**\n     * @dev Throws if the sender is not the owner.\n     */\n    function _checkOwner() internal view virtual {\n        require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions anymore. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby removing any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        _transferOwnership(address(0));\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n        _transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Internal function without access restriction.\n     */\n    function _transferOwnership(address newOwner) internal virtual {\n        address oldOwner = _owner;\n        _owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[49] private __gap;\n}\n"
      },
      "src/interfaces/IEtherFiNodesManager.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nimport \"./IEtherFiNode.sol\";\nimport \"../eigenlayer-interfaces/IEigenPodManager.sol\";\nimport \"../eigenlayer-interfaces/IDelegationManager.sol\";\nimport \"../eigenlayer-interfaces/IDelayedWithdrawalRouter.sol\";\n\ninterface IEtherFiNodesManager {\n\n    struct ValidatorInfo {\n        uint32 validatorIndex;\n        uint32 exitRequestTimestamp;\n        uint32 exitTimestamp;\n        IEtherFiNode.VALIDATOR_PHASE phase;\n    }\n\n    struct RewardsSplit {\n        uint64 treasury;\n        uint64 nodeOperator;\n        uint64 tnft;\n        uint64 bnft;\n    }\n\n    // VIEW functions\n    function delayedWithdrawalRouter() external view returns (IDelayedWithdrawalRouter);\n    function eigenPodManager() external view returns (IEigenPodManager);\n    function delegationManager() external view returns (IDelegationManager);\n    function treasuryContract() external view returns (address);\n\n    function etherfiNodeAddress(uint256 _validatorId) external view returns (address);\n    function calculateTVL(uint256 _validatorId, uint256 _beaconBalance) external view returns (uint256, uint256, uint256, uint256);\n    function getFullWithdrawalPayouts(uint256 _validatorId) external view returns (uint256, uint256, uint256, uint256);\n    function getNonExitPenalty(uint256 _validatorId) external view returns (uint256);\n    function getRewardsPayouts(uint256 _validatorId) external view returns (uint256, uint256, uint256, uint256);\n    function getWithdrawalCredentials(uint256 _validatorId) external view returns (bytes memory);\n    function getValidatorInfo(uint256 _validatorId) external view returns (ValidatorInfo memory);\n    function numAssociatedValidators(uint256 _validatorId) external view returns (uint256);\n    function phase(uint256 _validatorId) external view returns (IEtherFiNode.VALIDATOR_PHASE phase);\n\n    function generateWithdrawalCredentials(address _address) external view returns (bytes memory);\n    function nonExitPenaltyDailyRate() external view returns (uint64);\n    function nonExitPenaltyPrincipal() external view returns (uint64);\n    function numberOfValidators() external view returns (uint64);\n    function maxEigenlayerWithdrawals() external view returns (uint8);\n\n    function admins(address _address) external view returns (bool);\n\n    // Non-VIEW functions    \n    function updateEtherFiNode(uint256 _validatorId) external;\n\n    function batchQueueRestakedWithdrawal(uint256[] calldata _validatorIds) external;\n    function batchSendExitRequest(uint256[] calldata _validatorIds) external;\n    function batchRevertExitRequest(uint256[] calldata _validatorIds) external;\n    function batchFullWithdraw(uint256[] calldata _validatorIds) external;\n    function batchPartialWithdraw(uint256[] calldata _validatorIds) external;\n    function fullWithdraw(uint256 _validatorId) external;\n    function getUnusedWithdrawalSafesLength() external view returns (uint256);\n    function incrementNumberOfValidators(uint64 _count) external;\n    function markBeingSlashed(uint256[] calldata _validatorIds) external;\n    function partialWithdraw(uint256 _validatorId) external;\n    function processNodeExit(uint256[] calldata _validatorIds, uint32[] calldata _exitTimestamp) external;\n    function allocateEtherFiNode(bool _enableRestaking) external returns (address);\n    function registerValidator(uint256 _validatorId, bool _enableRestaking, address _withdrawalSafeAddress) external;\n    function setValidatorPhase(uint256 _validatorId, IEtherFiNode.VALIDATOR_PHASE _phase) external;\n    function setNonExitPenalty(uint64 _nonExitPenaltyDailyRate, uint64 _nonExitPenaltyPrincipal) external;\n    function setStakingRewardsSplit(uint64 _treasury, uint64 _nodeOperator, uint64 _tnft, uint64 _bnf) external;\n    function unregisterValidator(uint256 _validatorId) external;\n    \n    function updateAdmin(address _address, bool _isAdmin) external;\n    function pauseContract() external;\n    function unPauseContract() external;\n}\n"
      },
      "src/helpers/AddressProvider.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\ninterface EtherFiProxy {\n    function getImplementation() external view returns (address);\n}\n\ncontract AddressProvider {\n\n    //--------------------------------------------------------------------------------------\n    //---------------------------------  STATE-VARIABLES  ----------------------------------\n    //--------------------------------------------------------------------------------------\n\n    struct ContractData {\n        address contractAddress;\n        string name;\n    }\n\n    mapping(string => ContractData) public contracts;\n    uint256 public numberOfContracts;\n\n    address public owner;\n\n    event ContractAdded(address contractAddress, string name);\n    event ContractRemoved(address contractAddress, string name);\n\n    constructor(address _owner) {\n        owner = _owner;\n    }\n\n    //--------------------------------------------------------------------------------------\n    //----------------------------  STATE-CHANGING FUNCTIONS  ------------------------------\n    //--------------------------------------------------------------------------------------\n\n    /// @notice Adds contracts to the address provider that have already been deployed\n    /// @dev Only called by the contract owner\n    /// @param _contractAddress the proxy address of the contract we are adding\n    /// @param _name the name of the contract for reference\n    function addContract(address _contractAddress, string memory _name) external onlyOwner {\n        require(contracts[_name].contractAddress == address(0), \"Contract already exists\");\n        contracts[_name] = ContractData({\n            contractAddress: _contractAddress,\n            name: _name\n        });\n        numberOfContracts++;\n\n        emit ContractAdded(_contractAddress, _name);\n    }\n\n    /// @notice Removes a contract\n    /// @dev Only called by the contract owner\n    /// @param _name the name of the contract for reference\n    function removeContract(string memory _name) external onlyOwner {\n        ContractData memory contractData = contracts[_name];\n        require(contracts[_name].contractAddress != address(0), \"Contract does not exist\");\n        \n        address contractAddress = contractData.contractAddress;\n        delete contracts[_name];\n        numberOfContracts--;\n\n        emit ContractRemoved(contractAddress, _name);\n    }\n\n    //--------------------------------------------------------------------------------------\n    //-----------------------------------  SETTER  -----------------------------------------\n    //--------------------------------------------------------------------------------------\n\n    /// @notice Facilitates the change of ownership\n    /// @dev Only called by the contract owner\n    /// @param _newOwner the address of the new owner\n    function setOwner(address _newOwner) external onlyOwner {\n        require(_newOwner != address(0), \"Cannot be zero addr\");\n        owner = _newOwner;\n    }\n\n    //--------------------------------------------------------------------------------------\n    //------------------------------------  GETTER  ----------------------------------------\n    //--------------------------------------------------------------------------------------\n\n    function getContractAddress(string memory _name) external view returns (address) {\n        return contracts[_name].contractAddress;\n    }\n\n    function getImplementationAddress(string memory _name) external view returns (address) {\n        address localContractAddress = contracts[_name].contractAddress;\n        try EtherFiProxy(localContractAddress).getImplementation() returns (address result) {\n            return result;\n        } catch {\n            return address(0);\n        }\n    }\n\n    //--------------------------------------------------------------------------------------\n    //-----------------------------------  MODIFIERS  --------------------------------------\n    //--------------------------------------------------------------------------------------\n\n    modifier onlyOwner() {\n        require(msg.sender == owner, \"Only owner function\");\n        _;\n    }\n}"
      },
      "lib/openzeppelin-contracts-upgradeable/contracts/utils/AddressUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n    /**\n     * @dev Returns true if `account` is a contract.\n     *\n     * [IMPORTANT]\n     * ====\n     * It is unsafe to assume that an address for which this function returns\n     * false is an externally-owned account (EOA) and not a contract.\n     *\n     * Among others, `isContract` will return false for the following\n     * types of addresses:\n     *\n     *  - an externally-owned account\n     *  - a contract in construction\n     *  - an address where a contract will be created\n     *  - an address where a contract lived, but was destroyed\n     * ====\n     *\n     * [IMPORTANT]\n     * ====\n     * You shouldn't rely on `isContract` to protect against flash loan attacks!\n     *\n     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n     * constructor.\n     * ====\n     */\n    function isContract(address account) internal view returns (bool) {\n        // This method relies on extcodesize/address.code.length, which returns 0\n        // for contracts in construction, since the code is only stored at the end\n        // of the constructor execution.\n\n        return account.code.length > 0;\n    }\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        require(success, \"Address: unable to send value, recipient may have reverted\");\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason, it is bubbled up by this\n     * function (like regular Solidity function calls).\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n     * `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(address(this).balance >= value, \"Address: insufficient balance for call\");\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        return functionStaticCall(target, data, \"Address: low-level static call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n     *\n     * _Available since v4.8._\n     */\n    function verifyCallResultFromTarget(\n        address target,\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        if (success) {\n            if (returndata.length == 0) {\n                // only check isContract if the call was successful and the return data is empty\n                // otherwise we already know that it was a contract\n                require(isContract(target), \"Address: call to non-contract\");\n            }\n            return returndata;\n        } else {\n            _revert(returndata, errorMessage);\n        }\n    }\n\n    /**\n     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n     * revert reason or using the provided one.\n     *\n     * _Available since v4.3._\n     */\n    function verifyCallResult(\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal pure returns (bytes memory) {\n        if (success) {\n            return returndata;\n        } else {\n            _revert(returndata, errorMessage);\n        }\n    }\n\n    function _revert(bytes memory returndata, string memory errorMessage) private pure {\n        // Look for revert reason and bubble it up if present\n        if (returndata.length > 0) {\n            // The easiest way to bubble the revert reason is using memory via assembly\n            /// @solidity memory-safe-assembly\n            assembly {\n                let returndata_size := mload(returndata)\n                revert(add(32, returndata), returndata_size)\n            }\n        } else {\n            revert(errorMessage);\n        }\n    }\n}\n"
      },
      "lib/openzeppelin-contracts-upgradeable/contracts/interfaces/draft-IERC1822Upgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822ProxiableUpgradeable {\n    /**\n     * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n     * address.\n     *\n     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n     * function revert if invoked through a proxy.\n     */\n    function proxiableUUID() external view returns (bytes32);\n}\n"
      },
      "lib/openzeppelin-contracts-upgradeable/contracts/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeaconUpgradeable.sol\";\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../../utils/AddressUpgradeable.sol\";\nimport \"../../utils/StorageSlotUpgradeable.sol\";\nimport \"../utils/Initializable.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967UpgradeUpgradeable is Initializable {\n    function __ERC1967Upgrade_init() internal onlyInitializing {\n    }\n\n    function __ERC1967Upgrade_init_unchained() internal onlyInitializing {\n    }\n    // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n    bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n    /**\n     * @dev Storage slot with the address of the current implementation.\n     * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n     * validated in the constructor.\n     */\n    bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n    /**\n     * @dev Emitted when the implementation is upgraded.\n     */\n    event Upgraded(address indexed implementation);\n\n    /**\n     * @dev Returns the current implementation address.\n     */\n    function _getImplementation() internal view returns (address) {\n        return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new address in the EIP1967 implementation slot.\n     */\n    function _setImplementation(address newImplementation) private {\n        require(AddressUpgradeable.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n        StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n    }\n\n    /**\n     * @dev Perform implementation upgrade\n     *\n     * Emits an {Upgraded} event.\n     */\n    function _upgradeTo(address newImplementation) internal {\n        _setImplementation(newImplementation);\n        emit Upgraded(newImplementation);\n    }\n\n    /**\n     * @dev Perform implementation upgrade with additional setup call.\n     *\n     * Emits an {Upgraded} event.\n     */\n    function _upgradeToAndCall(\n        address newImplementation,\n        bytes memory data,\n        bool forceCall\n    ) internal {\n        _upgradeTo(newImplementation);\n        if (data.length > 0 || forceCall) {\n            _functionDelegateCall(newImplementation, data);\n        }\n    }\n\n    /**\n     * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n     *\n     * Emits an {Upgraded} event.\n     */\n    function _upgradeToAndCallUUPS(\n        address newImplementation,\n        bytes memory data,\n        bool forceCall\n    ) internal {\n        // Upgrades from old implementations will perform a rollback test. This test requires the new\n        // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n        // this special case will break upgrade paths from old UUPS implementation to new ones.\n        if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {\n            _setImplementation(newImplementation);\n        } else {\n            try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n                require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n            } catch {\n                revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n            }\n            _upgradeToAndCall(newImplementation, data, forceCall);\n        }\n    }\n\n    /**\n     * @dev Storage slot with the admin of the contract.\n     * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n     * validated in the constructor.\n     */\n    bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n    /**\n     * @dev Emitted when the admin account has changed.\n     */\n    event AdminChanged(address previousAdmin, address newAdmin);\n\n    /**\n     * @dev Returns the current admin.\n     */\n    function _getAdmin() internal view returns (address) {\n        return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new address in the EIP1967 admin slot.\n     */\n    function _setAdmin(address newAdmin) private {\n        require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n        StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n    }\n\n    /**\n     * @dev Changes the admin of the proxy.\n     *\n     * Emits an {AdminChanged} event.\n     */\n    function _changeAdmin(address newAdmin) internal {\n        emit AdminChanged(_getAdmin(), newAdmin);\n        _setAdmin(newAdmin);\n    }\n\n    /**\n     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n     * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n     */\n    bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n    /**\n     * @dev Emitted when the beacon is upgraded.\n     */\n    event BeaconUpgraded(address indexed beacon);\n\n    /**\n     * @dev Returns the current beacon.\n     */\n    function _getBeacon() internal view returns (address) {\n        return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new beacon in the EIP1967 beacon slot.\n     */\n    function _setBeacon(address newBeacon) private {\n        require(AddressUpgradeable.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n        require(\n            AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),\n            \"ERC1967: beacon implementation is not a contract\"\n        );\n        StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n    }\n\n    /**\n     * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n     * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n     *\n     * Emits a {BeaconUpgraded} event.\n     */\n    function _upgradeBeaconToAndCall(\n        address newBeacon,\n        bytes memory data,\n        bool forceCall\n    ) internal {\n        _setBeacon(newBeacon);\n        emit BeaconUpgraded(newBeacon);\n        if (data.length > 0 || forceCall) {\n            _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);\n        }\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {\n        require(AddressUpgradeable.isContract(target), \"Address: delegate call to non-contract\");\n\n        // solhint-disable-next-line avoid-low-level-calls\n        (bool success, bytes memory returndata) = target.delegatecall(data);\n        return AddressUpgradeable.verifyCallResult(success, returndata, \"Address: low-level delegate call failed\");\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[50] private __gap;\n}\n"
      },
      "lib/openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../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    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[50] private __gap;\n}\n"
      },
      "src/interfaces/IEtherFiNode.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nimport \"./IEtherFiNodesManager.sol\";\n\ninterface IEtherFiNode {\n    // State Transition Diagram for StateMachine contract:\n    //\n    //      NOT_INITIALIZED <-\n    //              |        |\n    //              ↓        |\n    //      STAKE_DEPOSITED --\n    //           /    \\      |\n    //          ↓      ↓     |\n    //         LIVE <- WAITING_FOR_APPROVAL\n    //         |  \\ \n    //         |   ↓  \n    //         |  BEING_SLASHED\n    //         |   /\n    //         ↓  ↓\n    //         EXITED\n    //         |\n    //         ↓\n    //     FULLY_WITHDRAWN\n    // \n    // Transitions are only allowed as directed above.\n    // For instance, a transition from STAKE_DEPOSITED to either LIVE or CANCELLED is allowed,\n    // but a transition from LIVE to NOT_INITIALIZED is not.\n    //\n    // All phase transitions should be made through the setPhase function,\n    // which validates transitions based on these rules.\n    //\n    enum VALIDATOR_PHASE {\n        NOT_INITIALIZED,\n        STAKE_DEPOSITED,\n        LIVE,\n        EXITED,\n        FULLY_WITHDRAWN,\n        DEPRECATED_CANCELLED,\n        BEING_SLASHED,\n        DEPRECATED_EVICTED,\n        WAITING_FOR_APPROVAL,\n        DEPRECATED_READY_FOR_DEPOSIT\n    }\n\n    // VIEW functions\n    function numAssociatedValidators() external view returns (uint256);\n    function numExitRequestsByTnft() external view returns (uint16);\n    function numExitedValidators() external view returns (uint16);\n    function version() external view returns (uint16);\n    function eigenPod() external view returns (address);\n    function calculateTVL(uint256 _beaconBalance, IEtherFiNodesManager.ValidatorInfo memory _info, IEtherFiNodesManager.RewardsSplit memory _SRsplits, bool _onlyWithdrawable) external view returns (uint256, uint256, uint256, uint256);\n    function getNonExitPenalty(uint32 _tNftExitRequestTimestamp, uint32 _bNftExitRequestTimestamp) external view returns (uint256);\n    function getRewardsPayouts(uint32 _exitRequestTimestamp, IEtherFiNodesManager.RewardsSplit memory _splits) external view returns (uint256, uint256, uint256, uint256);\n    function getFullWithdrawalPayouts(IEtherFiNodesManager.ValidatorInfo memory _info, IEtherFiNodesManager.RewardsSplit memory _SRsplits) external view returns (uint256, uint256, uint256, uint256);\n    function associatedValidatorIds(uint256 _index) external view returns (uint256);\n    function validatePhaseTransition(VALIDATOR_PHASE _currentPhase, VALIDATOR_PHASE _newPhase) external pure returns (bool);\n\n    function DEPRECATED_exitRequestTimestamp() external view returns (uint32);\n    function DEPRECATED_exitTimestamp() external view returns (uint32);\n    function DEPRECATED_phase() external view returns (VALIDATOR_PHASE);\n\n    // Non-VIEW functions\n    function initialize(address _etherFiNodesManager) external;\n    function claimQueuedWithdrawals(uint256 maxNumWithdrawals, bool _checkIfHasOutstandingEigenLayerWithdrawals) external returns (bool);\n    function createEigenPod() external;\n    function hasOutstaingEigenPodWithdrawalsQueuedBeforeExit() external view returns (bool);\n    function isRestakingEnabled() external view returns (bool);\n    function processNodeExit() external;\n    function queueRestakedWithdrawal() external;\n    function updateNumberOfAssociatedValidators(uint16 _up, uint16 _down) external;\n    function updateNumExitedValidators(uint16 _up, uint16 _down) external;\n    function registerValidator(uint256 _validatorId, bool _enableRestaking) external;\n    function unRegisterValidator(uint256 _validatorId, IEtherFiNodesManager.ValidatorInfo memory _info) external returns (bool);\n    function splitBalanceInExecutionLayer() external view returns (uint256 _withdrawalSafe, uint256 _eigenPod, uint256 _delayedWithdrawalRouter);\n    function totalBalanceInExecutionLayer() external view returns (uint256);\n    function withdrawableBalanceInExecutionLayer() external view returns (uint256);\n    function updateNumExitRequests(uint16 _up, uint16 _down) external;\n    function migrateVersion(uint256 _validatorId, IEtherFiNodesManager.ValidatorInfo memory _info) external;\n\n    function callEigenPod(bytes calldata data) external payable;\n    function callDelegationManager(bytes calldata data) external payable;\n    function callEigenPodManager(bytes calldata data) external payable;\n\n    function withdrawFunds(\n        address _treasury,\n        uint256 _treasuryAmount,\n        address _operator,\n        uint256 _operatorAmount,\n        address _tnftHolder,\n        uint256 _tnftAmount,\n        address _bnftHolder,\n        uint256 _bnftAmount\n    ) external;\n\n    function moveFundsToManager(uint256 _amount) external;\n}\n"
      },
      "src/eigenlayer-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 `maxPods` value is updated from `previousValue` to `newValue`\n    event MaxPodsUpdated(uint256 previousValue, uint256 newValue);\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    /**\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;\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    /// @notice Returns the maximum number of EigenPods that can be created\n    function maxPods() 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"
      },
      "src/eigenlayer-interfaces/IDelegationManager.sol": {
        "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.5.0;\n\nimport \"./IDelegationTerms.sol\";\n\n/**\n * @title The interface for the primary delegation contract for EigenLayer.\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 new operators to provide a DelegationTerms-type contract, which may mediate their interactions with stakers who delegate to them\n * - enabling any staker to delegate its stake to the operator of its choice\n * - enabling a staker to undelegate its assets from an operator (performed as part of the withdrawal process, initiated through the StrategyManager)\n */\ninterface IDelegationManager {\n\n    /**\n     * @notice This will be called by an operator to register itself as an operator that stakers can choose to delegate to.\n     * @param dt is the `DelegationTerms` contract that the operator has for those who delegate to them.\n     * @dev An operator can set `dt` equal to their own address (or another EOA address), in the event that they want to split payments\n     * in a more 'trustful' manner.\n     * @dev In the present design, once set, there is no way for an operator to ever modify the address of their DelegationTerms contract.\n     */\n    function registerAsOperator(IDelegationTerms dt) external;\n\n    /**\n     *  @notice This will be called by a staker to delegate its assets to some operator.\n     *  @param operator is the operator to whom staker (msg.sender) is delegating its assets\n     */\n    function delegateTo(address operator) external;\n\n    /**\n     * @notice Delegates from `staker` to `operator`.\n     * @dev requires that:\n     * 1) if `staker` is an EOA, then `signature` is valid ECDSA signature from `staker`, indicating their intention for this action\n     * 2) if `staker` is a contract, then `signature` must will be checked according to EIP-1271\n     */\n    function delegateToBySignature(address staker, address operator, uint256 expiry, bytes memory signature) external;\n\n    /**\n     * @notice Undelegates `staker` from the operator who they are delegated to.\n     * @notice Callable only by the StrategyManager\n     * @dev Should only ever be called in the event that the `staker` has no active deposits in EigenLayer.\n     */\n    function undelegate(address staker) external;\n\n    /// @notice returns the address of the operator that `staker` is delegated to.\n    function delegatedTo(address staker) external view returns (address);\n\n    /// @notice returns the DelegationTerms of the `operator`, which may mediate their interactions with stakers who delegate to them.\n    function delegationTerms(address operator) external view returns (IDelegationTerms);\n\n    /// @notice returns the total number of shares in `strategy` that are delegated to `operator`.\n    function operatorShares(address operator, IStrategy strategy) external view returns (uint256);\n\n    /**\n     * @notice Increases the `staker`'s delegated shares in `strategy` by `shares, typically called when the staker has further deposits into EigenLayer\n     * @dev Callable only by the StrategyManager\n     */\n    function increaseDelegatedShares(address staker, IStrategy strategy, uint256 shares) external;\n\n    /**\n     * @notice Decreases the `staker`'s delegated shares in each entry of `strategies` by its respective `shares[i]`, typically called when the staker withdraws from EigenLayer\n     * @dev Callable only by the StrategyManager\n     */\n    function decreaseDelegatedShares(\n        address staker,\n        IStrategy[] calldata strategies,\n        uint256[] calldata shares\n    ) external;\n\n    /// @notice Returns 'true' if `staker` *is* actively delegated, and 'false' otherwise.\n    function isDelegated(address staker) external view returns (bool);\n\n    /// @notice Returns 'true' if `staker` is *not* actively delegated, and 'false' otherwise.\n    function isNotDelegated(address staker) external view returns (bool);\n\n    /// @notice Returns if an operator can be delegated to, i.e. it has called `registerAsOperator`.\n    function isOperator(address operator) external view returns (bool);\n}"
      },
      "src/eigenlayer-interfaces/IDelayedWithdrawalRouter.sol": {
        "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.5.0;\n\ninterface IDelayedWithdrawalRouter {\n    // struct used to pack data into a single storage slot\n    struct DelayedWithdrawal {\n        uint224 amount;\n        uint32 blockCreated;\n    }\n\n    // struct used to store a single users delayedWithdrawal data\n    struct UserDelayedWithdrawals {\n        uint256 delayedWithdrawalsCompleted;\n        DelayedWithdrawal[] delayedWithdrawals;\n    }\n\n     /// @notice event for delayedWithdrawal creation\n    event DelayedWithdrawalCreated(address podOwner, address recipient, uint256 amount, uint256 index);\n\n    /// @notice event for the claiming of delayedWithdrawals\n    event DelayedWithdrawalsClaimed(address recipient, uint256 amountClaimed, uint256 delayedWithdrawalsCompleted);\n\n    /// @notice Emitted when the `withdrawalDelayBlocks` variable is modified from `previousValue` to `newValue`.\n    event WithdrawalDelayBlocksSet(uint256 previousValue, uint256 newValue);\n\n    /**\n     * @notice Creates an delayed withdrawal for `msg.value` to the `recipient`.\n     * @dev Only callable by the `podOwner`'s EigenPod contract.\n     */\n    function createDelayedWithdrawal(address podOwner, address recipient) external payable;\n\n    /**\n     * @notice Called in order to withdraw delayed withdrawals made to the `recipient` that have passed the `withdrawalDelayBlocks` period.\n     * @param recipient The address to claim delayedWithdrawals for.\n     * @param maxNumberOfWithdrawalsToClaim Used to limit the maximum number of withdrawals to loop through claiming.\n     */\n    function claimDelayedWithdrawals(address recipient, uint256 maxNumberOfWithdrawalsToClaim) external;\n\n    /**\n     * @notice Called in order to withdraw delayed withdrawals made to the caller that have passed the `withdrawalDelayBlocks` period.\n     * @param maxNumberOfWithdrawalsToClaim Used to limit the maximum number of withdrawals to loop through claiming.\n     */\n    function claimDelayedWithdrawals(uint256 maxNumberOfWithdrawalsToClaim) external;\n\n    /// @notice Owner-only function for modifying the value of the `withdrawalDelayBlocks` variable.\n    function setWithdrawalDelayBlocks(uint256 newValue) external;\n\n    /// @notice Getter function for the mapping `_userWithdrawals`\n    function userWithdrawals(address user) external view returns (UserDelayedWithdrawals memory);\n\n    /// @notice Getter function to get all delayedWithdrawals of the `user`\n    function getUserDelayedWithdrawals(address user) external view returns (DelayedWithdrawal[] memory);\n\n    /// @notice Getter function to get all delayedWithdrawals that are currently claimable by the `user`\n    function getClaimableUserDelayedWithdrawals(address user) external view returns (DelayedWithdrawal[] memory);\n\n    /// @notice Getter function for fetching the delayedWithdrawal at the `index`th entry from the `_userWithdrawals[user].delayedWithdrawals` array\n    function userDelayedWithdrawalByIndex(address user, uint256 index) external view returns (DelayedWithdrawal memory);\n\n    /// @notice Getter function for fetching the length of the delayedWithdrawals array of a specific user\n    function userWithdrawalsLength(address user) external view returns (uint256);\n\n    /// @notice Convenience function for checking whether or not the delayedWithdrawal at the `index`th entry from the `_userWithdrawals[user].delayedWithdrawals` array is currently claimable\n    function canClaimDelayedWithdrawal(address user, uint256 index) external view returns (bool);\n\n    /**\n     * @notice Delay enforced by this contract for completing any delayedWithdrawal. 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 withdrawalDelayBlocks() external view returns (uint256);\n}\n"
      },
      "lib/openzeppelin-contracts-upgradeable/contracts/proxy/beacon/IBeaconUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeaconUpgradeable {\n    /**\n     * @dev Must return an address that can be used as a delegate call target.\n     *\n     * {BeaconProxy} will check that this address is a contract.\n     */\n    function implementation() external view returns (address);\n}\n"
      },
      "lib/openzeppelin-contracts-upgradeable/contracts/utils/StorageSlotUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n *     function _getImplementation() internal view returns (address) {\n *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n *     }\n *\n *     function _setImplementation(address newImplementation) internal {\n *         require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n *     }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlotUpgradeable {\n    struct AddressSlot {\n        address value;\n    }\n\n    struct BooleanSlot {\n        bool value;\n    }\n\n    struct Bytes32Slot {\n        bytes32 value;\n    }\n\n    struct Uint256Slot {\n        uint256 value;\n    }\n\n    /**\n     * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n     */\n    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n     */\n    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n     */\n    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n     */\n    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n}\n"
      },
      "lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\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     * {BeaconProxy} will check that this address is a contract.\n     */\n    function implementation() external view returns (address);\n}\n"
      },
      "src/eigenlayer-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"
      },
      "src/eigenlayer-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\";\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    // packed struct for queued withdrawals; helps deal with stack-too-deep errors\n    struct 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 QueuedWithdrawal {\n        IStrategy[] strategies;\n        uint256[] shares;\n        address depositor;\n        WithdrawerAndNonce withdrawerAndNonce;\n        uint32 withdrawalStartBlock;\n        address delegatedAddress;\n    }\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 depositor\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)\n        external\n        returns (uint256 shares);\n\n\n    /**\n     * @notice Deposits `amount` of beaconchain ETH into this contract on behalf of `staker`\n     * @param staker is the entity that is restaking in eigenlayer,\n     * @param amount is the amount of beaconchain ETH being restaked,\n     * @dev Only callable by EigenPodManager.\n     */\n    function depositBeaconChainETH(address staker, uint256 amount) external;\n\n    /**\n     * @notice Records an overcommitment event on behalf of a staker. The staker's beaconChainETH shares are decremented by `amount`.\n     * @param overcommittedPodOwner is the pod owner to be slashed\n     * @param beaconChainETHStrategyIndex is the index of the beaconChainETHStrategy in case it must be removed,\n     * @param amount is the amount to decrement the slashedAddress's beaconChainETHStrategy shares\n     * @dev Only callable by EigenPodManager.\n     */\n    function recordOvercommittedBeaconChainETH(address overcommittedPodOwner, uint256 beaconChainETHStrategyIndex, uint256 amount)\n        external;\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 depositor\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 on behalf of a staker that is 'frozen' (this function will revert if the `staker` 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 depositIntoStrategyWithSignature(\n        IStrategy strategy,\n        IERC20 token,\n        uint256 amount,\n        address staker,\n        uint256 expiry,\n        bytes memory signature\n    )\n        external\n        returns (uint256 shares);\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 depositor's deposits and corresponding shares\n     * @return (depositor's strategies, shares in these strategies)\n     */\n    function getDeposits(address depositor) 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 Called by a staker to queue a withdrawal of the given amount of `shares` from each of the respective given `strategies`.\n     * @dev Stakers will complete their withdrawal by calling the 'completeQueuedWithdrawal' function.\n     * User shares are decreased in this function, but the total number of shares in each strategy remains the same.\n     * The total number of shares is decremented in the 'completeQueuedWithdrawal' function instead, which is where\n     * the funds are actually sent to the user through use of the strategies' 'withdrawal' function. This ensures\n     * that the value per share reported by each strategy will remain consistent, and that the shares will continue\n     * to accrue gains during the enforced withdrawal waiting period.\n     * @param strategyIndexes is a list of the indices in `stakerStrategyList[msg.sender]` that correspond to the strategies\n     * for which `msg.sender` is withdrawing 100% of their shares\n     * @param strategies The Strategies to withdraw from\n     * @param shares The amount of shares to withdraw from each of the respective Strategies in the `strategies` array\n     * @param withdrawer The address that can complete the withdrawal and will receive any withdrawn funds or shares upon completing the withdrawal\n     * @param undelegateIfPossible If this param is marked as 'true' *and the withdrawal will result in `msg.sender` having no shares in any Strategy,*\n     * then this function will also make an internal call to `undelegate(msg.sender)` to undelegate the `msg.sender`.\n     * @return The 'withdrawalRoot' of the newly created Queued Withdrawal\n     * @dev Strategies are removed from `stakerStrategyList` by swapping the last entry with the entry to be removed, then\n     * popping off the last entry in `stakerStrategyList`. The simplest way to calculate the correct `strategyIndexes` to input\n     * is to order the strategies *for which `msg.sender` is withdrawing 100% of their shares* from highest index in\n     * `stakerStrategyList` to lowest index\n     * @dev Note that if the withdrawal includes shares in the enshrined 'beaconChainETH' strategy, then it must *only* include shares in this strategy, and\n     * `withdrawer` must match the caller's address. The first condition is because slashing of queued withdrawals cannot be guaranteed \n     * for Beacon Chain ETH (since we cannot trigger a withdrawal from the beacon chain through a smart contract) and the second condition is because shares in\n     * the enshrined 'beaconChainETH' strategy technically represent non-fungible positions (deposits to the Beacon Chain, each pointed at a specific EigenPod).\n     */\n    function queueWithdrawal(\n        uint256[] calldata strategyIndexes,\n        IStrategy[] calldata strategies,\n        uint256[] calldata shares,\n        address withdrawer,\n        bool undelegateIfPossible\n    )\n        external returns(bytes32);\n        \n    /**\n     * @notice Used to complete the specified `queuedWithdrawal`. The function caller must match `queuedWithdrawal.withdrawer`\n     * @param queuedWithdrawal The QueuedWithdrawal 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 `strategies` array\n     * of the `queuedWithdrawal`. 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 queued withdrawal will be withdrawn from the specified strategies themselves\n     * and sent to the caller, through calls to `queuedWithdrawal.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     */\n    function completeQueuedWithdrawal(\n        QueuedWithdrawal calldata queuedWithdrawal,\n        IERC20[] calldata tokens,\n        uint256 middlewareTimesIndex,\n        bool receiveAsTokens\n    )\n        external;\n    \n    /**\n     * @notice Used to complete the specified `queuedWithdrawals`. The function caller must match `queuedWithdrawals[...].withdrawer`\n     * @param queuedWithdrawals The QueuedWithdrawals to complete.\n     * @param tokens Array of tokens for each QueuedWithdrawal. See `completeQueuedWithdrawal` for the usage of a single array.\n     * @param middlewareTimesIndexes One index to reference per QueuedWithdrawal. See `completeQueuedWithdrawal` for the usage of a single index.\n     * @param receiveAsTokens If true, the shares specified in the queued withdrawal will be withdrawn from the specified strategies themselves\n     * and sent to the caller, through calls to `queuedWithdrawal.strategies[i].withdraw`. If false, then the shares in the specified strategies\n     * will simply be transferred to the caller directly.\n     * @dev Array-ified version of `completeQueuedWithdrawal`\n     * @dev middlewareTimesIndex should be calculated off chain before calling this function by finding the first index that satisfies `slasher.canWithdraw`\n     */\n    function completeQueuedWithdrawals(\n        QueuedWithdrawal[] calldata queuedWithdrawals,\n        IERC20[][] calldata tokens,\n        uint256[] calldata middlewareTimesIndexes,\n        bool[] calldata receiveAsTokens\n    )\n        external;\n\n    /**\n     * @notice Slashes the shares of a 'frozen' operator (or a staker delegated to one)\n     * @param slashedAddress is the frozen address that is having its shares slashed\n     * @param recipient is the address that will receive the slashed funds, which could e.g. be a harmed party themself,\n     * or a MerkleDistributor-type contract that further sub-divides the slashed funds.\n     * @param strategies Strategies to slash\n     * @param shareAmounts The amount of shares to slash in each of the provided `strategies`\n     * @param tokens The tokens to use as input to the `withdraw` function of each of the provided `strategies`\n     * @param strategyIndexes is a list of the indices in `stakerStrategyList[msg.sender]` that correspond to the strategies\n     * for which `msg.sender` is withdrawing 100% of their shares\n     * @param recipient The slashed funds are withdrawn as tokens to this address.\n     * @dev strategies are removed from `stakerStrategyList` by swapping the last entry with the entry to be removed, then\n     * popping off the last entry in `stakerStrategyList`. The simplest way to calculate the correct `strategyIndexes` to input\n     * is to order the strategies *for which `msg.sender` is withdrawing 100% of their shares* from highest index in\n     * `stakerStrategyList` to lowest index\n     */\n    function slashShares(\n        address slashedAddress,\n        address recipient,\n        IStrategy[] calldata strategies,\n        IERC20[] calldata tokens,\n        uint256[] calldata strategyIndexes,\n        uint256[] calldata shareAmounts\n    )\n        external;\n\n    /**\n     * @notice Slashes an existing queued withdrawal that was created by a 'frozen' operator (or a staker delegated to one)\n     * @param recipient The funds in the slashed withdrawal are withdrawn as tokens to this address.\n     * @param queuedWithdrawal The previously queued withdrawal to be slashed\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 `strategies`\n     * array of the `queuedWithdrawal`.\n     * @param indicesToSkip Optional input parameter -- indices in the `strategies` array to skip (i.e. not call the 'withdraw' function on). This input exists\n     * so that, e.g., if the slashed QueuedWithdrawal contains a malicious strategy in the `strategies` array which always reverts on calls to its 'withdraw' function,\n     * then the malicious strategy can be skipped (with the shares in effect \"burned\"), while the non-malicious strategies are still called as normal.\n     */\n    function slashQueuedWithdrawal(address recipient, QueuedWithdrawal calldata queuedWithdrawal, IERC20[] calldata tokens, uint256[] calldata indicesToSkip)\n        external;\n\n    /// @notice Returns the keccak256 hash of `queuedWithdrawal`.\n    function calculateWithdrawalRoot(\n        QueuedWithdrawal memory queuedWithdrawal\n    )\n        external\n        pure\n        returns (bytes32);\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    */\n    function addStrategiesToDepositWhitelist(IStrategy[] calldata strategiesToWhitelist) 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 enshrined, virtual 'beaconChainETH' Strategy\n    function beaconChainETHStrategy() external view returns (IStrategy);\n\n    /// @notice Returns the number of blocks that must pass between the time a withdrawal is queued and the time it can be completed\n    function withdrawalDelayBlocks() external view returns (uint256);\n}"
      },
      "src/eigenlayer-interfaces/IEigenPod.sol": {
        "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.5.0;\n\nimport \"../eigenlayer-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"
      },
      "src/eigenlayer-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"
      },
      "src/eigenlayer-interfaces/IPausable.sol": {
        "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.5.0;\n\nimport \"./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"
      },
      "src/eigenlayer-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/eigenlayer-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 `depositor`'s address\n     * @param depositor 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 depositor, 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 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    function shares(address user) external view returns (uint256);\n}"
      },
      "src/eigenlayer-interfaces/IDelegationTerms.sol": {
        "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.5.0;\n\nimport \"./IStrategy.sol\";\n\n/**\n * @title Abstract interface for a contract that helps structure the delegation relationship.\n * @author Layr Labs, Inc.\n * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service\n * @notice The gas budget provided to this contract in calls from EigenLayer contracts is limited.\n */\ninterface IDelegationTerms {\n    function payForService(IERC20 token, uint256 amount) external payable;\n\n    function onDelegationWithdrawn(\n        address delegator,\n        IStrategy[] memory stakerStrategyList,\n        uint256[] memory stakerShares\n    ) external returns(bytes memory);\n\n    function onDelegationReceived(\n        address delegator,\n        IStrategy[] memory stakerStrategyList,\n        uint256[] memory stakerShares\n    ) external returns(bytes memory);\n}"
      },
      "src/eigenlayer-libraries/BeaconChainProofs.sol": {
        "content": "// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity ^0.8.0;\n\nimport \"./Merkle.sol\";\nimport \"./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 NUM_BEACON_BLOCK_HEADER_FIELDS = 5;\n    uint256 internal constant BEACON_BLOCK_HEADER_FIELD_TREE_HEIGHT = 3;\n\n    uint256 internal constant NUM_BEACON_BLOCK_BODY_FIELDS = 11;\n    uint256 internal constant BEACON_BLOCK_BODY_FIELD_TREE_HEIGHT = 4;\n\n    uint256 internal constant NUM_BEACON_STATE_FIELDS = 21;\n    uint256 internal constant BEACON_STATE_FIELD_TREE_HEIGHT = 5;\n\n    uint256 internal constant NUM_ETH1_DATA_FIELDS = 3;\n    uint256 internal constant ETH1_DATA_FIELD_TREE_HEIGHT = 2;\n\n    uint256 internal constant NUM_VALIDATOR_FIELDS = 8;\n    uint256 internal constant VALIDATOR_FIELD_TREE_HEIGHT = 3;\n\n    uint256 internal constant NUM_EXECUTION_PAYLOAD_HEADER_FIELDS = 15;\n    uint256 internal constant EXECUTION_PAYLOAD_HEADER_FIELD_TREE_HEIGHT = 4;\n\n    uint256 internal constant NUM_EXECUTION_PAYLOAD_FIELDS = 15;\n    uint256 internal constant EXECUTION_PAYLOAD_FIELD_TREE_HEIGHT = 4;\n\n    // HISTORICAL_ROOTS_LIMIT\t = 2**24, so tree height is 24\n    uint256 internal constant HISTORICAL_ROOTS_TREE_HEIGHT = 24;\n\n    // HISTORICAL_BATCH is root of state_roots and block_root, so number of leaves =  2^1\n    uint256 internal constant HISTORICAL_BATCH_TREE_HEIGHT = 1;\n\n    // SLOTS_PER_HISTORICAL_ROOT = 2**13, so tree height is 13\n    uint256 internal constant STATE_ROOTS_TREE_HEIGHT = 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    uint256 internal constant NUM_WITHDRAWAL_FIELDS = 4;\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 PROPOSER_INDEX_INDEX = 1;\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 HISTORICAL_BATCH_STATE_ROOT_INDEX = 1;\n    uint256 internal constant BEACON_STATE_SLOT_INDEX = 2;\n    uint256 internal constant LATEST_BLOCK_HEADER_ROOT_INDEX = 4;\n    uint256 internal constant BLOCK_ROOTS_INDEX = 5;\n    uint256 internal constant STATE_ROOTS_INDEX = 6;\n    uint256 internal constant HISTORICAL_ROOTS_INDEX = 7;\n    uint256 internal constant ETH_1_ROOT_INDEX = 8;\n    uint256 internal constant VALIDATOR_TREE_ROOT_INDEX = 11;\n    uint256 internal constant EXECUTION_PAYLOAD_HEADER_INDEX = 24;\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_SLASHED_INDEX = 3;\n    uint256 internal constant VALIDATOR_WITHDRAWABLE_EPOCH_INDEX = 7;\n\n    // in execution payload header\n    uint256 internal constant TIMESTAMP_INDEX = 9;\n    uint256 internal constant WITHDRAWALS_ROOT_INDEX = 14;\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    //In historicalBatch\n    uint256 internal constant HISTORICALBATCH_STATEROOTS_INDEX = 1;\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 = EigenlayerMerkle.merkleizeSha256(validatorFields);\n\n        // verify the proof of the validatorRoot against the beaconStateRoot\n        require(\n            EigenlayerMerkle.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            EigenlayerMerkle.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    ) 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        require(\n            withdrawalProof.withdrawalProof.length ==\n                32 * (EXECUTION_PAYLOAD_HEADER_FIELD_TREE_HEIGHT + 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 * (EXECUTION_PAYLOAD_HEADER_FIELD_TREE_HEIGHT),\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            EigenlayerMerkle.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            EigenlayerMerkle.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                EigenlayerMerkle.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            EigenlayerMerkle.verifyInclusionSha256({\n                proof: withdrawalProof.timestampProof,\n                root: withdrawalProof.executionPayloadRoot,\n                leaf: withdrawalProof.timestampRoot,\n                index: TIMESTAMP_INDEX\n            }),\n            \"BeaconChainProofs.verifyWithdrawal: Invalid blockNumber merkle proof\"\n        );\n\n        {\n            /**\n             * Next we verify the withdrawal fields against the blockRoot:\n             * First we compute the withdrawal_index relative to the blockRoot by concatenating the indexes of all the\n             * intermediate root indexes from the bottom of the sub trees (the withdrawal container) to the top, the blockRoot.\n             * Then we calculate merkleize the withdrawalFields container to calculate the the withdrawalRoot.\n             * Finally we verify the withdrawalRoot against the executionPayloadRoot.\n             *\n             *\n             * Note: EigenlayerMerkleization of the withdrawals root tree uses EigenlayerMerkleizeWithMixin, 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 = EigenlayerMerkle.merkleizeSha256(withdrawalFields);\n            require(\n                EigenlayerMerkle.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 v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\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 amount of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the amount of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves `amount` 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 amount) 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 `amount` as the allowance of `spender` over the 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 amount) external returns (bool);\n\n    /**\n     * @dev Moves `amount` tokens from `from` to `to` using the\n     * allowance mechanism. `amount` 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(\n        address from,\n        address to,\n        uint256 amount\n    ) external returns (bool);\n}\n"
      },
      "src/eigenlayer-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"
      },
      "src/eigenlayer-libraries/Merkle.sol": {
        "content": "// SPDX-License-Identifier: BUSL-1.1\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 EigenlayerMerkle {\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"
      },
      "src/eigenlayer-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"
      }
    },
    "settings": {
      "remappings": [
        "ds-test/=lib/forge-std/lib/ds-test/src/",
        "forge-std/=lib/forge-std/src/",
        "murky/=lib/murky/src/",
        "@openzeppelin/=lib/openzeppelin-contracts/",
        "@openzeppelin-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
        "@uniswap/=lib/",
        "@eigenlayer/=lib/eigenlayer-contracts/src/",
        "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
        "openzeppelin-contracts/=lib/openzeppelin-contracts/",
        "v3-core/=lib/v3-core/",
        "v3-periphery/=lib/v3-periphery/contracts/"
      ],
      "optimizer": {
        "enabled": true,
        "runs": 2000
      },
      "metadata": {
        "useLiteralContent": false,
        "bytecodeHash": "ipfs",
        "appendCBOR": true
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "evmVersion": "paris",
      "libraries": {}
    }
  }}