Vault lifecycle
The vault lifecycle is a small state machine computed from existence, claimed status, and timestamps. Most UX decisions in the dApp come from this state machine.
State table
getVaultState(owner) returns the computed lifecycle state for a vault.
Creation
createVault initializes the owner's vault. The owner is always msg.sender. The heir must be non-zero and must not equal the owner. Timing windows must fit the protocol limits.
createVault(address heir, uint256 inactivityPeriod, uint256 gracePeriod)Owner window
While the vault is active or still recoverable by check-in, the owner can refresh liveness, change the heir, change timing, deposit assets, and withdraw assets. These actions are blocked once the vault is claimable or claimed.
- checkIn refreshes lastCheckIn to block.timestamp.
- updateHeir changes the configured claimant wallet.
- updateInactivityPeriod and updateGracePeriod change future timing windows.
- depositUSDC/depositToken add value to the vault.
- withdrawUSDC/withdrawToken remove value while owner control is valid.
Claim window
When the claimable timestamp matures, the heir can activate inheritance. From a user's perspective this is the moment where the vault opens. From the contract perspective, it is a strict timestamp and caller authorization check.
block.timestamp >= vault.lastCheckIn + vault.inactivityPeriod + vault.gracePeriodCleanup and new vaults
A claimed or empty vault is not automatically removed from storage. It must be disabled after all native USDC and active token balances are zero. Cleanup matters because the protocol allows one vault lifecycle per owner at a time.
The dApp should show completed-vault UX instead of normal owner controls after inheritance has been activated. Once the vault is drained, it should guide the owner or heir to disable it.
