{
    "Function": "removeValidator",
    "File": "src/OperatorRegistry.sol",
    "Parent Contracts": [
        "src/Utils/Owned.sol"
    ],
    "High-Level Calls": [],
    "Internal Calls": [
        "onlyByOwnGov",
        "swapValidator"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function removeValidator(uint256 remove_idx, bool dont_care_about_ordering) public onlyByOwnGov {\n        // Get the pubkey for the validator to remove (for informational purposes)\n        bytes memory removed_pubkey = validators[remove_idx].pubKey;\n\n        // Less gassy to swap and pop\n        if (dont_care_about_ordering){\n            // Swap the (validator to remove) with the (last validator in the array)\n            swapValidator(remove_idx, validators.length - 1);\n\n            // Pop off the validator to remove, which is now at the end of the array\n            validators.pop();\n        }\n        // More gassy, loop\n        else {\n            // Save the original validators\n            Validator[] memory original_validators = validators;\n\n            // Clear the original validators list\n            delete validators;\n\n            // Fill the new validators array with all except the value to remove\n            for (uint256 i = 0; i < original_validators.length; ++i) {\n                if (i != remove_idx) {\n                    validators.push(original_validators[i]);\n                }\n            }\n        }\n\n        emit ValidatorRemoved(removed_pubkey, remove_idx, dont_care_about_ordering);\n    }"
}