IEigenPodManager

Git Source

Author: Layr Labs, Inc.

Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service

Functions

createPod

Creates an EigenPod for the sender.

Function will revert if the msg.sender already has an EigenPod.

Returns EigenPod address.

function createPod() external returns (address);

stake

Stakes for a new beacon chain validator on the sender's EigenPod. Also creates an EigenPod for the sender if they don't have one already.

function stake(bytes calldata pubkey, bytes calldata signature, bytes32 depositDataRoot) external payable;

Parameters

NameTypeDescription

pubkey

bytes

The 48 bytes public key of the beacon chain validator.

signature

bytes

The validator's signature of the deposit data.

depositDataRoot

bytes32

The root/hash of the deposit data for the validator's deposit.

recordBeaconChainETHBalanceUpdate

Changes the podOwner's shares by sharesDelta and performs a call to the DelegationManager to ensure that delegated shares are also tracked correctly

Callable only by the podOwner's EigenPod contract.

Reverts if sharesDelta is not a whole Gwei amount

function recordBeaconChainETHBalanceUpdate(address podOwner, int256 sharesDelta) external;

Parameters

NameTypeDescription

podOwner

address

is the pod owner whose balance is being updated.

sharesDelta

int256

is the change in podOwner's beaconChainETHStrategy shares

updateBeaconChainOracle

Updates the oracle contract that provides the beacon chain state root

Callable only by the owner of this contract (i.e. governance)

function updateBeaconChainOracle(IBeaconChainOracle newBeaconChainOracle) external;

Parameters

NameTypeDescription

newBeaconChainOracle

IBeaconChainOracle

is the new oracle contract being pointed to

ownerToPod

Returns the address of the podOwner's EigenPod if it has been deployed.

function ownerToPod(address podOwner) external view returns (IEigenPod);

getPod

Returns the address of the podOwner's EigenPod (whether it is deployed yet or not).

function getPod(address podOwner) external view returns (IEigenPod);

ethPOS

The ETH2 Deposit Contract

function ethPOS() external view returns (IETHPOSDeposit);

eigenPodBeacon

Beacon proxy to which the EigenPods point

function eigenPodBeacon() external view returns (IBeacon);

beaconChainOracle

Oracle contract that provides updates to the beacon chain's state

function beaconChainOracle() external view returns (IBeaconChainOracle);

getBlockRootAtTimestamp

Returns the beacon block root at timestamp. Reverts if the Beacon block root at timestamp has not yet been finalized.

function getBlockRootAtTimestamp(uint64 timestamp) external view returns (bytes32);

strategyManager

EigenLayer's StrategyManager contract

function strategyManager() external view returns (IStrategyManager);

slasher

EigenLayer's Slasher contract

function slasher() external view returns (ISlasher);

hasPod

Whether the podOwner has an EigenPod deployed.

function hasPod(address podOwner) external view returns (bool);

podOwnerShares

Mapping from Pod owner owner to the number of shares they have in the virtual beacon chain ETH strategy.

The share amount can become negative. This is necessary to accommodate the fact that a pod owner's virtual beacon chain ETH shares can decrease between the pod owner queuing and completing a withdrawal. When the pod owner's shares would otherwise increase, this "deficit" is decreased first instead. Likewise, when a withdrawal is completed, this "deficit" is decreased and the withdrawal amount is decreased; We can think of this as the withdrawal "paying off the deficit".

function podOwnerShares(address podOwner) external view returns (int256);

beaconChainETHStrategy

returns canonical, virtual beaconChainETH strategy

function beaconChainETHStrategy() external view returns (IStrategy);

removeShares

Used by the DelegationManager to remove a pod owner's shares while they're in the withdrawal queue. Simply decreases the podOwner's shares by shares, down to a minimum of zero.

This function reverts if it would result in podOwnerShares[podOwner] being less than zero, i.e. it is forbidden for this function to result in the podOwner incurring a "share deficit". This behavior prevents a Staker from queuing a withdrawal which improperly removes excessive shares from the operator to whom the staker is delegated.

Reverts if shares is not a whole Gwei amount

function removeShares(address podOwner, uint256 shares) external;

addShares

Increases the podOwner's shares by shares, paying off deficit if possible. Used by the DelegationManager to award a pod owner shares on exiting the withdrawal queue

Returns the number of shares added to podOwnerShares[podOwner] above zero, which will be less than the shares input in the event that the podOwner has an existing shares deficit (i.e. podOwnerShares[podOwner] starts below zero)

Reverts if shares is not a whole Gwei amount

function addShares(address podOwner, uint256 shares) external returns (uint256);

withdrawSharesAsTokens

Used by the DelegationManager to complete a withdrawal, sending tokens to some destination address

Prioritizes decreasing the podOwner's share deficit, if they have one

Reverts if shares is not a whole Gwei amount

function withdrawSharesAsTokens(address podOwner, address destination, uint256 shares) external;

Events

BeaconOracleUpdated

Emitted to notify the update of the beaconChainOracle address

event BeaconOracleUpdated(address indexed newOracleAddress);

PodDeployed

Emitted to notify the deployment of an EigenPod

event PodDeployed(address indexed eigenPod, address indexed podOwner);

BeaconChainETHDeposited

Emitted to notify a deposit of beacon chain ETH recorded in the strategy manager

event BeaconChainETHDeposited(address indexed podOwner, uint256 amount);

MaxPodsUpdated

Emitted when maxPods value is updated from previousValue to newValue

event MaxPodsUpdated(uint256 previousValue, uint256 newValue);

BeaconChainETHWithdrawalCompleted

Emitted when a withdrawal of beacon chain ETH is completed

event BeaconChainETHWithdrawalCompleted(
    address indexed podOwner,
    uint256 shares,
    uint96 nonce,
    address delegatedAddress,
    address withdrawer,
    bytes32 withdrawalRoot
);

Last updated