Skip to content

Commit

Permalink
fix: bug in registration
Browse files Browse the repository at this point in the history
  • Loading branch information
gpsanant committed Feb 1, 2025
1 parent 2c04380 commit 15c5636
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/RegistryCoordinator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ contract RegistryCoordinator is RegistryCoordinatorStorage {
SignatureWithSaltAndExpiry memory operatorSignature
) external onlyWhenNotPaused(PAUSED_REGISTER_OPERATOR) {
require(!isM2QuorumRegistrationDisabled, M2QuorumRegistrationIsDisabled());
require(quorumNumbers.orderedBytesArrayToBitmap().isSubsetOf(m2QuorumBitmap), OnlyM2QuorumsAllowed());

// Check if the operator has registered before
bool operatorRegisteredBefore = _operatorInfo[msg.sender].status == OperatorStatus.REGISTERED;
Expand Down Expand Up @@ -91,7 +92,8 @@ contract RegistryCoordinator is RegistryCoordinatorStorage {
SignatureWithSaltAndExpiry memory operatorSignature
) external onlyWhenNotPaused(PAUSED_REGISTER_OPERATOR) {
require(!isM2QuorumRegistrationDisabled, M2QuorumRegistrationIsDisabled());

require(quorumNumbers.orderedBytesArrayToBitmap().isSubsetOf(m2QuorumBitmap), OnlyM2QuorumsAllowed());

// Check if the operator has registered before
bool operatorRegisteredBefore = _operatorInfo[msg.sender].status == OperatorStatus.REGISTERED;

Expand Down
2 changes: 2 additions & 0 deletions src/interfaces/IRegistryCoordinator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ interface IRegistryCoordinatorErrors is ISlashingRegistryCoordinatorErrors {
error M2QuorumRegistrationIsDisabled();
/// @notice Thrown when operator set operations are attempted while not enabled.
error OperatorSetsNotEnabled();
/// @notice Thrown when only M2 quorums are allowed.
error OnlyM2QuorumsAllowed();
}

interface IRegistryCoordinatorTypes is ISlashingRegistryCoordinatorTypes {}
Expand Down

0 comments on commit 15c5636

Please sign in to comment.