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/g1t2kg2vtr3fukg43eujkn6x53gfdyakhngt4sfd/gnofly/arena/v0

Realm
Open in gnoweb ↗

Overview

Kind
Realm (renderable)
Name
v0
Namespace
g1t2kg2vtr3fukg43eujkn6x53gfdyakhngt4sfd / gnofly / arena
Files
15 (gnomod.toml)
Exported functions
21
Module
gno.land/r/g1t2kg2vtr3fukg43eujkn6x53gfdyakhngt4sfd/gnofly/arena/v0
gno
0.9

Files (15)

  • gnomod.tomltoml
  • arena.gnogno
  • claims.gnogno
  • doc.gnogno
  • earnings.gnogno
  • errors.gnogno
  • escrow.gnogno
  • json.gnogno
  • lobby.gnogno
  • render.gnogno
  • results.gnogno
  • roles.gnogno
  • rounds.gnogno
  • spec.gnogno
  • validate.gnogno
  • doc.gnogno
    1// v0 - Unaudited: This is an initial version that has not yet been formally audited.2// Use in production at your own risk.3//4// Package arena holds the paid games of gnofly, a multiplayer plane game. A5// player pays an entry price in ugnot to join a game, the realm keeps the6// stakes until the game is over, then credits them by a rule it applies7

    Functions

    • ArenaJSON(id string) string

    • ArenasJSON() string

    • CancelRound(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)

    • Claim(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}) int64

    • Claimable(addr string) int64

    • ClaimsJSON(addr string) string

    • EarningsJSON() string

    • Enter(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}, spec string, ticket string) string

    • Escrowed() int64

    • ExpireLobby(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)

    • Leave(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)

    • PlayerJSON(addr string) string

    • RefundDelay() int64

    • RefundRound(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)

    • Render(path string) string

    • ResultJSON(id string) string

    • ResultsJSON() string

    • SetRefundDelay(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}, seconds int64)

    • SettleRound(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, deaths string)

    • StartRound(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) int64

    • Version() int64

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

    Rendered

    RenderedRawgnoweb ↗
    // itself. Winners take what they are owed with Claim.
    8//
    9// Games are created off chain, by the game server at a player's request, and
    10// described by a spec (see spec.gno): mode, entry price, seats, lives, game
    11// time and kill target. The realm only stores a game once someone paid for
    12// it, and forgets it when it is over or its lobby empties: no game nobody
    13// played is ever left on chain.
    14//
    15// Four kinds of callers write to it:
    16//
    17// - players enter a game with their stake attached, the first one handing
    18// the realm its spec, and may leave again until it starts (Enter, Leave);
    19// - referees, the game servers, start a game with the players of its lobby,
    20// and report who died by whose hand when it is over (StartRound,
    21// SettleRound, CancelRound);
    22// - anyone can send the stakes of a game back to its players once the
    23// referee is long overdue, and close a lobby whose game never started an
    24// hour after it was created (RefundRound, ExpireLobby);
    25// - the admins of the game realm set the refund delay (SetRefundDelay).
    26//
    27// The realm keeps no roles of its own: the owner, the admins, the referees
    28// and the treasury are those of gno.land/r/g1t2kg2vtr3fukg43eujkn6x53gfdyakhngt4sfd/gnofly/game/v0, asked at
    29// the time of each call.
    30//
    31// The referee is trusted for facts only: who died, and by whom. What these
    32// facts are worth is decided by a rule of
    33// gno.land/p/g1t2kg2vtr3fukg43eujkn6x53gfdyakhngt4sfd/gnofly/arena/payout/v0, picked by the mode of the game,
    34// and the realm checks what the rule returns before it sends anything.
    35//
    36// # Money
    37//
    38// The realm owes exactly the stakes of its lobbies and of its running
    39// games, and the winnings not claimed yet, and counts them in one number,
    40// see Escrowed. Every coin that leaves
    41// goes to a player of the game it came from, or to the treasury of the game
    42// realm:
    43//
    44// Enter +stake the envelope of the call stays in the realm
    45// Leave -stake back to the player
    46// ExpireLobby -stakes back to the players of the lobby
    47// StartRound 0 stakes move from the lobby to the game
    48// SettleRound -fee the fee leaves, the rest is credited to the winners
    49// Claim -owed everything credited to the caller, every game at once
    50// CancelRound -pot back to the players of the game
    51// RefundRound -pot back to the players of the game
    52//
    53// A game is closed by exactly one of SettleRound, CancelRound and
    54// RefundRound, once.
    55//
    56// What a settlement does not pay to the players is the house's cut, a fee of
    57// 5% sent to the treasury of the game realm, rounding included.
    58//
    59// Reads are plain functions meant for vm/qeval. The ones ending in JSON
    60// return a single string holding a JSON document. Render exposes the same
    61// data as markdown for gnoweb.
    62package arena
    63

    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.