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 coinflipduel is a one-on-one coin-flip duel: challenge another address, they call heads or tails, and the blo...

Readme View source

Coin-Flip 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


A one-on-one coin-flip duel between two addresses. The challenger picks heads or tails and names an opponent; the opponent settles it with a single Accept call, which flips the coin on the spot and records the result. No stakes, just an on-chain win/loss record and a running champion.

Realm: gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/coinflipduel

Example calls

Challenge("g1bob...", "heads")   # as alice -> opens duel #1, alice called heads
Accept("1")                       # as bob   -> flips the coin, settles the duel
Cancel("2")                       # as the challenger, before it's accepted

Render paths

  • `` (home) — arena summary, champion, pending duels
  • <id> (e.g. 3) — a single duel's detail
  • <address> — a player's win/loss record

Toolchain

Built and tested against the local gno binary (master.3130+bf5b31eda). gno test . passes; see the injected build brief for the sapphire (gno 0.9) API notes this realm follows (chain, chain/runtime, gno.land/p/nt/avl/v0).


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/coinflipduel/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 coinflipduel is a one-on-one coin-flip duel: challenge another address, they call heads or tails, and the block settles it. No stakes, just bragging rights tracked in an on-chain win/loss record.

Functions 4

func Accept

crossing Action
1func Accept(cur realm, id string) string
source

Accept settles a pending duel. Only the challenged opponent may call it; the flip happens immediately and the result is final.

func Cancel

crossing Action
1func Cancel(cur realm, id string) string
source

Cancel withdraws a still-pending duel. Only the challenger may cancel, and only before the opponent accepts.

func Challenge

crossing Action
1func Challenge(cur realm, opponentAddr string, call string) string
source

Challenge opens a new duel against opponentAddr, locking in the challenger's call of "heads"/"tails" ("h"/"t" also accepted). The opponent settles it by calling Accept with the returned duel ID.

func Render

1func Render(path string) string
source

Render shows the duel arena at "", a specific duel when path is a numeric ID, or one player's record when path is their bech32 address.

Imports 5

Source Files 3