From f688c9a826a41e8906125a4edbbaef4d06e0288c Mon Sep 17 00:00:00 2001 From: Naman Garg <0708ng@gmail.com> Date: Tue, 23 Jul 2024 19:39:07 +0530 Subject: [PATCH] fix: remove operator --- bolt-contracts/src/contracts/BoltRegistry.sol | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bolt-contracts/src/contracts/BoltRegistry.sol b/bolt-contracts/src/contracts/BoltRegistry.sol index 79c285d5..c064eda8 100644 --- a/bolt-contracts/src/contracts/BoltRegistry.sol +++ b/bolt-contracts/src/contracts/BoltRegistry.sol @@ -97,6 +97,15 @@ contract BoltRegistry is IBoltRegistry { revert CooldownNotElapsed(); } + // Remove operator from the operators array + for (uint256 i = 0; i < operators.length; i++) { + if (operators[i] == msg.sender) { + operators[i] = operators[operators.length - 1]; + operators.pop(); + break; + } + } + delete registrants[msg.sender]; for (uint256 i = 0; i < registrant.validatorIndexes.length; i++) {