v0 source pure
Package shootout holds the state types of gno.land/r/g1lnkytfqcjwllws63gvf0mv9yt04aswy4y9amhm/shots: games, challenge...
Package shootout holds the state types of gno.land/r/g1lnkytfqcjwllws63gvf0mv9yt04aswy4y9amhm/shots: games, challengers' sessions and their kicks.
They live in a package rather than in the realm because gno only lets a realm's own code allocate the types that realm declares, and the game's rules engine runs in a separate, upgradeable implementation realm. Declared here, both realms can build and read them, and like the realm's storage they never change once deployed.
2
5
type Game
struct 1type Game struct {
2 ID uint64
3 Creator address
4 Config penalty.Config
5 EntryFee int64 // ugnot a challenger pays into the pot to play
6 TimeoutBlocks int64 // a challenger idle this long may be forfeited by anyone
7 Pot int64 // ugnot
8 Status GameStatus
9 Sessions int // challengers so far; while playing, the live session is number Sessions
10 Winner address
11 CreatedHeight int64
12 ClosedHeight int64
13}Game is a pot and the constants it is played for.
type GameStatus
identGameStatus is where a game is in its life.
type Kick
structKick is one kick of a shootout, with everything needed to re-run it: penalty.SimulateShot(Shot, Plan, game.Config) == Result. Seed is the 32 bytes that completed it, derived from the block it was played in.
type Session
structSession is one challenger's shootout against the chain.
type SessionStatus
identSessionStatus is how a challenger's shootout stands.