Skip to content

Commit 5a4594b

Browse files
committed
refactor: natspec + StakeRegistry interface
1 parent 58772b4 commit 5a4594b

16 files changed

+466
-450
lines changed

docs/RegistryCoordinator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ These methods are used by the Owner to configure the `RegistryCoordinator`:
256256
function createQuorum(
257257
OperatorSetParam memory operatorSetParams,
258258
uint96 minimumStake,
259-
IStakeRegistry.StrategyParams[] memory strategyParams
259+
IStakeRegistryTypes.StrategyParams[] memory strategyParams
260260
)
261261
external
262262
virtual

docs/storage-report/StakeRegistry.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
|----------------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------|
99
| operatorStakeHistory | mapping(bytes32 => mapping(uint8 => struct IStakeRegistry.StakeUpdate[])) | 2 | 0 | 32 | src/StakeRegistry.sol:StakeRegistry |
1010
|----------------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------|
11-
| strategyParams | mapping(uint8 => struct IStakeRegistry.StrategyParams[]) | 3 | 0 | 32 | src/StakeRegistry.sol:StakeRegistry |
11+
| strategyParams | mapping(uint8 => struct IStakeRegistryTypes.StrategyParams[]) | 3 | 0 | 32 | src/StakeRegistry.sol:StakeRegistry |
1212
|----------------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------|
1313
| strategiesPerQuorum | mapping(uint8 => contract IStrategy[]) | 4 | 0 | 32 | src/StakeRegistry.sol:StakeRegistry |
1414
|----------------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------|
15-
| stakeTypePerQuorum | mapping(uint8 => enum StakeType) | 5 | 0 | 32 | src/StakeRegistry.sol:StakeRegistry |
15+
| stakeTypePerQuorum | mapping(uint8 => enum IStakeRegistryTypes.StakeType) | 5 | 0 | 32 | src/StakeRegistry.sol:StakeRegistry |
1616
|----------------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------|
1717
| slashableStakeLookAheadPerQuorum | mapping(uint8 => uint32) | 6 | 0 | 32 | src/StakeRegistry.sol:StakeRegistry |
1818
|----------------------------------+---------------------------------------------------------------------------+------+--------+-------+-------------------------------------|

docs/storage-report/StakeRegistryStorage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
|----------------------------------+---------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------|
99
| operatorStakeHistory | mapping(bytes32 => mapping(uint8 => struct IStakeRegistry.StakeUpdate[])) | 2 | 0 | 32 | src/StakeRegistryStorage.sol:StakeRegistryStorage |
1010
|----------------------------------+---------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------|
11-
| strategyParams | mapping(uint8 => struct IStakeRegistry.StrategyParams[]) | 3 | 0 | 32 | src/StakeRegistryStorage.sol:StakeRegistryStorage |
11+
| strategyParams | mapping(uint8 => struct IStakeRegistryTypes.StrategyParams[]) | 3 | 0 | 32 | src/StakeRegistryStorage.sol:StakeRegistryStorage |
1212
|----------------------------------+---------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------|
1313
| strategiesPerQuorum | mapping(uint8 => contract IStrategy[]) | 4 | 0 | 32 | src/StakeRegistryStorage.sol:StakeRegistryStorage |
1414
|----------------------------------+---------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------|
15-
| stakeTypePerQuorum | mapping(uint8 => enum StakeType) | 5 | 0 | 32 | src/StakeRegistryStorage.sol:StakeRegistryStorage |
15+
| stakeTypePerQuorum | mapping(uint8 => enum IStakeRegistryTypes.StakeType) | 5 | 0 | 32 | src/StakeRegistryStorage.sol:StakeRegistryStorage |
1616
|----------------------------------+---------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------|
1717
| slashableStakeLookAheadPerQuorum | mapping(uint8 => uint32) | 6 | 0 | 32 | src/StakeRegistryStorage.sol:StakeRegistryStorage |
1818
|----------------------------------+---------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------|

src/RegistryCoordinator.sol

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
} from "eigenlayer-contracts/src/contracts/interfaces/IAllocationManager.sol";
1212
import {ISocketUpdater} from "./interfaces/ISocketUpdater.sol";
1313
import {IBLSApkRegistry, IBLSApkRegistryTypes} from "./interfaces/IBLSApkRegistry.sol";
14-
import {IStakeRegistry, StakeType} from "./interfaces/IStakeRegistry.sol";
14+
import {IStakeRegistry, IStakeRegistryTypes} from "./interfaces/IStakeRegistry.sol";
1515
import {IIndexRegistry} from "./interfaces/IIndexRegistry.sol";
1616
import {IServiceManager} from "./interfaces/IServiceManager.sol";
1717
import {IRegistryCoordinator} from "./interfaces/IRegistryCoordinator.sol";
@@ -94,8 +94,8 @@ contract RegistryCoordinator is
9494
uint256 _initialPausedStatus,
9595
OperatorSetParam[] memory _operatorSetParams,
9696
uint96[] memory _minimumStakes,
97-
IStakeRegistry.StrategyParams[][] memory _strategyParams,
98-
StakeType[] memory _stakeTypes,
97+
IStakeRegistryTypes.StrategyParams[][] memory _strategyParams,
98+
IStakeRegistryTypes.StakeType[] memory _stakeTypes,
9999
uint32[] memory _lookAheadPeriods
100100
) external initializer {
101101
require(
@@ -439,24 +439,30 @@ contract RegistryCoordinator is
439439
function createTotalDelegatedStakeQuorum(
440440
OperatorSetParam memory operatorSetParams,
441441
uint96 minimumStake,
442-
IStakeRegistry.StrategyParams[] memory strategyParams
442+
IStakeRegistryTypes.StrategyParams[] memory strategyParams
443443
) external virtual onlyOwner {
444-
_createQuorum(operatorSetParams, minimumStake, strategyParams, StakeType.TOTAL_DELEGATED, 0);
444+
_createQuorum(
445+
operatorSetParams,
446+
minimumStake,
447+
strategyParams,
448+
IStakeRegistryTypes.StakeType.TOTAL_DELEGATED,
449+
0
450+
);
445451
}
446452

447453
/// @inheritdoc IRegistryCoordinator
448454
function createSlashableStakeQuorum(
449455
OperatorSetParam memory operatorSetParams,
450456
uint96 minimumStake,
451-
IStakeRegistry.StrategyParams[] memory strategyParams,
457+
IStakeRegistryTypes.StrategyParams[] memory strategyParams,
452458
uint32 lookAheadPeriod
453459
) external virtual onlyOwner {
454460
require(isUsingOperatorSets(), OperatorSetsNotEnabled());
455461
_createQuorum(
456462
operatorSetParams,
457463
minimumStake,
458464
strategyParams,
459-
StakeType.TOTAL_SLASHABLE,
465+
IStakeRegistryTypes.StakeType.TOTAL_SLASHABLE,
460466
lookAheadPeriod
461467
);
462468
}
@@ -832,8 +838,8 @@ contract RegistryCoordinator is
832838
function _createQuorum(
833839
OperatorSetParam memory operatorSetParams,
834840
uint96 minimumStake,
835-
IStakeRegistry.StrategyParams[] memory strategyParams,
836-
StakeType stakeType,
841+
IStakeRegistryTypes.StrategyParams[] memory strategyParams,
842+
IStakeRegistryTypes.StakeType stakeType,
837843
uint32 lookAheadPeriod
838844
) internal {
839845
// Increment the total quorum count. Fails if we're already at the max
@@ -870,9 +876,9 @@ contract RegistryCoordinator is
870876
});
871877
}
872878
// Initialize stake registry based on stake type
873-
if (stakeType == StakeType.TOTAL_DELEGATED) {
879+
if (stakeType == IStakeRegistryTypes.StakeType.TOTAL_DELEGATED) {
874880
stakeRegistry.initializeDelegatedStakeQuorum(quorumNumber, minimumStake, strategyParams);
875-
} else if (stakeType == StakeType.TOTAL_SLASHABLE) {
881+
} else if (stakeType == IStakeRegistryTypes.StakeType.TOTAL_SLASHABLE) {
876882
stakeRegistry.initializeSlashableStakeQuorum(
877883
quorumNumber, minimumStake, lookAheadPeriod, strategyParams
878884
);

0 commit comments

Comments
 (0)