```\nfunction emergencyShutdown() external onlyRole("emergency_shutdown") {\n    active = false;\n\n    // If necessary, defund sDAI.\n    uint256 sdaiBalance = sdai.balanceOf(address(this));\n    if (sdaiBalance != 0) defund(sdai, sdaiBalance);\n\n    // If necessary, defund DAI.\n    uint256 daiBalance = dai.balanceOf(address(this));\n    if (daiBalance != 0) defund(dai, daiBalance);\n\n    emit Deactivated();\n}\n```\n