Skip to content

Commit

Permalink
chore: forge fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
0xClandestine committed Jan 22, 2025
1 parent 268fc63 commit e4be353
Show file tree
Hide file tree
Showing 10 changed files with 714 additions and 333 deletions.
92 changes: 53 additions & 39 deletions src/RegistryCoordinator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,9 @@ contract RegistryCoordinator is
}

/// @inheritdoc IRegistryCoordinator
function deregisterOperator(bytes memory quorumNumbers)
external
onlyWhenNotPaused(PAUSED_DEREGISTER_OPERATOR)
{
function deregisterOperator(
bytes memory quorumNumbers
) external onlyWhenNotPaused(PAUSED_DEREGISTER_OPERATOR) {
// Check that either:
// 1. The AVS hasn't migrated to operator sets yet (!isOperatorSetAVS), or
// 2. The AVS has migrated but this is an M2 quorum
Expand Down Expand Up @@ -275,7 +274,11 @@ contract RegistryCoordinator is
address operator,
uint32[] memory operatorSetIds,
bytes memory data
) external override(IRegistryCoordinator, AVSRegistrar) onlyWhenNotPaused(PAUSED_REGISTER_OPERATOR) {
)
external
override(IRegistryCoordinator, AVSRegistrar)
onlyWhenNotPaused(PAUSED_REGISTER_OPERATOR)
{
require(isUsingOperatorSets(), OperatorSetsNotEnabled());
for (uint256 i = 0; i < operatorSetIds.length; i++) {
require(!isM2Quorum[uint8(operatorSetIds[i])], OperatorSetsNotSupported());
Expand Down Expand Up @@ -306,7 +309,11 @@ contract RegistryCoordinator is
function deregisterOperator(
address operator,
uint32[] memory operatorSetIds
) external override(IRegistryCoordinator, AVSRegistrar) onlyWhenNotPaused(PAUSED_REGISTER_OPERATOR) {
)
external
override(IRegistryCoordinator, AVSRegistrar)
onlyWhenNotPaused(PAUSED_REGISTER_OPERATOR)
{
require(isUsingOperatorSets(), OperatorSetsNotEnabled());
for (uint256 i = 0; i < operatorSetIds.length; i++) {
require(!isM2Quorum[uint8(operatorSetIds[i])], OperatorSetsNotSupported());
Expand All @@ -321,10 +328,9 @@ contract RegistryCoordinator is
}

/// @inheritdoc IRegistryCoordinator
function updateOperators(address[] memory operators)
external
onlyWhenNotPaused(PAUSED_UPDATE_OPERATOR)
{
function updateOperators(
address[] memory operators
) external onlyWhenNotPaused(PAUSED_UPDATE_OPERATOR) {
for (uint256 i = 0; i < operators.length; i++) {
address operator = operators[i];
OperatorInfo memory operatorInfo = _operatorInfo[operator];
Expand Down Expand Up @@ -393,11 +399,10 @@ contract RegistryCoordinator is
}

/// @inheritdoc IRegistryCoordinator
function updateSocket(string memory socket) external override(IRegistryCoordinator, ISocketUpdater) {
require(
_operatorInfo[msg.sender].status == OperatorStatus.REGISTERED,
NotRegistered()
);
function updateSocket(
string memory socket
) external override(IRegistryCoordinator, ISocketUpdater) {
require(_operatorInfo[msg.sender].status == OperatorStatus.REGISTERED, NotRegistered());
emit OperatorSocketUpdate(_operatorInfo[msg.sender].operatorId, socket);
}

Expand Down Expand Up @@ -465,17 +470,23 @@ contract RegistryCoordinator is
}

/// @inheritdoc IRegistryCoordinator
function setChurnApprover(address _churnApprover) external onlyOwner {
function setChurnApprover(
address _churnApprover
) external onlyOwner {
_setChurnApprover(_churnApprover);
}

/// @inheritdoc IRegistryCoordinator
function setEjector(address _ejector) external onlyOwner {
function setEjector(
address _ejector
) external onlyOwner {
_setEjector(_ejector);
}

/// @inheritdoc IRegistryCoordinator
function setEjectionCooldown(uint256 _ejectionCooldown) external onlyOwner {
function setEjectionCooldown(
uint256 _ejectionCooldown
) external onlyOwner {
ejectionCooldown = _ejectionCooldown;
}

Expand All @@ -484,7 +495,6 @@ contract RegistryCoordinator is
* INTERNAL FUNCTIONS
*
*/

struct RegisterResults {
uint32[] numOperatorsPerQuorum;
uint96[] operatorStakes;
Expand Down Expand Up @@ -931,35 +941,37 @@ contract RegistryCoordinator is
*/

/// @inheritdoc IRegistryCoordinator
function getOperatorSetParams(uint8 quorumNumber)
external
view
returns (OperatorSetParam memory)
{
function getOperatorSetParams(
uint8 quorumNumber
) external view returns (OperatorSetParam memory) {
return _quorumParams[quorumNumber];
}

/// @inheritdoc IRegistryCoordinator
function getOperator(address operator) external view returns (OperatorInfo memory) {
function getOperator(
address operator
) external view returns (OperatorInfo memory) {
return _operatorInfo[operator];
}

/// @inheritdoc IRegistryCoordinator
function getOperatorId(address operator) external view returns (bytes32) {
function getOperatorId(
address operator
) external view returns (bytes32) {
return _operatorInfo[operator].operatorId;
}

/// @inheritdoc IRegistryCoordinator
function getOperatorFromId(bytes32 operatorId) external view returns (address) {
function getOperatorFromId(
bytes32 operatorId
) external view returns (address) {
return blsApkRegistry.getOperatorFromPubkeyHash(operatorId);
}

/// @inheritdoc IRegistryCoordinator
function getOperatorStatus(address operator)
external
view
returns (IRegistryCoordinator.OperatorStatus)
{
function getOperatorStatus(
address operator
) external view returns (IRegistryCoordinator.OperatorStatus) {
return _operatorInfo[operator].status;
}

Expand Down Expand Up @@ -993,12 +1005,16 @@ contract RegistryCoordinator is
}

/// @inheritdoc IRegistryCoordinator
function getCurrentQuorumBitmap(bytes32 operatorId) external view returns (uint192) {
function getCurrentQuorumBitmap(
bytes32 operatorId
) external view returns (uint192) {
return _currentOperatorBitmap(operatorId);
}

/// @inheritdoc IRegistryCoordinator
function getQuorumBitmapHistoryLength(bytes32 operatorId) external view returns (uint256) {
function getQuorumBitmapHistoryLength(
bytes32 operatorId
) external view returns (uint256) {
return _operatorBitmapHistory[operatorId].length;
}

Expand Down Expand Up @@ -1031,11 +1047,9 @@ contract RegistryCoordinator is
}

/// @inheritdoc IRegistryCoordinator
function pubkeyRegistrationMessageHash(address operator)
public
view
returns (BN254.G1Point memory)
{
function pubkeyRegistrationMessageHash(
address operator
) public view returns (BN254.G1Point memory) {
return BN254.hashToG1(
_hashTypedDataV4(keccak256(abi.encode(PUBKEY_REGISTRATION_TYPEHASH, operator)))
);
Expand Down
Loading

0 comments on commit e4be353

Please sign in to comment.