emergencyExit()
/**
* @notice emergency exit the entire strategy in extreme circumstances
* unwind the strategy and send the funds to governance
* @dev only callable by governance
*/
function emergencyExit() external onlyGovernance {
// unwind strategy unless it is already unwound
if (!isUnwind) {
unwind();
}
uint256 wantBalance = IERC20(want).balanceOf(address(this));
// send funds to governance
IERC20(want).safeTransfer(governance, wantBalance);
emit EmergencyExit(governance, wantBalance);
}Last updated