revealWindow
int64revealWindow is how many blocks the challenger gets to reveal after the opponent accepts before the opponent can claim a forfeit win.
Value
50
duelStatus
typeValue
v1.duelStatus
statusPending
v1.duelStatusValue
<zero>
statusAwaitingReveal
v1.duelStatusValue
<zero>
statusResolved
v1.duelStatusValue
<zero>
statusForfeited
v1.duelStatusValue
<zero>
statusCancelled
v1.duelStatusValue
<zero>
duel
typeduel is one asynchronous round between Challenger and Opponent. The challenger's move is hidden behind Commit until Reveal; the opponent's move is stored in the clear once they Accept.
Value
v1.duel
playerState
typeplayerState is the persisted record for one address.
Value
v1.playerState
duels
v0.Tree// duel ID -> \*duel
- OID
- 0bfb12…1d3d:4
duels details
players
v0.Tree// address string -> \*playerState
- OID
- 0bfb12…1d3d:6
players details
nextID
intValue
0
totalResolved
intValue
0
champion
.uverse.addressValue
<zero>
championWins
intValue
0
ComputeCommit
func(moveStr string, salt string) stringComputeCommit hashes a move and salt exactly the way Reveal checks it, so a caller can compute their commitment (e.g. via a read-only query) before calling Open, then remember the salt to pass to Reveal later.
- OID
- 0bfb12…1d3d:11
ComputeCommit details
getOrCreate
func(addr .uverse.address) *v1.playerState- OID
- 0bfb12…1d3d:13
getOrCreate details
bumpChampion
func(addr .uverse.address, wins int)- OID
- 0bfb12…1d3d:14
bumpChampion details
settle
func(d *v1.duel, challengerMove v0.Move, result int)settle scores a revealed round and updates both players' records.
- OID
- 0bfb12…1d3d:15
settle details
Open
func(opponentAddr string, commitHex string) stringOpen challenges opponentAddr to a duel, locking in the challenger's move as a commitment (see ComputeCommit) so the opponent can't see it before replying.
- OID
- 0bfb12…1d3d:16
Open details
Accept
func(id string, moveStr string) stringAccept replies to a pending duel with a plain move. Only the challenged opponent may call it; going second behind the challenger's hidden commitment is what keeps this fair.
- OID
- 0bfb12…1d3d:17
Accept details
Reveal
func(id string, moveStr string, salt string) stringReveal settles an accepted duel. Only the original challenger may call it, and only with the exact move+salt that produced their commitment.
- OID
- 0bfb12…1d3d:18
Reveal details
outcomeMsg
func(d *v1.duel) string- OID
- 0bfb12…1d3d:19
outcomeMsg details
ClaimForfeit
func(id string) stringClaimForfeit lets the opponent collect a default win when the challenger dodges revealing (e.g. because they saw the opponent's move and knew they'd lose) past the reveal window.
- OID
- 0bfb12…1d3d:20
ClaimForfeit details
Cancel
func(id string) stringCancel withdraws a still-pending duel. Only the challenger may cancel, and only before the opponent accepts.
- OID
- 0bfb12…1d3d:21
Cancel details
renderHome
func() string- OID
- 0bfb12…1d3d:22
renderHome details
renderDuel
func(id string) string- OID
- 0bfb12…1d3d:23
renderDuel details
renderPlayer
func(rawAddr string) string- OID
- 0bfb12…1d3d:24
renderPlayer details
Render
func(path string) stringRender shows the duel lobby at "", a specific duel when path is a numeric ID, or one player's record when path is their bech32 address.
- OID
- 0bfb12…1d3d:25