# 🏆 Leaderboard
> ⚠️ **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](https://github.com/moul/gno-contracts/blob/main/r/moul/x/daily/README.md)
---
An on-chain score leaderboard realm for gno.land (sapphire / gno 0.9). Any account
can accumulate points with `AddPoints(n)` and optionally attach a display name
with `SetName(name)`. `Render` returns a Markdown table ranked by points
descending — gold/silver/bronze medals for the top three — plus the total player
count. State is kept in an `avl.Tree` so rendering is deterministic across nodes.
**Realm path:** `gno.land/r/REPLACE_ADDR/leaderboard`
## Public API
| Function | Kind | Description |
| --- | --- | --- |
| `AddPoints(cur realm, n int)` | crossing (tx) | Add `n` (> 0) points to the caller's total. |
| `SetName(cur realm, name string)` | crossing (tx) | Set the caller's display name (≤ 32 bytes; empty clears it). |
| `Render(path string) string` | view | Ranked Markdown leaderboard. |
## Example calls
```sh
# Add 10 points to your total
gnokey maketx call \
-pkgpath "gno.land/r/REPLACE_ADDR/leaderboard" \
-func AddPoints -args 10 \
-gas-fee 1000000ugnot -gas-wanted 2000000 \
-broadcast -chainid sapphire-1 -remote <rpc> <keyname>
# Set your display name
gnokey maketx call \
-pkgpath "gno.land/r/REPLACE_ADDR/leaderboard" \
-func SetName -args "Alice" \
-gas-fee 1000000ugnot -gas-wanted 2000000 \
-broadcast -chainid sapphire-1 -remote <rpc> <keyname>
```
View the rendered leaderboard in gnoweb at
`/r/REPLACE_ADDR/leaderboard`, or query it:
```sh
gnokey query "vm/qrender" -data "gno.land/r/REPLACE_ADDR/leaderboard:" -remote <rpc>
```
<!-- BEGIN GNOCONTRACTS FOOTER (generated by `make readmes`; do not edit below) -->
---
Part of **[moul/gno-contracts](https://github.com/moul/gno-contracts)** — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage.
**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](https://github.com/moul/gno-contracts/blob/main/DISCLAIMER.md).
<!-- END GNOCONTRACTS FOOTER -->
AddPoints(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, n int)
Render(path string) string
SetName(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, name string)
Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.
vm/qrender output, sanitized (docs/render-security.md) and displayed in an empty-sandbox iframe — scripts, forms and popups cannot run. Links stay inert in-preview; right-click to open.