{
    "Function": "_forceRemoveProtocol",
    "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": [
        "_setSingleAndGlobalProtocolPremium",
        "_setProtocolAgent"
    ],
    "Library Calls": [
        "safeTransfer"
    ],
    "Low-Level Calls": [],
    "Code": "function _forceRemoveProtocol(bytes32 _protocol, address _agent) internal {\n    // Sets the individual protocol's premium to zero and updates the global premium variable for a zero premium at this protocol\n    _setSingleAndGlobalProtocolPremium(_protocol, 0);\n\n    // Grabs the protocol's active balance\n    uint256 balance = activeBalances[_protocol];\n\n    // If there's still some active balance, delete the entry and send the remaining balance to the protocol agent\n    if (balance != 0) {\n      delete activeBalances[_protocol];\n      token.safeTransfer(_agent, balance);\n\n      emit ProtocolBalanceWithdrawn(_protocol, balance);\n    }\n\n    // Sets the protocol agent to zero address (as part of clean up)\n    _setProtocolAgent(_protocol, _agent, address(0));\n\n    // Cleans up other mappings for this protocol\n    delete nonStakersPercentage[_protocol];\n    delete lastAccountedEachProtocol[_protocol];\n    // `premiums_` mapping is not deleted here as it's already 0 because of the `_setSingleAndGlobalProtocolPremium` call above\n\n    // Sets a deadline in the future until which this protocol agent can still make claims for this removed protocol\n    removedProtocolClaimDeadline[_protocol] = block.timestamp + PROTOCOL_CLAIM_DEADLINE;\n\n    // This mapping allows Sherlock to verify the protocol agent making a claim after the protocol has been removed\n    // Remember, only the protocol agent can make claims on behalf of the protocol, so this must be checked\n    removedProtocolAgent[_protocol] = _agent;\n\n    emit ProtocolUpdated(_protocol, bytes32(0), uint256(0), uint256(0));\n    emit ProtocolRemoved(_protocol);\n  }"
}