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

memba_arcade_leaderboard_v1 package

Overview

Package memba_arcade_leaderboard_v1 is the funds-free, verified-score ledger for the Memba arcade (BARRICADE, Space Invaders, and future games — one realm, boards keyed per game slug). Nothing here trusts a client number: an authorized ATTESTER (the backend verifier's key) re-simulates a submitted input log and attests only the reproduced result. The chain stores the attested result plus a commitment to the log (its sha256) — the log itself stays off-chain; "verified, never trustless" is the public contract.

SAFETY: there is NO banker, NO transfer, and NO OriginSend anywhere — the fund-drain risk class does not apply. The only trust boundary is who may attest (owner ∪ the attester allowlist); every write emits an event. Two buckets never mix: the competitive DAILY BOARD (one best entry per address per game per day, shared seed) and personal TRAINING RECEIPTS (practice runs — a verified flex, never ranked).

The game slug is shape-validated only — there is deliberately NO on-chain game registry: the realm is funds-free, so the worst a typo'd slug can do is fragment a board, and the attester (not the player) authors the slug.

Functions

AcceptOwnership

func AcceptOwnership(cur realm)

AcceptOwnership completes the handoff. Only the staged pendingOwner may call it.

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/samcrew/memba_arcade_leaderboard_v1" -func "AcceptOwnership" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/samcrew/memba_arcade_leaderboard_v1" -func "AcceptOwnership" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx
  

AddAttester

func AddAttester(cur realm, addr address)

AddAttester allowlists an ADDRESS (the backend verifier's dedicated low-privilege key — never the deploy multisig itself) as an authorized result source. Owner only.

Param

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/samcrew/memba_arcade_leaderboard_v1" -func "AddAttester" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/samcrew/memba_arcade_leaderboard_v1" -func "AddAttester" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx
  

AttestReceipt

func AttestReceipt(cur realm, game string, addr address, day, seed string, score, simVersion int64, stateHash, logHash, stats string)

AttestReceipt mints a personal training receipt — a verified "I did this run", never ranked. Attester-only; capped per address per (game, day) and ring-capped per address. Fulfills (and clears) a matching player-paid RequestReceipt if one is staged.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/samcrew/memba_arcade_leaderboard_v1" -func "AttestReceipt" -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/samcrew/memba_arcade_leaderboard_v1" -func "AttestReceipt" -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx
  

AttestScore

func AttestScore(cur realm, game string, addr address, day, seed string, score, simVersion int64, stateHash, logHash, stats string)

AttestScore writes (or improves) an address's entry on a game's competitive board for a day. Attester-only. The verifier batches a day's results into one multi-msg tx at day close, plus spam-capped singles for the "certify now" flow. Re-attesting the same game/address/day only ever RAISES the score (Second Wind). A log hash already attested for that game-day for a DIFFERENT address is rejected — on a shared daily seed a valid input log is portable, so first-submitter wins (replay-theft defense). `stats` is the attester-authored per-game JSON blob (waves, wins, levels, …) — never ranked, only echoed by reads.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/samcrew/memba_arcade_leaderboard_v1" -func "AttestScore" -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/samcrew/memba_arcade_leaderboard_v1" -func "AttestScore" -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx
  

BoardCount

func BoardCount(game, day string) int

BoardCount returns how many addresses hold an entry on a game's board for a day (O(1)).

Params

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/samcrew/memba_arcade_leaderboard_v1.BoardCount(,)"

Result

CancelOwnershipTransfer

func CancelOwnershipTransfer(cur realm)

CancelOwnershipTransfer withdraws a staged handoff. Owner only.

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/samcrew/memba_arcade_leaderboard_v1" -func "CancelOwnershipTransfer" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/samcrew/memba_arcade_leaderboard_v1" -func "CancelOwnershipTransfer" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx
  

GetBoardJSON

func GetBoardJSON(game, day string, offset, limit int) string

GetBoardJSON returns a page of a game-day's board, rank-ordered, as {"game":…,"day":…,"total":N,"entries":[…]}. Reads sort the day's entries on demand — fine for a testnet-scale board; a rank index (points_v1-style) is the v2 upgrade if daily boards grow past a few thousand entries.

Params

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/samcrew/memba_arcade_leaderboard_v1.GetBoardJSON(,,,)"

Result

GetEntryJSON

func GetEntryJSON(game, day, addr string) string

GetEntryJSON returns one address's board entry for a game-day, or "null".

Params

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/samcrew/memba_arcade_leaderboard_v1.GetEntryJSON(,,)"

Result

GetReceiptsJSON

func GetReceiptsJSON(addr string, offset, limit int) string

GetReceiptsJSON returns a page of one address's training receipts (all games, newest first) as {"addr":…,"total":N,"entries":[…]}.

Params

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/samcrew/memba_arcade_leaderboard_v1.GetReceiptsJSON(,,)"

Result

IsAttester

func IsAttester(addr string) bool

IsAttester reports whether an address is on the attester allowlist.

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/samcrew/memba_arcade_leaderboard_v1.IsAttester()"

Result

IsPaused

func IsPaused() bool

IsPaused reports whether attestation is frozen.

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/samcrew/memba_arcade_leaderboard_v1.IsPaused()"

Result

Pause

func Pause(cur realm, state bool)

Pause freezes all attestation + receipt requests (reads stay available). Owner only.

Param

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/samcrew/memba_arcade_leaderboard_v1" -func "Pause" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/samcrew/memba_arcade_leaderboard_v1" -func "Pause" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx
  

RemoveAttester

func RemoveAttester(cur realm, addr address)

RemoveAttester revokes an attester key. Owner only.

Param

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/samcrew/memba_arcade_leaderboard_v1" -func "RemoveAttester" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/samcrew/memba_arcade_leaderboard_v1" -func "RemoveAttester" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx
  

Render

func Render(path string) string

Render serves a human-readable snapshot: `:board/<game>/YYYY-MM-DD` for a game-day's top entries, `:receipts/<addr>` for an address's latest receipts.

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/samcrew/memba_arcade_leaderboard_v1.Render()"

Result

RequestReceipt

func RequestReceipt(cur realm, logHash string)

RequestReceipt is the player-paid leg: ANY signer stages an on-chain consent + payment anchor for one of their own runs (they pay this call's gas). The backend sees the event, verifies the stored log, and fulfills via AttestReceipt. Self-limiting: each request costs the caller gas, and one key slot per (addr, hash). Hash-scoped and game-agnostic on purpose — the verifier, not the player, decides which game the log replays under.

Param

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/samcrew/memba_arcade_leaderboard_v1" -func "RequestReceipt" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/samcrew/memba_arcade_leaderboard_v1" -func "RequestReceipt" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx
  

TransferOwnership

func TransferOwnership(cur realm, newOwner address)

TransferOwnership stages a new owner; it takes effect only after AcceptOwnership is called BY that address (2-step, so a typo can't brick admin).

Param

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/samcrew/memba_arcade_leaderboard_v1" -func "TransferOwnership" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/samcrew/memba_arcade_leaderboard_v1" -func "TransferOwnership" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx