Skip to content

About

On-chain dead-man's switch for ERC-20 assets: owner checks in to keep control, beneficiary can claim after the owner goes silent past the interval; non-custodial, solvency invariant

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

inheritance-vault

An on-chain dead-man's switch for ERC-20 assets. An owner deposits into a plan and periodically checks in. While they keep checking in, only they control the funds. If they go silent past their chosen interval, the named beneficiary can claim the whole plan. Non-custodial: no admin, no third party can ever take the funds — only the owner (any time) or the beneficiary (after a lapse). MIT.

Flow

  • createPlan(token, amount, beneficiary, interval) — fund a plan; credits the actual amount received (fee-on-transfer-safe). Returns a planId.
  • checkIn(id) — the owner's heartbeat: resets the silence clock. topUp and ownerWithdraw also reset it.
  • ownerWithdraw(id, amount) — the owner pulls their own funds out at any time.
  • changeBeneficiary / changeInterval — owner-only; changing the interval also resets the clock (so a shortened interval can't cause an instant lapse).
  • claim(id) — the beneficiary takes the whole plan, but only once block.timestamp > lastCheckIn + interval (strictly past the deadline). Terminal: a plan can be claimed once.

Invariant (fuzzed, fail_on_revert=true, non-hollow)

  • Solvency — the vault always holds at least the sum of every plan's recorded balance, across any sequence of create / check-in / owner-withdraw / top-up / time-warp / beneficiary-claim (12,800 calls, 0 reverts). No plan's funds can ever be paid to the wrong party or double-claimed. Mutation-checked (relaxing the lapse boundary from > to >= fails a test).

Trust model (honest)

  • The only actors who can move a plan's funds are its owner (always) and its beneficiary (only after the owner is silent past the interval). There is no contract owner/admin and no path to another plan's funds.
  • Standard ERC-20 assumed; fee-on-transfer is handled on deposit (actual-received) — a rebasing token is out of scope.
  • Liveness is on the owner: they must check in to retain exclusive control. Unaudited reference impl.
forge test   # 17 tests: heartbeat/lapse gating, owner powers, beneficiary change, reentrancy, solvency invariant

About

On-chain dead-man's switch for ERC-20 assets: owner checks in to keep control, beneficiary can claim after the owner goes silent past the interval; non-custodial, solvency invariant

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages