// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.12; import "./BeaconChainProofs.sol"; import "./IEigenPodManager.sol"; /** * @notice DEPRECATED INTERFACE at commit hash https://github.com/Layr-Labs/eigenlayer-contracts/tree/0139d6213927c0a7812578899ddd3dda58051928 * @title The implementation contract used for restaking beacon chain ETH on EigenLayer * @author Layr Labs, Inc. * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service * @notice The main functionalities are: * - creating new ETH validators with their withdrawal credentials pointed to this contract * - proving from beacon chain state roots that withdrawal credentials are pointed to this contract * - proving from beacon chain state roots the balances of ETH validators with their withdrawal credentials * pointed to this contract * - updating aggregate balances in the EigenPodManager * - withdrawing eth when withdrawals are initiated * @dev Note that all beacon chain balances are stored as gwei within the beacon chain datastructures. We choose * to account balances in terms of gwei in the EigenPod contract and convert to wei when making calls to other contracts */ interface IEigenPod_DeprecatedM1 { enum VALIDATOR_STATUS { INACTIVE, // doesnt exist ACTIVE, // staked on ethpos and withdrawal credentials are pointed to the EigenPod OVERCOMMITTED, // proven to be overcommitted to EigenLayer WITHDRAWN // withdrawn from the Beacon Chain } // this struct keeps track of PartialWithdrawalClaims struct PartialWithdrawalClaim { PARTIAL_WITHDRAWAL_CLAIM_STATUS status; // block at which the PartialWithdrawalClaim was created uint32 creationBlockNumber; // last block (inclusive) in which the PartialWithdrawalClaim can be fraudproofed uint32 fraudproofPeriodEndBlockNumber; // amount of ETH -- in Gwei -- to be withdrawn until completion of this claim uint64 partialWithdrawalAmountGwei; } enum PARTIAL_WITHDRAWAL_CLAIM_STATUS { REDEEMED, PENDING, FAILED } /// @notice The amount of eth, in gwei, that is restaked per validator function REQUIRED_BALANCE_GWEI() external view returns(uint64); /// @notice The amount of eth, in wei, that is restaked per validator function REQUIRED_BALANCE_WEI() external view returns(uint256); /// @notice this is a mapping of validator indices to a Validator struct containing pertinent info about the validator function validatorStatus(uint40 validatorIndex) external view returns(VALIDATOR_STATUS); /// @notice the amount of execution layer ETH in this contract that is staked in EigenLayer (i.e. withdrawn from beaconchain but not EigenLayer), function restakedExecutionLayerGwei() external view returns(uint64); /// @notice Used to initialize the pointers to contracts crucial to the pod's functionality, in beacon proxy construction from EigenPodManager function initialize(address owner) external; /// @notice Called by EigenPodManager when the owner wants to create another ETH validator. function stake(bytes calldata pubkey, bytes calldata signature, bytes32 depositDataRoot) external payable; /** * @notice Transfers `amountWei` in ether from this contract to the specified `recipient` address * @notice Called by EigenPodManager to withdrawBeaconChainETH that has been added to the EigenPod's balance due to a withdrawal from the beacon chain. * @dev Called during withdrawal or slashing. * @dev Note that this function is marked as non-reentrant to prevent the recipient calling back into it */ function withdrawRestakedBeaconChainETH(address recipient, uint256 amount) external; /// @notice The single EigenPodManager for EigenLayer function eigenPodManager() external view returns (IEigenPodManager_DeprecatedM1); /// @notice The owner of this EigenPod function podOwner() external view returns (address); /// @notice an indicator of whether or not the podOwner has ever "fully restaked" by successfully calling `verifyCorrectWithdrawalCredentials`. function hasRestaked() external view returns (bool); /// @notice block number of the most recent withdrawal function mostRecentWithdrawalBlockNumber() external view returns (uint64); ///@notice mapping that tracks proven partial withdrawals function provenPartialWithdrawal(uint40 validatorIndex, uint64 slot) external view returns (bool); /** * @notice This function verifies that the withdrawal credentials of the podOwner are pointed to * this contract. It also verifies the current (not effective) balance of the validator. It verifies the provided proof of the ETH validator against the beacon chain state * root, marks the validator as 'active' in EigenLayer, and credits the restaked ETH in Eigenlayer. * @param oracleBlockNumber is the Beacon Chain blockNumber whose state root the `proof` will be proven against. * @param validatorIndex is the index of the validator being proven, refer to consensus specs * @param proofs is the bytes that prove the ETH validator's balance and withdrawal credentials against a beacon chain state root * @param validatorFields are the fields of the "Validator Container", refer to consensus specs * for details: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#validator */ function verifyWithdrawalCredentialsAndBalance( uint64 oracleBlockNumber, uint40 validatorIndex, BeaconChainProofs_DeprecatedM1.ValidatorFieldsAndBalanceProofs memory proofs, bytes32[] calldata validatorFields ) external; /** * @notice This function records an overcommitment of stake to EigenLayer on behalf of a certain ETH validator. * If successful, the overcommitted balance is penalized (available for withdrawal whenever the pod's balance allows). * The ETH validator's shares in the enshrined beaconChainETH strategy are also removed from the StrategyManager and undelegated. * @param oracleBlockNumber The oracleBlockNumber whose state root the `proof` will be proven against. * Must be within `VERIFY_OVERCOMMITTED_WINDOW_BLOCKS` of the current block. * @param validatorIndex is the index of the validator being proven, refer to consensus specs * @param proofs is the proof of the validator's balance and validatorFields in the balance tree and the balanceRoot to prove for * @param beaconChainETHStrategyIndex is the index of the beaconChainETHStrategy for the pod owner for the callback to * the StrategyManager in case it must be removed from the list of the podOwners strategies * @param validatorFields are the fields of the "Validator Container", refer to consensus specs * @dev For more details on the Beacon Chain spec, see: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#validator */ function verifyOvercommittedStake( uint40 validatorIndex, BeaconChainProofs_DeprecatedM1.ValidatorFieldsAndBalanceProofs calldata proofs, bytes32[] calldata validatorFields, uint256 beaconChainETHStrategyIndex, uint64 oracleBlockNumber ) external; /** * @notice This function records a full withdrawal on behalf of one of the Ethereum validators for this EigenPod * @param withdrawalProofs is the information needed to check the veracity of the block number and withdrawal being proven * @param validatorFieldsProof is the proof of the validator's fields in the validator tree * @param withdrawalFields are the fields of the withdrawal being proven * @param validatorFields are the fields of the validator being proven * @param beaconChainETHStrategyIndex is the index of the beaconChainETHStrategy for the pod owner for the callback to * the EigenPodManager to the StrategyManager in case it must be removed from the podOwner's list of strategies */ function verifyAndProcessWithdrawal( BeaconChainProofs_DeprecatedM1.WithdrawalProofs calldata withdrawalProofs, bytes calldata validatorFieldsProof, bytes32[] calldata validatorFields, bytes32[] calldata withdrawalFields, uint256 beaconChainETHStrategyIndex, uint64 oracleBlockNumber ) external; /// @notice Called by the pod owner to withdraw the balance of the pod when `hasRestaked` is set to false function withdrawBeforeRestaking() external; }