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

v0 source realm

Package tipjar is a public tip jar. Anyone can send real ugnot with an optional message via Tip; the realm keeps a ru...

Readme View source

Tip Jar

⚠️ Experimental — generated with no human supervision by the daily MCP pipeline to exercise gno tooling. Not audited. See r/moul/x/daily.


A public tip jar realm: anyone can send real ugnot with an optional message via Tip, and the realm tracks a leaderboard of the most generous tippers plus a feed of recent tips, both rendered live in Markdown. Only the deployer (captured as owner at deploy time) can withdraw the accumulated balance. It's a small, complete example of the payment-guard pattern (OriginSend + IsUserCall) paired with a sorted avl.Tree leaderboard.

Built for gno 0.9.


Part of moul/gno-contracts — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage.

Dependency graph:

gno.land/r/moul/x/daily/tipjar/v0 dependency graph

🧪 Highly experimental — potentially vibe-coded. Not audited; may break, change, or be removed at any time. Do not use with anything of value. Full disclaimer: DISCLAIMER.

Overview

Package tipjar is a public tip jar. Anyone can send real ugnot with an optional message via Tip; the realm keeps a running leaderboard of the most generous tippers and a feed of the most recent tips, both shown in Render. Only the deployer (captured as owner at init time) can Withdraw the accumulated balance. State-mutating functions are crossing functions (`cur realm`) per the gno 0.9 interrealm convention.

Functions 4

func Balance

Action
1func Balance() int64
source

Balance reports the ugnot still held by the jar (received minus withdrawn).

func Render

1func Render(path string) string
source

Render shows the jar's balance, the tipper leaderboard, and a feed of the most recent tips.

func Tip

crossing Action
1func Tip(cur realm, message string) string
source

Tip credits the caller's OriginSend ugnot to the jar and records it against their running total. Only an EOA calling directly via MsgCall may tip — see the payment-guard note on IsUserCall vs IsUser.

func Withdraw

crossing Action
1func Withdraw(cur realm, amount int64)
source

Withdraw sends amount ugnot from the jar to the owner. Owner-only.

Imports 7

Source Files 3