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/gnoswap/gov/governance

Realm
Open in gnoweb ↗

Overview

Kind
Realm (renderable)
Name
governance
Namespace
gnoswap / gov
Files
21 (README)(gnomod.toml)
Exported functions
64
Module
gno.land/r/gnoswap/gov/governance
gno
0.9

Files (21)

  • README.mdmarkdown
  • gnomod.tomltoml
  • accessor.gnogno
  • config.gnogno
  • counter.gnogno
  • doc.gnogno
  • getters.gnogno
  • proposal_action_status.gnogno
  • proposal_data.gnogno
  • proposal_schedule_status.gnogno
  • proposal_status.gnogno
  • proposal_type.gnogno
  • proposal_vote_status.gnogno
  • proposal.gnogno
  • proxy.gnogno
  • render.gnogno
  • state.gnogno
  • store.gnogno
  • types.gnogno
  • upgrade.gnogno
  • voting_info.gnogno
  • voting_info.gnogno
    1package governance23// VotingInfo tracks voting-related information for a specific user on a specific proposal.4// This structure maintains the user's voting eligibility, voting history, and voting power.5type VotingInfo struct {6	availableVoteWeight int64 // Total voting weight available to this user for this proposal7

    Functions

    • Cancel(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}, proposalId int64) int64

    • DefaultVotingInfo() struct{availableVoteWeight int64; votedWeight int64; votedHeight int64; votedAt int64; votedYes bool; voted bool}

    • Execute(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}, proposalId int64) int64

    • ExistsProposal(proposalID int64) bool

    • ExistsVotingInfo(proposalID int64, addr string) bool

    • GetConfig(configVersion int64) (struct{VotingStartDelay int64; VotingPeriod int64; VotingWeightSmoothingDuration int64; Quorum int64; ProposalCreationThreshold int64; ExecutionDelay int64; ExecutionWindow int64}, interface {Error func() string})

    • GetConfigVersionByProposalId(proposalId int64) (int64, interface {Error func() string})

    • GetCurrentProposalID() int64

    • GetCurrentVotingWeightSnapshot() (int64, int64, interface {Error func() string})

    • GetDescriptionByProposalId(proposalId int64) (string, interface {Error func() string})

    • GetImplementationPackagePath() string

    • GetLatestConfig() (struct{VotingStartDelay int64; VotingPeriod int64; VotingWeightSmoothingDuration int64; Quorum int64; ProposalCreationThreshold int64; ExecutionDelay int64; ExecutionWindow int64}, interface {Error func() string})

    • GetLatestConfigVersion() int64

    • GetMaxSmoothingPeriod() int64

    • GetNayByProposalId(proposalId int64) (int64, interface {Error func() string})

    • GetOldestActiveProposalSnapshotTime() (int64, bool, interface {Error func() string})

    • GetProposalCommunityPoolSpendInfo(proposalID int64) (*gno.land/r/gnoswap/gov/governance.CommunityPoolSpendInfo, interface {Error func() string})

    • GetProposalCreatedAt(proposalId int64) (int64, interface {Error func() string})

    • GetProposalCreatedHeight(proposalId int64) (int64, interface {Error func() string})

    • GetProposalExecutionInfo(proposalID int64) (*gno.land/r/gnoswap/gov/governance.ExecutionInfo, interface {Error func() string})

    • GetProposals() *gno.land/p/nt/bptree/rotree/v0.ReadOnlyTree

    • GetProposalStatusByProposalId(proposalId int64) (string, interface {Error func() string})

    • GetProposalTypeByProposalId(proposalId int64) (string, interface {Error func() string})

    • GetProposerByProposalId(proposalId int64) (string, interface {Error func() string})

    • GetQuorumAmountByProposalId(proposalId int64) (int64, interface {Error func() string})

    • GetTitleByProposalId(proposalId int64) (string, interface {Error func() string})

    • GetUserProposals() *gno.land/p/nt/bptree/rotree/v0.ReadOnlyTree

    • GetVotedAt(proposalID int64, addr string) (int64, interface {Error func() string})

    • GetVotedHeight(proposalID int64, addr string) (int64, interface {Error func() string})

    • GetVoteStatus(proposalId int64) (quorum int64, maxVotingWeight int64, yesWeight int64, noWeight int64, err interface {Error func() string})

    • GetVoteWeight(proposalID int64, addr string) (int64, interface {Error func() string})

    • GetVotingInfos(proposalID int64) *gno.land/p/nt/bptree/rotree/v0.ReadOnlyTree

    • GetYeaByProposalId(proposalId int64) (int64, interface {Error func() string})

    • NewCommunityPoolSpendInfo(to string, tokenPath string, amount int64) *gno.land/r/gnoswap/gov/governance.CommunityPoolSpendInfo

    • NewConfig(votingStartDelay int64, votingPeriod int64, votingWeightSmoothingDuration int64, quorum int64, proposalCreationThreshold int64, executionDelay int64, executionWindow int64) struct{VotingStartDelay int64; VotingPeriod int64; VotingWeightSmoothingDuration int64; Quorum int64; ProposalCreationThreshold int64; ExecutionDelay int64; ExecutionWindow int64}

    • NewConfigPtr(votingStartDelay int64, votingPeriod int64, votingWeightSmoothingDuration int64, quorum int64, proposalCreationThreshold int64, executionDelay int64, executionWindow int64) *gno.land/r/gnoswap/gov/governance.Config

    • NewConfigTree() *gno.land/p/nt/bptree/v0.BPTree

    • NewCounter() *gno.land/r/gnoswap/gov/governance.Counter

    • NewDefaultConfig() struct{VotingStartDelay int64; VotingPeriod int64; VotingWeightSmoothingDuration int64; Quorum int64; ProposalCreationThreshold int64; ExecutionDelay int64; ExecutionWindow int64}

    • NewExecutionInfo(num int64, msgs []string) *gno.land/r/gnoswap/gov/governance.ExecutionInfo

    • NewGovernanceStore(kvStore interface {AddAuthorizedCaller func(int, .uverse.realm, .uverse.address, gno.land/p/gnoswap/store/v1.Permission) .uverse.error; Delete func(int, .uverse.realm, string) .uverse.error; Get func(string) (interface {}, .uverse.error); GetAddress func(string) (.uverse.address, .uverse.error); GetAllKeys func() ([]string, .uverse.error); GetAuthorizedCallers func() (map[.uverse.address]gno.land/p/gnoswap/store/v1.Permission, .uverse.error); GetBPTree func(string) (*gno.land/p/nt/bptree/v0.BPTree, .uverse.error); GetBool func(string) (bool, .uverse.error); GetDomainAddress func() .uverse.address; GetInt64 func(string) (int64, .uverse.error); GetString func(string) (string, .uverse.error); GetUint64 func(string) (uint64, .uverse.error); Has func(string) bool; IsWriteAuthorized func(.uverse.address) bool; RemoveAuthorizedCaller func(int, .uverse.realm, .uverse.address) .uverse.error; Set func(int, .uverse.realm, string, interface {}) .uverse.error; UpdateAuthorizedCaller func(int, .uverse.realm, .uverse.address, gno.land/p/gnoswap/store/v1.Permission) .uverse.error}) interface {AddUserProposal func(int, .uverse.realm, string, int64) .uverse.error; GetActiveProposalsBySnapshot func() *gno.land/p/nt/bptree/v0.BPTree; GetConfig func(int64) (gno.land/r/gnoswap/gov/governance.Config, bool); GetConfigCounter func() *gno.land/r/gnoswap/gov/governance.Counter; GetProposal func(int64) (*gno.land/r/gnoswap/gov/governance.Proposal, bool); GetProposalCounter func() *gno.land/r/gnoswap/gov/governance.Counter; GetProposalUserVotingInfos func() *gno.land/p/nt/bptree/v0.BPTree; GetProposalVotingInfos func(int64) (*gno.land/p/nt/bptree/v0.BPTree, bool); GetProposals func() *gno.land/p/nt/bptree/v0.BPTree; GetUserProposalIDs func(string) ([]int64, bool); GetUserProposals func() *gno.land/p/nt/bptree/v0.BPTree; HasActiveProposalsBySnapshotStoreKey func() bool; HasConfigCounterStoreKey func() bool; HasConfigsStoreKey func() bool; HasProposalCounterStoreKey func() bool; HasProposalUserVotingInfosStoreKey func() bool; HasProposalsStoreKey func() bool; HasUserProposalsStoreKey func() bool; RemoveUserProposal func(int, .uverse.realm, string, int64) .uverse.error; SetActiveProposalsBySnapshot func(int, .uverse.realm, *gno.land/p/nt/bptree/v0.BPTree) .uverse.error; SetConfig func(int, .uverse.realm, int64, gno.land/r/gnoswap/gov/governance.Config) .uverse.error; SetConfigCounter func(int, .uverse.realm, *gno.land/r/gnoswap/gov/governance.Counter) .uverse.error; SetConfigs func(int, .uverse.realm, *gno.land/p/nt/bptree/v0.BPTree) .uverse.error; SetProposal func(int, .uverse.realm, int64, *gno.land/r/gnoswap/gov/governance.Proposal) .uverse.error; SetProposalCounter func(int, .uverse.realm, *gno.land/r/gnoswap/gov/governance.Counter) .uverse.error; SetProposalUserVotingInfos func(int, .uverse.realm, *gno.land/p/nt/bptree/v0.BPTree) .uverse.error; SetProposalVotingInfos func(int, .uverse.realm, int64, *gno.land/p/nt/bptree/v0.BPTree) .uverse.error; SetProposals func(int, .uverse.realm, *gno.land/p/nt/bptree/v0.BPTree) .uverse.error; SetUserProposals func(int, .uverse.realm, *gno.land/p/nt/bptree/v0.BPTree) .uverse.error}

    • NewParameterChangeInfo(pkgPath string, function string, params []string) struct{pkgPath string; function string; params []string}

    • NewProposal(proposalID int64, status *gno.land/r/gnoswap/gov/governance.ProposalStatus, metadata *gno.land/r/gnoswap/gov/governance.ProposalMetadata, data *gno.land/r/gnoswap/gov/governance.ProposalData, proposerAddress string, configVersion int64, snapshotTime int64, createdHeight int64) *gno.land/r/gnoswap/gov/governance.Proposal

    • NewProposalActionStatus(executable bool) *gno.land/r/gnoswap/gov/governance.ProposalActionStatus

    • NewProposalData(proposalType string, communityPoolSpend *gno.land/r/gnoswap/gov/governance.CommunityPoolSpendInfo, execution *gno.land/r/gnoswap/gov/governance.ExecutionInfo) *gno.land/r/gnoswap/gov/governance.ProposalData

    • NewProposalMetadata(title string, description string) *gno.land/r/gnoswap/gov/governance.ProposalMetadata

    • NewProposalScheduleStatus(createTime int64, activeTime int64, votingEndTime int64, executableTime int64, expiredTime int64) *gno.land/r/gnoswap/gov/governance.ProposalScheduleStatus

    • NewProposalStatusBy(schedule *gno.land/r/gnoswap/gov/governance.ProposalScheduleStatus, actionStatus *gno.land/r/gnoswap/gov/governance.ProposalActionStatus, voteStatus *gno.land/r/gnoswap/gov/governance.ProposalVoteStatus) *gno.land/r/gnoswap/gov/governance.ProposalStatus

    • NewProposalTree() *gno.land/p/nt/bptree/v0.BPTree

    • NewProposalUserVotingInfoTree() *gno.land/p/nt/bptree/v0.BPTree

    • NewProposalVoteStatus(maxVotingWeight int64, quorumAmount int64) *gno.land/r/gnoswap/gov/governance.ProposalVoteStatus

    • NewUserProposalTree() *gno.land/p/nt/bptree/v0.BPTree

    • NewVotedVotingInfo(availableVoteWeight int64, votedYes bool, votedWeight int64, votedHeight int64, votedAt int64) struct{availableVoteWeight int64; votedWeight int64; votedHeight int64; votedAt int64; votedYes bool; voted bool}

    • NewVotingInfo(availableVoteWeight int64) struct{availableVoteWeight int64; votedWeight int64; votedHeight int64; votedAt int64; votedYes bool; voted bool}

    • NewVotingInfoTree() *gno.land/p/nt/bptree/v0.BPTree

    • ProposeCommunityPoolSpend(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}, title string, description string, to string, tokenPath string, amount int64) int64

    • ProposeParameterChange(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}, title string, description string, numToExecute int64, executions string) int64

    • ProposeText(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}, title string, description string) int64

    • Reconfigure(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}, votingStartDelay int64, votingPeriod int64, votingWeightSmoothingDuration int64, quorum int64, proposalCreationThreshold int64, executionDelay int64, executionWindow int64) int64

    • RegisterInitializer(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}, initializer func(int, .uverse.realm, gno.land/r/gnoswap/gov/governance.IGovernanceStore, gno.land/r/gnoswap/gov/governance.GovStakerAccessor) gno.land/r/gnoswap/gov/governance.IGovernance)

    • RemoveInactiveProposalFromIndex(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}, proposalID int64)

    • Render(path string) string

    • UpgradeImpl(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}, targetPackagePath string)

    • Vote(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}, proposalId int64, yes bool) string

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

    Rendered

    RenderedRawgnoweb ↗

    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.

    votedWeight int64 // Actual weight used when voting (0 if not voted)
    8 votedHeight int64 // Block height when vote was cast
    9 votedAt int64 // Timestamp when vote was cast
    10 votedYes bool // True if voted "yes", false if voted "no"
    11 voted bool // True if user has already voted
    12}
    13
    14// NewVotingInfo creates a new voting information structure for a user.
    15// This constructor initializes the voting eligibility based on delegation snapshots.
    16//
    17// Parameters:
    18// - availableVoteWeight: total voting weight available to this user
    19//
    20// Returns:
    21// - VotingInfo: newly created voting information value
    22func NewVotingInfo(availableVoteWeight int64) VotingInfo {
    23 return VotingInfo{
    24 availableVoteWeight: availableVoteWeight,
    25 // Other fields are initialized to zero values (false, 0)
    26 // voted starts as false, indicating no vote has been cast
    27 }
    28}
    29
    30// DefaultVotingInfo creates an empty voting information value.
    31//
    32// Returns:
    33// - VotingInfo: zero-valued voting record with no available weight and no vote recorded
    34func DefaultVotingInfo() VotingInfo {
    35 return VotingInfo{}
    36}
    37
    38// NewVotedVotingInfo creates a voting information value with a recorded vote.
    39//
    40// Parameters:
    41// - availableVoteWeight: total voting weight available to the user for this proposal
    42// - votedYes: true when the recorded vote is yes, false when it is no
    43// - votedWeight: voting weight applied to the recorded vote
    44// - votedHeight: block height at which the vote was recorded
    45// - votedAt: Unix timestamp at which the vote was recorded
    46//
    47// Returns:
    48// - VotingInfo: voting record populated with the supplied weight, choice, height, and timestamp and marked as voted
    49func NewVotedVotingInfo(availableVoteWeight int64, votedYes bool, votedWeight, votedHeight, votedAt int64) VotingInfo {
    50 return VotingInfo{
    51 availableVoteWeight: availableVoteWeight,
    52 votedWeight: votedWeight,
    53 votedHeight: votedHeight,
    54 votedAt: votedAt,
    55 votedYes: votedYes,
    56 voted: true,
    57 }
    58}
    59
    60// VotingType returns a human-readable string representation of the vote choice.
    61//
    62// Returns:
    63// - string: "yes" or "no" based on voting choice
    64func (v VotingInfo) VotingType() string {
    65 if v.votedYes {
    66 return "yes"
    67 }
    68
    69 return "no"
    70}
    71
    72// IsVoted checks if the user has already cast their vote.
    73//
    74// Returns:
    75// - bool: true if user has voted on this proposal
    76func (v VotingInfo) IsVoted() bool {
    77 return v.voted
    78}
    79
    80// VotedYes checks if the user voted "yes" on the proposal.
    81// Only meaningful if IsVoted() returns true.
    82//
    83// Returns:
    84// - bool: true if user voted "yes"
    85func (v VotingInfo) VotedYes() bool {
    86 return v.votedYes
    87}
    88
    89// VotedNo checks if the user voted "no" on the proposal.
    90// Only meaningful if IsVoted() returns true.
    91//
    92// Returns:
    93// - bool: true if user voted "no"
    94func (v VotingInfo) VotedNo() bool {
    95 return !v.votedYes
    96}
    97
    98// AvailableVoteWeight returns the total voting weight available to this user.
    99// This weight is determined at proposal creation time based on delegation snapshots.
    100//
    101// Returns:
    102// - int64: available voting weight
    103func (v VotingInfo) AvailableVoteWeight() int64 {
    104 return v.availableVoteWeight
    105}
    106
    107// VotedWeight returns the weight actually used when voting.
    108// Returns 0 if the user hasn't voted yet.
    109//
    110// Returns:
    111// - int64: weight used for voting, or 0 if not voted
    112func (v VotingInfo) VotedWeight() int64 {
    113 if !v.voted {
    114 return 0
    115 }
    116
    117 return v.votedWeight
    118}
    119
    120// VotedHeight returns the block height when the vote was cast.
    121// Returns 0 if the user hasn't voted yet.
    122//
    123// Returns:
    124// - int64: block height when vote was cast
    125func (v VotingInfo) VotedHeight() int64 {
    126 if !v.voted {
    127 return 0
    128 }
    129
    130 return v.votedHeight
    131}
    132
    133// VotedAt returns the timestamp when the vote was cast.
    134// Returns 0 if the user hasn't voted yet.
    135//
    136// Returns:
    137// - int64: timestamp when vote was cast
    138func (v VotingInfo) VotedAt() int64 {
    139 if !v.voted {
    140 return 0
    141 }
    142
    143 return v.votedAt
    144}
    145