Codicil

The mechanism Verified · Sepolia testnet Five steps · Fourteen functions

Five steps. One transfer.

A permission, a person, a code and a clock, in that order. Watch it run, then read each step below.

How to read the plates Dashed lines carry permission. Teal carries value. It appears once, at the end.
Fig. 1The mechanism, in five steps
01 / 05Setup Actor · Owner Call · token.approve(vault, amount)

Approve an allowance

You name your heirs, seal the hash of a claim code, and sign one ordinary ERC-20 approval. No deposit is made. The tokens stay in your wallet, and approving zero withdraws the permission.

Assets moved
None
Reversible
Yes, by the owner, at any time
OWNER WALLET BALANCE 2.5 CDT UNCHANGED ALLOWANCE 2.5 CDT VAULT CONTRACT HOLDS 0 MAY SPEND, LATER HEIRS + SHARES → updateHeirs() HASH OF CLAIM CODE → setClaimCodeHash()
02 / 05The trigger Actor · Solicitor Off-chain · No transaction

A solicitor verifies the death

No blockchain can know that a person has died, so most schemes guess from silence. Codicil asks the profession that already answers this question: a solicitor checks the certificate, then releases the claim code to the heir.

Assets moved
None
In the demo
Represented by handing over the claim code
CERTIFICATE SOLICITOR CLAIM CODE TO THE HEIR VERIFIED BY A PERSON, NOT INFERRED FROM SILENCE
03 / 05The claim Actor · Heir Call · vault.submitClaimCode(code)

The claim code is submitted

The contract hashes the submitted code and compares it with the hash sealed at setup. A match records the time. There is no address anywhere in the call: the code proves a claim has begun, and has no say in where it ends.

Assets moved
None
State written
countdownStart = now
SUBMITTED keccak256( CODE ) SEALED AT SETUP claimCodeHash = VAULT CONTRACT CLOCK STARTED NO ADDRESS ANYWHERE IN THE CALL
04 / 05The safeguard Actor · Owner, if alive Call · vault.cancelClaim()

The cancellation window

The countdown runs in public. If the claim is mistaken or malicious, one transaction from your wallet cancels it and the vault reseals. You act only if something has gone wrong, so there are no check-ins.

Assets moved
None
Length
90 days by design 90 seconds on the demo deployment
CODE SUBMITTED WINDOW CLOSES T + 0 T + 90 DAYS cancelClaim() OWNER, ANY TIME IN THE WINDOW SEALED
05 / 05Release Actor · Heir Call · vault.claim() → token.transferFrom()

The heirs claim

Once the window closes, claim() spends your allowance and pays every stored heir in one transaction. This is the only time the asset moves, and it moves from your wallet to theirs.

Assets moved
Owner → named heirs, once
Destination
Read from storage. Never supplied by the caller.
OWNER WALLET 2.5 CDT VAULT CONTRACT claim() HEIR 01 60% 1.5 CDT HEIR 02 40% 1.0 CDT transferFrom()

§The whole contract Every state-changing function. There are five.

Short enough to read.

A vault you cannot audit by eye is a custodian with extra steps. This is everything the deployed contract can be asked to do.

FunctionWhenEffectMoves assets
updateHeirs(address[], uint16[]) Setup, by the owner Stores up to ten heir addresses and their shares in basis points. No
setClaimCodeHash(bytes32) Setup, by the owner Stores the hash of the claim code. The code itself never goes on-chain until it is used. No
submitClaimCode(string) After the death is verified Checks the code against the stored hash and starts the countdown. No
cancelClaim() During the window, by the owner Clears the countdown and reseals the vault. No
claim() After the window Spends the allowance, paying each stored heir their share. Owner → heirs

Signatures as deployed at 0x1FAf…a4A7 on Sepolia. The remaining nine functions are read-only.


Next Try it on the testnet

See it run.