Skip to main content

TriggerableWithdrawalsGateway

What is TriggerableWithdrawalsGateway

TriggerableWithdrawalsGateway (TWG) is a gateway contract introducing an validators' execution triggerable exit path for the Lido protocol. It proxies exit request calls to the WithdrawalVault, checking permissions, applying limits, and refunding any redundant trigger fee costs.

Roles and access control

Access to lever methods is restricted using the functionality of the AccessControlEnumerable contract and a bunch of granular roles. To engage Emergency Brakes and unpause if required, it inherits from PausableContract (see GateSeals).

Methods

ADD_FULL_WITHDRAWAL_REQUEST_ROLE

An ACL role granting the permission to submit exit requests.

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

TW_EXIT_LIMIT_MANAGER_ROLE

An ACL role granting the permission to modify limit params.

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

getExitRequestLimitFullInfo

Returns information about current limits data.

function getExitRequestLimitFullInfo() external view;

Returns:

NameTypeDescription
_maxExitRequestsLimituint256Maximum exit requests limit
_exitsPerFrameuint256The number of exits that can be restored per frame
_frameDurationInSecuint256The duration of each frame, in seconds, after which exitsPerFrame exits can be restored
_prevExitRequestsLimituint256Limit left after previous requests
_currentExitRequestsLimituint256Current exit requests limit

setExitRequestLimit

Sets the maximum exit request limit and the frame during which a portion of the limit can be restored.

function setExitRequestLimit(
uint256 maxExitRequestsLimit,
uint256 exitsPerFrame,
uint256 frameDurationInSec
) external onlyRole(TW_EXIT_LIMIT_MANAGER_ROLE);

Parameters:

NameTypeDescription
maxExitRequestsLimituint256The maximum number of exit requests.
exitsPerFrameuint256The number of exits that can be restored per frame.
frameDurationInSecuint256The duration of each frame, in seconds, after which exitsPerFrame exits can be restored.

triggerFullWithdrawals

Submits Triggerable Withdrawal Requests to the Withdrawal Vault as full withdrawal requests for the specified validator public keys.

function triggerFullWithdrawals(
IStakingRouter.ValidatorExitData[] calldata validatorsData,
address refundRecipient,
uint256 exitType,
) external payable onlyRole(ADD_FULL_WITHDRAWAL_REQUEST_ROLE) preservesEthBalance whenResumed

Structures:

struct ValidatorExitData {
uint256 stakingModuleId;
uint256 nodeOperatorId;
bytes pubkey;
}

Parameters:

NameTypeDescription
validatorsDataValidatorExitData[]An array of ValidatorExitData structs, each representing a validator for which a withdrawal request will be submitted.
refundRecipientaddressThe address that will receive any excess ETH sent for fees.
exitTypeuint256A parameter indicating the type of exit, passed to the Staking Module.

Permissions

ADD_FULL_WITHDRAWAL_REQUEST_ROLE()

An ACL role granting the permission to add withdrawal requests.

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

TW_EXIT_LIMIT_MANAGER_ROLE()

An ACL role granting the permission to change trigger request limits.

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