Denom
untyped stringDenom is the only asset this realm accepts.
Value
"ugnot"
MaxFeeBps
int64MaxFeeBps is the hard protocol-fee cap: 1000 bps = 10%.
Value
1000
StatusOpen
untyped stringGrant status values.
Value
"open"
StatusAwarded
untyped stringGrant status values.
Value
"awarded"
StatusCancelled
untyped stringGrant status values.
Value
"cancelled"
StatusExpired
untyped stringGrant status values.
Value
"expired"
MaxTitleLen
untyped bigintInput bounds.
Value
(80 <untyped> bigint)
MaxDescLen
untyped bigintInput bounds.
Value
(2000 <untyped> bigint)
MaxPitchLen
untyped bigintInput bounds.
Value
(1000 <untyped> bigint)
MinDurationBlocks
int64Input bounds.
Value
1
MaxDurationBlocks
int64Input bounds.
Value
10000000
ExpiryGraceBlocks
int64Input bounds.
Value
100
application
typeValue
grants.application
grant
typeValue
grants.grant
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// fee snapshotted into NEW grants
Value
0
self
.uverse.address// this realm's address, captured at deploy
Value
<gnolang.StringValue>
nextID
int64Value
2
openTotal
int64// == Σ amount over grants with status Open
Value
0
grants
*v0.Tree// padID(id) -> \*grant
- OID
- 0e2ab8…5493:10
grants details
ledger
*feeledger.Ledger- OID
- 0e2ab8…5493:13
ledger details
init.22
func()- OID
- 0e2ab8…5493:17
init.22 details
CreateGrant
func(title string, description string, durationBlocks int64, maxFeeBps int64) int64CreateGrant escrows the attached GNOT as a new open grant and returns its id. Only direct EOA calls with -send are accepted. The current protocol fee is snapshotted into the grant — and must not exceed maxFeeBps, the ceiling the caller signed for (rejects a fee raise sequenced ahead of this transaction); pass MaxFeeBps to accept any legal fee. The application window is durationBlocks from now.
- OID
- 0e2ab8…5493:19
CreateGrant details
Apply
func(id int64, pitch string)Apply submits (or re-submits) the caller's application to an open grant before its deadline. One application per address per grant — re-applying replaces the caller's own pitch only. The creator cannot apply to their own grant.
- OID
- 0e2ab8…5493:20
Apply details
SelectWinner
func(id int64, winner .uverse.address)SelectWinner awards an open grant to one of its applicants: the escrow leaves the open pool and is credited to the winner's claimable balance through the ledger, charging the fee snapshotted at creation. Only the grant's creator may select, and only an address that actually applied can win. Terminal.
- OID
- 0e2ab8…5493:21
SelectWinner details
CancelGrant
func(id int64)CancelGrant closes an open grant and refunds its escrow to the creator's claimable balance, fee-free. Only the creator may cancel. Terminal.
- OID
- 0e2ab8…5493:22
CancelGrant details
ExpireGrant
func(id int64)ExpireGrant closes an open grant whose deadline passed more than ExpiryGraceBlocks ago, refunding the creator fee-free. ANYONE may call it — this is the permissionless valve that guarantees escrow can never be trapped by an inactive creator. Terminal.
- OID
- 0e2ab8…5493:23
ExpireGrant details
refundOpen
func(g *grants.grant, terminal string)refundOpen moves an Open grant's escrow into the creator's claimable balance fee-free and finalizes the status. Callers have already verified authorization and status.
- OID
- 0e2ab8…5493:24
refundOpen details
Claim
func(amount int64)Claim sends amount ugnot of the caller's claimable balance (won grants and refunds) back to the caller.
- OID
- 0e2ab8…5493:25
Claim details
ClaimAll
func()ClaimAll sends the caller's entire claimable balance back to the caller. Fails if there is nothing to claim.
- OID
- 0e2ab8…5493:26
ClaimAll details
WithdrawFees
func()WithdrawFees sends the accrued fee pot to the fee recipient. Only the fee recipient may call it.
- OID
- 0e2ab8…5493:27
WithdrawFees details
SweepDenom
func(denom string)SweepDenom sends the surplus of a single denomination to the fee recipient. For ugnot only the excess over Liabilities() moves; other denoms move wholly. Only the fee recipient may call it.
- OID
- 0e2ab8…5493:28
SweepDenom details
SetFeeBps
func(bps int64)SetFeeBps sets the protocol fee snapshotted into FUTURE grants at creation. Existing grants keep the fee they were created under. Admin only; bounded by \[0, MaxFeeBps].
- OID
- 0e2ab8…5493:29
SetFeeBps details
SetFeeRecipient
func(next .uverse.address)SetFeeRecipient re-points the fee/surplus role, including the pot accrued so far. Admin only; zero address rejected.
- OID
- 0e2ab8…5493:30
SetFeeRecipient details
TransferAdmin
func(next .uverse.address)TransferAdmin hands the admin role to next. Admin only; zero address rejected. One-step (documented trade-off).
- OID
- 0e2ab8…5493:31
TransferAdmin details
GrantInfo
func(id int64) (creator .uverse.address, title string, amount int64, feeBps int64, deadline int64, status string, winner .uverse.address, numApplicants int64)GrantInfo returns a grant's fields by value: creator, title, amount, snapshotted fee bps, application deadline (block height), status, winner (zero unless awarded), and number of applicants.
- OID
- 0e2ab8…5493:32
GrantInfo details
Description
func(id int64) stringDescription returns a grant's raw description text.
- OID
- 0e2ab8…5493:33
Description details
ApplicationOf
func(id int64, addr .uverse.address) (pitch string, height int64, ok bool)ApplicationOf returns addr's pitch and submission height for a grant, with ok reporting whether an application exists.
- OID
- 0e2ab8…5493:34
ApplicationOf details
Admin
func() .uverse.address- OID
- 0e2ab8…5493:35
Admin details
FeeRecipient
func() .uverse.address- OID
- 0e2ab8…5493:36
FeeRecipient details
FeeBps
func() int64FeeBps returns the fee that will be snapshotted into newly created grants (existing grants keep their own snapshot).
- OID
- 0e2ab8…5493:37
FeeBps details
FeeOn
func(amount int64) (fee int64, credited int64)FeeOn previews the fee and net payout for a grant of amount at the CURRENT FeeBps.
- OID
- 0e2ab8…5493:38
FeeOn details
NumGrants
func() int64NumGrants returns how many grants have ever been created.
- OID
- 0e2ab8…5493:39
NumGrants details
OpenTotal
func() int64OpenTotal returns the escrow held by open grants (the G term).
- OID
- 0e2ab8…5493:40
OpenTotal details
BalanceOf
func(addr .uverse.address) int64BalanceOf returns addr's claimable balance (won grants + refunds).
- OID
- 0e2ab8…5493:41
BalanceOf details
UsersTotal
func() int64UsersTotal returns the sum of all claimable balances (the U term).
- OID
- 0e2ab8…5493:42
UsersTotal details
FeesAccrued
func() int64FeesAccrued returns the fee pot (the F term).
- OID
- 0e2ab8…5493:43
FeesAccrued details
Liabilities
func() int64Liabilities returns everything this realm owes: openTotal + UsersTotal + FeesAccrued.
- OID
- 0e2ab8…5493:44
Liabilities details
Held
func() int64Held returns the ugnot actually held at the realm address (H).
- OID
- 0e2ab8…5493:45
Held details
Surplus
func() int64Surplus returns Held() - Liabilities() (the S term).
- OID
- 0e2ab8…5493:46
Surplus details
Address
func() .uverse.address- OID
- 0e2ab8…5493:47
Address details
Height
func() int64Height returns the current chain height (deadline arithmetic aid).
- OID
- 0e2ab8…5493:48
Height details
Render
func(path string) stringRender shows the market at "" and a grant detail at "\<id>". Free text (titles are charset-restricted; descriptions are not) passes through the ecosystem sanitizer before hitting markdown.
- OID
- 0e2ab8…5493:49
Render details
renderGrant
func(path string) string- OID
- 0e2ab8…5493:50
renderGrant details
assertAdmin
func(caller .uverse.address)- OID
- 0e2ab8…5493:51
assertAdmin details
mustGetGrant
func(id int64) *grants.grant- OID
- 0e2ab8…5493:52
mustGetGrant details
assertValidTitle
func(title string)assertValidTitle bounds length and restricts the charset so titles are list-safe in Render without escaping.
- OID
- 0e2ab8…5493:53
assertValidTitle details
padID
func(id int64) stringpadID renders an id as a fixed-width key so avl iteration order is numeric order.
- OID
- 0e2ab8…5493:54
padID details
itoa
func(n int64) string- OID
- 0e2ab8…5493:55
itoa details
checkedAdd
func(a int64, b int64) (int64, bool)- OID
- 0e2ab8…5493:56