PathrockNetwork Gno Explorer
HomeBlocksTransactionsTokensRealmsPackagesValidatorsAnalytics

PathrockNetwork Gno Explorer — an independent explorer for Gno.land Mainnet (gnoland-1), operated by PathrockNetwork. Not an official Gno.land service.

gnowebarchive RPC

gno.land/r/moul/x/daily/rpsduel/v0

Realm
Open in gnoweb ↗

Overview

Kind
Realm (renderable)
Name
v0
Namespace
moul / x / daily / rpsduel
Files
3 (README)(gnomod.toml)
Exported functions
7
Module
gno.land/r/moul/x/daily/rpsduel/v0
gno
0.9

Files (3)

  • README.mdmarkdown
  • gnomod.tomltoml
  • rpsduel.gnogno
README.mdPreviewRaw
# Rock-Paper-Scissors Duel

> ⚠️ **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)

---


Asynchronous, two-player rock-paper-scissors with a real commit-reveal
handshake: the challenger locks in a move as a sha256 commitment, the
opponent replies in the open (seeing only a hash gives them nothing to go
on), and the challenger reveals last to settle the round. A challenger who
tries to dodge a losing reveal can be forfeited by the opponent once a
50-block reveal window expires — no house move, no single-tx shortcut, just
two players and a fairness primitive.

**Realm path:** `gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/rpsduel`

## Example calls

```sh
# 1. Compute your commitment off-chain (or via a read-only query)
gnokey query vm/qeval \
  --data 'gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/rpsduel.ComputeCommit("rock", "xyz123")'

# 2. Open a duel against an opponent with that commitment
gnokey maketx call \
  -pkgpath "gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/rpsduel" \
  -func Open -args "g1opponentaddr..." -args "<64-char hex commit>" \
  -gas-fee 1000000ugnot -gas-wanted 3000000 -broadcast -chainid sapphire-1 <key>

# 3. Opponent replies in the clear
gnokey maketx call \
  -pkgpath "gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/rpsduel" \
  -func Accept -args "1" -args "paper" \
  -gas-fee 1000000ugnot -gas-wanted 3000000 -broadcast -chainid sapphire-1 <key>

# 4. Challenger reveals to settle it
gnokey maketx call \
  -pkgpath "gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/rpsduel" \
  -func Reveal -args "1" -args "rock" -args "xyz123" \
  -gas-fee 1000000ugnot -gas-wanted 3000000 -broadcast -chainid sapphire-1 <key>

# View the lobby, a specific duel, or a player's record
gnokey query vm/qrender --data "gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/rpsduel:"
gnokey query vm/qrender --data "gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/rpsduel:1"
```

## Toolchain status

Compiled and tested against the `chain/sapphire` (gno 0.9) toolchain tag from
`gnolang/gno` — `gno test .` and `gno lint .` both pass clean.

<!-- 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:**

![gno.land/r/moul/x/daily/rpsduel/v0 dependency graph](https://raw.githubusercontent.com/moul/gno-contracts/main/_assets/gno.land/r/moul/x/daily/rpsduel/v0/deps.png)

> 🧪 **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 -->

Functions

  • Accept(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}, id string, moveStr string) string

  • Cancel(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}, id string) string

  • ClaimForfeit(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}, id string) string

  • ComputeCommit(moveStr string, salt string) string

  • Open(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}, opponentAddr string, commitHex string) string

  • Render(path string) string

  • Reveal(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}, id string, moveStr string, salt string) string

Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.

Rendered

RenderedRawgnoweb ↗

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.