-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: unify StakeRegistry state variable typing, and split RegistryC…
…oordinatorStorage into separate contract
- Loading branch information
Showing
5 changed files
with
103 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
pragma solidity =0.8.12; | ||
|
||
import {IBLSApkRegistry} from "./interfaces/IBLSApkRegistry.sol"; | ||
import {IStakeRegistry} from "./interfaces/IStakeRegistry.sol"; | ||
import {IIndexRegistry} from "./interfaces/IIndexRegistry.sol"; | ||
import {IServiceManager} from "./interfaces/IServiceManager.sol"; | ||
import {IRegistryCoordinator} from "./interfaces/IRegistryCoordinator.sol"; | ||
|
||
abstract contract RegistryCoordinatorStorage is IRegistryCoordinator { | ||
|
||
/******************************************************************************* | ||
CONSTANTS AND IMMUTABLES | ||
*******************************************************************************/ | ||
|
||
/// @notice The EIP-712 typehash for the `DelegationApproval` struct used by the contract | ||
bytes32 public constant OPERATOR_CHURN_APPROVAL_TYPEHASH = | ||
keccak256("OperatorChurnApproval(bytes32 registeringOperatorId,OperatorKickParam[] operatorKickParams)OperatorKickParam(address operator,bytes32[] operatorIdsToSwap)"); | ||
/// @notice The EIP-712 typehash used for registering BLS public keys | ||
bytes32 public constant PUBKEY_REGISTRATION_TYPEHASH = keccak256("BN254PubkeyRegistration(address operator)"); | ||
/// @notice The maximum value of a quorum bitmap | ||
uint256 internal constant MAX_QUORUM_BITMAP = type(uint192).max; | ||
/// @notice The basis point denominator | ||
uint16 internal constant BIPS_DENOMINATOR = 10000; | ||
/// @notice Index for flag that pauses operator registration | ||
uint8 internal constant PAUSED_REGISTER_OPERATOR = 0; | ||
/// @notice Index for flag that pauses operator deregistration | ||
uint8 internal constant PAUSED_DEREGISTER_OPERATOR = 1; | ||
/// @notice Index for flag pausing operator stake updates | ||
uint8 internal constant PAUSED_UPDATE_OPERATOR = 2; | ||
/// @notice The maximum number of quorums this contract supports | ||
uint8 internal constant MAX_QUORUM_COUNT = 192; | ||
|
||
/// @notice the ServiceManager for this AVS, which forwards calls onto EigenLayer's core contracts | ||
IServiceManager public immutable serviceManager; | ||
/// @notice the BLS Aggregate Pubkey Registry contract that will keep track of operators' aggregate BLS public keys per quorum | ||
IBLSApkRegistry public immutable blsApkRegistry; | ||
/// @notice the Stake Registry contract that will keep track of operators' stakes | ||
IStakeRegistry public immutable stakeRegistry; | ||
/// @notice the Index Registry contract that will keep track of operators' indexes | ||
IIndexRegistry public immutable indexRegistry; | ||
|
||
/******************************************************************************* | ||
STATE | ||
*******************************************************************************/ | ||
|
||
/// @notice the current number of quorums supported by the registry coordinator | ||
uint8 public quorumCount; | ||
/// @notice maps quorum number => operator cap and kick params | ||
mapping(uint8 => OperatorSetParam) internal _quorumParams; | ||
/// @notice maps operator id => historical quorums they registered for | ||
mapping(bytes32 => QuorumBitmapUpdate[]) internal _operatorBitmapHistory; | ||
/// @notice maps operator address => operator id and status | ||
mapping(address => OperatorInfo) internal _operatorInfo; | ||
/// @notice whether the salt has been used for an operator churn approval | ||
mapping(bytes32 => bool) public isChurnApproverSaltUsed; | ||
/// @notice mapping from quorum number to the latest block that all quorums were updated all at once | ||
mapping(uint8 => uint256) public quorumUpdateBlockNumber; | ||
|
||
/// @notice the dynamic-length array of the registries this coordinator is coordinating | ||
address[] public registries; | ||
/// @notice the address of the entity allowed to sign off on operators getting kicked out of the AVS during registration | ||
address public churnApprover; | ||
/// @notice the address of the entity allowed to eject operators from the AVS | ||
address public ejector; | ||
|
||
constructor( | ||
IServiceManager _serviceManager, | ||
IStakeRegistry _stakeRegistry, | ||
IBLSApkRegistry _blsApkRegistry, | ||
IIndexRegistry _indexRegistry | ||
) { | ||
serviceManager = _serviceManager; | ||
stakeRegistry = _stakeRegistry; | ||
blsApkRegistry = _blsApkRegistry; | ||
indexRegistry = _indexRegistry; | ||
} | ||
|
||
// storage gap for upgradeability | ||
// slither-disable-next-line shadowing-state | ||
uint256[41] private __GAP; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters