Skip to content

Commit

Permalink
chore(contracts): restore IBoltManager.sol interface
Browse files Browse the repository at this point in the history
  • Loading branch information
thedevbirb committed Sep 30, 2024
1 parent 5fc293c commit 18f2554
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
6 changes: 3 additions & 3 deletions bolt-contracts/src/contracts/BoltEigenLayerMiddleware.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {IERC20} from "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.so
import {MapWithTimeData} from "../lib/MapWithTimeData.sol";
import {IBoltValidators} from "../interfaces/IBoltValidators.sol";
import {IBoltMiddleware} from "../interfaces/IBoltMiddleware.sol";
import {BoltManager} from "./BoltManager.sol";
import {IBoltManager} from "../interfaces/IBoltManager.sol";

import {IStrategyManager} from "@eigenlayer/src/contracts/interfaces/IStrategyManager.sol";
import {IAVSDirectory} from "@eigenlayer/src/contracts/interfaces/IAVSDirectory.sol";
Expand All @@ -30,7 +30,7 @@ contract BoltEigenLayerMiddleware is IBoltMiddleware, Ownable {

/// @notice Validators registry, where validators are registered via their
/// BLS pubkey and are assigned a sequence number.
BoltManager public boltManager;
IBoltManager public boltManager;

/// @notice Set of EigenLayer operators addresses that have opted in to Bolt Protocol.
EnumerableMap.AddressToUintMap private operators;
Expand Down Expand Up @@ -85,7 +85,7 @@ contract BoltEigenLayerMiddleware is IBoltMiddleware, Ownable {
address _eigenlayerDelegationManager,
address _eigenlayerStrategyManager
) Ownable(_owner) {
boltManager = BoltManager(_boltManager);
boltManager = IBoltManager(_boltManager);
START_TIMESTAMP = Time.timestamp();

AVS_DIRECTORY = AVSDirectoryStorage(_eigenlayerAVSDirectory);
Expand Down
7 changes: 2 additions & 5 deletions bolt-contracts/src/contracts/BoltManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,14 @@ import {IEntity} from "@symbiotic/interfaces/common/IEntity.sol";
import {MapWithTimeData} from "../lib/MapWithTimeData.sol";
import {IBoltValidators} from "../interfaces/IBoltValidators.sol";
import {IBoltMiddleware} from "../interfaces/IBoltMiddleware.sol";
import {IBoltManager} from "../interfaces/IBoltManager.sol";

contract BoltManager is Ownable {
contract BoltManager is IBoltManager, Ownable {
using EnumerableSet for EnumerableSet.AddressSet;
using EnumerableMap for EnumerableMap.AddressToUintMap;
using MapWithTimeData for EnumerableMap.AddressToUintMap;
using Subnetwork for address;

// ========= ERRORS =========

error InvalidQuery();

// ========= STORAGE =========

/// @notice Validators registry, where validators are registered via their
Expand Down
6 changes: 3 additions & 3 deletions bolt-contracts/src/contracts/BoltSymbioticMiddleware.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {IEntity} from "@symbiotic/interfaces/common/IEntity.sol";
import {MapWithTimeData} from "../lib/MapWithTimeData.sol";
import {IBoltValidators} from "../interfaces/IBoltValidators.sol";
import {IBoltMiddleware} from "../interfaces/IBoltMiddleware.sol";
import {BoltManager} from "./BoltManager.sol";
import {IBoltManager} from "../interfaces/IBoltManager.sol";

contract BoltSymbioticMiddleware is IBoltMiddleware, Ownable {
using EnumerableSet for EnumerableSet.AddressSet;
Expand All @@ -31,7 +31,7 @@ contract BoltSymbioticMiddleware is IBoltMiddleware, Ownable {

/// @notice Validators registry, where validators are registered via their
/// BLS pubkey and are assigned a sequence number.
BoltManager public boltManager;
IBoltManager public boltManager;

/// @notice Set of Symbiotic operator addresses that have opted in to Bolt Protocol.
EnumerableMap.AddressToUintMap private operators;
Expand Down Expand Up @@ -97,7 +97,7 @@ contract BoltSymbioticMiddleware is IBoltMiddleware, Ownable {
address _symbioticOperatorNetOptIn,
address _symbioticVaultRegistry
) Ownable(_owner) {
boltManager = BoltManager(_boltManager);
boltManager = IBoltManager(_boltManager);
START_TIMESTAMP = Time.timestamp();

BOLT_SYMBIOTIC_NETWORK = _symbioticNetwork;
Expand Down
14 changes: 14 additions & 0 deletions bolt-contracts/src/interfaces/IBoltManager.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

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

interface IBoltManager {
error InvalidQuery();

function validators() external view returns (IBoltValidators);

function isOperatorAuthorizedForValidator(address operator, bytes32 pubkeyHash) external view returns (bool);

function getSupportedRestakingProtocols() external view returns (address[] memory middlewares);
}

0 comments on commit 18f2554

Please sign in to comment.