Skip to main content

CSModule

CSModule.sol is the core module contract conforming to the IStakingModule interface. It stores information about Node Operators and deposit data (DD). This contract is used as an entry point for the Node Operators. It is responsible for all interactions with the StakingRouter, namely, the DD queue management and Node Operator's params.

Upgradability

The contract uses OssifiableProxy for upgradability.

State Variables

PAUSE_ROLE

bytes32 public constant PAUSE_ROLE = keccak256("PAUSE_ROLE");

RESUME_ROLE

bytes32 public constant RESUME_ROLE = keccak256("RESUME_ROLE");

MODULE_MANAGER_ROLE

bytes32 public constant MODULE_MANAGER_ROLE = keccak256("MODULE_MANAGER_ROLE");

STAKING_ROUTER_ROLE

bytes32 public constant STAKING_ROUTER_ROLE = keccak256("STAKING_ROUTER_ROLE");

REPORT_EL_REWARDS_STEALING_PENALTY_ROLE

bytes32 public constant REPORT_EL_REWARDS_STEALING_PENALTY_ROLE = keccak256("REPORT_EL_REWARDS_STEALING_PENALTY_ROLE");

SETTLE_EL_REWARDS_STEALING_PENALTY_ROLE

bytes32 public constant SETTLE_EL_REWARDS_STEALING_PENALTY_ROLE = keccak256("SETTLE_EL_REWARDS_STEALING_PENALTY_ROLE");

VERIFIER_ROLE

bytes32 public constant VERIFIER_ROLE = keccak256("VERIFIER_ROLE");

RECOVERER_ROLE

bytes32 public constant RECOVERER_ROLE = keccak256("RECOVERER_ROLE");

DEPOSIT_SIZE

uint256 private constant DEPOSIT_SIZE = 32 ether;

FORCED_TARGET_LIMIT_MODE_ID

uint8 private constant FORCED_TARGET_LIMIT_MODE_ID = 2;

INITIAL_SLASHING_PENALTY

uint256 public immutable INITIAL_SLASHING_PENALTY;

EL_REWARDS_STEALING_FINE

uint256 public immutable EL_REWARDS_STEALING_FINE;

MAX_SIGNING_KEYS_PER_OPERATOR_BEFORE_PUBLIC_RELEASE

uint256 public immutable MAX_SIGNING_KEYS_PER_OPERATOR_BEFORE_PUBLIC_RELEASE;

MAX_KEY_REMOVAL_CHARGE

uint256 public immutable MAX_KEY_REMOVAL_CHARGE;

MODULE_TYPE

bytes32 private immutable MODULE_TYPE;

LIDO_LOCATOR

ILidoLocator public immutable LIDO_LOCATOR;

STETH

IStETH public immutable STETH;

keyRemovalCharge

uint256 public keyRemovalCharge;

depositQueue

QueueLib.Queue public depositQueue;

accounting

ICSAccounting public accounting;

earlyAdoption

ICSEarlyAdoption public earlyAdoption;

publicRelease

bool public publicRelease;

Functions

resume

Resume creation of the Node Operators and keys upload

function resume() external onlyRole(RESUME_ROLE);

pauseFor

Pause creation of the Node Operators and keys upload for duration seconds. Existing NO management and reward claims are still available. To pause reward claims use pause method on CSAccounting

function pauseFor(uint256 duration) external onlyRole(PAUSE_ROLE);

Parameters

NameTypeDescription
durationuint256Duration of the pause in seconds

activatePublicRelease

Activate public release mode Enable permissionless creation of the Node Operators Remove the keys limit for the Node Operators

function activatePublicRelease() external onlyRole(MODULE_MANAGER_ROLE);

setKeyRemovalCharge

Set the key removal charge amount. A charge is taken from the bond for each removed key

function setKeyRemovalCharge(uint256 amount) external onlyRole(MODULE_MANAGER_ROLE);

Parameters

NameTypeDescription
amountuint256Amount of stETH in wei to be charged for removing a single key

addNodeOperatorETH

Add a new Node Operator using ETH as a bond. At least one deposit data and corresponding bond should be provided

function addNodeOperatorETH(
uint256 keysCount,
bytes calldata publicKeys,
bytes calldata signatures,
NodeOperatorManagementProperties calldata managementProperties,
bytes32[] calldata eaProof,
address referrer
) external payable whenResumed;

Parameters

NameTypeDescription
keysCountuint256Signing keys count
publicKeysbytesPublic keys to submit
signaturesbytesSignatures of (deposit_message_root, domain) tuples https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/beacon-chain.md#signingdata
managementPropertiesNodeOperatorManagementPropertiesOptional. Management properties to be used for the Node Operator. managerAddress: Used as managerAddress for the Node Operator. If not passed msg.sender will be used. rewardAddress: Used as rewardAddress for the Node Operator. If not passed msg.sender will be used. extendedManagerPermissions: Flag indicating that managerAddress will be able to change rewardAddress. If set to true resetNodeOperatorManagerAddress method will be disabled
eaProofbytes32[]Optional. Merkle proof of the sender being eligible for the Early Adoption
referreraddressOptional. Referrer address. Should be passed when Node Operator is created using partners integration

addNodeOperatorStETH

Add a new Node Operator using stETH as a bond. At least one deposit data and corresponding bond should be provided

Due to the stETH rounding issue make sure to make approval or sign permit with extra 10 wei to avoid revert

function addNodeOperatorStETH(
uint256 keysCount,
bytes calldata publicKeys,
bytes calldata signatures,
NodeOperatorManagementProperties calldata managementProperties,
ICSAccounting.PermitInput calldata permit,
bytes32[] calldata eaProof,
address referrer
) external whenResumed;

Parameters

NameTypeDescription
keysCountuint256Signing keys count
publicKeysbytesPublic keys to submit
signaturesbytesSignatures of (deposit_message_root, domain) tuples https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/beacon-chain.md#signingdata
managementPropertiesNodeOperatorManagementPropertiesOptional. Management properties to be used for the Node Operator. managerAddress: Used as managerAddress for the Node Operator. If not passed msg.sender will be used. rewardAddress: Used as rewardAddress for the Node Operator. If not passed msg.sender will be used. extendedManagerPermissions: Flag indicating that managerAddress will be able to change rewardAddress. If set to true resetNodeOperatorManagerAddress method will be disabled
permitICSAccounting.PermitInputOptional. Permit to use stETH as bond
eaProofbytes32[]Optional. Merkle proof of the sender being eligible for the Early Adoption
referreraddressOptional. Referrer address. Should be passed when Node Operator is created using partners integration

addNodeOperatorWstETH

Add a new Node Operator using wstETH as a bond. At least one deposit data and corresponding bond should be provided

Due to the stETH rounding issue make sure to make approval or sign permit with extra 10 wei to avoid revert

function addNodeOperatorWstETH(
uint256 keysCount,
bytes calldata publicKeys,
bytes calldata signatures,
NodeOperatorManagementProperties calldata managementProperties,
ICSAccounting.PermitInput calldata permit,
bytes32[] calldata eaProof,
address referrer
) external whenResumed;

Parameters

NameTypeDescription
keysCountuint256Signing keys count
publicKeysbytesPublic keys to submit
signaturesbytesSignatures of (deposit_message_root, domain) tuples https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/beacon-chain.md#signingdata
managementPropertiesNodeOperatorManagementPropertiesOptional. Management properties to be used for the Node Operator. managerAddress: Used as managerAddress for the Node Operator. If not passed msg.sender will be used. rewardAddress: Used as rewardAddress for the Node Operator. If not passed msg.sender will be used. extendedManagerPermissions: Flag indicating that managerAddress will be able to change rewardAddress. If set to true resetNodeOperatorManagerAddress method will be disabled
permitICSAccounting.PermitInputOptional. Permit to use wstETH as bond
eaProofbytes32[]Optional. Merkle proof of the sender being eligible for the Early Adoption
referreraddressOptional. Referrer address. Should be passed when Node Operator is created using partners integration

addValidatorKeysETH

Add new keys to the existing Node Operator using ETH as a bond

function addValidatorKeysETH(
uint256 nodeOperatorId,
uint256 keysCount,
bytes calldata publicKeys,
bytes calldata signatures
) external payable whenResumed;

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator
keysCountuint256Signing keys count
publicKeysbytesPublic keys to submit
signaturesbytesSignatures of (deposit_message_root, domain) tuples https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/beacon-chain.md#signingdata

addValidatorKeysStETH

Add new keys to the existing Node Operator using stETH as a bond

Due to the stETH rounding issue make sure to make approval or sign permit with extra 10 wei to avoid revert

function addValidatorKeysStETH(
uint256 nodeOperatorId,
uint256 keysCount,
bytes calldata publicKeys,
bytes calldata signatures,
ICSAccounting.PermitInput calldata permit
) external whenResumed;

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator
keysCountuint256Signing keys count
publicKeysbytesPublic keys to submit
signaturesbytesSignatures of (deposit_message_root, domain) tuples https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/beacon-chain.md#signingdata
permitICSAccounting.PermitInputOptional. Permit to use stETH as bond

addValidatorKeysWstETH

Add new keys to the existing Node Operator using wstETH as a bond

Due to the stETH rounding issue make sure to make approval or sign permit with extra 10 wei to avoid revert

function addValidatorKeysWstETH(
uint256 nodeOperatorId,
uint256 keysCount,
bytes calldata publicKeys,
bytes calldata signatures,
ICSAccounting.PermitInput calldata permit
) external whenResumed;

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator
keysCountuint256Signing keys count
publicKeysbytesPublic keys to submit
signaturesbytesSignatures of (deposit_message_root, domain) tuples https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/beacon-chain.md#signingdata
permitICSAccounting.PermitInputOptional. Permit to use wstETH as bond

depositETH

Stake user's ETH with Lido and make a deposit in stETH to the bond of the existing Node Operator

function depositETH(uint256 nodeOperatorId) external payable;

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator

depositStETH

Deposit user's stETH to the bond of the existing Node Operator

function depositStETH(
uint256 nodeOperatorId,
uint256 stETHAmount,
ICSAccounting.PermitInput calldata permit
) external;

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator
stETHAmountuint256Amount of stETH to deposit
permitICSAccounting.PermitInputOptional. Permit to use stETH as bond

depositWstETH

Unwrap the user's wstETH and make a deposit in stETH to the bond of the existing Node Operator

function depositWstETH(
uint256 nodeOperatorId,
uint256 wstETHAmount,
ICSAccounting.PermitInput calldata permit
) external;

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator
wstETHAmountuint256Amount of wstETH to deposit
permitICSAccounting.PermitInputOptional. Permit to use wstETH as bond

claimRewardsStETH

Claim full reward (fees + bond rewards) in stETH for the given Node Operator

If stETHAmount exceeds the current claimable amount, the claimable amount will be used instead

If rewardsProof is not provided, only excess bond (bond rewards) will be available for claim

function claimRewardsStETH(
uint256 nodeOperatorId,
uint256 stETHAmount,
uint256 cumulativeFeeShares,
bytes32[] calldata rewardsProof
) external;

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator
stETHAmountuint256Amount of stETH to claim
cumulativeFeeSharesuint256Optional. Cumulative fee stETH shares for the Node Operator
rewardsProofbytes32[]Optional. Merkle proof of the rewards

claimRewardsWstETH

Claim full reward (fees + bond rewards) in wstETH for the given Node Operator

If wstETHAmount exceeds the current claimable amount, the claimable amount will be used instead

If rewardsProof is not provided, only excess bond (bond rewards) will be available for claim

function claimRewardsWstETH(
uint256 nodeOperatorId,
uint256 wstETHAmount,
uint256 cumulativeFeeShares,
bytes32[] calldata rewardsProof
) external;

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator
wstETHAmountuint256Amount of wstETH to claim
cumulativeFeeSharesuint256Optional. Cumulative fee stETH shares for the Node Operator
rewardsProofbytes32[]Optional. Merkle proof of the rewards

claimRewardsUnstETH

Request full reward (fees + bond rewards) in Withdrawal NFT (unstETH) for the given Node Operator

Amounts less than MIN_STETH_WITHDRAWAL_AMOUNT (see LidoWithdrawalQueue contract) are not allowed

Amounts above MAX_STETH_WITHDRAWAL_AMOUNT should be requested in several transactions

If ethAmount exceeds the current claimable amount, the claimable amount will be used instead

If rewardsProof is not provided, only excess bond (bond rewards) will be available for claim

Reverts if amount isn't between MIN_STETH_WITHDRAWAL_AMOUNT and MAX_STETH_WITHDRAWAL_AMOUNT

function claimRewardsUnstETH(
uint256 nodeOperatorId,
uint256 stEthAmount,
uint256 cumulativeFeeShares,
bytes32[] calldata rewardsProof
) external;

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator
stEthAmountuint256Amount of ETH to request
cumulativeFeeSharesuint256Optional. Cumulative fee stETH shares for the Node Operator
rewardsProofbytes32[]Optional. Merkle proof of the rewards

proposeNodeOperatorManagerAddressChange

Propose a new manager address for the Node Operator

function proposeNodeOperatorManagerAddressChange(
uint256 nodeOperatorId,
address proposedAddress
) external;

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator
proposedAddressaddressProposed manager address

confirmNodeOperatorManagerAddressChange

Confirm a new manager address for the Node Operator. Should be called from the currently proposed address

function confirmNodeOperatorManagerAddressChange(uint256 nodeOperatorId) external;

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator

proposeNodeOperatorRewardAddressChange

Propose a new reward address for the Node Operator

function proposeNodeOperatorRewardAddressChange(
uint256 nodeOperatorId,
address proposedAddress
) external;

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator
proposedAddressaddressProposed reward address

confirmNodeOperatorRewardAddressChange

Confirm a new reward address for the Node Operator. Should be called from the currently proposed address

function confirmNodeOperatorRewardAddressChange(uint256 nodeOperatorId) external;

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator

resetNodeOperatorManagerAddress

Reset the manager address to the reward address. Should be called from the reward address

function resetNodeOperatorManagerAddress(uint256 nodeOperatorId) external;

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator

changeNodeOperatorRewardAddress

Change rewardAddress if extendedManagerPermissions is enabled for the Node Operator

function changeNodeOperatorRewardAddress(uint256 nodeOperatorId, address newAddress) external;

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator
newAddressaddressProposed reward address

onRewardsMinted

Called when rewards are minted for the module

Called by StakingRouter

Passes through the minted stETH shares to the fee distributor

function onRewardsMinted(uint256 totalShares) external onlyRole(STAKING_ROUTER_ROLE);

updateStuckValidatorsCount

Update stuck validators count for Node Operators

Called by StakingRouter

If the stuck keys count is above zero for the Node Operator, the depositable validators count is set to 0 for this Node Operator

function updateStuckValidatorsCount(
bytes calldata nodeOperatorIds,
bytes calldata stuckValidatorsCounts
) external onlyRole(STAKING_ROUTER_ROLE);

Parameters

NameTypeDescription
nodeOperatorIdsbytesbytes packed array of Node Operator IDs
stuckValidatorsCountsbytesbytes packed array of stuck validators counts

updateExitedValidatorsCount

Update exited validators count for Node Operators

Called by StakingRouter

function updateExitedValidatorsCount(
bytes calldata nodeOperatorIds,
bytes calldata exitedValidatorsCounts
) external onlyRole(STAKING_ROUTER_ROLE);

Parameters

NameTypeDescription
nodeOperatorIdsbytesbytes packed array of Node Operator IDs
exitedValidatorsCountsbytesbytes packed array of exited validators counts

updateRefundedValidatorsCount

Update refunded validators count for the Node Operator. Non supported in CSM

Called by StakingRouter

Always reverts

refundedValidatorsCount is not used in the module

function updateRefundedValidatorsCount(uint256, uint256) external onlyRole(STAKING_ROUTER_ROLE);

updateTargetValidatorsLimits

Update target validators limits for Node Operator

Called by StakingRouter

function updateTargetValidatorsLimits(
uint256 nodeOperatorId,
uint256 targetLimitMode,
uint256 targetLimit
) external onlyRole(STAKING_ROUTER_ROLE);

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator
targetLimitModeuint256Target limit mode for the Node Operator (see https://hackmd.io/@lido/BJXRTxMRp) 0 - disabled 1 - soft mode 2 - forced mode
targetLimituint256Target limit of validators

onExitedAndStuckValidatorsCountsUpdated

Called when exited and stuck validators counts updated. This method is not used in CSM, hence it is empty

Called by StakingRouter

function onExitedAndStuckValidatorsCountsUpdated() external onlyRole(STAKING_ROUTER_ROLE);

unsafeUpdateValidatorsCount

Unsafe update of validators count for Node Operator by the DAO

Called by StakingRouter

function unsafeUpdateValidatorsCount(
uint256 nodeOperatorId,
uint256 exitedValidatorsKeysCount,
uint256 stuckValidatorsKeysCount
) external onlyRole(STAKING_ROUTER_ROLE);

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator
exitedValidatorsKeysCountuint256Exited validators counts
stuckValidatorsKeysCountuint256Stuck validators counts

decreaseVettedSigningKeysCount

Called to decrease the number of vetted keys for Node Operators with given ids

Called by StakingRouter

function decreaseVettedSigningKeysCount(
bytes calldata nodeOperatorIds,
bytes calldata vettedSigningKeysCounts
) external onlyRole(STAKING_ROUTER_ROLE);

Parameters

NameTypeDescription
nodeOperatorIdsbytesBytes packed array of the Node Operator ids
vettedSigningKeysCountsbytesBytes packed array of the new numbers of vetted keys for the Node Operators

removeKeys

Remove keys for the Node Operator and confiscate removal charge for each deleted key

function removeKeys(uint256 nodeOperatorId, uint256 startIndex, uint256 keysCount) external;

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator
startIndexuint256Index of the first key
keysCountuint256Keys count to delete

normalizeQueue

Perform queue normalization for the given Node Operator

Normalization stands for adding vetted but not enqueued keys to the queue

function normalizeQueue(uint256 nodeOperatorId) external;

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator

reportELRewardsStealingPenalty

Report EL rewards stealing for the given Node Operator

The amount equal to the stolen funds plus EL stealing fine will be locked

function reportELRewardsStealingPenalty(
uint256 nodeOperatorId,
bytes32 blockHash,
uint256 amount
) external onlyRole(REPORT_EL_REWARDS_STEALING_PENALTY_ROLE);

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator
blockHashbytes32Execution layer block hash of the proposed block with EL rewards stealing
amountuint256Amount of stolen EL rewards in ETH

cancelELRewardsStealingPenalty

Cancel previously reported and not settled EL rewards stealing penalty for the given Node Operator

The funds will be unlocked

function cancelELRewardsStealingPenalty(
uint256 nodeOperatorId,
uint256 amount
) external onlyRole(REPORT_EL_REWARDS_STEALING_PENALTY_ROLE);

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator
amountuint256Amount of penalty to cancel

settleELRewardsStealingPenalty

Settle locked bond for the given Node Operators

SETTLE_EL_REWARDS_STEALING_PENALTY_ROLE role is expected to be assigned to Easy Track

function settleELRewardsStealingPenalty(
uint256[] calldata nodeOperatorIds
) external onlyRole(SETTLE_EL_REWARDS_STEALING_PENALTY_ROLE);

Parameters

NameTypeDescription
nodeOperatorIdsuint256[]IDs of the Node Operators

compensateELRewardsStealingPenalty

Compensate EL rewards stealing penalty for the given Node Operator to prevent further validator exits

Can only be called by the Node Operator manager

function compensateELRewardsStealingPenalty(uint256 nodeOperatorId) external payable;

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator

submitWithdrawal

Report Node Operator's key as withdrawn and settle withdrawn amount

Called by the Verifier contract. See CSVerifier.processWithdrawalProof to use this method permissionless

function submitWithdrawal(
uint256 nodeOperatorId,
uint256 keyIndex,
uint256 amount,
bool isSlashed
) external onlyRole(VERIFIER_ROLE);

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator
keyIndexuint256Index of the withdrawn key in the Node Operator's keys storage
amountuint256Amount of withdrawn ETH in wei
isSlashedboolValidator is slashed or not

submitInitialSlashing

Report Node Operator's key as slashed and apply the initial slashing penalty

Called by the Verifier contract. See CSVerifier.processSlashingProof to use this method permissionless

function submitInitialSlashing(
uint256 nodeOperatorId,
uint256 keyIndex
) external onlyRole(VERIFIER_ROLE);

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator
keyIndexuint256Index of the slashed key in the Node Operator's keys storage

onWithdrawalCredentialsChanged

Called by the Staking Router when withdrawal credentials changed by DAO

Called by StakingRouter

Resets the key removal charge

Changing the WC means that the current deposit data in the queue is not valid anymore and can't be deposited So, the key removal charge should be reset to 0 to allow Node Operators to remove the keys without any charge. After keys removal the DAO should set the new key removal charge.

function onWithdrawalCredentialsChanged() external onlyRole(STAKING_ROUTER_ROLE);

obtainDepositData

Get the next depositsCount of depositable keys with signatures from the queue

Called by StakingRouter

Second param depositCalldata is not used

function obtainDepositData(
uint256 depositsCount,
bytes calldata
) external onlyRole(STAKING_ROUTER_ROLE) returns (bytes memory publicKeys, bytes memory signatures);

Parameters

NameTypeDescription
depositsCountuint256Count of deposits to get
<none>bytes

Returns

NameTypeDescription
publicKeysbytesPublic keys
signaturesbytesSignatures

cleanDepositQueue

Clean the deposit queue from batches with no depositable keys

Use eth_call to check how many items will be removed

function cleanDepositQueue(
uint256 maxItems
) external returns (uint256 removed, uint256 lastRemovedAtDepth);

Parameters

NameTypeDescription
maxItemsuint256How many queue items to review

Returns

NameTypeDescription
removeduint256Count of batches to be removed by visiting maxItems batches
lastRemovedAtDepthuint256The value to use as maxItems to remove removed batches if the static call of the method was used

depositQueueItem

Get the deposit queue item by an index

function depositQueueItem(uint128 index) external view returns (Batch);

Parameters

NameTypeDescription
indexuint128Index of a queue item

Returns

NameTypeDescription
<none>BatchDeposit queue item

isValidatorSlashed

Check if the given Node Operator's key is reported as slashed

function isValidatorSlashed(uint256 nodeOperatorId, uint256 keyIndex) external view returns (bool);

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator
keyIndexuint256Index of the key to check

Returns

NameTypeDescription
<none>boolValidator reported as slashed flag

isValidatorWithdrawn

Check if the given Node Operator's key is reported as withdrawn

function isValidatorWithdrawn(
uint256 nodeOperatorId,
uint256 keyIndex
) external view returns (bool);

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator
keyIndexuint256index of the key to check

Returns

NameTypeDescription
<none>boolValidator reported as withdrawn flag

getType

Get the module type

function getType() external view returns (bytes32);

Returns

NameTypeDescription
<none>bytes32Module type

getStakingModuleSummary

Get staking module summary

function getStakingModuleSummary()
external
view
returns (
uint256 totalExitedValidators,
uint256 totalDepositedValidators,
uint256 depositableValidatorsCount
);

getNodeOperator

Get Node Operator info

function getNodeOperator(uint256 nodeOperatorId) external view returns (NodeOperator memory);

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator

Returns

NameTypeDescription
<none>NodeOperatorNode Operator info

getNodeOperatorNonWithdrawnKeys

Get Node Operator non-withdrawn keys

function getNodeOperatorNonWithdrawnKeys(uint256 nodeOperatorId) external view returns (uint256);

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator

Returns

NameTypeDescription
<none>uint256Non-withdrawn keys count

getNodeOperatorSummary

Get Node Operator summary

depositableValidatorsCount depends on:

  • totalVettedKeys
  • totalDepositedKeys
  • totalExitedKeys
  • targetLimitMode
  • targetValidatorsCount
  • totalUnbondedKeys
  • totalStuckKeys
function getNodeOperatorSummary(
uint256 nodeOperatorId
)
external
view
returns (
uint256 targetLimitMode,
uint256 targetValidatorsCount,
uint256 stuckValidatorsCount,
uint256 refundedValidatorsCount,
uint256 stuckPenaltyEndTimestamp,
uint256 totalExitedValidators,
uint256 totalDepositedValidators,
uint256 depositableValidatorsCount
);

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator

Returns

NameTypeDescription
targetLimitModeuint256Target limit mode
targetValidatorsCountuint256Target validators count
stuckValidatorsCountuint256Stuck validators count
refundedValidatorsCountuint256Refunded validators count
stuckPenaltyEndTimestampuint256Stuck penalty end timestamp (unused)
totalExitedValidatorsuint256Total exited validators
totalDepositedValidatorsuint256Total deposited validators
depositableValidatorsCountuint256Depositable validators count

getSigningKeys

Get Node Operator signing keys

function getSigningKeys(
uint256 nodeOperatorId,
uint256 startIndex,
uint256 keysCount
) external view returns (bytes memory);

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator
startIndexuint256Index of the first key
keysCountuint256Count of keys to get

Returns

NameTypeDescription
<none>bytesSigning keys

getSigningKeysWithSignatures

Get Node Operator signing keys with signatures

function getSigningKeysWithSignatures(
uint256 nodeOperatorId,
uint256 startIndex,
uint256 keysCount
) external view returns (bytes memory keys, bytes memory signatures);

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator
startIndexuint256Index of the first key
keysCountuint256Count of keys to get

Returns

NameTypeDescription
keysbytesSigning keys
signaturesbytesSignatures of (deposit_message_root, domain) tuples https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/phase0/beacon-chain.md#signingdata

getNonce

Get nonce of the module

function getNonce() external view returns (uint256);

getNodeOperatorsCount

Get total number of Node Operators

function getNodeOperatorsCount() external view returns (uint256);

getActiveNodeOperatorsCount

Get total number of active Node Operators

function getActiveNodeOperatorsCount() external view returns (uint256);

getNodeOperatorIsActive

Get Node Operator active status

function getNodeOperatorIsActive(uint256 nodeOperatorId) external view returns (bool);

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator

Returns

NameTypeDescription
<none>boolactive Operator is active flag

getNodeOperatorIds

Get IDs of Node Operators

function getNodeOperatorIds(
uint256 offset,
uint256 limit
) external view returns (uint256[] memory nodeOperatorIds);

Parameters

NameTypeDescription
offsetuint256Offset of the first Node Operator ID to get
limituint256Count of Node Operator IDs to get

Returns

NameTypeDescription
nodeOperatorIdsuint256[]IDs of the Node Operators

Events

NodeOperatorAdded

event NodeOperatorAdded(
uint256 indexed nodeOperatorId,
address indexed managerAddress,
address indexed rewardAddress
);

ReferrerSet

event ReferrerSet(uint256 indexed nodeOperatorId, address indexed referrer);

DepositableSigningKeysCountChanged

event DepositableSigningKeysCountChanged(
uint256 indexed nodeOperatorId,
uint256 depositableKeysCount
);

VettedSigningKeysCountChanged

event VettedSigningKeysCountChanged(uint256 indexed nodeOperatorId, uint256 vettedKeysCount);

VettedSigningKeysCountDecreased

event VettedSigningKeysCountDecreased(uint256 indexed nodeOperatorId);

DepositedSigningKeysCountChanged

event DepositedSigningKeysCountChanged(uint256 indexed nodeOperatorId, uint256 depositedKeysCount);

ExitedSigningKeysCountChanged

event ExitedSigningKeysCountChanged(uint256 indexed nodeOperatorId, uint256 exitedKeysCount);

StuckSigningKeysCountChanged

event StuckSigningKeysCountChanged(uint256 indexed nodeOperatorId, uint256 stuckKeysCount);

TotalSigningKeysCountChanged

event TotalSigningKeysCountChanged(uint256 indexed nodeOperatorId, uint256 totalKeysCount);

TargetValidatorsCountChanged

event TargetValidatorsCountChanged(
uint256 indexed nodeOperatorId,
uint256 targetLimitMode,
uint256 targetValidatorsCount
);

WithdrawalSubmitted

event WithdrawalSubmitted(
uint256 indexed nodeOperatorId,
uint256 keyIndex,
uint256 amount,
bytes pubkey
);

InitialSlashingSubmitted

event InitialSlashingSubmitted(uint256 indexed nodeOperatorId, uint256 keyIndex, bytes pubkey);

PublicRelease

event PublicRelease();

KeyRemovalChargeSet

event KeyRemovalChargeSet(uint256 amount);

KeyRemovalChargeApplied

event KeyRemovalChargeApplied(uint256 indexed nodeOperatorId);

ELRewardsStealingPenaltyReported

event ELRewardsStealingPenaltyReported(
uint256 indexed nodeOperatorId,
bytes32 proposedBlockHash,
uint256 stolenAmount
);

ELRewardsStealingPenaltyCancelled

event ELRewardsStealingPenaltyCancelled(uint256 indexed nodeOperatorId, uint256 amount);

ELRewardsStealingPenaltyCompensated

event ELRewardsStealingPenaltyCompensated(uint256 indexed nodeOperatorId, uint256 amount);

ELRewardsStealingPenaltySettled

event ELRewardsStealingPenaltySettled(uint256 indexed nodeOperatorId);