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.

campaigns source realm

Package campaigns is Guildhall's escrow for many-hands tasks: a fixed reward per claim, a fixed number of slots, and ...

Overview

Package campaigns is Guildhall's escrow for many-hands tasks: a fixed reward per claim, a fixed number of slots, and one reviewer approval per claim. "10 GNOT each to the first 100 people who write about X" is one campaign holding 1000 GNOT.

Each approved claim pays the claimant and writes a reputation record to gno.land/r/g1lnkytfqcjwllws63gvf0mv9yt04aswy4y9amhm/guildhall/reputation at ClaimShareBps of a normal record's weight, vouched for by the reviewer who approved it. Small, repeatable tasks therefore count for something without outweighing reviewed bounty work.

The rules live in gno.land/p/g1lnkytfqcjwllws63gvf0mv9yt04aswy4y9amhm/guildhall/campaign. This realm holds the funds, authenticates callers, moves coins, and renders the campaigns.

Constants 1

const ClaimShareBps, maxDeadlineDays

1const (
2	// ClaimShareBps is the weight of a claim's reputation record relative to
3	// a fully approved bounty milestone (10000).
4	ClaimShareBps = 500
5
6	maxDeadlineDays = 365
7)
source

Functions 13

func ApproveClaim

crossing Action
1func ApproveClaim(cur realm, id uint64, claim int)
source

ApproveClaim pays a pending claim. Any reviewer of the campaign.

func Claim

crossing Action
1func Claim(cur realm, id uint64, proof string) int
source

Claim asks to be paid for doing the task once. proof is a link to the work (the post, the PR, the page). It reserves a slot until a reviewer decides. Returns the claim number.

func Close

crossing Action
1func Close(cur realm, id uint64)
source

Close stops new claims and refunds the free slots to the poster. The poster can close at any time; anyone can close after the deadline. Pending claims can still be approved or rejected afterwards.

func CountByStatus

Action
1func CountByStatus(status string) int
source

CountByStatus counts campaigns in a status ("open" or "closed").

func Escrowed

Action
1func Escrowed(denom string) int64
source

Escrowed is the amount of denom (a native denom or a grc20reg key) held.

func PostCampaign

crossing Action
1func PostCampaign(cur realm, title, description, link, tags, reviewers string, reward int64, slots, deadlineDays int) uint64
source

PostCampaign posts a campaign funded with the native coins sent along with the call, which must equal reward × slots. reviewers is a comma-separated address list (empty means the poster reviews alone); any one of them can approve a claim. deadlineDays closes the campaign to new claims after that many days (0: no deadline).

func PostCampaignGRC20

crossing Action
1func PostCampaignGRC20(cur realm, tokenKey, title, description, link, tags, reviewers string, reward int64, slots, deadlineDays int) uint64
source

PostCampaignGRC20 posts a campaign funded with a registered GRC20 token. The caller must first approve this realm's address for reward × slots on the token; this call pulls the funds into escrow.

func RejectClaim

crossing Action
1func RejectClaim(cur realm, id uint64, claim int, reason string)
source

RejectClaim turns down a pending claim and frees its slot. Any reviewer of the campaign.

func Render

1func Render(path string) string
source

Render serves the campaigns:

Example
1""             every campaign (?status=open|closed|all, ?tag=x, ?page=N)
2<id>           a campaign and its claims (?claims=pending|approved|rejected|all, ?page=N)
3u/<address>    campaigns an address posted, reviews or claimed
4post           how to post a campaign

func SetPaused

crossing Action
1func SetPaused(cur realm, p bool)
source

SetPaused stops or resumes new campaigns. Existing campaigns, claims and payouts are never paused. Council only.

func TransferCouncil

crossing Action
1func TransferCouncil(cur realm, newCouncil address)
source

TransferCouncil hands the council seat to another address. Council only.

Dependencies

Source Files 4