types.gno
1.31 Kb · 28 lines
1// Package nslogic is the swappable "business rules" half of the split
2// (NOTES.md §9t). It holds every piece of policy that might reasonably
3// change — pricing, character validation, payment/refund, freeze rules,
4// transfer restrictions — and no persistent records of its own. (One
5// throttle, not a record: when each bounded price setting last moved,
6// timelock.gno's lastTweak. A logic swap starts it empty and loses
7// nothing.)
8//
9// Every mutation here ends by calling into nsdata's narrow Record/Raw
10// API via cross(cur). nsdata trusts whichever address is currently wired
11// up as trustedLogic to have done its own authorization checks
12// correctly, so THIS realm is where "is the caller allowed to do this"
13// actually lives. If a bug is found here, admin deploys a fixed nslogic
14// and re-points the vault at it (ProposeTrustedLogicGrant, then
15// ExecutePending after the timelock) — no data migration,
16// records and config untouched.
17//
18// Deliberately reads config fresh from nsdata on every call rather than
19// caching it. The one thing that cannot be read fresh is a COMPILED
20// regex — avl trees store the pattern string, not the compiled object —
21// so that one value is cached, and the cache is validated against
22// nsdata on every use.
23package nslogic
24
25const (
26 ugnot = "ugnot"
27 bpsDenom = 10_000
28)