Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

bounties state

Back to all declarations

Denom

untyped string

Denom is the only asset this realm accepts.

Value

"ugnot"

MaxFeeBps

int64

MaxFeeBps is the hard protocol-fee cap: 1000 bps = 10%.

Value

1000

StatusOpen

untyped string

Bounty status values.

Value

"open"

StatusAwarded

untyped string

Bounty status values.

Value

"awarded"

StatusCancelled

untyped string

Bounty status values.

Value

"cancelled"

maxTitleLen

untyped bigint

Value

(80 <untyped> bigint)

bounty

type

Bounty is one bounty record. Fields are unexported; read access goes through BountyInfo so no interior pointers escape the realm.

Value

bounties.bounty

admin

.uverse.address

// may set fee, fee recipient, successor admin

Value

<gnolang.StringValue>

feeRecipient

.uverse.address

// may withdraw fees and sweep surplus

Value

<gnolang.StringValue>

feeBps

int64

// protocol fee snapshotted into new bounties

Value

0

self

.uverse.address

// this realm's address, captured at deploy

Value

<gnolang.StringValue>

nextID

int64

// next bounty id (first bounty gets id 1)

Value

2

openTotal

int64

// == Σ amount over bounties with status Open

Value

0

CreateBounty

func(title string) int64

CreateBounty escrows the attached GNOT as a new open bounty and returns its id. Only direct EOA calls with -send are accepted (the receipt-guaranteed shape). The envelope must be exactly one positive ugnot coin. The caller becomes the bounty's funder.

Open
OID
04dead…46fb:19
CreateBounty details

Inspect func

Award

func(id int64, winner .uverse.address)

Award closes an open bounty in favor of winner: the escrowed amount leaves the open pool and is credited to winner's claimable balance through the ledger, charging the fee snapshotted at creation. Only the bounty's funder may award it. Terminal: an awarded bounty can never change again.

Open
OID
04dead…46fb:20
Award details

Inspect func

Cancel

func(id int64)

Cancel closes an open bounty and refunds its escrow to the funder's claimable balance, fee-free. Only the bounty's funder may cancel. Terminal: a cancelled bounty can never change again.

Open
OID
04dead…46fb:21
Cancel details

Inspect func

Claim

func(amount int64)

Claim sends amount ugnot of the caller's claimable balance (won bounties and refunds) back to the caller.

Open
OID
04dead…46fb:22
Claim details

Inspect func

ClaimAll

func()

ClaimAll sends the caller's entire claimable balance back to the caller. Fails if there is nothing to claim.

Open
OID
04dead…46fb:23
ClaimAll details

Inspect func

WithdrawFees

func()

WithdrawFees sends the accrued fee pot to the fee recipient. Only the fee recipient may call it.

Open
OID
04dead…46fb:24
WithdrawFees details

Inspect func

SweepDenom

func(denom string)

SweepDenom sends the surplus of a single denomination to the fee recipient (the bounded escape hatch validated on the vault realm). For ugnot only the excess over Liabilities() moves; other denoms move wholly. Only the fee recipient may call it.

Open
OID
04dead…46fb:25
SweepDenom details

Inspect func

SetFeeBps

func(bps int64)

SetFeeBps sets the protocol fee snapshotted into FUTURE bounties at creation. Existing bounties keep the fee they were created under. Admin only; bounded by \[0, MaxFeeBps].

Open
OID
04dead…46fb:26
SetFeeBps details

Inspect func

SetFeeRecipient

func(next .uverse.address)

SetFeeRecipient re-points the fee/surplus role, including the pot accrued so far. Admin only; zero address rejected.

Open
OID
04dead…46fb:27
SetFeeRecipient details

Inspect func

TransferAdmin

func(next .uverse.address)

TransferAdmin hands the admin role to next. Admin only; zero address rejected. One-step (documented trade-off, as on the vault).

Open
OID
04dead…46fb:28
TransferAdmin details

Inspect func

BountyInfo

func(id int64) (funder .uverse.address, title string, amount int64, feeBps int64, status string, winner .uverse.address)

BountyInfo returns a bounty's fields by value: funder, title, amount, snapshotted fee bps, status, winner (zero address unless awarded).

Open
OID
04dead…46fb:29
BountyInfo details

Inspect func

FeeRecipient

func() .uverse.address
Open
OID
04dead…46fb:31
FeeRecipient details

Inspect func

FeeBps

func() int64

FeeBps returns the protocol fee that will be snapshotted into newly created bounties (existing bounties keep their own snapshot).

Open
OID
04dead…46fb:32
FeeBps details

Inspect func

NumBounties

func() int64

NumBounties returns how many bounties have ever been created.

Open
OID
04dead…46fb:33
NumBounties details

Inspect func

OpenTotal

func() int64

OpenTotal returns the escrow held by open bounties (the B term).

Open
OID
04dead…46fb:34
OpenTotal details

Inspect func

BalanceOf

func(addr .uverse.address) int64

BalanceOf returns addr's claimable balance (won bounties + refunds).

Open
OID
04dead…46fb:35
BalanceOf details

Inspect func

UsersTotal

func() int64

UsersTotal returns the sum of all claimable balances (the U term).

Open
OID
04dead…46fb:36
UsersTotal details

Inspect func

FeesAccrued

func() int64

FeesAccrued returns the fee pot (the F term).

Open
OID
04dead…46fb:37
FeesAccrued details

Inspect func

Liabilities

func() int64

Liabilities returns everything this realm owes: openTotal + UsersTotal + FeesAccrued.

Open
OID
04dead…46fb:38
Liabilities details

Inspect func

Held

func() int64

Held returns the ugnot actually held at the realm address (the H term).

Open
OID
04dead…46fb:39
Held details

Inspect func

Surplus

func() int64

Surplus returns Held() - Liabilities() (the S term; >= 0 unless a conservation bug exists).

Open
OID
04dead…46fb:40
Surplus details

Inspect func

Render

func(string) string

Render shows configuration, totals, the composed conservation check, and the most recent bounties (bounded page, newest first).

Open
OID
04dead…46fb:42
Render details

Inspect func

assertAdmin

func(caller .uverse.address)
Open
OID
04dead…46fb:43
assertAdmin details

Inspect func

mustGetBounty

func(id int64) *bounties.bounty
Open
OID
04dead…46fb:44
mustGetBounty details

Inspect func

assertValidTitle

func(title string)

assertValidTitle bounds length and restricts the charset so titles cannot inject markdown into Render output.

Open
OID
04dead…46fb:45
assertValidTitle details

Inspect func

padID

func(id int64) string

padID renders an id as a fixed-width key so avl iteration order is numeric order.

Open
OID
04dead…46fb:46
padID details

Inspect func

send

func(to .uverse.address, amount int64)

send moves amount ugnot from the realm to \`to\`. Callers must have debited the ledger first (checks-effects-interactions).

Open
OID
04dead…46fb:47
send details

Inspect func

checkedAdd

func(a int64, b int64) (int64, bool)
Open
OID
04dead…46fb:49
checkedAdd details

Inspect func
Denom : untyped string ="ugnot"
MaxFeeBps : int64 =1000
StatusOpen : untyped string ="open"
StatusAwarded : untyped string ="awarded"
StatusCancelled : untyped string ="cancelled"
maxTitleLen : untyped bigint =(80 <untyped> bigint)
bounty : type =bounties.bounty
admin : .uverse.address =<gnolang.StringValue>
feeRecipient : .uverse.address =<gnolang.StringValue>
feeBps : int64 =0
self : .uverse.address =<gnolang.StringValue>
nextID : int64 =2
openTotal : int64 =0
bounties : *v0.Tree Inspect
ledger : *feeledger.Ledger Inspect
init.15 : func() Inspect
CreateBounty : func(title string) int64 Inspect
Award : func(id int64, winner .uverse.address) Inspect
Cancel : func(id int64) Inspect
Claim : func(amount int64) Inspect
ClaimAll : func() Inspect
WithdrawFees : func() Inspect
SweepDenom : func(denom string) Inspect
SetFeeBps : func(bps int64) Inspect
SetFeeRecipient : func(next .uverse.address) Inspect
TransferAdmin : func(next .uverse.address) Inspect
BountyInfo : func(id int64) (funder .uverse.address, title string, amount int64, feeBps int64, status string, winner .uverse.address) Inspect
Admin : func() .uverse.address Inspect
FeeRecipient : func() .uverse.address Inspect
FeeBps : func() int64 Inspect
NumBounties : func() int64 Inspect
OpenTotal : func() int64 Inspect
BalanceOf : func(addr .uverse.address) int64 Inspect
UsersTotal : func() int64 Inspect
FeesAccrued : func() int64 Inspect
Liabilities : func() int64 Inspect
Held : func() int64 Inspect
Surplus : func() int64 Inspect
Address : func() .uverse.address Inspect
Render : func(string) string Inspect
assertAdmin : func(caller .uverse.address) Inspect
mustGetBounty : func(id int64) *bounties.bounty Inspect
assertValidTitle : func(title string) Inspect
padID : func(id int64) string Inspect
send : func(to .uverse.address, amount int64) Inspect
itoa : func(n int64) string Inspect
checkedAdd : func(a int64, b int64) (int64, bool) Inspect