Skip to content

Commit

Permalink
refactor: natspec comments
Browse files Browse the repository at this point in the history
  • Loading branch information
neutiyoo committed May 17, 2024
1 parent 373200a commit 95e824e
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions contracts/src/core/MachServiceManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,29 @@ contract MachServiceManager is
using EnumerableSet for EnumerableSet.Bytes32Set;
using EnumerableSet for EnumerableSet.AddressSet;

/// @notice when applied to a function, ensures that the function is only callable by the `alertConfirmer`.
/**
* @dev Ensures that the function is only callable by the `alertConfirmer`.
*/
modifier onlyAlertConfirmer() {
if (_msgSender() != alertConfirmer) {
revert InvalidConfirmer();
}
_;
}

/// @notice when applied to a function, ensures that the function is only callable by the `whitelister`.
/**
* @dev Ensures that the function is only callable by the `whitelister`.
*/
modifier onlyWhitelister() {
if (_msgSender() != whitelister) {
revert NotWhitelister();
}
_;
}

/// @notice when applied to a function, ensures that the `rollupChainID` is valid.
/**
* @dev Ensures that the `rollupChainID` is valid.
*/
modifier onlyValidRollupChainID(uint256 rollupChainID) {
if (!rollupChainIDs[rollupChainID]) {
revert InvalidRollupChainID();
Expand Down Expand Up @@ -219,9 +225,7 @@ contract MachServiceManager is
//////////////////////////////////////////////////////////////////////////////

/**
* @notice Register an operator with the AVS. Forwards call to EigenLayer' AVSDirectory.
* @param operator The address of the operator to register.
* @param operatorSignature The signature, salt, and expiry of the operator's signature.
* @inheritdoc IServiceManager
*/
function registerOperatorToAVS(
address operator,
Expand All @@ -240,8 +244,7 @@ contract MachServiceManager is
}

/**
* @notice Deregister an operator from the AVS. Forwards a call to EigenLayer's AVSDirectory.
* @param operator The address of the operator to register.
* @inheritdoc IServiceManager
*/
function deregisterOperatorFromAVS(address operator)
public
Expand Down Expand Up @@ -375,14 +378,14 @@ contract MachServiceManager is
//////////////////////////////////////////////////////////////////////////////

/**
* @dev hash the alert header
* @dev Hashes an alert header
*/
function _hashAlertHeader(AlertHeader calldata alertHeader) internal pure returns (bytes32) {
return keccak256(abi.encode(_convertAlertHeaderToReducedAlertHeader(alertHeader)));
}

/**
* @dev changes the alert confirmer
* @dev Changes the alert confirmer
*/
function _setAlertConfirmer(address _alertConfirmer) internal {
address previousBatchConfirmer = alertConfirmer;
Expand All @@ -391,7 +394,7 @@ contract MachServiceManager is
}

/**
* @dev changes the whitelister
* @dev Changes the whitelister
*/
function _setWhitelister(address _whitelister) internal {
address previousWhitelister = whitelister;
Expand All @@ -400,7 +403,7 @@ contract MachServiceManager is
}

/**
* @dev converts a alert header to a reduced alert header
* @dev Converts a alert header to a reduced alert header
* @param alertHeader the alert header to convert
*/
function _convertAlertHeaderToReducedAlertHeader(AlertHeader calldata alertHeader)
Expand Down

0 comments on commit 95e824e

Please sign in to comment.