Emergency Flow
This document details the emergency and disaster recovery mechanisms within King's Vault V2.
Pause And Unpause
The Guardian can halt normal operations instantly.
| Function | Effect |
|---|---|
vault.pause() |
Blocks all deposit and withdrawal flows. |
vault.unpause() |
Reopens deposit and withdrawal flows if the vault is not permanently shutdown. |
Shutdown
In severe scenarios, the Guardian can permanently disable the vault. This action is irreversible.
- The Guardian calls
vault.shutdown(). - The Vault sets
_shutdownTime = block.timestamp. - The Vault calls
Controller.fundExitOnlyForVault(address(this)). - The Controller exits all registered strategies with the
force = trueflag. - Normal deposit/withdraw flows are disabled permanently.
- Investors can now only call
emergencyRedeem(receiver).
Emergency Redemption
Emergency redemption uses only idle vault assets. It burns all caller shares and transfers a pro-rata share of the currently held idle assets:
userAssets = userShares * idleAssets / totalSupply
In KingsVaultV2Async, emergencyRedeem() first handles any existing async requests:
| Request State | Behavior |
|---|---|
| Executed request | Claims reserved assets first. |
| Pending request | Returns the escrowed shares to the user. |
| No request | Continues to the base emergency redeem logic. |
Harvest Lock
The harvestOnlyForController(token, recipient) function prevents harvesting the native vault asset or the vault share token while the vault is active, or within 7 days after shutdown.
After 7 days from the shutdown() call, even native asset harvesting is allowed to recover remaining dust or trapped funds.