Skip to main content

CSEjector

CSEjector.sol is a supplementary contract responsible for interactions with EIP-7002-powered Lido Withdrawal credentials via TriggerableWithdrawalsGateway (TWG). Node Operators can voluntarily eject their validators. CSStrikes.sol uses CSEjector.sol to trigger exits for validators that have surpassed the strike threshold.

Upgradability​

The contract is immutable.

State Variables​

PAUSE_ROLE​

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

RESUME_ROLE​

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

RECOVERER_ROLE​

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

STAKING_MODULE_ID​

uint256 public immutable STAKING_MODULE_ID;

MODULE​

ICSModule public immutable MODULE;

STRIKES​

address public immutable STRIKES;

Functions​

resume​

Resume ejection methods calls

function resume() external onlyRole(RESUME_ROLE);

pauseFor​

Pause ejection methods calls

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

Parameters

NameTypeDescription
durationuint256Duration of the pause in seconds

voluntaryEject​

Withdraw the validator key from the Node Operator

function voluntaryEject(uint256 nodeOperatorId, uint256 startFrom, uint256 keysCount, address refundRecipient)
external
payable
whenResumed;

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator
startFromuint256Index of the first key to withdraw
keysCountuint256Number of keys to withdraw
refundRecipientaddressAddress to send the refund to

voluntaryEjectByArray​

Withdraw the validator key from the Node Operator

Additional method for non-sequential keys to save gas and decrease fee amount compared to separate transactions.

function voluntaryEjectByArray(uint256 nodeOperatorId, uint256[] calldata keyIndices, address refundRecipient)
external
payable
whenResumed;

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator
keyIndicesuint256[]Array of indices of the keys to withdraw
refundRecipientaddressAddress to send the refund to

ejectBadPerformer​

Eject Node Operator's key as a bad performer

function ejectBadPerformer(uint256 nodeOperatorId, uint256 keyIndex, address refundRecipient)
external
payable
whenResumed
onlyStrikes;

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator
keyIndexuint256index of deposited key to eject
refundRecipientaddressAddress to send the refund to

triggerableWithdrawalsGateway​

TriggerableWithdrawalsGateway implementation used by the contract.

function triggerableWithdrawalsGateway() public view returns (ITriggerableWithdrawalsGateway);