{
    "Function": "shutdown",
    "File": "contracts/src/BorrowerOperations.sol",
    "Parent Contracts": [
        "contracts/src/Interfaces/IBorrowerOperations.sol",
        "contracts/src/Dependencies/AddRemoveManagers.sol",
        "contracts/src/Interfaces/IAddRemoveManagers.sol",
        "contracts/src/Dependencies/LiquityBase.sol",
        "contracts/src/Interfaces/ILiquityBase.sol"
    ],
    "High-Level Calls": [
        "IPriceFeed",
        "LiquityMath",
        "IBoldToken"
    ],
    "Internal Calls": [
        "revert TCRNotBelowSCR()",
        "getEntireBranchColl",
        "revert IsShutDown()",
        "_applyShutdown",
        "getEntireBranchDebt"
    ],
    "Library Calls": [
        "_computeCR"
    ],
    "Low-Level Calls": [],
    "Code": "function shutdown() external {\n        if (hasBeenShutDown) revert IsShutDown();\n\n        uint256 totalColl = getEntireBranchColl();\n        uint256 totalDebt = getEntireBranchDebt();\n        (uint256 price, bool newOracleFailureDetected) = priceFeed.fetchPrice();\n        // If the oracle failed, the above call to PriceFeed will have shut this branch down\n        if (newOracleFailureDetected) return;\n\n        // check if caller is branch owner\n        bool isBranchOwner = msg.sender == boldToken.owner();\n\n        // Otherwise, proceed with the TCR check:\n        uint256 TCR = LiquityMath._computeCR(totalColl, totalDebt, price);\n        if (TCR >= SCR && !isBranchOwner) revert TCRNotBelowSCR();\n\n        _applyShutdown();\n\n        emit ShutDown(TCR);\n    }"
}