Contracts

Smart contract overview

InheritanceVault is the core Solidity contract. It owns vault configuration, liveness timestamps, per-owner accounting, ERC20 token tracking, claim activation, and cleanup.

Contract summary

InheritanceVault is written in Solidity 0.8.24 and uses OpenZeppelin IERC20, SafeERC20, Ownable, Pausable, and ReentrancyGuard. The current version is profiled for Arc Testnet and Circle-native USDC language.

The contract is GPL-3.0-only. The protocol logic is intentionally compact: one vault struct per owner, separate native and token accounting, strict role checks, and no unbounded token claim loop.

Compiler
Solidity ^0.8.24
License
GPL-3.0-only
Dependencies
OpenZeppelin IERC20, SafeERC20, Ownable, Pausable, ReentrancyGuard
Primary contract
InheritanceVault

Vault struct

Every owner has a single Vault struct keyed by owner address.

struct Vault {
  address owner;
  address heir;
  uint256 inactivityPeriod;
  uint256 gracePeriod;
  uint256 lastCheckIn;
  bool exists;
  bool claimed;
}

Storage maps

Core storage is split between vault metadata and balances.

vaults(owner)
Raw vault configuration and lifecycle flags.
nativeUSDCBalances(owner)
Native USDC escrowed for a vault owner.
tokenBalances(owner, token)
ERC20-compatible token balance for owner and token.
activeTokenCounts(owner)
Count of non-zero token balances for empty-vault checks.
_trackedTokens(owner)
Historical token list for frontend discovery in current epoch.

Events

Events make lifecycle and accounting activity indexable by explorers or future offchain services.

VaultCreated
HeirUpdated
InactivityPeriodUpdated
GracePeriodUpdated
CheckedIn
USDCDeposited
USDCWithdrawn
TokenDeposited
TokenWithdrawn
InheritanceActivated
InheritanceUSDCClaimed
InheritanceTokenClaimed
VaultDisabled

Custom errors

Custom errors are used instead of long revert strings. Frontends should map these to user-readable copy. For example, VaultClaimable should be shown as owner controls are frozen because the inheritance window is open, not as a generic gas failure.

VaultAlreadyExists(address owner)
VaultDoesNotExist(address owner)
VaultAlreadyClaimed(address owner)
InvalidHeir()
InvalidReceiver()
InvalidToken()
InvalidPeriod()
Unauthorized()
ZeroAmount()
ZeroReceivedAmount()
InsufficientBalance()
VaultClaimable(address owner)
VaultNotClaimable(address owner)
AssetBalanceNotZero(address owner)
ArrayLengthMismatch()
NativeUSDCTransferFailed()

Admin controls

The contract owner can pause and unpause. Pausing blocks state-changing user functions marked whenNotPaused. It does not grant the admin heir rights or permission to drain user vaults.

pause()
unpause()