Skip to content Search Apps Documentation Source Content Run Reset Eval Playground 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.

questmaster state

Back to all declarations

escBlock

func(s string) string

escBlock shows multi-line user text as a blockquote that keeps its line breaks but nothing else: every line is escaped like a table cell (so no link, image, HTML, \`|\` table or line-leading marker survives), a leading "=" is escaped (no setext heading), and lines end with a hard break.

Open
OID
00a977…1476:6
escBlock details

Inspect func

gnowebSafe

func(s string) string

gnowebSafe applies the gnoweb-specific steps described above.

Open
OID
00a977…1476:7
gnowebSafe details

Inspect func

linkOrText

func(link string) string

linkOrText shows a work link. The escrow already guarantees it starts with https:// and has no spaces or control characters.

Open
OID
00a977…1476:8
linkOrText details

Inspect func

Denom

untyped string

Value

"ugnot"

MinReward

int64

Value

1000000

MaxPageSize

untyped bigint

Value

(50 <untyped> bigint)

ErrNotUserCall

untyped string

Panic messages for the realm's own checks. Escrow rule violations panic with the escrow error's text (prefix "escrow: ").

Value

"questmaster: only direct user calls (gnokey maketx call) are accepted"

ErrNoCoins

untyped string

Panic messages for the realm's own checks. Escrow rule violations panic with the escrow error's text (prefix "escrow: ").

Value

"questmaster: send the reward in ugnot with the call"

ErrSeveralCoins

untyped string

Panic messages for the realm's own checks. Escrow rule violations panic with the escrow error's text (prefix "escrow: ").

Value

"questmaster: send exactly one coin (ugnot)"

ErrWrongDenom

untyped string

Panic messages for the realm's own checks. Escrow rule violations panic with the escrow error's text (prefix "escrow: ").

Value

"questmaster: the reward must be in ugnot"

ErrRewardTooLow

untyped string

Panic messages for the realm's own checks. Escrow rule violations panic with the escrow error's text (prefix "escrow: ").

Value

"questmaster: the reward is below the minimum of 1 GNOT (1000000ugnot)"

ErrCoinsNotTaken

untyped string

Panic messages for the realm's own checks. Escrow rule violations panic with the escrow error's text (prefix "escrow: ").

Value

"questmaster: this function does not take coins; send none"

ErrUnknownQuest

untyped string

Panic messages for the realm's own checks. Escrow rule violations panic with the escrow error's text (prefix "escrow: ").

Value

"questmaster: unknown quest id"

quests

v0.Tree

// questKey(id) -> \*escrow.Quest

Open
OID
00a977…1476:10
quests details

Inspect ref

byPoster

v0.Tree

// poster address -> \*avl.Tree of questKey(id) -> true

Open
OID
00a977…1476:12
byPoster details

Inspect ref

byBuilder

v0.Tree

// builder address -> \*avl.Tree of questKey(id) -> true

Open
OID
00a977…1476:14
byBuilder details

Inspect ref

openIDs

v0.Tree

// questKey(id) -> true, quests in state Open

Open
OID
00a977…1476:16
openIDs details

Inspect ref

paidIDs

v0.Tree

// questKey(id) -> true, quests in state Paid

Open
OID
00a977…1476:18
paidIDs details

Inspect ref

lastID

uint64

Value

2

totalPosted

int64

// ugnot ever locked by PostQuest

Value

55000000

totalLocked

int64

// ugnot held for quests that are Open, Claimed or Submitted

Value

50000000

totalPaid

int64

// ugnot paid to builders

Value

5000000

totalRefunded

int64

// ugnot refunded to posters

Value

0

PostQuest

func(title string, details string, workBlocks int64) uint64

PostQuest creates a quest. Send the reward with the call as exactly one coin of ugnot, at least MinReward. workBlocks is the builder's work window in blocks (escrow.MinWorkBlocks to escrow.MaxWorkBlocks). Returns the new id.

Open
OID
00a977…1476:24
PostQuest details

Inspect func

ClaimQuest

func(id uint64)

ClaimQuest takes an Open quest. The poster cannot claim their own quest.

Open
OID
00a977…1476:26
ClaimQuest details

Inspect func

UnclaimQuest

func(id uint64)

UnclaimQuest lets the builder give a Claimed quest back. It opens again, or, if the poster closed it, ends with a refund to the poster.

Open
OID
00a977…1476:27
UnclaimQuest details

Inspect func

ReleaseQuest

func(id uint64)

ReleaseQuest ends the builder's turn on a Claimed quest whose work deadline has passed. Anyone may call it. The quest opens again, or, if the poster closed it, ends with a refund to the poster.

Open
OID
00a977…1476:28
ReleaseQuest details

Inspect func

SubmitWork

func(id uint64, link string)

SubmitWork sends the link to the work (must start with https://). Only the builder, up to and including the work deadline block.

Open
OID
00a977…1476:29
SubmitWork details

Inspect func

ApproveWork

func(id uint64)

ApproveWork accepts the submitted work and pays the reward to the builder. Only the poster.

Open
OID
00a977…1476:30
ApproveWork details

Inspect func

RejectWork

func(id uint64, reason string)

RejectWork refuses the submitted work with a reason. Its public reject count goes up. The quest opens again, or, if the poster closed it, ends with a refund to the poster. Only the poster, up to and including the review deadline block.

Open
OID
00a977…1476:31
RejectWork details

Inspect func

CancelQuest

func(id uint64)

CancelQuest is the poster's way out. Only the poster. - Open quest: it ends at once and the reward is refunded. - Claimed or Submitted quest: it is marked as closing and no coins move. The builder keeps their turn (submit, approval, timeout payout); when the turn ends without approval (unclaim, release after the work deadline, or reject), the quest ends and the reward goes back to the poster instead of the quest opening again.

Open
OID
00a977…1476:32
CancelQuest details

Inspect func

endTurn

func(id uint64, p escrow.Payout, actor .uverse.address, how string, rlm .uverse.realm)

endTurn finishes Unclaim, Release and Reject: the quest opens again, or a closing quest ends with the refund p.

Open
OID
00a977…1476:33
endTurn details

Inspect func

settleRefund

func(id uint64, p escrow.Payout, actor .uverse.address, how string, rlm .uverse.realm)

settleRefund updates totals, emits QuestCancelled and sends the refund last. The quest is already Cancelled (final) when it is called.

Open
OID
00a977…1476:34
settleRefund details

Inspect func

ClaimPayout

func(id uint64)

ClaimPayout pays the builder when the poster has not answered within the review window. Only the builder, from the block after the review deadline.

Open
OID
00a977…1476:35
ClaimPayout details

Inspect func

QuestView

type

QuestView is a read-only copy of one quest at the current block.

Value

questmaster.QuestView

GetQuest

func(id uint64) questmaster.QuestView

GetQuest returns a copy of quest id. It panics on an unknown id.

Open
OID
00a977…1476:36
GetQuest details

Inspect func

Totals

type

Totals are the board-wide running sums, in ugnot.

Value

questmaster.Totals

GetTotals

func() questmaster.Totals

GetTotals returns the running totals. Posted == Locked + Paid + Refunded.

Open
OID
00a977…1476:37
GetTotals details

Inspect func

OpenQuestIDs

func(offset int, limit int) []uint64

OpenQuestIDs lists ids of Open quests, newest first. offset skips that many; at most MaxPageSize ids are returned whatever limit is.

Open
OID
00a977…1476:38
OpenQuestIDs details

Inspect func

PaidQuestIDs

func(offset int, limit int) []uint64

PaidQuestIDs lists ids of Paid quests, newest first (by quest id).

Open
OID
00a977…1476:39
PaidQuestIDs details

Inspect func

AllQuestIDs

func(offset int, limit int) []uint64

AllQuestIDs lists ids of all quests, newest first.

Open
OID
00a977…1476:40
AllQuestIDs details

Inspect func

QuestIDsByPoster

func(addr .uverse.address, offset int, limit int) []uint64

QuestIDsByPoster lists ids of quests posted by addr, newest first.

Open
OID
00a977…1476:41
QuestIDsByPoster details

Inspect func

QuestIDsByBuilder

func(addr .uverse.address, offset int, limit int) []uint64

QuestIDsByBuilder lists ids of quests addr has ever claimed, newest first. It is a history: a quest stays listed after the builder unclaims it, is released or is rejected, even if someone else builds it later. Use GetQuest(id).Builder for the current builder.

Open
OID
00a977…1476:42
QuestIDsByBuilder details

Inspect func

CountByPoster

func(addr .uverse.address) int

CountByPoster returns how many quests addr has posted.

Open
OID
00a977…1476:43
CountByPoster details

Inspect func

CountByBuilder

func(addr .uverse.address) int

CountByBuilder returns how many quests addr has ever claimed.

Open
OID
00a977…1476:44
CountByBuilder details

Inspect func

requireUserCall

func() .uverse.address
Open
OID
00a977…1476:45
requireUserCall details

Inspect func

requireReward

func() int64

requireReward checks the coins sent with PostQuest (rules 1 and 2) and returns the amount. Valid only together with requireUserCall.

Open
OID
00a977…1476:46
requireReward details

Inspect func

requireNoCoins

func()

requireNoCoins refuses coins sent to a function that does not take any (rule 3), so nothing gets stuck in the realm.

Open
OID
00a977…1476:47
requireNoCoins details

Inspect func

mustGet

func(id uint64) *escrow.Quest
Open
OID
00a977…1476:48
mustGet details

Inspect func

settlePaid

func(id uint64, p escrow.Payout)

settlePaid updates storage and totals for a PayBuilder payout.

Open
OID
00a977…1476:50
settlePaid details

Inspect func

send

func(p escrow.Payout, rlm .uverse.realm)

send moves exactly p.Amount ugnot from this realm to p.To. It is called last, after every state change (rule 4), and never sends the realm's balance (rule 5).

Open
OID
00a977…1476:51
send details

Inspect func

questKey

func(id uint64) string

questKey zero-pads id so the avl order is numeric order.

Open
OID
00a977…1476:52
questKey details

Inspect func

amountStr

func(ugnot int64) string
Open
OID
00a977…1476:54
amountStr details

Inspect func

addToIndex

func(idx *v0.Tree, addr .uverse.address, key string)
Open
OID
00a977…1476:55
addToIndex details

Inspect func

indexSize

func(idx *v0.Tree, addr .uverse.address) int
Open
OID
00a977…1476:56
indexSize details

Inspect func

indexPage

func(idx *v0.Tree, addr .uverse.address, offset int, limit int) []uint64
Open
OID
00a977…1476:57
indexPage details

Inspect func

page

func(t *v0.Tree, offset int, limit int) []uint64

page returns up to min(limit, MaxPageSize) ids from t, newest first.

Open
OID
00a977…1476:58
page details

Inspect func

PageSize

untyped bigint

PageSize is the number of quests per list page.

Value

(20 <untyped> bigint)

maxPage

untyped bigint

maxPage bounds ?page= so offsets stay small.

Value

(1000000 <untyped> bigint)

SourceRepo

untyped string

SourceRepo is where the source code is published, shown in the footer of every page.

Value

"https://github.com/elangrr/questmaster"

Render

func(path string) string

Render returns the gnoweb page for path, with the footer.

Open
OID
00a977…1476:59
Render details

Inspect func

renderPage

func(path string) string
Open
OID
00a977…1476:62
renderPage details

Inspect func

renderHome

func(page int) string
Open
OID
00a977…1476:63
renderHome details

Inspect func

renderQuest

func(id uint64) string
Open
OID
00a977…1476:64
renderQuest details

Inspect func

step

type

step is one possible move on a quest page.

Value

questmaster.step

closeStep

func() questmaster.step
Open
OID
00a977…1476:65
closeStep details

Inspect func

reviewWarning

func() string

reviewWarning is shown to posters on the home and help pages.

Open
OID
00a977…1476:66
reviewWarning details

Inspect func

questState

func(q *escrow.Quest) string

questState is the state as shown in tables and on the quest page.

Open
OID
00a977…1476:67
questState details

Inspect func

nextSteps

func(q *escrow.Quest, h int64) string

nextSteps lists the moves valid in q's state, who may make each, and a transaction link and gnokey command for each.

Open
OID
00a977…1476:68
nextSteps details

Inspect func

renderUser

func(addr .uverse.address, asPoster bool, page int) string
Open
OID
00a977…1476:70
renderUser details

Inspect func

renderPaid

func(page int) string
Open
OID
00a977…1476:71
renderPaid details

Inspect func

renderNotFound

func(reason string) string
Open
OID
00a977…1476:73
renderNotFound details

Inspect func

shortAddr

func(a .uverse.address) string
Open
OID
00a977…1476:76
shortAddr details

Inspect func

stateText

func(s escrow.State) string
Open
OID
00a977…1476:77
stateText details

Inspect func

realmPkgPath

string

realmPkgPath is this realm's package path, captured once when the realm is added. (unsafe.CurrentRealm() inside Render depends on the caller's frame, so it is not used there.)

Value

"gno.land/r/g1llc3lq3zmjtjdk29dk52munrzxt5ne746cl7r8/questmaster"

realmPath

func() string

realmPath is this realm's web path, e.g. "/r/g1llc3lq3zmjtjdk29dk52munrzxt5ne746cl7r8/questmaster".

Open
OID
00a977…1476:80
realmPath details

Inspect func

pageURL

func(p string) string

pageURL links to one of this realm's pages.

Open
OID
00a977…1476:82
pageURL details

Inspect func

postLinkFor

func(ugnot int64) string
Open
OID
00a977…1476:84
postLinkFor details

Inspect func

gnokeyCall

func(fn string, id string, arg string, send string) string

gnokeyCall builds a copy-paste gnokey command. Only realm-chosen text goes into it (function names, numbers, fixed example values).

Open
OID
00a977…1476:86
gnokeyCall details

Inspect func

chainID

untyped string

QuestMaster runs on the Onyx test network only; every example command targets it.

Value

"onyx-1"

chainRPC

untyped string

QuestMaster runs on the Onyx test network only; every example command targets it.

Value

"https://rpc.onyx.testnets.gno.land:443"

pageOf

func(t *v0.Tree, pageNum int, base string) ([]uint64, string)

pageOf returns the ids for page (newest first) and prev/next links.

Open
OID
00a977…1476:87
pageOf details

Inspect func

splitQuery

func(path string) (string, url.Values)
Open
OID
00a977…1476:88
splitQuery details

Inspect func

parseID

func(s string) (uint64, bool)
Open
OID
00a977…1476:90
parseID details

Inspect func

parseAddress

func(s string) (.uverse.address, bool)
Open
OID
00a977…1476:91
parseAddress details

Inspect func

gnotStr

func(ugnot int64) string

gnot formats ugnot as GNOT with up to 6 decimals, without floats.

Open
OID
00a977…1476:92
gnotStr details

Inspect func

blocksStr

func(n int64) string

blocksStr formats a block count or height with thousands separators.

Open
OID
00a977…1476:93
blocksStr details

Inspect func

approx

func(blocks int64) string

approx turns a number of blocks into "about N days/hours/minutes", at ApproxBlockMillis per block.

Open
OID
00a977…1476:94
approx details

Inspect func

left

func(deadline int64, h int64) string

left describes the time to a deadline block from height h.

Open
OID
00a977…1476:95
left details

Inspect func

ApproxBlockMillis

untyped bigint

ApproxBlockMillis is the block time used for the approximate times on the pages (measured about 3.4 to 3.5 s on Onyx and mainnet in Nov 2026).

Value

(3500 <untyped> bigint)

plural

func(n int, word string) string

plural returns "1 quest" or "N quests".

Open
OID
00a977…1476:98
plural details

Inspect func
esc : func(s string) string Inspect
escCell : func(s string) string Inspect
escBlock : func(s string) string Inspect
gnowebSafe : func(s string) string Inspect
linkOrText : func(link string) string Inspect
Denom : untyped string ="ugnot"
MinReward : int64 =1000000
MaxPageSize : untyped bigint =(50 <untyped> bigint)
ErrNotUserCall : untyped string ="questmaster: only direct user calls (gnokey maketx call) are accepted"
ErrNoCoins : untyped string ="questmaster: send the reward in ugnot with the call"
ErrSeveralCoins : untyped string ="questmaster: send exactly one coin (ugnot)"
ErrWrongDenom : untyped string ="questmaster: the reward must be in ugnot"
ErrRewardTooLow : untyped string ="questmaster: the reward is below the minimum of 1 GNOT (1000000ugnot)"
ErrCoinsNotTaken : untyped string ="questmaster: this function does not take coins; send none"
ErrUnknownQuest : untyped string ="questmaster: unknown quest id"
quests : v0.Tree Inspect
byPoster : v0.Tree Inspect
byBuilder : v0.Tree Inspect
openIDs : v0.Tree Inspect
paidIDs : v0.Tree Inspect
lastID : uint64 =2
totalPosted : int64 =55000000
totalLocked : int64 =50000000
totalPaid : int64 =5000000
totalRefunded : int64 =0
PostQuest : func(title string, details string, workBlocks int64) uint64 Inspect
ClaimQuest : func(id uint64) Inspect
UnclaimQuest : func(id uint64) Inspect
ReleaseQuest : func(id uint64) Inspect
SubmitWork : func(id uint64, link string) Inspect
ApproveWork : func(id uint64) Inspect
RejectWork : func(id uint64, reason string) Inspect
CancelQuest : func(id uint64) Inspect
endTurn : func(id uint64, p escrow.Payout, actor .uverse.address, how string, rlm .uverse.realm) Inspect
settleRefund : func(id uint64, p escrow.Payout, actor .uverse.address, how string, rlm .uverse.realm) Inspect
ClaimPayout : func(id uint64) Inspect
QuestView : type =questmaster.QuestView
GetQuest : func(id uint64) questmaster.QuestView Inspect
Totals : type =questmaster.Totals
GetTotals : func() questmaster.Totals Inspect
OpenQuestIDs : func(offset int, limit int) []uint64 Inspect
PaidQuestIDs : func(offset int, limit int) []uint64 Inspect
AllQuestIDs : func(offset int, limit int) []uint64 Inspect
QuestIDsByPoster : func(addr .uverse.address, offset int, limit int) []uint64 Inspect
QuestIDsByBuilder : func(addr .uverse.address, offset int, limit int) []uint64 Inspect
CountByPoster : func(addr .uverse.address) int Inspect
CountByBuilder : func(addr .uverse.address) int Inspect
requireUserCall : func() .uverse.address Inspect
requireReward : func() int64 Inspect
requireNoCoins : func() Inspect
mustGet : func(id uint64) *escrow.Quest Inspect
check : func(err .uverse.error) Inspect
settlePaid : func(id uint64, p escrow.Payout) Inspect
send : func(p escrow.Payout, rlm .uverse.realm) Inspect
questKey : func(id uint64) string Inspect
idStr : func(id uint64) string Inspect
amountStr : func(ugnot int64) string Inspect
addToIndex : func(idx *v0.Tree, addr .uverse.address, key string) Inspect
indexSize : func(idx *v0.Tree, addr .uverse.address) int Inspect
indexPage : func(idx *v0.Tree, addr .uverse.address, offset int, limit int) []uint64 Inspect
page : func(t *v0.Tree, offset int, limit int) []uint64 Inspect
PageSize : untyped bigint =(20 <untyped> bigint)
maxPage : untyped bigint =(1000000 <untyped> bigint)
SourceRepo : untyped string ="https://github.com/elangrr/questmaster"
Render : func(path string) string Inspect
renderPage : func(path string) string Inspect
renderHome : func(page int) string Inspect
renderQuest : func(id uint64) string Inspect
step : type =questmaster.step
closeStep : func() questmaster.step Inspect
reviewWarning : func() string Inspect
questState : func(q *escrow.Quest) string Inspect
nextSteps : func(q *escrow.Quest, h int64) string Inspect
extraArg : func(fn string) string Inspect
renderUser : func(addr .uverse.address, asPoster bool, page int) string Inspect
renderPaid : func(page int) string Inspect
renderHelp : func() string Inspect
renderNotFound : func(reason string) string Inspect
shortAddr : func(a .uverse.address) string Inspect
stateText : func(s escrow.State) string Inspect
realmPkgPath : string ="gno.land/r/g1llc3lq3zmjtjdk29dk52munrzxt5ne746cl7r8/questmaster"
init.84 : func() Inspect
realmPath : func() string Inspect
pageURL : func(p string) string Inspect
postLinkFor : func(ugnot int64) string Inspect
gnokeyCall : func(fn string, id string, arg string, send string) string Inspect
chainID : untyped string ="onyx-1"
chainRPC : untyped string ="https://rpc.onyx.testnets.gno.land:443"
pageOf : func(t *v0.Tree, pageNum int, base string) ([]uint64, string) Inspect
splitQuery : func(path string) (string, url.Values) Inspect
pageArg : func(q url.Values) int Inspect
parseID : func(s string) (uint64, bool) Inspect
parseAddress : func(s string) (.uverse.address, bool) Inspect
gnotStr : func(ugnot int64) string Inspect
blocksStr : func(n int64) string Inspect
approx : func(blocks int64) string Inspect
left : func(deadline int64, h int64) string Inspect
ApproxBlockMillis : untyped bigint =(3500 <untyped> bigint)
timeNote : func() string Inspect
capital : func(s string) string Inspect
plural : func(n int, word string) string Inspect