Contracts

Function reference

This is the practical ABI map for builders. Each function is grouped by user intent: create, configure, stay alive, move assets, claim, cleanup, and read state.

createVault

Creates a new vault lifecycle for msg.sender. Fails if the caller already has an existing vault.

Caller
Owner
Requires
No existing vault; valid heir; valid period bounds
Effects
Stores vault, sets lastCheckIn, emits VaultCreated
Common errors
VaultAlreadyExists, InvalidHeir, InvalidPeriod
createVault(address heir, uint256 inactivityPeriod, uint256 gracePeriod)

Owner configuration

These functions are owner-only and available only before the vault is claimable or claimed.

Caller
Owner
Blocked when
Vault is claimable or claimed
Events
HeirUpdated, InactivityPeriodUpdated, GracePeriodUpdated
updateHeir(address newHeir)
updateInactivityPeriod(uint256 newInactivityPeriod)
updateGracePeriod(uint256 newGracePeriod)

checkIn

Refreshes the owner's liveness signal. This is the most important recurring action in the product UX.

Caller
Owner
Effect
lastCheckIn = block.timestamp
Event
CheckedIn(owner, timestamp)
Common errors
VaultDoesNotExist, VaultClaimable, VaultAlreadyClaimed
checkIn()

Native USDC movement

Native USDC is moved with payable functions and low-level native transfers. The dApp should label these as USDC, not ETH.

depositUSDC
Credits msg.sender vault by msg.value.
depositUSDCFor
Credits another existing owner's vault by msg.value.
withdrawUSDC
Owner withdraws before claimable.
claimUSDC
Heir claims native USDC after claimable to explicit receiver.
Common errors
ZeroAmount, InsufficientBalance, VaultClaimable, VaultNotClaimable, InvalidReceiver
depositUSDC() payable
depositUSDCFor(address owner) payable
withdrawUSDC(uint256 amount)
claimUSDC(address owner, address receiver)

ERC20 token movement

ERC20 token actions are separate from native USDC. Deposits require allowance. Claims are token-by-token.

depositToken
Transfers from owner and credits actual received token amount.
withdrawToken
Owner withdraws tracked token balance before claimable.
claimToken
Heir claims one tracked token balance after claimable.
Common errors
InvalidToken, InvalidReceiver, ZeroAmount, ZeroReceivedAmount, InsufficientBalance
depositToken(address token, uint256 amount)
withdrawToken(address token, uint256 amount)
claimToken(address owner, address token, address receiver)

Inheritance activation

claimInheritance is the simple heir action: activate inheritance and claim native USDC to the heir address. Token balances can still be claimed separately.

Caller
Configured heir
Requires
Vault is claimable and not already claimed
Effects
Sets claimed, emits InheritanceActivated, claims native USDC if present
Token note
ERC20 balances remain claimable individually with claimToken
claimInheritance(address owner)

Cleanup

Disables an empty vault lifecycle. This is required before the same owner can create a new vault.

Requires
nativeUSDCBalances(owner) == 0 and activeTokenCounts(owner) == 0
Effect
Deletes vault lifecycle and advances tracking epoch
Common errors
AssetBalanceNotZero, Unauthorized, VaultDoesNotExist
disableVault()
disableVault(address owner)

View helpers

The frontend should prefer view helpers over duplicating too much lifecycle logic. UI timers can mirror the formula, but transactions should always trust contract reads.

getVaultDetails(address owner)
getVaultState(address owner)
getTrackedTokens(address owner)
isClaimable(address owner)
isInGracePeriod(address owner)
gracePeriodStartsAt(address owner)
claimableAt(address owner)
timeUntilClaimable(address owner)
nativeUSDCBalances(address owner)
tokenBalances(address owner, address token)
activeTokenCounts(address owner)