guildhall.gno
3.57 Kb · 53 lines
1// Package guildhall is the front door of Guildhall: fund work, track it, and
2// turn finished work into a record anyone can check.
3//
4// gno.land/r/g1lnkytfqcjwllws63gvf0mv9yt04aswy4y9amhm/guildhall/bounties escrowed bounties with milestones, reviewers and disputes
5// gno.land/r/g1lnkytfqcjwllws63gvf0mv9yt04aswy4y9amhm/guildhall/reputation work records and reputation other realms can import
6// gno.land/r/g1lnkytfqcjwllws63gvf0mv9yt04aswy4y9amhm/guildhall/govdao optional adapter: reputation as an input to GovDAO membership
7package guildhall
8
9import (
10 "strings"
11
12 "gno.land/p/g1lnkytfqcjwllws63gvf0mv9yt04aswy4y9amhm/guildhall/trust/v0"
13 "gno.land/p/nt/ufmt/v0"
14 "gno.land/r/g1lnkytfqcjwllws63gvf0mv9yt04aswy4y9amhm/guildhall/bounties"
15 "gno.land/r/g1lnkytfqcjwllws63gvf0mv9yt04aswy4y9amhm/guildhall/reputation"
16)
17
18func Render(_ string) string {
19 var b strings.Builder
20 b.WriteString("# Guildhall\n\n")
21 b.WriteString("**Fund work, track it, and turn finished work into a record anyone can check.**\n\n")
22 b.WriteString("Post a task and escrow GNOT or any registered GRC20 token against it. Split it into milestones and name the reviewers. ")
23 b.WriteString("Each approved milestone pays the contributor and writes a public record of the work: who did it, who vouched for it, and a link to the PR, realm or proposal. ")
24 b.WriteString("Those records add up to a reputation that any realm can read with one import. Guildhall governs itself; no outside realm has authority over it.\n\n")
25
26 b.WriteString(ufmt.Sprintf("| Open bounties | In progress | Completed | Work records | Ranked contributors |\n|---:|---:|---:|---:|---:|\n| %d | %d | %d | %d | %d |\n\n",
27 bounties.CountByStatus("open"), bounties.CountByStatus("active"), bounties.CountByStatus("completed"),
28 reputation.RecordCount(), reputation.ContributorCount()))
29
30 b.WriteString("- [**Bounty board**](/r/g1lnkytfqcjwllws63gvf0mv9yt04aswy4y9amhm/guildhall/bounties): find work or [post a bounty](/r/g1lnkytfqcjwllws63gvf0mv9yt04aswy4y9amhm/guildhall/bounties:post)\n")
31 b.WriteString("- [**Reputation**](/r/g1lnkytfqcjwllws63gvf0mv9yt04aswy4y9amhm/guildhall/reputation): leaderboard, profiles and [how scoring works](/r/g1lnkytfqcjwllws63gvf0mv9yt04aswy4y9amhm/guildhall/reputation:about)\n")
32 b.WriteString("- [**GovDAO**](/r/g1lnkytfqcjwllws63gvf0mv9yt04aswy4y9amhm/guildhall/govdao): an optional bridge that lets GovDAO members propose high-reputation contributors\n\n")
33
34 top := reputation.Top(5)
35 if len(top) > 0 {
36 b.WriteString("## Top contributors\n\n")
37 for i, s := range top {
38 b.WriteString(ufmt.Sprintf("%d. [%s](/r/g1lnkytfqcjwllws63gvf0mv9yt04aswy4y9amhm/guildhall/reputation:u/%s): %d (%s)\n", i+1, s.Addr.String(), s.Addr.String(), s.Score, trust.Level(s.Score)))
39 }
40 b.WriteString("\n")
41 }
42
43 b.WriteString("## How it works\n\n")
44 b.WriteString("1. **Post.** Send funds with `PostBounty`. They stay in the realm, not with the poster.\n")
45 b.WriteString("2. **Assign.** Contributors apply and the poster picks one.\n")
46 b.WriteString("3. **Deliver.** The contributor submits each milestone with a link to the work.\n")
47 b.WriteString("4. **Review.** Once enough reviewers approve, the milestone pays out and a reputation record is written.\n")
48 b.WriteString("5. **Dispute.** If reviewer and contributor disagree, the arbiter pays, refunds or splits.\n\n")
49
50 b.WriteString("## Gate your realm on reputation\n\n")
51 b.WriteString("```go\nimport \"gno.land/r/g1lnkytfqcjwllws63gvf0mv9yt04aswy4y9amhm/guildhall/reputation\"\n\nfunc Post(cur realm, body string) {\n\treputation.AssertScore(cur.Previous().Address(), 100)\n\t// ...\n}\n```\n")
52 return b.String()
53}