From 3af458258d3335887b13229569ab97cb62c929be Mon Sep 17 00:00:00 2001 From: thedevbirb Date: Mon, 23 Sep 2024 18:00:37 +0200 Subject: [PATCH] chore(contracts): restaking protocols getter; function docs --- bolt-contracts/src/contracts/BoltEigenLayerMiddleware.sol | 4 +++- bolt-contracts/src/contracts/BoltManager.sol | 5 +++++ bolt-contracts/src/contracts/BoltSymbioticMiddleware.sol | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/bolt-contracts/src/contracts/BoltEigenLayerMiddleware.sol b/bolt-contracts/src/contracts/BoltEigenLayerMiddleware.sol index 89696d850..88630515c 100644 --- a/bolt-contracts/src/contracts/BoltEigenLayerMiddleware.sol +++ b/bolt-contracts/src/contracts/BoltEigenLayerMiddleware.sol @@ -73,7 +73,7 @@ contract BoltEigenLayerMiddleware is IBoltMiddleware, Ownable { // ========= CONSTRUCTOR ========= - /// @notice Constructor for the BoltManager contract. + /// @notice Constructor for the BoltEigenLayerMiddleware contract. /// @param _validators The address of the validators registry. /// @param _eigenlayerAVSDirectory The address of the EigenLayer AVS Directory contract. /// @param _eigenlayerDelegationManager The address of the EigenLayer Delegation Manager contract. @@ -404,6 +404,8 @@ contract BoltEigenLayerMiddleware is IBoltMiddleware, Ownable { AVS_DIRECTORY.registerOperatorToAVS(operator, operatorSignature); } + /// @notice Check if an operator is registered to work in Bolt Protocol AVS by + /// looking up the AVS Directory contract. function checkIfOperatorRegisteredToAVS( address operator ) public view returns (bool registered) { diff --git a/bolt-contracts/src/contracts/BoltManager.sol b/bolt-contracts/src/contracts/BoltManager.sol index a7bf636ce..26d3e4207 100644 --- a/bolt-contracts/src/contracts/BoltManager.sol +++ b/bolt-contracts/src/contracts/BoltManager.sol @@ -91,6 +91,11 @@ contract BoltManager is IBoltManager, Ownable { return validators.getValidatorByPubkeyHash(pubkeyHash).authorizedOperator == operator; } + /// @notice Returns the addresses of the middleware contracts of restaking protocols supported by Bolt. + function getSupportedRestakingProtocols() public view returns (address[] memory middlewares) { + return restakingProtocols.values(); + } + // ========= ADMIN FUNCTIONS ========= /// @notice Add a restaking protocol into Bolt diff --git a/bolt-contracts/src/contracts/BoltSymbioticMiddleware.sol b/bolt-contracts/src/contracts/BoltSymbioticMiddleware.sol index c5860ad7c..dca265836 100644 --- a/bolt-contracts/src/contracts/BoltSymbioticMiddleware.sol +++ b/bolt-contracts/src/contracts/BoltSymbioticMiddleware.sol @@ -83,7 +83,7 @@ contract BoltSymbioticMiddleware is IBoltMiddleware, Ownable { // ========= CONSTRUCTOR ========= - /// @notice Constructor for the BoltManager contract. + /// @notice Constructor for the BoltSymbioticMiddleware contract. /// @param _validators The address of the validators registry. /// @param _symbioticNetwork The address of the Symbiotic network. /// @param _symbioticOperatorRegistry The address of the Symbiotic operator registry.