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

getters.gno

1.51 Kb · 27 lines
 1package escrow_v3
 2
 3// ── NF-2 solvency getters (MAINNET_READINESS.md §3) ───────────────────────────
 4//
 5// escrow_v3 pools funds between FundMilestone and release/refund, making it a
 6// pooled-fund realm. Without a machine-readable liabilities figure the solvency
 7// monitor can only do a balance-only heuristic. escrow_v3 was the LAST unpublished
 8// pooled-fund realm without this pair — candidature_v3 and agent_registry_v2
 9// already shipped on Topaz without it and can never get it now, on immutable
10// package paths (§3b). Added before this realm ships to any enforce chain.
11//
12// Invariant the monitor reconciles: realm balance >= TotalLiabilities().
13// totalLiable is maintained in lockstep with every fund-moving mutation in
14// escrow.gno: +ms.Amount on FundMilestone, -ms.Amount at every point funds leave
15// (ReleaseFunds; ResolveDispute both branches; CancelContract both branches;
16// ClaimRefund; ClaimDisputeTimeout both branches) — see escrow_feespine_test.gno
17// for the lockstep pin across every one of those paths.
18
19import "chain/runtime/unsafe"
20
21// TotalLiabilities returns the total ugnot the realm owes across all funded and
22// disputed milestones (funds that have arrived but not yet left the realm).
23func TotalLiabilities() int64 { return totalLiable }
24
25// RealmAddress is the NF-2 canonical name for the realm's own address (the
26// solvency monitor pairs it with TotalLiabilities).
27func RealmAddress() string { return unsafe.CurrentRealm().Address().String() }