const Denom
Denom is the only coin this realm accepts: ugnot (GNOT).
Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.
Package heirrealm is a dead-man's-switch inheritance realm for Gno.land.
Package heirrealm is a dead-man's-switch inheritance realm for Gno.land.
The problem: a Gno holder dies, loses their keys, or simply disappears, and their GNOT is locked forever. No will, no custodian, no recovery.
HeirRealm lets the holder name a beneficiary and a check-in window. As long as the holder checks in before the window expires, nothing happens. Miss the window and anyone — an incentivised keeper, not a trusted custodian — can trigger the release. The keeper earns a small fee for doing the work; the rest goes to the beneficiary. The keeper can never release early, never change the beneficiary, and never touch the funds before the deadline.
Design choices (all documented in README.md):
Caller authentication follows the atomicswap pattern: payment functions require cur.Previous().IsUserCall() and read the attached coins from unsafe.OriginSend(). A realm in the middle of a call chain cannot fake a payment, because OriginSend describes the transaction envelope and IsUserCall rejects non-wallet callers.
Social/voice recovery is intentionally NOT in this MVP. It is listed as a future extension in README.md.
Denom is the only coin this realm accepts: ugnot (GNOT).
KeeperFeeBPS is the keeper's cut of a released vault, in basis points. 200 bps = 2%.
MaxCheckInIntervalSeconds is the longest check-in window: 365 days.
MinCheckInIntervalSeconds is the shortest check-in window: 60s. It exists so the demo can fast-forward through a full lifecycle in about a minute.
Cancel closes an active vault and refunds the full balance to the owner. Only the owner may cancel, and only BEFORE the deadline. After expiry the funds belong to the beneficiary and the owner can no longer claw them back.
CheckIn resets the vault's deadline to now + the check-in interval. Only the owner may check in, only while the vault is active, and only BEFORE the deadline has passed. After the deadline the vault is claimable and checking in can no longer save it.
CreateVault opens a vault for beneficiary with a check-in window of intervalSeconds. Attach the initial deposit with -send ugnot.
The caller becomes the owner. The beneficiary must not be the owner. The deposit must be more than 0 ugnot.
Deposit tops up an active vault. Only the owner may deposit, and only ugnot is accepted. The check-in timer is NOT reset by a deposit — only CheckIn resets it.
Render is the gnoweb homepage for the realm. It lists every vault with its owner, beneficiary, balance, deadline and status, plus a short how-to. A single vault can be viewed at /<id>.
TriggerRelease releases an expired vault. Anyone may call it — that is the keeper's job — but the keeper may not be the owner or the beneficiary, and the deadline must have passed. The keeper earns 2% of the balance; the beneficiary receives the remaining 98%. The keeper is paid for doing the work, never a custodian: they cannot release early, change the beneficiary, or touch the funds before expiry.
VaultCount returns the number of vaults ever created.
GetVault returns a copy of the vault with the given ID. Read-only: callable as a query, no transaction needed.
1type Vault struct {
2 ID int
3 Owner address
4 Beneficiary address
5 Balance int64 // ugnot held by this vault
6 Interval int64 // check-in window, in seconds
7 Deadline time.Time
8 CreatedAt time.Time
9 Released bool
10 Cancelled bool
11 Keeper address // set on release; zero address until then
12 ReleasedAt time.Time // zero until released
13}Vault is one inheritance vault.
BeneficiaryShare returns what the beneficiary receives at release.
KeeperFee returns the keeper's cut of the vault balance at release.
Status returns a human-readable state for the vault.