{
    "Function": "forceRemoveByActiveBalance",
    "File": "contracts/managers/SherlockProtocolManager.sol",
    "Parent Contracts": [
        "contracts/managers/Manager.sol",
        "node_modules/@openzeppelin/contracts/security/Pausable.sol",
        "node_modules/@openzeppelin/contracts/access/Ownable.sol",
        "node_modules/@openzeppelin/contracts/utils/Context.sol",
        "contracts/interfaces/managers/ISherlockProtocolManager.sol",
        "contracts/interfaces/managers/IManager.sol"
    ],
    "High-Level Calls": [
        "SafeERC20"
    ],
    "Internal Calls": [
        "_forceRemoveProtocol",
        "revert InvalidConditions()",
        "whenNotPaused",
        "_verifyProtocolExists",
        "_settleProtocolDebt"
    ],
    "Library Calls": [
        "safeTransfer"
    ],
    "Low-Level Calls": [],
    "Code": "function forceRemoveByActiveBalance(bytes32 _protocol) external override whenNotPaused {\n    address agent = _verifyProtocolExists(_protocol);\n\n    // Gets the latest value of the active balance at this protocol\n    _settleProtocolDebt(_protocol);\n    // Sets latest value of active balance to remainingBalance variable\n    uint256 remainingBalance = activeBalances[_protocol];\n\n    // This means the protocol still has adequate active balance and thus cannot be removed\n    if (remainingBalance >= minActiveBalance) revert InvalidConditions();\n\n    // Sets the protocol's active balance to 0\n    delete activeBalances[_protocol];\n    // Removes the protocol from coverage\n    _forceRemoveProtocol(_protocol, agent);\n\n    if (remainingBalance != 0) {\n      // sends the remaining balance to msg.sender\n      token.safeTransfer(msg.sender, remainingBalance);\n    }\n    emit ProtocolRemovedByArb(_protocol, msg.sender, remainingBalance);\n  }"
}