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 faucet is a toy points faucet realm for the gno.land sapphire testnet.

Readme View source

Token Faucet

⚠️ Experimental — generated with no human supervision. This realm was produced automatically by an MCP-driven agent to exercise the gno MCP server and tooling, and to generate test content for gno compilers, linters and formatters. Not audited. Not for production. Full context & folder README: r/moul/x/daily


A toy points faucet realm for the gno.land sapphire testnet. Any caller can Claim 100 points, but only once every 100 blocks per address — the cooldown is enforced deterministically via runtime.ChainHeight(). Per-caller balances and last-claim heights are stored in an avl.Tree, and Render shows the total distributed, total claim count, and a table of all claimers with their balances.

Realm path

gno.land/r/REPLACE_ADDR/faucet

(REPLACE_ADDR is replaced with the deploy address at deploy time.)

Example calls

 1# Claim 100 points (subject to the 100-block cooldown).
 2gnokey maketx call -pkgpath "gno.land/r/REPLACE_ADDR/faucet" \
 3  -func Claim -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast \
 4  -chainid sapphire-1 mykey
 5
 6# Query a balance (read-only).
 7gnokey query "vm/qeval" -data \
 8  'gno.land/r/REPLACE_ADDR/faucet.BalanceOf("g1...youraddr")'
 9
10# View the dashboard.
11gnokey query "vm/qrender" -data 'gno.land/r/REPLACE_ADDR/faucet:'

Behavior

  • Claim(cur realm) — grants ClaimAmount (100) points to the caller; aborts if the caller's previous claim was less than CooldownBlocks (100) blocks ago.
  • BalanceOf(addr string) int64 — current balance for an address (0 if unknown).
  • Render(path string) string — Markdown dashboard: stats + claimer table.

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/faucet/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 faucet is a toy points faucet realm for the gno.land sapphire testnet.

Any caller may Claim() 100 points, but only once per cooldown window of 100 blocks. Cooldown is enforced deterministically via runtime.ChainHeight() — no real clocks, no RNG. Per-caller balance and last-claim height live in an avl.Tree so Render iterates in deterministic (address-sorted) order.

Constants 1

const ClaimAmount, CooldownBlocks

1const (
2	// ClaimAmount is granted on every successful claim.
3	ClaimAmount = 100
4	// CooldownBlocks is the minimum number of blocks between two claims by the
5	// same caller.
6	CooldownBlocks = 100
7)
source

Functions 3

func BalanceOf

Action
1func BalanceOf(addr string) int64
source

BalanceOf returns the current point balance of addr (0 if never claimed).

func Claim

crossing Action
1func Claim(cur realm)
source

Claim grants ClaimAmount points to the caller, subject to the per-caller cooldown. It aborts (cross-realm) if the caller must still wait.

func Render

1func Render(path string) string
source

Render produces a Markdown dashboard of faucet activity.

Imports 6

Source Files 3