Skip to content

Commit

Permalink
chore: move BitmapUtils and BN254 libraries to middleware (#55)
Browse files Browse the repository at this point in the history
* chore: move BitmapUtils and BN254 libraries to middleware

* fix: actually commit migrated files

* chore: update submodule
  • Loading branch information
wadealexc authored Nov 7, 2023
1 parent a3d4a93 commit 5929f80
Show file tree
Hide file tree
Showing 26 changed files with 671 additions and 33 deletions.
3 changes: 2 additions & 1 deletion src/BLSOperatorStateRetriever.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import "src/interfaces/IStakeRegistry.sol";
import "src/interfaces/IBLSPubkeyRegistry.sol";
import "src/interfaces/IIndexRegistry.sol";
import "src/interfaces/IBLSRegistryCoordinatorWithIndices.sol";
import "eigenlayer-contracts/src/contracts/libraries/BitmapUtils.sol";

import "src/libraries/BitmapUtils.sol";

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

import "src/libraries/BN254.sol";

import "src/BLSPubkeyRegistryStorage.sol";
import "eigenlayer-contracts/src/contracts/libraries/BN254.sol";

contract BLSPubkeyRegistry is BLSPubkeyRegistryStorage {
using BN254 for BN254.G1Point;
Expand Down
3 changes: 2 additions & 1 deletion src/BLSPubkeyRegistryStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ pragma solidity =0.8.12;
import "src/interfaces/IBLSPubkeyRegistry.sol";
import "src/interfaces/IRegistryCoordinator.sol";
import "src/interfaces/IBLSPublicKeyCompendium.sol";
import "eigenlayer-contracts/src/contracts/libraries/BN254.sol";

import "src/libraries/BN254.sol";

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

Expand Down
3 changes: 2 additions & 1 deletion src/BLSPublicKeyCompendium.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
pragma solidity =0.8.12;

import "src/interfaces/IBLSPublicKeyCompendium.sol";
import "eigenlayer-contracts/src/contracts/libraries/BN254.sol";

import "src/libraries/BN254.sol";

/**
* @title A shared contract for EigenLayer operators to register their BLS public keys.
Expand Down
5 changes: 3 additions & 2 deletions src/BLSRegistryCoordinatorWithIndices.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ 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/BN254.sol";
import "eigenlayer-contracts/src/contracts/libraries/EIP1271SignatureUtils.sol";
import "eigenlayer-contracts/src/contracts/libraries/BitmapUtils.sol";
import "eigenlayer-contracts/src/contracts/permissions/Pausable.sol";

import "src/interfaces/IBLSRegistryCoordinatorWithIndices.sol";
Expand All @@ -20,6 +18,9 @@ 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";



/**
Expand Down
7 changes: 4 additions & 3 deletions src/BLSSignatureChecker.sol
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import "src/interfaces/IBLSSignatureChecker.sol";
import "eigenlayer-contracts/src/contracts/libraries/BitmapUtils.sol";
import "eigenlayer-contracts/src/contracts/libraries/BN254.sol";
import "src/interfaces/IRegistryCoordinator.sol";
import "src/interfaces/IStakeRegistry.sol";
import "src/interfaces/IBLSPubkeyRegistry.sol";
import "src/interfaces/IBLSRegistryCoordinatorWithIndices.sol";
import "src/interfaces/IBLSSignatureChecker.sol";

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

/**
* @title Used for checking BLS aggregate signatures from the operators of a `BLSRegistry`.
Expand Down
1 change: 0 additions & 1 deletion src/IndexRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
pragma solidity =0.8.12;

import "src/IndexRegistryStorage.sol";
import "eigenlayer-contracts/src/contracts/libraries/BN254.sol";

/**
* @title A `Registry` that keeps track of an ordered list of operators for each quorum
Expand Down
10 changes: 6 additions & 4 deletions src/ServiceManagerBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ pragma solidity ^0.8.9;

import "@openzeppelin-upgrades/contracts/proxy/utils/Initializable.sol";
import "@openzeppelin-upgrades/contracts/access/OwnableUpgradeable.sol";
import "src/BLSSignatureChecker.sol";
import "src/interfaces/IBLSRegistryCoordinatorWithIndices.sol";
import "src/interfaces/IServiceManager.sol";

import "eigenlayer-contracts/src/contracts/permissions/Pausable.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 "src/interfaces/IBLSRegistryCoordinatorWithIndices.sol";
import "src/interfaces/IServiceManager.sol";

import "src/BLSSignatureChecker.sol";

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

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/libraries/BitmapUtils.sol";

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

Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/IBLSPubkeyRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity =0.8.12;

import {IRegistry} from "src/interfaces/IRegistry.sol";
import {BN254} from "eigenlayer-contracts/src/contracts/libraries/BN254.sol";
import {BN254} from "src/libraries/BN254.sol";

/**
* @title Minimal interface for a registry that keeps track of aggregate operator public keys for among many quorums.
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/IBLSPublicKeyCompendium.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 {BN254}from"eigenlayer-contracts/src/contracts/libraries/BN254.sol";
import {BN254} from "src/libraries/BN254.sol";

/**
* @title Minimal interface for the `BLSPublicKeyCompendium` contract.
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/IBLSRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity >=0.5.0;

import {IQuorumRegistry} from "./IQuorumRegistry.sol";
import {BN254} from "eigenlayer-contracts/src/contracts/libraries/BN254.sol";
import {BN254} from "src/libraries/BN254.sol";


/**
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/IBLSRegistryCoordinatorWithIndices.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {IRegistryCoordinator} from "src/interfaces/IRegistryCoordinator.sol";
import {IStakeRegistry} from "src/interfaces/IStakeRegistry.sol";
import {IBLSPubkeyRegistry} from "src/interfaces/IBLSPubkeyRegistry.sol";
import {IIndexRegistry} from "src/interfaces/IIndexRegistry.sol";
import {BN254} from "eigenlayer-contracts/src/contracts/libraries/BN254.sol";
import {BN254} from "src/libraries/BN254.sol";

/**
* @title Minimal interface for the `IBLSStakeRegistryCoordinator` contract.
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/IBLSSignatureChecker.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {IBLSRegistryCoordinatorWithIndices} from "src/interfaces/IBLSRegistryCoo
import {IBLSPubkeyRegistry} from "src/interfaces/IBLSPubkeyRegistry.sol";
import {IRegistryCoordinator} from "src/interfaces/IRegistryCoordinator.sol";
import {IStakeRegistry} from "src/interfaces/IStakeRegistry.sol";
import {BN254} from "eigenlayer-contracts/src/contracts/libraries/BN254.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
Loading

0 comments on commit 5929f80

Please sign in to comment.