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
| Name | Type | Description |
|---|---|---|
duration | uint256 | Duration 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
| Name | Type | Description |
|---|---|---|
nodeOperatorId | uint256 | ID of the Node Operator |
startFrom | uint256 | Index of the first key to withdraw |
keysCount | uint256 | Number of keys to withdraw |
refundRecipient | address | Address 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
| Name | Type | Description |
|---|---|---|
nodeOperatorId | uint256 | ID of the Node Operator |
keyIndices | uint256[] | Array of indices of the keys to withdraw |
refundRecipient | address | Address 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
| Name | Type | Description |
|---|---|---|
nodeOperatorId | uint256 | ID of the Node Operator |
keyIndex | uint256 | index of deposited key to eject |
refundRecipient | address | Address to send the refund to |
triggerableWithdrawalsGateway​
TriggerableWithdrawalsGateway implementation used by the contract.
function triggerableWithdrawalsGateway() public view returns (ITriggerableWithdrawalsGateway);