From 6d8096769f4f36ca5cd75508825dec7afbda0690 Mon Sep 17 00:00:00 2001 From: thedevbirb Date: Fri, 20 Sep 2024 14:37:03 +0200 Subject: [PATCH] feat(contracts): enumerable map for middleware contracts --- bolt-contracts/src/contracts/BoltManager.sol | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/bolt-contracts/src/contracts/BoltManager.sol b/bolt-contracts/src/contracts/BoltManager.sol index b3585dd56..230440b71 100644 --- a/bolt-contracts/src/contracts/BoltManager.sol +++ b/bolt-contracts/src/contracts/BoltManager.sol @@ -59,6 +59,10 @@ contract BoltManager is IBoltManager, Ownable { /// @notice Set of EigenLayer collaterals addresses that are allowed. EnumerableSet.AddressSet private whitelistedEigenLayerCollaterals; + /// @notice Set of restaking protocols supported. Each address corresponds to the + /// associated Bolt Middleware contract. + EnumerableSet.AddressSet private restakingProtocols; + // ========= IMMUTABLES ========= /// @notice Address of the Bolt network in Symbiotic Protocol. @@ -197,6 +201,22 @@ contract BoltManager is IBoltManager, Ownable { // ========= ADMIN FUNCTIONS ========= + /// @notice Add a restaking protocol into Bolt + /// @param protocolMiddleware The address of the restaking protocol Bolt middleware + function addRestakingProtocol( + IBoltMiddleware protocolMiddleware + ) public onlyOwner { + restakingProtocols.add(address(protocolMiddleware)); + } + + /// @notice Remove a restaking protocol from Bolt + /// @param protocolMiddleware The address of the restaking protocol Bolt middleware + function removeRestakingProtocol( + IBoltMiddleware protocolMiddleware + ) public onlyOwner { + restakingProtocols.remove(address(protocolMiddleware)); + } + /// @notice Add a collateral address to the whitelist. /// @param collateral The collateral address to add to the whitelist. function addWhitelistedSymbioticCollateral(