Skip to content

Commit

Permalink
cleanup imports (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
0x0aa0 authored and steven committed Dec 18, 2023
1 parent 8c0ee3f commit 1a2024b
Show file tree
Hide file tree
Showing 17 changed files with 85 additions and 89 deletions.
10 changes: 5 additions & 5 deletions src/BLSOperatorStateRetriever.sol
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import "./interfaces/IStakeRegistry.sol";
import "./interfaces/IBLSPubkeyRegistry.sol";
import "./interfaces/IIndexRegistry.sol";
import "./interfaces/IBLSRegistryCoordinatorWithIndices.sol";
import {IBLSRegistryCoordinatorWithIndices} from "src/interfaces/IBLSRegistryCoordinatorWithIndices.sol";
import {IBLSPubkeyRegistry} from "src/interfaces/IBLSPubkeyRegistry.sol";
import {IStakeRegistry} from "src/interfaces/IStakeRegistry.sol";
import {IIndexRegistry} from "src/interfaces/IIndexRegistry.sol";

import "./libraries/BitmapUtils.sol";
import {BitmapUtils} from "src/libraries/BitmapUtils.sol";

/**
* @title BLSOperatorStateRetriever with view functions that allow to retrieve the state of an AVSs registry system.
Expand Down
7 changes: 5 additions & 2 deletions src/BLSPubkeyRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import "./libraries/BN254.sol";
import {BLSPubkeyRegistryStorage} from "src/BLSPubkeyRegistryStorage.sol";

import "./BLSPubkeyRegistryStorage.sol";
import {IBLSPublicKeyCompendium} from "src/interfaces/IBLSPublicKeyCompendium.sol";
import {IRegistryCoordinator} from "src/interfaces/IRegistryCoordinator.sol";

import {BN254} from "src/libraries/BN254.sol";

contract BLSPubkeyRegistry is BLSPubkeyRegistryStorage {
using BN254 for BN254.G1Point;
Expand Down
12 changes: 5 additions & 7 deletions src/BLSPubkeyRegistryStorage.sol
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import "./interfaces/IBLSPubkeyRegistry.sol";
import "./interfaces/IRegistryCoordinator.sol";
import "./interfaces/IBLSPublicKeyCompendium.sol";

import "./libraries/BN254.sol";

import "@openzeppelin-upgrades/contracts/proxy/utils/Initializable.sol";
import {IBLSPubkeyRegistry} from "src/interfaces/IBLSPubkeyRegistry.sol";
import {IRegistryCoordinator} from "src/interfaces/IRegistryCoordinator.sol";
import {IBLSPublicKeyCompendium} from "src/interfaces/IBLSPublicKeyCompendium.sol";
import {BN254} from "src/libraries/BN254.sol";
import {Initializable} from "@openzeppelin-upgrades/contracts/proxy/utils/Initializable.sol";

abstract contract BLSPubkeyRegistryStorage is Initializable, IBLSPubkeyRegistry {
/// @notice the registry coordinator contract
Expand Down
5 changes: 2 additions & 3 deletions src/BLSPublicKeyCompendium.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import "./interfaces/IBLSPublicKeyCompendium.sol";

import "./libraries/BN254.sol";
import {IBLSPublicKeyCompendium} from "src/interfaces/IBLSPublicKeyCompendium.sol";
import {BN254} from "src/libraries/BN254.sol";

/**
* @title A shared contract for EigenLayer operators to register their BLS public keys.
Expand Down
38 changes: 18 additions & 20 deletions src/BLSRegistryCoordinatorWithIndices.sol
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol";
import "@openzeppelin-upgrades/contracts/proxy/utils/Initializable.sol";

import "eigenlayer-contracts/src/contracts/interfaces/IPauserRegistry.sol";
import "eigenlayer-contracts/src/contracts/interfaces/ISlasher.sol";
import "eigenlayer-contracts/src/contracts/libraries/EIP1271SignatureUtils.sol";
import "eigenlayer-contracts/src/contracts/permissions/Pausable.sol";

import "src/interfaces/IBLSRegistryCoordinatorWithIndices.sol";
import "src/interfaces/ISocketUpdater.sol";
import "src/interfaces/IServiceManager.sol";
import "src/interfaces/IBLSPubkeyRegistry.sol";
import "src/interfaces/IStakeRegistry.sol";
import "src/interfaces/IIndexRegistry.sol";
import "src/interfaces/IRegistryCoordinator.sol";

import "src/libraries/BitmapUtils.sol";
import "src/libraries/BN254.sol";


import {Initializable} from "@openzeppelin-upgrades/contracts/proxy/utils/Initializable.sol";
import {EIP712} from "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol";

import {EIP1271SignatureUtils} from "eigenlayer-contracts/src/contracts/libraries/EIP1271SignatureUtils.sol";
import {IPauserRegistry} from "eigenlayer-contracts/src/contracts/interfaces/IPauserRegistry.sol";
import {Pausable} from "eigenlayer-contracts/src/contracts/permissions/Pausable.sol";
import {ISlasher} from "eigenlayer-contracts/src/contracts/interfaces/ISlasher.sol";

import {IBLSRegistryCoordinatorWithIndices} from "src/interfaces/IBLSRegistryCoordinatorWithIndices.sol";
import {IRegistryCoordinator} from "src/interfaces/IRegistryCoordinator.sol";
import {IBLSPubkeyRegistry} from "src/interfaces/IBLSPubkeyRegistry.sol";
import {IServiceManager} from "src/interfaces/IServiceManager.sol";
import {ISocketUpdater} from "src/interfaces/ISocketUpdater.sol";
import {IStakeRegistry} from "src/interfaces/IStakeRegistry.sol";
import {IIndexRegistry} from "src/interfaces/IIndexRegistry.sol";

import {BitmapUtils} from "src/libraries/BitmapUtils.sol";
import {BN254} from "src/libraries/BN254.sol";

/**
* @title A `RegistryCoordinator` that has three registries:
Expand Down
20 changes: 9 additions & 11 deletions src/BLSSignatureChecker.sol
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import "./interfaces/IRegistryCoordinator.sol";
import "./interfaces/IStakeRegistry.sol";
import "./interfaces/IBLSPubkeyRegistry.sol";
import "./interfaces/IBLSRegistryCoordinatorWithIndices.sol";
import "./interfaces/IBLSSignatureChecker.sol";
import {IBLSRegistryCoordinatorWithIndices} from "src/interfaces/IBLSRegistryCoordinatorWithIndices.sol";
import {IBLSSignatureChecker} from "src/interfaces/IBLSSignatureChecker.sol";
import {IRegistryCoordinator} from "src/interfaces/IRegistryCoordinator.sol";
import {IBLSPubkeyRegistry} from "src/interfaces/IBLSPubkeyRegistry.sol";
import {IStakeRegistry} from "src/interfaces/IStakeRegistry.sol";

import "./libraries/BitmapUtils.sol";
import "./libraries/BN254.sol";
import {BitmapUtils} from "src/libraries/BitmapUtils.sol";
import {BN254} from "src/libraries/BN254.sol";

/**
* @title Used for checking BLS aggregate signatures from the operators of a `BLSRegistry`.
Expand Down Expand Up @@ -132,13 +132,11 @@ contract BLSSignatureChecker is IBLSSignatureChecker {
stakeRegistry.getTotalStakeAtBlockNumberFromIndex(quorumNumber, referenceBlockNumber, nonSignerStakesAndSignature.totalStakeIndices[quorumNumberIndex]);
// copy total stake to signed stake
quorumStakeTotals.signedStakeForQuorum[quorumNumberIndex] = quorumStakeTotals.totalStakeForQuorum[quorumNumberIndex];

// keep track of the nonSigners index in the quorum
uint32 nonSignerForQuorumIndex = 0;

// loop through all nonSigners, checking that they are a part of the quorum via their quorumBitmap
// if so, load their stake at referenceBlockNumber and subtract it from running stake signed
for (uint32 i = 0; i < nonSignerStakesAndSignature.nonSignerPubkeys.length; i++) {
// keep track of the nonSigners index in the quorum
uint32 nonSignerForQuorumIndex = 0;
// if the nonSigner is a part of the quorum, subtract their stake from the running total
if (BitmapUtils.numberIsInBitmap(nonSignerQuorumBitmaps[i], quorumNumber)) {
quorumStakeTotals.signedStakeForQuorum[quorumNumberIndex] -=
Expand Down
3 changes: 2 additions & 1 deletion src/IndexRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import "./IndexRegistryStorage.sol";
import {IndexRegistryStorage} from "src/IndexRegistryStorage.sol";
import {IRegistryCoordinator} from "src/interfaces/IRegistryCoordinator.sol";

/**
* @title A `Registry` that keeps track of an ordered list of operators for each quorum
Expand Down
6 changes: 3 additions & 3 deletions src/IndexRegistryStorage.sol
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import "./interfaces/IIndexRegistry.sol";
import "./interfaces/IRegistryCoordinator.sol";
import {Initializable} from "@openzeppelin-upgrades/contracts/proxy/utils/Initializable.sol";

import "@openzeppelin-upgrades/contracts/proxy/utils/Initializable.sol";
import {IRegistryCoordinator} from "src/interfaces/IRegistryCoordinator.sol";
import {IIndexRegistry} from "src/interfaces/IIndexRegistry.sol";

/**
* @title Storage variables for the `IndexRegistry` contract.
Expand Down
16 changes: 8 additions & 8 deletions src/ServiceManagerBase.sol
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;

import "@openzeppelin-upgrades/contracts/proxy/utils/Initializable.sol";
import "@openzeppelin-upgrades/contracts/access/OwnableUpgradeable.sol";
import {OwnableUpgradeable} from "@openzeppelin-upgrades/contracts/access/OwnableUpgradeable.sol";
import {Initializable} from "@openzeppelin-upgrades/contracts/proxy/utils/Initializable.sol";

import "eigenlayer-contracts/src/contracts/interfaces/IPauserRegistry.sol";
import "eigenlayer-contracts/src/contracts/interfaces/ISlasher.sol";
import "eigenlayer-contracts/src/contracts/permissions/Pausable.sol";
import {IPauserRegistry} from "eigenlayer-contracts/src/contracts/interfaces/IPauserRegistry.sol";
import {ISlasher} from "eigenlayer-contracts/src/contracts/interfaces/ISlasher.sol";
import {Pausable} from "eigenlayer-contracts/src/contracts/permissions/Pausable.sol";

import "./interfaces/IBLSRegistryCoordinatorWithIndices.sol";
import "./interfaces/IServiceManager.sol";
import {BLSSignatureChecker} from "src/BLSSignatureChecker.sol";

import "./BLSSignatureChecker.sol";
import {IBLSRegistryCoordinatorWithIndices} from "src/interfaces/IBLSRegistryCoordinatorWithIndices.sol";
import {IServiceManager} from "src/interfaces/IServiceManager.sol";

/**
* @title Base implementation of `IServiceManager` interface, designed to be inherited from by more complex ServiceManagers.
Expand Down
15 changes: 9 additions & 6 deletions src/StakeRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import "@openzeppelin/contracts/utils/math/Math.sol";
import "eigenlayer-contracts/src/contracts/libraries/BitmapUtils.sol";
import "src/interfaces/IServiceManager.sol";
import "src/interfaces/IStakeRegistry.sol";
import "src/interfaces/IRegistryCoordinator.sol";
import "src/StakeRegistryStorage.sol";
import {IDelegationManager} from "eigenlayer-contracts/src/contracts/interfaces/IDelegationManager.sol";

import {StakeRegistryStorage} from "src/StakeRegistryStorage.sol";

import {IRegistryCoordinator} from "src/interfaces/IRegistryCoordinator.sol";
import {IServiceManager} from "src/interfaces/IServiceManager.sol";
import {IStakeRegistry} from "src/interfaces/IStakeRegistry.sol";

import {BitmapUtils} from "src/libraries/BitmapUtils.sol";

/**
* @title A `Registry` that keeps track of stakes of operators for up to 256 quorums.
Expand Down
10 changes: 2 additions & 8 deletions src/StakeRegistryStorage.sol
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import {IStrategyManager} from "eigenlayer-contracts/src/contracts/interfaces/IStrategyManager.sol";
<<<<<<< HEAD
import {IServiceManager} from "./interfaces/IServiceManager.sol";
import {IStakeRegistry} from "./interfaces/IStakeRegistry.sol";
import {IRegistryCoordinator} from "./interfaces/IRegistryCoordinator.sol";
=======
import {IDelegationManager} from "eigenlayer-contracts/src/contracts/interfaces/IDelegationManager.sol";
import {IStrategyManager} from "eigenlayer-contracts/src/contracts/interfaces/IStrategyManager.sol";

import {IRegistryCoordinator} from "src/interfaces/IRegistryCoordinator.sol";
import {IServiceManager} from "src/interfaces/IServiceManager.sol";
import {IStakeRegistry} from "src/interfaces/IStakeRegistry.sol";
import {IRegistryCoordinator} from "src/interfaces/IRegistryCoordinator.sol";
>>>>>>> 12b09de (fix: fix compilation issues and tests)

/**
* @title Storage variables for the `StakeRegistry` contract.
Expand Down
1 change: 0 additions & 1 deletion src/interfaces/IBLSRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ pragma solidity >=0.5.0;
import {IQuorumRegistry} from "./IQuorumRegistry.sol";
import {BN254} from "../libraries/BN254.sol";


/**
* @title Minimal interface extension to `IQuorumRegistry`.
* @author Layr Labs, Inc.
Expand Down
12 changes: 7 additions & 5 deletions src/interfaces/IBLSRegistryCoordinatorWithIndices.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
pragma solidity =0.8.12;

import {ISignatureUtils} from "eigenlayer-contracts/src/contracts/interfaces/ISignatureUtils.sol";
import {IRegistryCoordinator} from "./IRegistryCoordinator.sol";
import {IStakeRegistry} from "./IStakeRegistry.sol";
import {IBLSPubkeyRegistry} from "./IBLSPubkeyRegistry.sol";
import {IIndexRegistry} from "./IIndexRegistry.sol";
import {BN254} from "../libraries/BN254.sol";

import {IRegistryCoordinator} from "src/interfaces/IRegistryCoordinator.sol";
import {IBLSPubkeyRegistry} from "src/interfaces/IBLSPubkeyRegistry.sol";
import {IStakeRegistry} from "src/interfaces/IStakeRegistry.sol";
import {IIndexRegistry} from "src/interfaces/IIndexRegistry.sol";

import {BN254} from "src/libraries/BN254.sol";

/**
* @title Minimal interface for the `IBLSStakeRegistryCoordinator` contract.
Expand Down
11 changes: 6 additions & 5 deletions src/interfaces/IBLSSignatureChecker.sol
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import {IBLSRegistryCoordinatorWithIndices} from "./IBLSRegistryCoordinatorWithIndices.sol";
import {IBLSPubkeyRegistry} from "./IBLSPubkeyRegistry.sol";
import {IRegistryCoordinator} from "./IRegistryCoordinator.sol";
import {IStakeRegistry} from "./IStakeRegistry.sol";
import {BN254} from "../libraries/BN254.sol";
import {IBLSRegistryCoordinatorWithIndices} from "src/interfaces/IBLSRegistryCoordinatorWithIndices.sol";
import {IRegistryCoordinator} from "src/interfaces/IRegistryCoordinator.sol";
import {IBLSPubkeyRegistry} from "src/interfaces/IBLSPubkeyRegistry.sol";
import {IStakeRegistry} from "src/interfaces/IStakeRegistry.sol";

import {BN254} from "src/libraries/BN254.sol";

/**
* @title Used for checking BLS aggregate signatures from the operators of a EigenLayer AVS with the RegistryCoordinator/BLSPubkeyRegistry/StakeRegistry architechture.
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/IIndexRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import "./IRegistry.sol";
import {IRegistry} from "./IRegistry.sol";

/**
* @title Interface for a `Registry`-type contract that keeps track of an ordered list of operators for up to 256 quorums.
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/IQuorumRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.5.0;

import "./IRegistry.sol";
import {IRegistry} from "./IRegistry.sol";

/**
* @title Interface for a `Registry`-type contract that uses either 1 or 2 quorums.
Expand Down
4 changes: 2 additions & 2 deletions src/interfaces/IStakeRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import {IStrategy} from "eigenlayer-contracts/src/contracts/interfaces/IStrategy.sol";
import {IDelegationManager} from "eigenlayer-contracts/src/contracts/interfaces/IDelegationManager.sol";
import {IStrategy} from "eigenlayer-contracts/src/contracts/interfaces/IStrategy.sol";

import {IRegistry} from "./IRegistry.sol";
import {IServiceManager} from "./IServiceManager.sol";
import {IRegistry} from "./IRegistry.sol";

/**
* @title Interface for a `Registry` that keeps track of stakes of operators for up to 256 quorums.
Expand Down

0 comments on commit 1a2024b

Please sign in to comment.