Skip to main content

Emergency exit

Same calls as for a generation-1 vault, sent from your wallet, on each vault you hold:
  • From initiateEmergencyWithdraw() on, the exchange rejects orders from that vault. emergencyUnlockAt() returns the unlock time.
  • If the 7-day execution window lapses, call initiateEmergencyWithdraw() again.
  • GET /api/me/vault/emergency shows the state (none, waiting, executable, unlocksAt, initiatedAt). Pass ?vault=0x… to inspect a specific vault (default: active vault). It is read-only; the calls are yours.
On a generation-2 vault the final emergencyWithdraw* call needs a gas limit of at least ~0.67M. The vault forwards 600,000 gas to DepositLimitRegistry.freezeUser(vaultOwner) and reverts with InsufficientGasForFreeze if the transaction leaves less. Always estimate gas with eth_estimateGas or set a limit ≥ 0.67M. A fixed limit sized for generation 1 reverts without paying out.

Upgradeability

Generation-1 vaults cannot be upgraded. Generation-2 contracts are upgradeable proxies:
  • Timelock: Changes take effect only after upgradeTimelock() (minimum 1 hour, maximum 30 days; configured on chain).
  • Execution window: Staged proposals must be executed within UPGRADE_WINDOW (7 days) after maturation.
  • Monitoring events: Watch for VaultUpgradeProposed(impl, activatesAt) and VaultImplementationSet(old, impl) on VaultFactoryGen2, or UpgradeProposed(impl, activatesAt) and UpgradeApplied(impl) on the exchange proxies.
  • Permanent disable: An admin can call disableUpgrades(address(this)) to irreversibly permanently disable upgrades on that contract (UpgradesDisabled).