govStakerAccessor
typeValue
governance.govStakerAccessor
newGovStakerAccessor
func() governance.GovStakerAccessor- OID
- 05efe5…55e4:3
newGovStakerAccessor details
Config
typeConfig represents the configuration of the governor contract All parameters in this struct can be modified through governance.
Value
governance.Config
NewConfig
func(votingStartDelay int64, votingPeriod int64, votingWeightSmoothingDuration int64, quorum int64, proposalCreationThreshold int64, executionDelay int64, executionWindow int64) governance.Config- OID
- 05efe5…55e4:5
NewConfig details
NewConfigPtr
func(votingStartDelay int64, votingPeriod int64, votingWeightSmoothingDuration int64, quorum int64, proposalCreationThreshold int64, executionDelay int64, executionWindow int64) *governance.ConfigNewConfigPtr constructs a Config and returns a pointer to it. The Config is allocated within the governance domain realm, satisfying realm allocation checks for callers (such as tests) that require a \*Config value.
- OID
- 05efe5…55e4:7
NewConfigPtr details
NewDefaultConfig
func() governance.Config- OID
- 05efe5…55e4:8
NewDefaultConfig details
NewConfigTree
func() *v0.BPTree- OID
- 05efe5…55e4:9
NewConfigTree details
Counter
typeCounter manages unique incrementing IDs.
Value
governance.Counter
NewCounter
func() *governance.CounterNewCounter creates a new Counter starting at 0.
- OID
- 05efe5…55e4:10
NewCounter details
cloneInt64Slice
func(src []int64) []int64- OID
- 05efe5…55e4:12
cloneInt64Slice details
cloneAddressSlice
func(src [].uverse.address) [].uverse.address- OID
- 05efe5…55e4:14
cloneAddressSlice details
GetLatestConfigVersion
func() int64GetLatestConfigVersion returns the current config version.
- OID
- 05efe5…55e4:15
GetLatestConfigVersion details
GetCurrentProposalID
func() int64GetCurrentProposalID returns the current proposal ID counter.
- OID
- 05efe5…55e4:17
GetCurrentProposalID details
GetMaxSmoothingPeriod
func() int64GetMaxSmoothingPeriod returns the maximum smoothing period for delegation history cleanup.
- OID
- 05efe5…55e4:18
GetMaxSmoothingPeriod details
GetLatestConfig
func() governance.ConfigGetLatestConfig returns the latest governance configuration.
- OID
- 05efe5…55e4:19
GetLatestConfig details
GetConfig
func(configVersion int64) (governance.Config, .uverse.error)GetConfig returns a specific governance configuration by version.
- OID
- 05efe5…55e4:20
GetConfig details
GetProposalCount
func() intGetProposalCount returns the total number of proposals.
- OID
- 05efe5…55e4:21
GetProposalCount details
GetProposalIDs
func(offset int, count int) []int64GetProposalIDs returns a paginated list of proposal IDs.
- OID
- 05efe5…55e4:22
GetProposalIDs details
ExistsProposal
func(proposalID int64) boolExistsProposal checks if a proposal exists.
- OID
- 05efe5…55e4:23
ExistsProposal details
GetProposal
func(proposalID int64) (*governance.Proposal, .uverse.error)GetProposal returns a proposal by ID. Returns a clone to prevent external modification.
- OID
- 05efe5…55e4:24
GetProposal details
GetProposerByProposalId
func(proposalId int64) (.uverse.address, .uverse.error)- OID
- 05efe5…55e4:25
GetProposerByProposalId details
GetProposalTypeByProposalId
func(proposalId int64) (governance.ProposalType, .uverse.error)GetProposalTypeByProposalId returns the type of a proposal.
- OID
- 05efe5…55e4:26
GetProposalTypeByProposalId details
GetYeaByProposalId
func(proposalId int64) (int64, .uverse.error)GetYeaByProposalId returns the yes vote weight of a proposal.
- OID
- 05efe5…55e4:27
GetYeaByProposalId details
GetNayByProposalId
func(proposalId int64) (int64, .uverse.error)GetNayByProposalId returns the no vote weight of a proposal.
- OID
- 05efe5…55e4:28
GetNayByProposalId details
GetConfigVersionByProposalId
func(proposalId int64) (int64, .uverse.error)GetConfigVersionByProposalId returns the config version used by a proposal.
- OID
- 05efe5…55e4:29
GetConfigVersionByProposalId details
GetQuorumAmountByProposalId
func(proposalId int64) (int64, .uverse.error)GetQuorumAmountByProposalId returns the quorum requirement for a proposal.
- OID
- 05efe5…55e4:30
GetQuorumAmountByProposalId details
GetTitleByProposalId
func(proposalId int64) (string, .uverse.error)GetTitleByProposalId returns the title of a proposal.
- OID
- 05efe5…55e4:31
GetTitleByProposalId details
GetDescriptionByProposalId
func(proposalId int64) (string, .uverse.error)GetDescriptionByProposalId returns the description of a proposal.
- OID
- 05efe5…55e4:32
GetDescriptionByProposalId details
GetProposalStatusByProposalId
func(proposalId int64) (string, .uverse.error)GetProposalStatusByProposalId returns the current status of a proposal.
- OID
- 05efe5…55e4:33
GetProposalStatusByProposalId details
GetProposalCreatedAt
func(proposalId int64) (int64, .uverse.error)GetProposalCreatedAt returns the creation timestamp of a proposal.
- OID
- 05efe5…55e4:34
GetProposalCreatedAt details
GetProposalCreatedHeight
func(proposalId int64) (int64, .uverse.error)GetProposalCreatedHeight returns the creation block height of a proposal.
- OID
- 05efe5…55e4:35
GetProposalCreatedHeight details
GetVoteStatus
func(proposalId int64) (quorum int64, maxVotingWeight int64, yesWeight int64, noWeight int64, err .uverse.error)GetVoteStatus returns the vote status of a proposal. Returns: - quorum: minimum vote weight required for proposal to pass - maxVotingWeight: maximum possible voting weight - yesWeight: total weight of "yes" votes - noWeight: total weight of "no" votes
- OID
- 05efe5…55e4:36
GetVoteStatus details
GetVotingInfoCount
func(proposalID int64) intGetVotingInfoCount returns the number of voters for a proposal.
- OID
- 05efe5…55e4:37
GetVotingInfoCount details
GetVotingInfoAddresses
func(proposalID int64, offset int, count int) [].uverse.address- OID
- 05efe5…55e4:38
GetVotingInfoAddresses details
ExistsVotingInfo
func(proposalID int64, addr .uverse.address) boolExistsVotingInfo checks if a voting info exists for a user on a proposal.
- OID
- 05efe5…55e4:39
ExistsVotingInfo details
GetVotingInfo
func(proposalID int64, addr .uverse.address) (*governance.VotingInfo, .uverse.error)GetVotingInfo returns the voting info for a user on a proposal. Returns a clone to prevent external modification.
- OID
- 05efe5…55e4:40
GetVotingInfo details
GetVoteWeight
func(proposalID int64, addr .uverse.address) (int64, .uverse.error)GetVoteWeight returns the voting weight of an address for a proposal.
- OID
- 05efe5…55e4:41
GetVoteWeight details
GetVotedHeight
func(proposalID int64, addr .uverse.address) (int64, .uverse.error)GetVotedHeight returns the block height when an address voted on a proposal.
- OID
- 05efe5…55e4:42
GetVotedHeight details
GetVotedAt
func(proposalID int64, addr .uverse.address) (int64, .uverse.error)GetVotedAt returns the timestamp when an address voted on a proposal.
- OID
- 05efe5…55e4:43
GetVotedAt details
GetProposalCommunityPoolSpendInfo
func(proposalID int64) (*governance.CommunityPoolSpendInfo, .uverse.error)GetProposalCommunityPoolSpendInfo returns the community pool spend info for a proposal.
- OID
- 05efe5…55e4:44
GetProposalCommunityPoolSpendInfo details
GetProposalExecutionInfo
func(proposalID int64) (*governance.ExecutionInfo, .uverse.error)GetProposalExecutionInfo returns the execution info for a proposal.
- OID
- 05efe5…55e4:45
GetProposalExecutionInfo details
GetUserProposalCount
func(user .uverse.address) intGetUserProposalCount returns the number of proposals created by a user.
- OID
- 05efe5…55e4:46
GetUserProposalCount details
GetUserProposalIDs
func(user .uverse.address, offset int, count int) []int64GetUserProposalIDs returns a paginated list of proposal IDs created by a user.
- OID
- 05efe5…55e4:47
GetUserProposalIDs details
GetOldestActiveProposalSnapshotTime
func() (int64, bool)GetOldestActiveProposalSnapshotTime returns the oldest snapshot time among active proposals.
- OID
- 05efe5…55e4:48
GetOldestActiveProposalSnapshotTime details
GetCurrentVotingWeightSnapshot
func() (int64, int64, .uverse.error)GetCurrentVotingWeightSnapshot returns the current voting weight snapshot.
- OID
- 05efe5…55e4:49
GetCurrentVotingWeightSnapshot details
Proposal
typeProposal represents a governance proposal with all its associated data and state. This is the core structure that tracks proposal lifecycle from creation to execution.
Value
governance.Proposal
NewProposal
func(proposalID int64, status *governance.ProposalStatus, metadata *governance.ProposalMetadata, data *governance.ProposalData, proposerAddress .uverse.address, configVersion int64, snapshotTime int64, createdHeight int64) *governance.ProposalNewProposal creates a new proposal instance with the provided parameters. NewProposal is the main constructor for creating governance proposals. - metadata: proposal title and description - data: type-specific proposal data - proposerAddress: address of the proposal creator - configVersion: governance configuration version - snapshotTime: timestamp for voting weight snapshot lookup - createdHeight: creation block height Returns: - \*Proposal: newly created proposal instance
- OID
- 05efe5…55e4:50
NewProposal details
NewProposalTree
func() *v0.BPTree- OID
- 05efe5…55e4:52
NewProposalTree details
NewUserProposalTree
func() *v0.BPTree- OID
- 05efe5…55e4:53
NewUserProposalTree details
NewVotingInfoTree
func() *v0.BPTree- OID
- 05efe5…55e4:54
NewVotingInfoTree details
NewProposalUserVotingInfoTree
func() *v0.BPTree- OID
- 05efe5…55e4:55
NewProposalUserVotingInfoTree details
ProposalActionStatus
typeProposalActionStatus tracks the execution and cancellation status of a proposal. This structure manages the action-related state including who performed actions and when.
Value
governance.ProposalActionStatus
NewProposalActionStatus
func(executable bool) *governance.ProposalActionStatusNewProposalActionStatus creates a new action status for a proposal. Initializes the status with default values and the executable flag. Parameters: - executable: whether this proposal type can be executed Returns: - \*ProposalActionStatus: new action status instance
- OID
- 05efe5…55e4:56
NewProposalActionStatus details
ProposalMetadata
typeProposalMetadata contains descriptive information about a proposal. This includes the title and description that are displayed to voters.
Value
governance.ProposalMetadata
NewProposalMetadata
func(title string, description string) *governance.ProposalMetadataNewProposalMetadata creates a new proposal metadata instance with trimmed input. Parameters: - title: proposal title - description: proposal description Returns: - \*ProposalMetadata: new metadata instance with trimmed whitespace
- OID
- 05efe5…55e4:58
NewProposalMetadata details
ProposalData
typeProposalData contains the type-specific data for a proposal. This structure holds different data depending on the proposal type.
Value
governance.ProposalData
NewProposalData
func(proposalType governance.ProposalType, communityPoolSpend *governance.CommunityPoolSpendInfo, execution *governance.ExecutionInfo) *governance.ProposalDataNewProposalData creates a new proposal data instance with the specified components. Parameters: - proposalType: type of the proposal - communityPoolSpend: community pool spending information - execution: parameter change execution information Returns: - \*ProposalData: new proposal data instance
- OID
- 05efe5…55e4:60
NewProposalData details
CommunityPoolSpendInfo
typeCommunityPoolSpendInfo contains information for community pool spending proposals.
Value
governance.CommunityPoolSpendInfo
NewCommunityPoolSpendInfo
func(to .uverse.address, tokenPath string, amount int64) *governance.CommunityPoolSpendInfo- OID
- 05efe5…55e4:61
NewCommunityPoolSpendInfo details
ExecutionInfo
typeExecutionInfo contains information for parameter change execution. Messages are encoded strings that specify function calls and parameters.
Value
governance.ExecutionInfo
NewExecutionInfo
func(num int64, msgs []string) *governance.ExecutionInfo- OID
- 05efe5…55e4:62
NewExecutionInfo details
ParameterChangeInfo
typeParameterChangeInfo represents a single parameter change to be executed.
Value
governance.ParameterChangeInfo
NewParameterChangeInfo
func(pkgPath string, function string, params []string) governance.ParameterChangeInfo- OID
- 05efe5…55e4:63
NewParameterChangeInfo details
ProposalScheduleStatus
typeProposalScheduleStatus represents the pre-calculated time schedule for a proposal. This structure defines all the important timestamps in a proposal's lifecycle, from creation through voting to execution and expiration.
Value
governance.ProposalScheduleStatus
NewProposalScheduleStatus
func(createTime int64, activeTime int64, votingEndTime int64, executableTime int64, expiredTime int64) *governance.ProposalScheduleStatus- OID
- 05efe5…55e4:64
NewProposalScheduleStatus details
ProposalStatusType
typeProposalStatusType represents the current status of a proposal in its lifecycle. These statuses determine what actions are available for a proposal.
Value
governance.ProposalStatusType
StatusUpcoming
governance.ProposalStatusType// Proposal created but voting hasn't started yet
Value
<zero>
StatusActive
governance.ProposalStatusType// Proposal is in voting period
Value
<zero>
StatusPassed
governance.ProposalStatusType// Proposal has passed but hasn't been executed (or is text proposal)
Value
<zero>
StatusRejected
governance.ProposalStatusType// Proposal failed to meet voting requirements
Value
<zero>
StatusExecutable
governance.ProposalStatusType// Proposal can be executed (passed and in execution window)
Value
<zero>
StatusExecuted
governance.ProposalStatusType// Proposal has been successfully executed
Value
<zero>
StatusExpired
governance.ProposalStatusType// Proposal execution window has passed
Value
<zero>
StatusCanceled
governance.ProposalStatusType// Proposal has been canceled
Value
<zero>
ProposalStatus
typeProposalStatus manages the complete status of a proposal including scheduling, voting, and actions. This is the central status tracking structure that coordinates different aspects of proposal state.
Value
governance.ProposalStatus
NewProposalStatusBy
func(schedule *governance.ProposalScheduleStatus, actionStatus *governance.ProposalActionStatus, voteStatus *governance.ProposalVoteStatus) *governance.ProposalStatus- OID
- 05efe5…55e4:66
NewProposalStatusBy details
ProposalType
typeProposalType defines the different types of proposals supported by the governance system. Each type has different execution behavior and validation requirements.
Value
governance.ProposalType
Text
governance.ProposalType// Informational proposals for community discussion
Value
<gnolang.StringValue>
CommunityPoolSpend
governance.ProposalTypeCommunityPoolSpend returns the community pool spending information. Returns: - \*CommunityPoolSpendInfo: community pool spending details
Value
<gnolang.StringValue>
ParameterChange
governance.ProposalType// Proposals to modify system parameters
Value
<gnolang.StringValue>
ProposalVoteStatus
typeProposalVoteStatus tracks the voting tallies and requirements for a proposal. This structure manages vote counting, quorum calculation, and voting outcome determination.
Value
governance.ProposalVoteStatus
NewProposalVoteStatus
func(maxVotingWeight int64, quorumAmount int64) *governance.ProposalVoteStatusNewProposalVoteStatus creates a new vote status for a proposal. Initializes vote tallies to zero and calculates the quorum requirement. Parameters: - maxVotingWeight: maximum possible voting weight for this proposal - quorumAmount: quorum amount required for passage Returns: - \*ProposalVoteStatus: new vote status instance
- OID
- 05efe5…55e4:68
NewProposalVoteStatus details
ProposeText
func(title string, description string) int64ProposeText creates a new text proposal for general governance decisions. Parameters: - title: proposal title - description: detailed proposal description Returns: - int64: ID of the created proposal
- OID
- 05efe5…55e4:70
ProposeText details
ProposeCommunityPoolSpend
func(title string, description string, to .uverse.address, tokenPath string, amount int64) int64ProposeCommunityPoolSpend creates a new community pool spending proposal. Parameters: - title: proposal title - description: detailed proposal description - to: recipient address - tokenPath: token path to transfer - amount: amount to transfer Returns: - int64: ID of the created proposal
- OID
- 05efe5…55e4:72
ProposeCommunityPoolSpend details
ProposeParameterChange
func(title string, description string, numToExecute int64, executions string) int64ProposeParameterChange creates a new parameter change proposal. Parameters: - title: proposal title - description: detailed proposal description - numToExecute: number of executions to perform - executions: encoded execution messages Returns: - int64: ID of the created proposal
- OID
- 05efe5…55e4:73
ProposeParameterChange details
Vote
func(proposalId int64, yes bool) stringVote casts a vote on a proposal. Parameters: - proposalId: ID of the proposal to vote on - yes: true for yes vote, false for no vote Returns: - string: voting result information
- OID
- 05efe5…55e4:74
Vote details
Execute
func(proposalId int64) int64Execute executes a passed proposal that is in the execution window. Parameters: - proposalId: ID of the proposal to execute Returns: - int64: execution result code
- OID
- 05efe5…55e4:75
Execute details
Cancel
func(proposalId int64) int64Cancel cancels a proposal before voting begins. Only callable by the proposer. Parameters: - proposalId: ID of the proposal to cancel Returns: - int64: cancellation result code
- OID
- 05efe5…55e4:76
Cancel details
Reconfigure
func(votingStartDelay int64, votingPeriod int64, votingWeightSmoothingDuration int64, quorum int64, proposalCreationThreshold int64, executionDelay int64, executionWindow int64) int64Reconfigure updates the governance configuration parameters. Only callable by admin or governance. Parameters: - votingStartDelay: delay before voting starts (seconds) - votingPeriod: voting duration (seconds) - votingWeightSmoothingDuration: weight smoothing duration (seconds) - quorum: minimum voting weight required (percentage) - proposalCreationThreshold: minimum weight to create proposal - executionDelay: delay before execution (seconds) - executionWindow: execution time window (seconds) Returns: - int64: new configuration version
- OID
- 05efe5…55e4:77
Reconfigure details
ErrSpoofedRealm
untyped stringValue
"rlm does not match the current crossing frame"
currentAddress
.uverse.addressValue
<gnolang.StringValue>
domainPath
stringValue
"gno.land/r/gnoswap/gov/governance"
kvStore
*store.kvStore- OID
- 05efe5…55e4:100
kvStore details
versionManager
*version_manager.versionManager- OID
- 05efe5…55e4:104
versionManager details
implementation
*v1.governanceV1- OID
- 0db2d2…952d:80
implementation details
init.95
func()- OID
- 05efe5…55e4:83
init.95 details
initializeDomainStore
func(int, rlm .uverse.realm, kvStore store.KVStore) interface{...}- OID
- 05efe5…55e4:85
initializeDomainStore details
getImplementation
func() governance.IGovernance- OID
- 05efe5…55e4:86
getImplementation details
updateImplementation
func() .uverse.error- OID
- 05efe5…55e4:87
updateImplementation details
StoreKey
typeValue
governance.StoreKey
StoreKeyConfigCounter
governance.StoreKey// Config version counter
Value
<gnolang.StringValue>
StoreKeyProposalCounter
governance.StoreKey// Proposal ID counter
Value
<gnolang.StringValue>
StoreKeyConfigs
governance.StoreKey// Configurations BPTree
Value
<gnolang.StringValue>
StoreKeyProposals
governance.StoreKey// Proposals BPTree
Value
<gnolang.StringValue>
StoreKeyProposalUserVotingInfos
governance.StoreKey// Proposal voting infos BPTree
Value
<gnolang.StringValue>
StoreKeyUserProposals
governance.StoreKey// User proposals mapping BPTree
Value
<gnolang.StringValue>
governanceStore
typeValue
governance.governanceStore
NewGovernanceStore
func(kvStore store.KVStore) governance.IGovernanceStoreNewGovernanceStore creates a new governance store instance with the provided KV store. This function is used by the upgrade system to create storage instances for each implementation.
- OID
- 05efe5…55e4:88
NewGovernanceStore details
formatInt64Key
func(id int64) stringformatInt64Key formats int64 identifiers for storage keys.
- OID
- 05efe5…55e4:90
formatInt64Key details
IGovernance
typeValue
governance.IGovernance
IGovernanceManager
typeValue
governance.IGovernanceManager
IGovernanceGetter
typeIGovernanceGetter provides read-only access to governance data.
Value
governance.IGovernanceGetter
IGovernanceStore
typeValue
governance.IGovernanceStore
GovStakerAccessor
typeGovStakerAccessor provides an interface for accessing gov staker functionality. This abstraction allows for easier testing by enabling mock implementations.
Value
governance.GovStakerAccessor
RegisterInitializer
func(initializer func(...))RegisterInitializer registers a version-specific initializer. Each version (e.g. v1, v2) calls this function from its init body to plug itself into the proxy. The initializer constructs the version's IGovernance from the supplied IGovernanceStore and GovStakerAccessor. It receives a realm value that resolves to the governance proxy realm — the only address with write permission on the shared KV store — so any per-version store bootstrap performed inside the initializer passes the proxy's authorization check. Security: Only contracts within the domain path can register initializers. Each package path can only register once to prevent duplicate registrations.
- OID
- 05efe5…55e4:91
RegisterInitializer details
UpgradeImpl
func(targetPackagePath string)UpgradeImpl switches the active governance implementation to a different version. This function allows seamless upgrades from one version to another without data migration or downtime. Security: Only admin or governance can perform upgrades. The new implementation must have been previously registered via RegisterInitializer.
- OID
- 05efe5…55e4:93
UpgradeImpl details
GetImplementationPackagePath
func() stringGetImplementationPackagePath returns the package path of the currently active implementation.
- OID
- 05efe5…55e4:94
GetImplementationPackagePath details
VotingInfo
typeVotingInfo tracks voting-related information for a specific user on a specific proposal. This structure maintains the user's voting eligibility, voting history, and voting power.
Value
governance.VotingInfo
NewVotingInfo
func(availableVoteWeight int64) *governance.VotingInfoNewVotingInfo creates a new voting information structure for a user. This constructor initializes the voting eligibility based on delegation snapshots. Parameters: - availableVoteWeight: total voting weight available to this user Returns: - \*VotingInfo: newly created voting information structure
- OID
- 05efe5…55e4:95