round
intround is the current (open) round number, 1-based.
Value
1
entrants
v0.Treeentrants holds the current round's players: key = address string, value = the address. Iteration is deterministic (sorted by key), which makes winner selection reproducible.
- OID
- 069aad…f906:5
entrants details
winners
v0.Treewinners records past rounds: key = zero-padded round number (for ordered iteration), value = \*winnerRecord.
- OID
- 069aad…f906:7
winners details
winnerRecord
typeValue
lottery.winnerRecord
winnerKey
func(r int) stringwinnerKey zero-pads the round number so avl iteration yields chronological order for up to 10^9 rounds.
- OID
- 069aad…f906:8
winnerKey details
pickIndex
func(height int64, n int) intpickIndex derives the winning entrant index from the block height. Panics if there are no entrants. Pure helper (deterministic, no state) — safe to test.
- OID
- 069aad…f906:10
pickIndex details
Enter
func()Enter adds the caller to the current round's entrants. Each address may only enter a given round once; a duplicate entry panics.
- OID
- 069aad…f906:11
Enter details
DrawWinner
func() .uverse.address- OID
- 069aad…f906:12
DrawWinner details
CurrentRound
func() intCurrentRound returns the currently open round number.
- OID
- 069aad…f906:13
CurrentRound details
NumEntrants
func() intNumEntrants returns how many players have entered the current round.
- OID
- 069aad…f906:14
NumEntrants details
HasEntered
func(addr .uverse.address) boolHasEntered reports whether addr is in the current round.
- OID
- 069aad…f906:15
HasEntered details
Render
func(path string) stringRender shows the current round, its entrants, and the winners history.
- OID
- 069aad…f906:16