Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

v2 state

Back to all declarations

Denom

untyped string

Denom is the only coin this realm accepts: ugnot (GNOT).

Value

"ugnot"

KeeperFeeBPS

untyped bigint

KeeperFeeBPS is the keeper's cut of a released vault, in basis points. 200 bps = 2%.

Value

(200 <untyped> bigint)

MinCheckInIntervalSeconds

untyped bigint

MinCheckInIntervalSeconds is the shortest check-in window: 60s. It exists so the demo can fast-forward through a full lifecycle in about a minute.

Value

(60 <untyped> bigint)

MaxCheckInIntervalSeconds

untyped bigint

MaxCheckInIntervalSeconds is the longest check-in window: 365 days.

Value

(31536000 <untyped> bigint)

ProductionGracePeriodSeconds

untyped bigint

ProductionGracePeriodSeconds is the production default grace period (7 days = 604,800s) before an expired vault becomes claimable.

Value

(604800 <untyped> bigint)

GracePeriodSeconds

untyped bigint

// 60s for demo, 7 days in production

Value

(60 <untyped> bigint)

vaults

v0.Tree

// vault ID (string) -> \*Vault

Open
OID
038ff8…9af9:4
vaults details

Inspect ref

nextVault

int

Value

2

Vault

type

Vault is one inheritance vault.

Value

v2.Vault

CreateVault

func(beneficiary .uverse.address, intervalSeconds int64) int

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.

Open
OID
038ff8…9af9:6
CreateVault details

Inspect func

Deposit

func(id int) int64

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.

Open
OID
038ff8…9af9:8
Deposit details

Inspect func

CheckIn

func(id int) time.Time

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.

Open
OID
038ff8…9af9:9
CheckIn details

Inspect func

Heartbeat

func(id int) time.Time

Heartbeat revives a vault during its post-deadline grace period and resets its deadline to now + the check-in interval, identically to CheckIn. Only the vault owner may call Heartbeat, and only strictly during the grace window (after Deadline, before Deadline + GracePeriod).

Open
OID
038ff8…9af9:10
Heartbeat details

Inspect func

TriggerRelease

func(id int) (beneficiaryShare int64, keeperFee int64)

TriggerRelease releases an expired vault once both its check-in deadline AND its post-deadline grace period have passed. Anyone may call it — that is the keeper's job — but the keeper may not be the owner or the beneficiary. The keeper earns 2% of the balance; the beneficiary receives the remaining 98%.

Open
OID
038ff8…9af9:11
TriggerRelease details

Inspect func

Cancel

func(id int) int64

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.

Open
OID
038ff8…9af9:12
Cancel details

Inspect func

GetVault

func(id int) v2.Vault

GetVault returns a copy of the vault with the given ID. Read-only: callable as a query, no transaction needed.

Open
OID
038ff8…9af9:13
GetVault details

Inspect func

VaultCount

func() int

VaultCount returns the number of vaults ever created.

Open
OID
038ff8…9af9:14
VaultCount details

Inspect func

requireActive

func(v *v2.Vault)

requireActive panics unless the vault is still live.

Open
OID
038ff8…9af9:15
requireActive details

Inspect func

mustGetVault

func(id int) *v2.Vault

mustGetVault loads a vault by ID or panics.

Open
OID
038ff8…9af9:16
mustGetVault details

Inspect func

Render

func(path string) string

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>.

Open
OID
038ff8…9af9:17
Render details

Inspect func

renderVault

func(v *v2.Vault) string
Open
OID
038ff8…9af9:19
renderVault details

Inspect func
Denom : untyped string ="ugnot"
KeeperFeeBPS : untyped bigint =(200 <untyped> bigint)
MinCheckInIntervalSeconds : untyped bigint =(60 <untyped> bigint)
MaxCheckInIntervalSeconds : untyped bigint =(31536000 <untyped> bigint)
ProductionGracePeriodSeconds : untyped bigint =(604800 <untyped> bigint)
GracePeriodSeconds : untyped bigint =(60 <untyped> bigint)
vaults : v0.Tree Inspect
nextVault : int =2
Vault : type =v2.Vault
CreateVault : func(beneficiary .uverse.address, intervalSeconds int64) int Inspect
Deposit : func(id int) int64 Inspect
CheckIn : func(id int) time.Time Inspect
Heartbeat : func(id int) time.Time Inspect
TriggerRelease : func(id int) (beneficiaryShare int64, keeperFee int64) Inspect
Cancel : func(id int) int64 Inspect
GetVault : func(id int) v2.Vault Inspect
VaultCount : func() int Inspect
requireActive : func(v *v2.Vault) Inspect
mustGetVault : func(id int) *v2.Vault Inspect
Render : func(path string) string Inspect
renderVault : func(v *v2.Vault) string Inspect