Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

timelock_guardian state

Back to all declarations

TargetConfig

type

TargetConfig binds a named target to the only address allowed to schedule actions against it, an enforced minimum delay, and an optional guardian who can veto pending actions. Without this binding a timelock attests nothing: anyone could schedule their own short-delay action against any name and "execute" it.

Value

timelock_guardian.TargetConfig

Action

type

Action represents a scheduled operation that can only execute after its delay has elapsed, and only within its grace window. State model (re-audit 2026-09-02): only PENDING and EXECUTED actions are stored. Executed records are permanent attestations consumers check via IsExecuted. Cancelled, vetoed, and expired actions are REAPED from state — their history lives in emitted events — so the live-action cap bounds live exposure and can never be consumed permanently by schedule/cancel cycling.

Value

timelock_guardian.Action

MinDelayFloor

int64

Value

60

MaxDelay

int64

// 10 years

Value

315360000

GracePeriod

int64

// 30 days

Value

2592000

MaxTargetsPerOwner

untyped bigint

Value

(10 <untyped> bigint)

MaxPendingPerTarget

untyped bigint

Value

(20 <untyped> bigint)

MaxTargetNameLen

untyped bigint

Value

(64 <untyped> bigint)

MaxDataLen

untyped bigint

Value

(2000 <untyped> bigint)

MaxRenderActions

untyped bigint

Value

(100 <untyped> bigint)

RenderIndexCap

untyped bigint

Value

(200 <untyped> bigint)

targets

map[string]*timelock_guardian.TargetConfig
Open
OID
04092f…8192:46
targets details

Inspect map

targetNames

[]string (len=1)

// insertion-ordered for deterministic iteration

Open
OID
04092f…8192:56
targetNames details (len=1)

+1 more Inspect slice

ownerTargets

map[.uverse.address]int
Open
OID
04092f…8192:48
ownerTargets details

Inspect map

actions

map[string]*timelock_guardian.Action
Open
OID
04092f…8192:49
actions details

Inspect map

actionIDs

[]string (len=1)

// insertion-ordered render window, self-trimmed to RenderIndexCap

Open
OID
04092f…8192:70
actionIDs details (len=1)

+1 more Inspect slice

nextID

int

Value

6

rejectStraySend

func()

rejectStraySend aborts when coins are attached to a call (fix Y6): this realm handles no funds and holds no banker, so an attached send would strand on the realm address forever. Aborting reverts the transfer back to the sender. Fails open for realm-routed calls, whose attached send lands on the intermediary realm, never here.

Open
OID
04092f…8192:15
rejectStraySend details

Inspect func

mustGetTarget

func(name string) *timelock_guardian.TargetConfig
Open
OID
04092f…8192:16
mustGetTarget details

Inspect func

mustGet

func(id string) *timelock_guardian.Action
Open
OID
04092f…8192:17
mustGet details

Inspect func

isValidName

func(name string) bool
Open
OID
04092f…8192:18
isValidName details

Inspect func

expired

func(a *timelock_guardian.Action) bool
Open
OID
04092f…8192:19
expired details

Inspect func

removeID

func(list []string, id string) []string
Open
OID
04092f…8192:20
removeID details

Inspect func

addPendingTarget

func(target string)
Open
OID
04092f…8192:21
addPendingTarget details

Inspect func

removePendingTarget

func(target string)

removePendingTarget drops a target from the with-pendings list in O(1) by swapping the last entry into its slot. Order afterwards is deterministic (a pure function of the operation history), which is all iteration needs.

Open
OID
04092f…8192:22
removePendingTarget details

Inspect func

dropPending

func(target string, id string)

dropPending removes id from its target's pending list. Bounded: the list never exceeds MaxPendingPerTarget.

Open
OID
04092f…8192:23
dropPending details

Inspect func

reap

func(id string)

reap removes a non-executed action from state entirely; its history is the emitted event. Executed records are permanent attestations: reap refuses them outright (round-2 hardening), so no future caller can erase one by mistake.

Open
OID
04092f…8192:24
reap details

Inspect func

sweepExpired

func(target string)

sweepExpired reaps the expired pending actions of ONE target (fix Y4/Y2: the old global budget-windowed sweep let long-delay entries at the front of a shared queue starve everything behind them). A target's list is bounded by MaxPendingPerTarget, so the sweep is a bounded scan. Expiry history is the emitted event.

Open
OID
04092f…8192:25
sweepExpired details

Inspect func

pendingCount

func(target string) int

pendingCount is the length of the target's live list. The counter it replaces (fix Y4) could desync from the lists it mirrored; a length cannot. It may briefly include not-yet-swept expired actions; those are reaped by the next Schedule's sweep or by anyone's Expire, and in the worst case an owner briefly under-uses their own quota — never another tenant's.

Open
OID
04092f…8192:26
pendingCount details

Inspect func

sanitize

func(s string) string

sanitize makes attacker-controlled text safe to embed in markdown and single-line summaries: backticks, pipes, newlines, link syntax, and raw HTML brackets (fix Y3: gnoweb has no HTML sanitization layer, so a literal \<script> tag must never reach the page) are replaced so a Data string cannot break out of its cell, inject rows or markup, or render a live link.

Open
OID
04092f…8192:27
sanitize details

Inspect func

truncate

func(s string, n int) string

truncate shortens s to at most n runes without splitting a multibyte character. n is clamped to a minimum of 4 (re-audit: n\<=2 sliced out of bounds).

Open
OID
04092f…8192:28
truncate details

Inspect func

RegisterTarget

func(name string, minDelay int64, guardian .uverse.address)

RegisterTarget creates a named target. The caller becomes its owner — the only address that may schedule actions against it. minDelay is the enforced floor for every action's delay. guardian may be empty (no guardian) or an address empowered to veto pending actions.

Open
OID
04092f…8192:29
RegisterTarget details

Inspect func

SetGuardian

func(targetName string, guardian .uverse.address)

SetGuardian changes (or clears, with "") the target's guardian. Owner only, and REFUSED while the target has pending actions: the guardian's veto power exists precisely to check the owner during a delay window, so the owner must not be able to strip it mid-window. KNOWN LIMIT (documented, round-3 audit): the owner can cancel all pending actions, change the guardian, and reschedule — the price is a full fresh MinDelay on every rescheduled action, and every step emits an event (cancellations + the guardian change below), so observers always get MinDelay of warning under the new guardian regime. Guardians protect open windows, not the owner's future.

Open
OID
04092f…8192:30
SetGuardian details

Inspect func

TransferTargetOwnership

func(targetName string, newOwner .uverse.address)

TransferTargetOwnership OFFERS a target to a new owner; the nominee must AcceptTargetOwnership to complete it (fix Y5: a one-step transfer let anyone fill a stranger's per-owner quota and dump pending obligations — with an attacker-chosen guardian — on an address that never asked). Owner only. Pass "" to clear a pending offer. Nothing changes hands until the nominee accepts.

Open
OID
04092f…8192:31
TransferTargetOwnership details

Inspect func

AcceptTargetOwnership

func(targetName string)

AcceptTargetOwnership completes a pending ownership offer; only the nominee can accept. The nominee's quota is checked HERE — consent time — so an offer can never overfill an account that did not agree to carry it.

Open
OID
04092f…8192:32
AcceptTargetOwnership details

Inspect func

Schedule

func(targetName string, data string, delay int64) string

Schedule creates a new timelocked action against a registered target. Only the target's owner may schedule. The delay must be at least the target's registered minimum and at most MaxDelay. Returns the action ID.

Open
OID
04092f…8192:33
Schedule details

Inspect func

Execute

func(actionID string) string

Execute marks an action as executed. Anyone can call this — the timelock is the protection, not the executor's identity. The action must exist, be pending, its delay elapsed, and its grace window not yet expired.

Open
OID
04092f…8192:34
Execute details

Inspect func

Cancel

func(actionID string) string

Cancel removes a pending action. Only the target's CURRENT owner can cancel (re-audit: the scheduling creator's rights must not survive an ownership transfer). The record is reaped; history is the event.

Open
OID
04092f…8192:35
Cancel details

Inspect func

Veto

func(actionID string) string

Veto cancels a pending action as the target's guardian. This is the guardian's whole power: it can stop a scheduled action during the delay window, never create or execute one. The record is reaped; history is the event.

Open
OID
04092f…8192:36
Veto details

Inspect func

Expire

func(actionID string) string

Expire reaps a provably expired action. Permissionless (fix Y2): an expired action decides nothing — reaping it only writes down what the clock already decided — so anyone may free the quota slot it holds. This is the recovery valve that makes a wedged target impossible: before it, a phantom expired entry consumed quota and blocked SetGuardian until a global sweep happened to reach it; now its own target's owner — or anyone else — reaps it directly.

Open
OID
04092f…8192:37
Expire details

Inspect func

GetTarget

func(targetName string) string

GetTarget returns a formatted summary of a registered target.

Open
OID
04092f…8192:38
GetTarget details

Inspect func

GetAction

func(actionID string) string

GetAction returns a formatted summary of a single pending or executed action. Cancelled/vetoed/expired actions are reaped — their history is in emitted events.

Open
OID
04092f…8192:39
GetAction details

Inspect func

GetPending

func() string

GetPending returns the IDs of all pending, non-expired actions, grouped by target, insertion-ordered within a target. Only targets that actually hold live pendings are visited (round-2 fix Y-1), so the scan cannot be inflated by registrations alone.

Open
OID
04092f…8192:40
GetPending details

Inspect func

IsReady

func(actionID string) bool

IsReady returns true if the action exists, is pending, its delay has elapsed, and it has not expired.

Open
OID
04092f…8192:41
IsReady details

Inspect func

IsExecuted

func(actionID string) bool

IsExecuted returns true if the action exists and was executed. This is the consumer-side check: combined with target registration it attests that the target's registered owner scheduled the action, it waited at least the registered minimum delay, no guardian vetoed it, and it was executed within its grace window. Executed records are permanent.

Open
OID
04092f…8192:42
IsExecuted details

Inspect func

Render

func(path string) string

Render returns a markdown overview. Never panics. Cancelled, vetoed, and expired actions are reaped from state; their history is in events. The page shows the most recent actions only (the ordering index is bounded — fix Y4); older executed records stay queryable via GetAction/IsExecuted forever.

Open
OID
04092f…8192:43
Render details

Inspect func

formatAction

func(a *timelock_guardian.Action) string
Open
OID
04092f…8192:44
formatAction details

Inspect func

renderActionRow

func(a *timelock_guardian.Action) string
Open
OID
04092f…8192:45
renderActionRow details

Inspect func
TargetConfig : type =timelock_guardian.TargetConfig
Action : type =timelock_guardian.Action
MinDelayFloor : int64 =60
MaxDelay : int64 =315360000
GracePeriod : int64 =2592000
MaxTargetsPerOwner : untyped bigint =(10 <untyped> bigint)
MaxPendingPerTarget : untyped bigint =(20 <untyped> bigint)
MaxTargetNameLen : untyped bigint =(64 <untyped> bigint)
MaxDataLen : untyped bigint =(2000 <untyped> bigint)
MaxRenderActions : untyped bigint =(100 <untyped> bigint)
RenderIndexCap : untyped bigint =(200 <untyped> bigint)
targets : map[string]*timelock_guardian.TargetConfig Inspect
targetNames : []string (len=1) Inspect
ownerTargets : map[.uverse.address]int Inspect
actions : map[string]*timelock_guardian.Action Inspect
actionIDs : []string (len=1) Inspect
pending : map[string][]string Inspect
pendingTargets : []string
ptIndex : map[string]int Inspect
nextID : int =6
init.20 : func() Inspect
now : func() time.Time Inspect
rejectStraySend : func() Inspect
mustGetTarget : func(name string) *timelock_guardian.TargetConfig Inspect
mustGet : func(id string) *timelock_guardian.Action Inspect
isValidName : func(name string) bool Inspect
expired : func(a *timelock_guardian.Action) bool Inspect
removeID : func(list []string, id string) []string Inspect
addPendingTarget : func(target string) Inspect
removePendingTarget : func(target string) Inspect
dropPending : func(target string, id string) Inspect
reap : func(id string) Inspect
sweepExpired : func(target string) Inspect
pendingCount : func(target string) int Inspect
sanitize : func(s string) string Inspect
truncate : func(s string, n int) string Inspect
RegisterTarget : func(name string, minDelay int64, guardian .uverse.address) Inspect
SetGuardian : func(targetName string, guardian .uverse.address) Inspect
TransferTargetOwnership : func(targetName string, newOwner .uverse.address) Inspect
AcceptTargetOwnership : func(targetName string) Inspect
Schedule : func(targetName string, data string, delay int64) string Inspect
Execute : func(actionID string) string Inspect
Cancel : func(actionID string) string Inspect
Veto : func(actionID string) string Inspect
Expire : func(actionID string) string Inspect
GetTarget : func(targetName string) string Inspect
GetAction : func(actionID string) string Inspect
GetPending : func() string Inspect
IsReady : func(actionID string) bool Inspect
IsExecuted : func(actionID string) bool Inspect
Render : func(path string) string Inspect
formatAction : func(a *timelock_guardian.Action) string Inspect
renderActionRow : func(a *timelock_guardian.Action) string Inspect