const MaxTitle, MaxSpec, MaxURL, MaxNote, MinBlocks, MaxBlocks
Field limits, in bytes, and block-count bounds for leases and review windows.
Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.
Package guild implements the quest state machine used by the Guildhall bounty board. It holds no coins and keeps no g...
Package guild implements the quest state machine used by the Guildhall bounty board. It holds no coins and keeps no globals: a realm posts a Quest, locks the reward itself, and drives the quest through these pure transition methods.
Field limits, in bytes, and block-count bounds for leases and review windows.
1var (
2 ErrInvalidPoster = errors.New("guild: invalid poster address")
3 ErrEmptyTitle = errors.New("guild: title is required")
4 ErrTitleTooLong = errors.New("guild: title exceeds 80 bytes")
5 ErrSpecTooLong = errors.New("guild: spec exceeds 2000 bytes")
6 ErrInvalidReward = errors.New("guild: reward must be positive")
7 ErrInvalidLease = errors.New("guild: lease blocks out of range [100, 500000]")
8 ErrInvalidReview = errors.New("guild: review blocks out of range [100, 500000]")
9 ErrInvalidDeadline = errors.New("guild: deadline must be later than height plus lease")
10 ErrNotOpen = errors.New("guild: quest is not open")
11 ErrNotClaimed = errors.New("guild: quest is not claimed")
12 ErrNotSubmitted = errors.New("guild: quest is not submitted")
13 ErrNotPoster = errors.New("guild: caller is not the poster")
14 ErrNotWorker = errors.New("guild: caller is not the worker")
15 ErrSelfClaim = errors.New("guild: poster cannot claim their own quest")
16 ErrPastDeadline = errors.New("guild: deadline has passed")
17 ErrLeaseExpired = errors.New("guild: lease has expired")
18 ErrReviewOpen = errors.New("guild: review window is still open")
19 ErrReviewClosed = errors.New("guild: review window has closed")
20 ErrBeforeDeadline = errors.New("guild: deadline has not passed")
21 ErrSubmittedPending = errors.New("guild: quest has a pending submission")
22 ErrProofURLEmpty = errors.New("guild: proof URL is required")
23 ErrProofURLTooLong = errors.New("guild: proof URL exceeds 300 bytes")
24 ErrNoteTooLong = errors.New("guild: note exceeds 500 bytes")
25 ErrReasonTooLong = errors.New("guild: reason exceeds 500 bytes")
26)Event records one state change in a quest's history.
Quest is a single bounty: posted with an escrowed reward, claimed under a lease, submitted with proof, then paid, rejected back to open, refunded or cancelled.
Accept pays the submission out: the poster approves inside or past the review window, there is no time limit on acceptance.
AutoAccept pays the worker when the poster let the review window lapse: silence counts as acceptance.
Cancel withdraws an Open quest — or one whose claim went stale — and frees the escrow back to the poster.
Claim lets w take the quest while it is Open — including a stale claim whose lease expired. The poster can never claim their own quest.
Refund returns the escrow to the poster once the deadline has passed, for an Open quest or a claim whose lease went stale. A pending submission can never be refunded.
Reject sends the quest back to Open, inside the review window, and clears the worker. The cleared fields are preserved in the event detail.
ReviewEnd is the last height at which the poster may reject a submission.
StatusAt reports the effective status at height h: a Claimed quest whose lease has run out reads as Open again.
Submit turns in the worker's proof while the lease is live.
Status is the lifecycle state of a Quest.