Skip to content

Commit

Permalink
chore: add more comment (#89)
Browse files Browse the repository at this point in the history
* chore: add more comment

* Update contracts/src/core/MachServiceManager.sol

Co-authored-by: Jun Hao Tan <[email protected]>

---------

Co-authored-by: Jun Hao Tan <[email protected]>
  • Loading branch information
renlulu and bb111189 authored Apr 5, 2024
1 parent 63fc6ab commit 927bb3f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 9 additions & 2 deletions contracts/src/core/MachServiceManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ import {
InvalidStartIndex,
InsufficientThresholdPercentages,
InvalidSender,
InvalidQuorumParam
InvalidQuorumParam,
AlreadyAdded
} from "../error/Errors.sol";
import {IMachServiceManager} from "../interfaces/IMachServiceManager.sol";

Expand Down Expand Up @@ -165,6 +166,9 @@ contract MachServiceManager is
if (allowlistEnabled && !allowlist[operator]) {
revert NotInAllowlist();
}
// Stake requirement for quorum is checked in StakeRegistry.sol
// https://github.com/Layr-Labs/eigenlayer-middleware/blob/dev/src/RegistryCoordinator.sol#L488
// https://github.com/Layr-Labs/eigenlayer-middleware/blob/dev/src/StakeRegistry.sol#L84
_avsDirectory.registerOperatorToAVS(operator, operatorSignature);
// we don't check if this operator has registered or not as AVSDirectory has such checking already
_operators.add(operator);
Expand Down Expand Up @@ -243,7 +247,10 @@ contract MachServiceManager is
}

// store alert
_messageHashes.add(alertHeader.messageHash);
bool success = _messageHashes.add(alertHeader.messageHash);
if (!success) {
revert AlreadyAdded();
}

emit AlertConfirmed(hashedHeader, alertHeader.messageHash);
}
Expand Down
1 change: 1 addition & 0 deletions contracts/src/error/Errors.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ error InsufficientThresholdPercentages();
error InvalidQuorumParam();
error AlreadyInAllowlist();
error NotInAllowlist();
error AlreadyAdded();

// Common
error AlreadyInitialized();
Expand Down

0 comments on commit 927bb3f

Please sign in to comment.