From 096e76ec4a2a002183cfc1ab5c7dffa86b7770eb Mon Sep 17 00:00:00 2001 From: Jonas Bostoen Date: Fri, 18 Oct 2024 14:58:41 +0200 Subject: [PATCH] feat(contracts): add vault / strategy deregistration --- .../src/contracts/BoltEigenLayerMiddlewareV1.sol | 12 ++++++++++++ .../src/contracts/BoltSymbioticMiddlewareV1.sol | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/bolt-contracts/src/contracts/BoltEigenLayerMiddlewareV1.sol b/bolt-contracts/src/contracts/BoltEigenLayerMiddlewareV1.sol index 7d648625..75050177 100644 --- a/bolt-contracts/src/contracts/BoltEigenLayerMiddlewareV1.sol +++ b/bolt-contracts/src/contracts/BoltEigenLayerMiddlewareV1.sol @@ -153,6 +153,18 @@ contract BoltEigenLayerMiddlewareV1 is IBoltMiddlewareV1, OwnableUpgradeable, UU strategies.enable(strategy); } + /// @notice Deregister a strategy from working in Bolt Protocol. + /// @param strategy The EigenLayer strategy address. + function deregisterStrategy( + address strategy + ) public onlyOwner { + if (!strategies.contains(strategy)) { + revert NotRegistered(); + } + + strategies.remove(strategy); + } + // ========= EIGENLAYER MIDDLEWARE LOGIC ========= /// @notice Allow an operator to signal opt-in to Bolt Protocol. diff --git a/bolt-contracts/src/contracts/BoltSymbioticMiddlewareV1.sol b/bolt-contracts/src/contracts/BoltSymbioticMiddlewareV1.sol index 6b4543e1..a844b78c 100644 --- a/bolt-contracts/src/contracts/BoltSymbioticMiddlewareV1.sol +++ b/bolt-contracts/src/contracts/BoltSymbioticMiddlewareV1.sol @@ -171,6 +171,18 @@ contract BoltSymbioticMiddlewareV1 is IBoltMiddlewareV1, OwnableUpgradeable, UUP vaults.enable(vault); } + /// @notice Deregister a vault from working in Bolt Protocol. + /// @param vault The vault address to deregister. + function deregisterVault( + address vault + ) public onlyOwner { + if (!vaults.contains(vault)) { + revert NotRegistered(); + } + + vaults.remove(vault); + } + // ========= SYMBIOTIC MIDDLEWARE LOGIC ========= /// @notice Allow an operator to signal opt-in to Bolt Protocol.