Skip to content

Commit

Permalink
Merge pull request #28 from chainbound/nico/fix/add-missing-fn
Browse files Browse the repository at this point in the history
fix: add missing function to deregister pre-ELIP-002
  • Loading branch information
merklefruit authored Jan 23, 2025
2 parents 6d407cf + b83967c commit 5f56f1f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions smart-contracts/src/contracts/EigenLayerMiddlewareV1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,18 @@ contract EigenLayerMiddlewareV1 is OwnableUpgradeable, UUPSUpgradeable, IAVSRegi
OPERATORS_REGISTRY.registerOperator(operator, rpcEndpoint, extraData);
}

/// @notice Deregister an operator through the AVS Directory
/// @dev This function is used before the ELIP-002 (slashing) EigenLayer upgrade to deregister operators.
/// @dev Operators must use this function to deregister before the upgrade. After the upgrade, this will be removed.
function deregisterThroughAVSDirectory() public {
address operator = msg.sender;

require(DELEGATION_MANAGER.isOperator(msg.sender), NotOperator());

AVS_DIRECTORY.deregisterOperatorFromAVS(operator);
OPERATORS_REGISTRY.pauseOperator(msg.sender);
}

// ========= AVS Registrar functions ========= //

/// @notice Allows the AllocationManager to hook into the middleware to validate operator registration
Expand Down

0 comments on commit 5f56f1f

Please sign in to comment.