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/akkadia/beta/game_vault

Realm
Open in gnoweb ↗

Overview

Kind
Realm (renderable)
Name
game_vault
Namespace
akkadia / beta
Files
13 (gnomod.toml)
Exported functions
73
Module
gno.land/r/akkadia/beta/game_vault
gno
0.9

Files (13)

  • gnomod.tomltoml
  • distribution.gnogno
  • entry.gnogno
  • funding.gnogno
  • participation.gnogno
  • refund_query.gnogno
  • store.gnogno
  • validation.gnogno
  • vault.gnogno
  • refund_query_test.gnogno
  • security_test.gnogno
  • setup_test.gnogno
  • vault_test.gnogno
  • store.gnogno
    1package game_vault23import (4	"strconv"56	"gno.land/p/nt/bptree/v0"7)8

    Functions

    • CancelEntryProcess(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}, processID uint64)

    • CancelParticipationProcess(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}, processID uint64)

    • CancelRewardPool(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}, poolKey string)

    • CloseEntryProcess(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}, processID uint64)

    • CloseParticipationProcess(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}, processID uint64)

    • CommitParticipationProcess(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}, processID uint64, operationKey string)

    • CreateEntryProcess(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}, processKey string, gameWorldID uint64, entryFeeUgnot int64) uint64

    • CreateParticipationProcess(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}, processKey string, gameWorldID uint64, rewardPoolKey string, participationFeeUgnot int64) uint64

    • CreateRewardPool(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}, poolKey string, gameWorldID uint64) uint64

    • DepositEntry(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}, processID uint64, participationKey string, entryKey string) uint64

    • DepositParticipation(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}, processID uint64, participationKey string, paymentKey string) uint64

    • DepositSystemFunding(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}, poolID uint64, fundingKey string) uint64

    • DistributeReward(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}, poolKey string, operationKey string, recipientCSV string, ugnotAmountCSV string) uint64

    • GetAccountedUgnotTotal() int64

    • GetDistributionBatchMax() int

    • GetEntryFund(fundID uint64) struct{ID uint64; ProcessID uint64; ParticipationKey string; EntryKey string; Owner .uverse.address; Amount int64; Refunded bool}

    • GetEntryFundCount(processID uint64, owner string, participationKey string) int

    • GetEntryFundCountByOwner(processID uint64, owner string) int

    • GetEntryFundID(processID uint64, owner string, entryKey string) uint64

    • GetEntryFundStatus(fundID uint64) int

    • GetEntryProcess(processID uint64) struct{ID uint64; ProcessKey string; GameWorldID uint64; EntryFee int64; Status gno.land/r/akkadia/beta/game_vault.EntryProcessStatus; HeldBalance int64; RefundedTotal int64; FundCount uint64}

    • GetEntryProcessID(processKey string) uint64

    • GetLatestEntryFundID() uint64

    • GetLatestEntryProcessID() uint64

    • GetLatestParticipationFundID() uint64

    • GetLatestParticipationProcessID() uint64

    • GetLatestRewardDistributionID() uint64

    • GetLatestRewardPoolID() uint64

    • GetLatestSystemFundingID() uint64

    • GetLatestVaultRefundID() uint64

    • GetParticipationFund(fundID uint64) struct{ID uint64; ProcessID uint64; ParticipationKey string; PaymentKey string; Owner .uverse.address; Amount int64; Refunded bool}

    • GetParticipationFundCount(processID uint64, owner string, participationKey string) int

    • GetParticipationFundCountByOwner(processID uint64, owner string) int

    • GetParticipationFundEffectiveStatus(fundID uint64) int

    • GetParticipationFundID(processID uint64, owner string, paymentKey string) uint64

    • GetParticipationProcess(processID uint64) struct{ID uint64; ProcessKey string; GameWorldID uint64; RewardPoolID uint64; ParticipationFee int64; Status gno.land/r/akkadia/beta/game_vault.ParticipationProcessStatus; HeldBalance int64; CommittedTotal int64; RefundedTotal int64; FundCount uint64}

    • GetParticipationProcessByKey(processKey string) struct{ID uint64; ProcessKey string; GameWorldID uint64; RewardPoolKey string; ParticipationFee int64; Status gno.land/r/akkadia/beta/game_vault.ParticipationProcessStatus; HeldBalance int64; CommittedTotal int64; RefundedTotal int64; FundCount uint64}

    • GetParticipationProcessID(processKey string) uint64

    • GetRewardDistribution(distributionID uint64) struct{ID uint64; PoolID uint64; GameWorldID uint64; OperationKey string; RecipientCount uint32; TotalAmount int64; Executor .uverse.address}

    • GetRewardDistributionByOperationKey(operationKey string) struct{ID uint64; PoolKey string; GameWorldID uint64; OperationKey string; RecipientCount uint32; TotalAmount int64; Executor .uverse.address}

    • GetRewardDistributionCountByPool(poolID uint64) int

    • GetRewardPool(poolID uint64) struct{ID uint64; PoolKey string; GameWorldID uint64; Status gno.land/r/akkadia/beta/game_vault.RewardPoolStatus; ParticipationCommittedTotal int64; SystemFundedTotal int64; SystemRefundedTotal int64; DistributedTotal int64; Balance int64; DistributionCount uint64}

    • GetRewardPoolByKey(poolKey string) struct{PoolKey string; GameWorldID uint64; Status gno.land/r/akkadia/beta/game_vault.RewardPoolStatus; ParticipationCommittedTotal int64; DistributedTotal int64; Balance int64; DistributionCount uint64}

    • GetRewardPoolCountByGameWorld(gameWorldID uint64) int

    • GetRewardPoolID(poolKey string) uint64

    • GetSystemFunding(fundingID uint64) struct{ID uint64; PoolID uint64; FundingKey string; Depositor .uverse.address; Amount int64; Refunded bool}

    • GetSystemFundingByKey(fundingKey string) struct{ID uint64; PoolID uint64; FundingKey string; Depositor .uverse.address; Amount int64; Refunded bool}

    • GetSystemFundingCountByPool(poolID uint64) int

    • GetUnaccountedUgnotTotal() int64

    • GetVaultRefund(refundID uint64) struct{ID uint64; PoolID uint64; OperationKey string; SourceKey string; Recipient .uverse.address; Amount int64; Kind string; Executor .uverse.address}

    • GetVaultRefundByOperationKey(operationKey string) struct{ID uint64; PoolID uint64; OperationKey string; SourceKey string; Recipient .uverse.address; Amount int64; Kind string; Executor .uverse.address}

    • GetVaultRefundCountByPool(poolID uint64) int

    • HasProcessedOperationKey(operationKey string) bool

    • ListEntryFundIDs(processID uint64, owner string, participationKey string, page int, count int) []uint64

    • ListEntryFundIDsByOwner(processID uint64, owner string, page int, count int) []uint64

    • ListEntryRefundStates(processKeysCSV string, ownersCSV string, entryKeysCSV string) []map[string]string

    • ListParticipationFundIDs(processID uint64, owner string, participationKey string, page int, count int) []uint64

    • ListParticipationFundIDsByOwner(processID uint64, owner string, page int, count int) []uint64

    • ListParticipationFundStates(values ...string) []map[string]string

    • ListParticipationPaymentStates(processKeysCSV string, ownersCSV string, paymentKeysCSV string) []map[string]string

    • ListParticipationProcessStates(processKeys ...string) []map[string]string

    • ListParticipationRefundStates(values ...string) []map[string]string

    • ListRefundScopeStates(scopeKeys ...string) []map[string]string

    • ListRewardDistributionIDsByPool(poolID uint64, page int, count int) []uint64

    • ListRewardPoolIDsByGameWorld(gameWorldID uint64, page int, count int) []uint64

    • ListSystemFundingIDsByPool(poolID uint64, page int, count int) []uint64

    • ListVaultRefundIDsByPool(poolID uint64, page int, count int) []uint64

    • LockRewardPool(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}, poolKey string)

    • RefundEntryFund(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}, fundID uint64, operationKey string) uint64

    • RefundParticipationFund(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}, fundID uint64, operationKey string) uint64

    • RefundSystemFunding(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}, poolID uint64, fundingKey string, operationKey string) uint64

    • SetDistributionBatchMax(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}, value int)

    • SettleRewardPool(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}, poolKey string)

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

    Rendered

    RenderedRawgnoweb ↗

    Render unavailable

    rate limit exceeded — the render query is served by the Gnoland archive RPC.

    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.

    9var (
    10 rewardPools *bptree.BPTree
    11 rewardPoolIDs *bptree.BPTree
    12 gameWorldRewardPoolIDs *bptree.BPTree
    13 participationProcesses *bptree.BPTree
    14 participationProcessIDs *bptree.BPTree
    15 gameWorldParticipationProcessIDs *bptree.BPTree
    16 participationFunds *bptree.BPTree
    17 participationFundIDs *bptree.BPTree
    18 participationOwnerFundIDs *bptree.BPTree
    19 participationGroupFundIDs *bptree.BPTree
    20 entryProcesses *bptree.BPTree
    21 entryProcessIDs *bptree.BPTree
    22 gameWorldEntryProcessIDs *bptree.BPTree
    23 entryFunds *bptree.BPTree
    24 entryFundIDs *bptree.BPTree
    25 entryOwnerFundIDs *bptree.BPTree
    26 entryGroupFundIDs *bptree.BPTree
    27 systemFundings *bptree.BPTree
    28 systemFundingIDs *bptree.BPTree
    29 poolSystemFundingIDs *bptree.BPTree
    30 rewardDistributions *bptree.BPTree
    31 rewardDistributionIDs *bptree.BPTree
    32 poolDistributionIDs *bptree.BPTree
    33 vaultRefunds *bptree.BPTree
    34 vaultRefundIDs *bptree.BPTree
    35 poolRefundIDs *bptree.BPTree
    36 processedOperationKeys *bptree.BPTree
    37 latestRewardPoolID uint64
    38 latestParticipationProcessID uint64
    39 latestParticipationFundID uint64
    40 latestEntryProcessID uint64
    41 latestEntryFundID uint64
    42 latestSystemFundingID uint64
    43 latestRewardDistributionID uint64
    44 latestVaultRefundID uint64
    45 accountedUgnotTotal int64
    46)
    47
    48func init() {
    49 resetGameVaultState()
    50}
    51
    52func resetGameVaultState() {
    53 rewardPools = bptree.NewBPTree32()
    54 rewardPoolIDs = bptree.NewBPTree32()
    55 gameWorldRewardPoolIDs = bptree.NewBPTree32()
    56 participationProcesses = bptree.NewBPTree32()
    57 participationProcessIDs = bptree.NewBPTree32()
    58 gameWorldParticipationProcessIDs = bptree.NewBPTree32()
    59 participationFunds = bptree.NewBPTree32()
    60 participationFundIDs = bptree.NewBPTree32()
    61 participationOwnerFundIDs = bptree.NewBPTree32()
    62 participationGroupFundIDs = bptree.NewBPTree32()
    63 entryProcesses = bptree.NewBPTree32()
    64 entryProcessIDs = bptree.NewBPTree32()
    65 gameWorldEntryProcessIDs = bptree.NewBPTree32()
    66 entryFunds = bptree.NewBPTree32()
    67 entryFundIDs = bptree.NewBPTree32()
    68 entryOwnerFundIDs = bptree.NewBPTree32()
    69 entryGroupFundIDs = bptree.NewBPTree32()
    70 systemFundings = bptree.NewBPTree32()
    71 systemFundingIDs = bptree.NewBPTree32()
    72 poolSystemFundingIDs = bptree.NewBPTree32()
    73 rewardDistributions = bptree.NewBPTree32()
    74 rewardDistributionIDs = bptree.NewBPTree32()
    75 poolDistributionIDs = bptree.NewBPTree32()
    76 vaultRefunds = bptree.NewBPTree32()
    77 vaultRefundIDs = bptree.NewBPTree32()
    78 poolRefundIDs = bptree.NewBPTree32()
    79 processedOperationKeys = bptree.NewBPTree32()
    80 latestRewardPoolID = 0
    81 latestParticipationProcessID = 0
    82 latestParticipationFundID = 0
    83 latestEntryProcessID = 0
    84 latestEntryFundID = 0
    85 latestSystemFundingID = 0
    86 latestRewardDistributionID = 0
    87 latestVaultRefundID = 0
    88 accountedUgnotTotal = 0
    89 distributionBatchMax = distributionBatchMaxDefault
    90}
    91
    92func ownerKey(processID uint64, owner address) string {
    93 return strconv.FormatUint(processID, 10) + ":" + owner.String()
    94}
    95
    96func keyedOwnerKey(processID uint64, owner address, key string) string {
    97 return ownerKey(processID, owner) + ":" + key
    98}
    99
    100func uint64Key(id uint64) string {
    101 // Zero-pad so BPTree key order matches numeric ID order.
    102 s := strconv.FormatUint(id, 10)
    103 if len(s) >= 20 {
    104 return s
    105 }
    106 return "00000000000000000000"[len(s):] + s
    107}
    108
    109func parseUint64Key(key string) uint64 {
    110 id, err := strconv.ParseUint(key, 10, 64)
    111 if err != nil {
    112 panic("invalid uint64 key: " + key)
    113 }
    114 return id
    115}
    116
    117func treeGet(store *bptree.BPTree, id uint64) (any, bool) {
    118 key := uint64Key(id)
    119 if !store.Has(key) {
    120 return nil, false
    121 }
    122 return store.Get(key), true
    123}
    124
    125func treeSet(store *bptree.BPTree, id uint64, value any) {
    126 store.Set(uint64Key(id), value)
    127}
    128
    129func stringGet(store *bptree.BPTree, key string) (any, bool) {
    130 if !store.Has(key) {
    131 return nil, false
    132 }
    133 return store.Get(key), true
    134}
    135
    136func addStringSetID(store *bptree.BPTree, key string, id uint64) {
    137 value := store.Get(key)
    138 var ids *bptree.BPTree
    139 if value != nil {
    140 ids = value.(*bptree.BPTree)
    141 } else {
    142 ids = bptree.NewBPTree32()
    143 store.Set(key, ids)
    144 }
    145 ids.Set(uint64Key(id), true)
    146}
    147
    148func getStringSet(store *bptree.BPTree, key string) (*bptree.BPTree, bool) {
    149 value := store.Get(key)
    150 if value == nil {
    151 return nil, false
    152 }
    153 return value.(*bptree.BPTree), true
    154}
    155
    156func getOrCreateIDSet(store *bptree.BPTree, key uint64) *bptree.BPTree {
    157 value := store.Get(uint64Key(key))
    158 if value != nil {
    159 return value.(*bptree.BPTree)
    160 }
    161 ids := bptree.NewBPTree32()
    162 store.Set(uint64Key(key), ids)
    163 return ids
    164}
    165
    166func getIDSet(store *bptree.BPTree, key uint64) (*bptree.BPTree, bool) {
    167 value := store.Get(uint64Key(key))
    168 if value == nil {
    169 return nil, false
    170 }
    171 return value.(*bptree.BPTree), true
    172}
    173
    174func listIDs(ids *bptree.BPTree, page, count int) []uint64 {
    175 assertPageCount(page, count)
    176 result := []uint64{}
    177 if ids == nil {
    178 return result
    179 }
    180 ids.ReverseIterateByOffset((page-1)*count, count, func(key string, _ any) bool {
    181 result = append(result, parseUint64Key(key))
    182 return false
    183 })
    184 return result
    185}
    186