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

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

adminparams.gno

4.83 Kb · 120 lines
  1package kourtv3
  2import (
  3	"strconv"
  4	"strings"
  5)
  6func adminAddr() address {
  7	if globalDAO != nil {
  8		return globalDAO.admin
  9	}
 10	return directoryAdmin
 11}
 12func purgeThreshold() int {
 13	if globalDAO != nil {
 14		return globalDAO.purgeM
 15	}
 16	return daoBootstrapM
 17}
 18func daoSeats() int {
 19	if globalDAO != nil {
 20		return globalDAO.n
 21	}
 22	return daoBootstrapN
 23}
 24func AdminParams() string {
 25	l := ladderDefault
 26	r := creditRatesDefault
 27	hosts := MediaHosts()
 28	exact, suffix := hosts, ""
 29	if i := strings.Index(hosts, "|"); i >= 0 {
 30		exact, suffix = hosts[:i], hosts[i+1:]
 31	}
 32	n := func(v int64) string { return strconv.FormatInt(v, 10) }
 33	return "admin:" + adminAddr().String() +
 34		";creationBurn:" + n(courtCreationBurn) +
 35		";burnBps:" + n(burnBps) +
 36		";assocBond:" + n(assocBondDefault) +
 37		";purgeM:" + strconv.Itoa(purgeThreshold()) +
 38		";t1:" + n(l.t1Bps) +
 39		";t2:" + n(l.t2Bps) +
 40		";t3:" + n(l.t3Bps) +
 41		";entry:" + n(l.postsEntry) +
 42		";l2:" + n(l.postsT2) +
 43		";l3:" + n(l.postsT3()) +
 44		";flag:" + n(r.flag) +
 45		";dispute:" + n(r.dispute) +
 46		";authorHigh:" + n(r.authorHigh) +
 47		";conviction:" + n(r.conviction) +
 48		";unadjudicated:" + n(r.unadjudicated) +
 49		";domain:" + siteDomain +
 50		";mediaExact:" + exact +
 51		";mediaSuffix:" + suffix
 52}
 53const adminParamsPath = "admin-params"
 54func renderAdminParams() string {
 55	l := ladderDefault
 56	r := creditRatesDefault
 57	n := func(v int64) string { return strconv.FormatInt(v, 10) }
 58	var b strings.Builder
 59	b.WriteString("# Realm parameters\n\n")
 60	b.WriteString("Everything the global DAO admin can set, and what it is set " +
 61		"to now. A court's moderators set their own court's bond, ladder and " +
 62		"standing rates; those are on the court's page, not here.\n\n")
 63	b.WriteString("Admin: `" + adminAddr().String() + "`\n\n")
 64	b.WriteString("| Setting | Now | What it does | Set with |\n")
 65	b.WriteString("|---|---|---|---|\n")
 66	b.WriteString("| Court creation burn | " + ugnotAmt(courtCreationBurn) +
 67		" GNOT | The minimum a new court costs to open. The whole payment is " +
 68		"burned. 0 turns it off, and off is the shipped default. | " +
 69		"`SetCourtCreationBurn` |\n")
 70	b.WriteString("| Burn share of each offering | " + pct(burnBps, bpsDenom) +
 71		" | Of every payment for a court's coin, this much burns to the keyless " +
 72		"sink for good; the rest is held by that court for all of its coin and " +
 73		"paid back pro-rata to anyone who returns coin. One-way courts burn all " +
 74		"of it. Applies to payments after the change; " +
 75		strconv.FormatInt(minBurnBps, 10) + "–" + strconv.FormatInt(maxBurnBps, 10) +
 76		" bps. | `SetBurnBps` |\n")
 77	b.WriteString("| Association bond | " + ccAmt(assocBondDefault) +
 78		" CC | What a stranger posts to attach an edge, in courts that set no " +
 79		"override. | `SetAssociationBondDefault` |\n")
 80	b.WriteString("| Purge threshold | " + strconv.Itoa(purgeThreshold()) + " of " +
 81		strconv.Itoa(daoSeats()) + " | How many global moderators must agree to purge. | " +
 82		"`SetPurgeThreshold` |\n")
 83	b.WriteString("| Posting ladder | " + n(l.t1Bps) + "/" + n(l.t2Bps) + "/" +
 84		n(l.t3Bps) + " bps at " + n(l.postsEntry) + "/" + n(l.postsT2) + "/" +
 85		n(l.postsT3()) + " posts | The default rungs a court inherits: the share " +
 86		"earned at each tier and the post counts that reach them. | " +
 87		"`SetLadderDefault` |\n")
 88	b.WriteString("| Standing rates | flag " + n(r.flag) + " (inert), dispute " +
 89		n(r.dispute) + ", author " + n(r.authorHigh) + ", conviction " +
 90		n(r.conviction) + ", unadjudicated " + n(r.unadjudicated) +
 91		" bps | The default credit each act earns toward standing. Policing " +
 92		"ranks above authorship, which ranks above staking. The flag rate is " +
 93		"still settable and still bounds what authorship may be set to, but no " +
 94		"path credits it since the quality lane was removed. | " +
 95		"`SetCreditRatesDefault` |\n")
 96	dom := siteDomain
 97	if dom == "" {
 98		dom = "_none_"
 99	}
100	b.WriteString("| Site domain | " + dom + " | The website this realm belongs " +
101		"to. Also allow-lists that domain for images without listing it below. | " +
102		"`SetSiteDomain` |\n")
103	hosts := MediaHosts()
104	if hosts == "|" {
105		hosts = "_none_"
106	}
107	b.WriteString("| Media hosts | " + hosts + " | Where images may be loaded " +
108		"from: exact hosts before the bar, suffixes after it. | " +
109		"`SetMediaHosts` |\n")
110	b.WriteString("\nBurned to date — the sink's balance, which is every burn share, " +
111		"every creation burn, and anything else ever sent there: **" +
112		ugnotAmt(BurnedGNOT()) + " GNOT**, held at `" + BurnSink().String() +
113		"` — an address derived from a package path that the path grammar can " +
114		"never assign to a deployed realm, so no key to it exists and nothing " +
115		"can ever be spent from it. " +
116		"Held for coin, across every court: **" + ugnotAmt(TotalReserveGNOT()) +
117		" GNOT**, at this realm's own address — which no instruction but a " +
118		"holder returning coin for its pro-rata share can move.\n")
119	return b.String()
120}