{
    "Function": "forceRemoveBySecondsOfCoverage",
    "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": [
        "_verifyProtocolExists",
        "revert InvalidConditions()",
        "_forceRemoveProtocol",
        "_settleProtocolDebt",
        "_calcForceRemoveBySecondsOfCoverage",
        "whenNotPaused"
    ],
    "Library Calls": [
        "safeTransfer"
    ],
    "Low-Level Calls": [],
    "Code": "function forceRemoveBySecondsOfCoverage(bytes32 _protocol) external override whenNotPaused {\n    // NOTE: We use _secondsOfCoverageLeft() below and include this check instead of secondsOfCoverageLeft() for gas savings\n    address agent = _verifyProtocolExists(_protocol);\n\n    // NOTE: We don't give the arb the full remaining balance like we do in forceRemoveByActiveBalance()\n    // This is because we know the exact balance the arb will get in forceRemoveByActiveBalance()\n    // But when removing based on seconds of coverage left, the remainingBalance could still be quite large\n    // So it's better to scale the arb reward over time. It's a little complex because the remainingBalance\n    // Decreases over time also but reward will be highest at the midpoint of percentageScaled (50%)\n    _settleProtocolDebt(_protocol);\n    (uint256 arbAmount, bool able) = _calcForceRemoveBySecondsOfCoverage(_protocol);\n    if (able == false) revert InvalidConditions();\n\n    if (arbAmount != 0) {\n      // subtracts the amount that will be paid to the arb from the active balance\n      activeBalances[_protocol] -= arbAmount;\n    }\n\n    // Removes the protocol from coverage\n    // This function also pays the active balance to the protocol agent, so it's good we do this after subtracting arb amount above\n    _forceRemoveProtocol(_protocol, agent);\n\n    // Done after removing protocol to mitigate reentrency pattern\n    // (In case token allows callback)\n    if (arbAmount != 0) {\n      token.safeTransfer(msg.sender, arbAmount);\n    }\n    emit ProtocolRemovedByArb(_protocol, msg.sender, arbAmount);\n  }"
}