@@ -85,7 +85,7 @@ contract NodeOperatorsRegistry is AragonApp, Versioned {
85
85
// SigningKeysStats
86
86
/// @dev Operator's max validator keys count approved for deposit by the DAO
87
87
uint8 internal constant TOTAL_VETTED_KEYS_COUNT_OFFSET = 0 ;
88
- /// @dev Number of keys in the EXITED state for this operator for all time
88
+ /// @dev Number of keys in the EXITED state of this operator for all time
89
89
uint8 internal constant TOTAL_EXITED_KEYS_COUNT_OFFSET = 1 ;
90
90
/// @dev Total number of keys of this operator for all time
91
91
uint8 internal constant TOTAL_KEYS_COUNT_OFFSET = 2 ;
@@ -116,11 +116,11 @@ contract NodeOperatorsRegistry is AragonApp, Versioned {
116
116
117
117
// Summary SigningKeysStats
118
118
uint8 internal constant SUMMARY_MAX_VALIDATORS_COUNT_OFFSET = 0 ;
119
- /// @dev Number of keys in the EXITED state for this operator for all time
119
+ /// @dev Number of keys of all operators which were in the EXITED state for all time
120
120
uint8 internal constant SUMMARY_EXITED_KEYS_COUNT_OFFSET = 1 ;
121
- /// @dev Total number of keys of this operator for all time
121
+ /// @dev Total number of keys of all operators for all time
122
122
uint8 internal constant SUMMARY_TOTAL_KEYS_COUNT_OFFSET = 2 ;
123
- /// @dev Number of keys of this operator which were in DEPOSITED state for all time
123
+ /// @dev Number of keys of all operators which were in the DEPOSITED state for all time
124
124
uint8 internal constant SUMMARY_DEPOSITED_KEYS_COUNT_OFFSET = 3 ;
125
125
126
126
//
@@ -150,7 +150,7 @@ contract NodeOperatorsRegistry is AragonApp, Versioned {
150
150
// bytes32 internal constant TYPE_POSITION = keccak256("lido.NodeOperatorsRegistry.type");
151
151
bytes32 internal constant TYPE_POSITION = 0xbacf4236659a602d72c631ba0b0d67ec320aaf523f3ae3590d7faee4f42351d0 ;
152
152
153
- // bytes32 internal constant TYPE_POSITION = keccak256("lido.NodeOperatorsRegistry.stuckPenaltyDelay");
153
+ // bytes32 internal constant STUCK_PENALTY_DELAY_POSITION = keccak256("lido.NodeOperatorsRegistry.stuckPenaltyDelay");
154
154
bytes32 internal constant STUCK_PENALTY_DELAY_POSITION = 0x8e3a1f3826a82c1116044b334cae49f3c3d12c3866a1c4b18af461e12e58a18e ;
155
155
156
156
//
@@ -286,7 +286,7 @@ contract NodeOperatorsRegistry is AragonApp, Versioned {
286
286
/// @return id a unique key of the added operator
287
287
function addNodeOperator (string _name , address _rewardAddress ) external returns (uint256 id ) {
288
288
_onlyValidNodeOperatorName (_name);
289
- _onlyNonZeroAddress (_rewardAddress);
289
+ _onlyValidRewardAddress (_rewardAddress);
290
290
_auth (MANAGE_NODE_OPERATOR_ROLE);
291
291
292
292
id = getNodeOperatorsCount ();
@@ -370,7 +370,7 @@ contract NodeOperatorsRegistry is AragonApp, Versioned {
370
370
/// @param _nodeOperatorId Node operator id to set reward address for
371
371
/// @param _rewardAddress Execution layer Ethereum address to set as reward address
372
372
function setNodeOperatorRewardAddress (uint256 _nodeOperatorId , address _rewardAddress ) external {
373
- _onlyNonZeroAddress (_rewardAddress);
373
+ _onlyValidRewardAddress (_rewardAddress);
374
374
_onlyExistedNodeOperator (_nodeOperatorId);
375
375
_auth (MANAGE_NODE_OPERATOR_ROLE);
376
376
@@ -383,7 +383,7 @@ contract NodeOperatorsRegistry is AragonApp, Versioned {
383
383
/// @dev Current implementation preserves invariant: depositedSigningKeysCount <= vettedSigningKeysCount <= totalSigningKeysCount.
384
384
/// If _vettedSigningKeysCount out of range [depositedSigningKeysCount, totalSigningKeysCount], the new vettedSigningKeysCount
385
385
/// value will be set to the nearest range border.
386
- /// @param _nodeOperatorId Node operator id to set reward address for
386
+ /// @param _nodeOperatorId Node operator id to set staking limit for
387
387
/// @param _vettedSigningKeysCount New staking limit of the node operator
388
388
function setNodeOperatorStakingLimit (uint256 _nodeOperatorId , uint64 _vettedSigningKeysCount ) external {
389
389
_onlyExistedNodeOperator (_nodeOperatorId);
@@ -1439,6 +1439,13 @@ contract NodeOperatorsRegistry is AragonApp, Versioned {
1439
1439
require (bytes (_name).length > 0 && bytes (_name).length <= MAX_NODE_OPERATOR_NAME_LENGTH, "WRONG_NAME_LENGTH " );
1440
1440
}
1441
1441
1442
+ function _onlyValidRewardAddress (address _rewardAddress ) internal view {
1443
+ _onlyNonZeroAddress (_rewardAddress);
1444
+ // The Lido address is forbidden explicitly because stETH transfers on this contract will revert
1445
+ // See onExitedAndStuckValidatorsCountsUpdated() and StETH._transferShares() for details
1446
+ require (_rewardAddress != getLocator ().lido (), "LIDO_REWARD_ADDRESS " );
1447
+ }
1448
+
1442
1449
function _onlyNonZeroAddress (address _a ) internal pure {
1443
1450
require (_a != address (0 ), "ZERO_ADDRESS " );
1444
1451
}
0 commit comments