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 can be modified through Reconfigure by admin or governance.
Value
governance.Config
NewConfig
func(votingStartDelay int64, votingPeriod int64, votingWeightSmoothingDuration int64, quorum int64, proposalCreationThreshold int64, executionDelay int64, executionWindow int64) governance.ConfigNewConfig constructs a governance configuration from the supplied delays, thresholds, quorum percentage, and execution window. Parameters: - votingStartDelay: delay from proposal creation until voting opens, in seconds - votingPeriod: duration for which voting remains open, in seconds - votingWeightSmoothingDuration: interval used to smooth delegation weight, in seconds - quorum: required approval percentage of total xGNS supply, from 0 through 100 - proposalCreationThreshold: minimum xGNS amount required to create a proposal - executionDelay: delay after voting ends before execution, in seconds - executionWindow: duration after the execution delay during which execution is allowed, in seconds Returns: - Config: configuration value populated with the supplied governance parameters
- 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. Parameters: - votingStartDelay: delay from proposal creation until voting opens, in seconds - votingPeriod: duration for which voting remains open, in seconds - votingWeightSmoothingDuration: interval used to smooth delegation weight, in seconds - quorum: required approval percentage of total xGNS supply, from 0 through 100 - proposalCreationThreshold: minimum xGNS amount required to create a proposal - executionDelay: delay after voting ends before execution, in seconds - executionWindow: duration after the execution delay during which execution is allowed, in seconds Returns: - \*Config: pointer to a configuration value populated with the supplied governance parameters
- OID
- 05efe5…55e4:7
NewConfigPtr details
NewDefaultConfig
func() governance.ConfigNewDefaultConfig returns the governance configuration's built-in defaults: one day before voting, seven days of voting, one day of weight smoothing, 50% quorum, a 1-billion-xGNS creation threshold, one day execution delay, and a 30-day execution window. Returns: - Config: default governance configuration value
- OID
- 05efe5…55e4:8
NewDefaultConfig details
NewConfigTree
func() *v0.BPTreeNewConfigTree creates an empty BPTree used to index configuration values by their encoded int64 version. Returns: - \*bptree.BPTree: empty configuration index tree
- OID
- 05efe5…55e4:9
NewConfigTree details
Counter
typeCounter manages unique incrementing IDs.
Value
governance.Counter
NewCounter
func() *governance.CounterNewCounter creates a new Counter whose current ID is initialized to zero. Returns: - \*Counter: counter initialized with current ID 0
- OID
- 05efe5…55e4:10
NewCounter details
GetLatestConfigVersion
func() int64GetLatestConfigVersion returns the current governance configuration version. Returns: - int64: latest configuration version stored by governance
- OID
- 05efe5…55e4:12
GetLatestConfigVersion details
GetCurrentProposalID
func() int64GetCurrentProposalID returns the current proposal ID counter. Returns: - int64: current proposal ID counter used for newly created proposals
- OID
- 05efe5…55e4:14
GetCurrentProposalID details
GetMaxSmoothingPeriod
func() int64GetMaxSmoothingPeriod returns the maximum smoothing period for delegation history cleanup. Returns: - int64: maximum permitted smoothing period in seconds
- OID
- 05efe5…55e4:15
GetMaxSmoothingPeriod details
GetLatestConfig
func() (governance.Config, .uverse.error)GetLatestConfig returns the latest governance configuration. Returns: - Config: latest stored configuration for the current version - error: nil on success, or an error when the current configuration is missing
- OID
- 05efe5…55e4:16
GetLatestConfig details
GetConfig
func(configVersion int64) (governance.Config, .uverse.error)GetConfig retrieves one governance configuration by version. A missing version returns the zero Config and false. Parameters: - version: configuration version used to form the tree key Returns: - Config: configuration stored for version, or zero Config when absent - bool: true when version was found; false when no configuration is stored
- OID
- 05efe5…55e4:17
GetConfig details
GetProposals
func() *v0.ReadOnlyTreeGetProposals retrieves the persisted proposals tree. Storage or type-cast failures panic. Returns: - \*bptree.BPTree: tree containing proposals keyed by formatted proposal ID
- OID
- 05efe5…55e4:18
GetProposals details
ExistsProposal
func(proposalID int64) boolExistsProposal checks whether a proposal is stored. Parameters: - proposalID: proposal identifier to look up Returns: - bool: true when proposalID is stored, otherwise false
- OID
- 05efe5…55e4:19
ExistsProposal details
GetProposerByProposalId
func(proposalId int64) (.uverse.address, .uverse.error)- OID
- 05efe5…55e4:20
GetProposerByProposalId details
GetProposalTypeByProposalId
func(proposalId int64) (governance.ProposalType, .uverse.error)GetProposalTypeByProposalId returns the type of a proposal. Parameters: - proposalId: proposal identifier to look up Returns: - ProposalType: type recorded for the proposal - error: nil on success, or an error when the proposal does not exist
- OID
- 05efe5…55e4:21
GetProposalTypeByProposalId details
GetYeaByProposalId
func(proposalId int64) (int64, .uverse.error)GetYeaByProposalId returns the yes vote weight of a proposal. Parameters: - proposalId: proposal identifier to inspect Returns: - int64: total voting weight recorded for yes votes - error: nil on success, or an error when the proposal does not exist
- OID
- 05efe5…55e4:22
GetYeaByProposalId details
GetNayByProposalId
func(proposalId int64) (int64, .uverse.error)GetNayByProposalId returns the no vote weight of a proposal. Parameters: - proposalId: proposal identifier to inspect Returns: - int64: total voting weight recorded for no votes - error: nil on success, or an error when the proposal does not exist
- OID
- 05efe5…55e4:23
GetNayByProposalId details
GetConfigVersionByProposalId
func(proposalId int64) (int64, .uverse.error)GetConfigVersionByProposalId returns the config version used by a proposal. Parameters: - proposalId: proposal identifier to inspect Returns: - int64: governance configuration version captured by the proposal - error: nil on success, or an error when the proposal does not exist
- OID
- 05efe5…55e4:24
GetConfigVersionByProposalId details
GetQuorumAmountByProposalId
func(proposalId int64) (int64, .uverse.error)GetQuorumAmountByProposalId returns the quorum requirement for a proposal. Parameters: - proposalId: proposal identifier to inspect Returns: - int64: minimum voting weight required for the proposal's quorum - error: nil on success, or an error when the proposal does not exist
- OID
- 05efe5…55e4:25
GetQuorumAmountByProposalId details
GetTitleByProposalId
func(proposalId int64) (string, .uverse.error)GetTitleByProposalId returns the title of a proposal. Parameters: - proposalId: proposal identifier to inspect Returns: - string: proposal title - error: nil on success, or an error when the proposal does not exist
- OID
- 05efe5…55e4:26
GetTitleByProposalId details
GetDescriptionByProposalId
func(proposalId int64) (string, .uverse.error)GetDescriptionByProposalId returns the description of a proposal. Parameters: - proposalId: proposal identifier to inspect Returns: - string: proposal description - error: nil on success, or an error when the proposal does not exist
- OID
- 05efe5…55e4:27
GetDescriptionByProposalId details
GetProposalStatusByProposalId
func(proposalId int64) (string, .uverse.error)GetProposalStatusByProposalId returns the current status of a proposal. Parameters: - proposalId: proposal identifier to inspect Returns: - string: status computed from the proposal and the current Unix time - error: nil on success, or an error when the proposal does not exist
- OID
- 05efe5…55e4:28
GetProposalStatusByProposalId details
GetProposalCreatedAt
func(proposalId int64) (int64, .uverse.error)GetProposalCreatedAt returns the creation timestamp of a proposal. Parameters: - proposalId: proposal identifier to look up Returns: - int64: Unix timestamp at which the proposal was created - error: nil on success, or an error when the proposal does not exist
- OID
- 05efe5…55e4:29
GetProposalCreatedAt details
GetProposalCreatedHeight
func(proposalId int64) (int64, .uverse.error)GetProposalCreatedHeight returns the creation block height of a proposal. Parameters: - proposalId: proposal identifier to look up Returns: - int64: block height at which the proposal was created - error: nil on success, or an error when the proposal does not exist
- OID
- 05efe5…55e4:30
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. Parameters: - proposalId: proposal identifier to inspect Returns: - quorum: minimum vote weight required for the proposal to pass - maxVotingWeight: maximum possible voting weight recorded for the proposal - yesWeight: total weight of yes votes - noWeight: total weight of no votes - err: nil on success, or an error when the proposal does not exist
- OID
- 05efe5…55e4:31
GetVoteStatus details
GetVotingInfos
func(proposalID int64) *v0.ReadOnlyTreeGetVotingInfos returns a read-only view of a proposal's value-backed voting infos, keyed by voter address. Existing proposals have an empty view before the first vote; nil is returned only when the stored voting-info tree is absent. Parameters: - proposalID: proposal identifier whose voting information is requested Returns: - \*rotree.ReadOnlyTree: read-only voting-info tree keyed by voter address, or nil when no tree is stored
- OID
- 05efe5…55e4:32
GetVotingInfos details
ExistsVotingInfo
func(proposalID int64, addr .uverse.address) boolExistsVotingInfo checks whether voting information exists for a user on a proposal. Parameters: - proposalID: proposal identifier to inspect - addr: voter address to look up within proposalID Returns: - bool: true when voting information exists for the proposal and address
- OID
- 05efe5…55e4:33
ExistsVotingInfo details
GetVoteWeight
func(proposalID int64, addr .uverse.address) (int64, .uverse.error)GetVoteWeight returns the voting weight of an address for a proposal. Parameters: - proposalID: proposal identifier to inspect - addr: voter address whose recorded vote weight is requested Returns: - int64: weight recorded for addr's vote - error: nil on success, or an error when no voting information exists for the proposal and address
- OID
- 05efe5…55e4:34
GetVoteWeight details
GetVotedHeight
func(proposalID int64, addr .uverse.address) (int64, .uverse.error)GetVotedHeight returns the block height when an address voted on a proposal. Parameters: - proposalID: proposal identifier to inspect - addr: voter address whose vote height is requested Returns: - int64: block height recorded for addr's vote - error: nil on success, or an error when no voting information exists for the proposal and address
- OID
- 05efe5…55e4:35
GetVotedHeight details
GetVotedAt
func(proposalID int64, addr .uverse.address) (int64, .uverse.error)GetVotedAt returns the timestamp when an address voted on a proposal. Parameters: - proposalID: proposal identifier to inspect - addr: voter address whose vote timestamp is requested Returns: - int64: Unix timestamp recorded for addr's vote - error: nil on success, or an error when no voting information exists for the proposal and address
- OID
- 05efe5…55e4:36
GetVotedAt details
GetProposalCommunityPoolSpendInfo
func(proposalID int64) (*governance.CommunityPoolSpendInfo, .uverse.error)GetProposalCommunityPoolSpendInfo returns a cloned copy of the community pool spend info for a proposal. Parameters: - proposalID: proposal identifier to inspect Returns: - \*CommunityPoolSpendInfo: cloned community-pool spend details, or nil when an error occurs - error: nil on success, or an error when the proposal is missing or has no spend data
- OID
- 05efe5…55e4:37
GetProposalCommunityPoolSpendInfo details
GetProposalExecutionInfo
func(proposalID int64) (*governance.ExecutionInfo, .uverse.error)GetProposalExecutionInfo returns a cloned copy of the execution info for a proposal. Parameters: - proposalID: proposal identifier to inspect Returns: - \*ExecutionInfo: cloned parameter-change execution messages and count, or nil when an error occurs - error: nil on success, or an error when the proposal is missing or has no execution data
- OID
- 05efe5…55e4:38
GetProposalExecutionInfo details
GetUserProposals
func() *v0.ReadOnlyTreeGetUserProposals retrieves the persisted user-to-proposals index. Storage or type-cast failures panic. Returns: - \*bptree.BPTree: tree mapping user strings to proposal ID slices
- OID
- 05efe5…55e4:39
GetUserProposals details
GetOldestActiveProposalSnapshotTime
func() (int64, bool, .uverse.error)GetOldestActiveProposalSnapshotTime returns the oldest active proposal's timestamp anchor. An empty index returns no active proposal; a stale or missing first entry returns an error so cleanup cannot silently skip it. Returns: - int64: snapshot timestamp of the oldest active proposal, or zero when the index is empty or an error occurs - bool: true when an active proposal was found at the oldest index entry, otherwise false - error: nil for an empty index or active entry, or an error when the entry is missing or inactive
- OID
- 05efe5…55e4:40
GetOldestActiveProposalSnapshotTime details
GetCurrentVotingWeightSnapshot
func() (int64, int64, .uverse.error)GetCurrentVotingWeightSnapshot returns the current total voting weight and its timestamp anchor computed with the configured smoothing duration. Returns: - int64: total voting weight averaged over the configured smoothing window - int64: Unix timestamp used as the snapshot history anchor - error: nil on success, or an error when the current configuration or snapshot data cannot be retrieved
- OID
- 05efe5…55e4:41
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 supplied identity, lifecycle, metadata, and type-specific data. Parameters: - proposalID: unique identifier assigned to the proposal - status: initial schedule, action, and voting status - metadata: proposal title and description metadata - data: type-specific proposal data - proposerAddress: address of the proposal creator - configVersion: governance configuration version captured for the proposal - snapshotTime: timestamp anchor for historical voting-weight lookup - createdHeight: block height at which the proposal was created Returns: - \*Proposal: newly initialized proposal containing the supplied fields
- OID
- 05efe5…55e4:42
NewProposal details
NewProposalTree
func() *v0.BPTreeNewProposalTree creates an empty B+ tree for proposals keyed by proposal ID. Returns: - \*bptree.BPTree: empty 16-way proposal tree
- OID
- 05efe5…55e4:44
NewProposalTree details
NewUserProposalTree
func() *v0.BPTreeNewUserProposalTree creates an empty B+ tree mapping users to proposal IDs. Returns: - \*bptree.BPTree: empty 16-way user-proposal index tree
- OID
- 05efe5…55e4:45
NewUserProposalTree details
NewVotingInfoTree
func() *v0.BPTreeNewVotingInfoTree creates an empty B+ tree for per-user voting information. Returns: - \*bptree.BPTree: empty 16-way voting-information tree
- OID
- 05efe5…55e4:46
NewVotingInfoTree details
NewProposalUserVotingInfoTree
func() *v0.BPTreeNewProposalUserVotingInfoTree creates an empty B+ tree mapping proposal IDs to their per-user voting-information trees. Returns: - \*bptree.BPTree: empty 16-way proposal voting-information index tree
- OID
- 05efe5…55e4:47
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:48
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:50
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:52
NewProposalData details
CommunityPoolSpendInfo
typeCommunityPoolSpendInfo contains information for community pool spending proposals.
Value
governance.CommunityPoolSpendInfo
NewCommunityPoolSpendInfo
func(to .uverse.address, tokenPath string, amount int64) *governance.CommunityPoolSpendInfoNewCommunityPoolSpendInfo creates community-pool spend data. Parameters: - to: Recipient address that receives the community-pool transfer. - tokenPath: Registered token path of the asset to transfer. - amount: Transfer amount in the token's smallest unit. Returns: - \*CommunityPoolSpendInfo: spend data containing the recipient, token path, and amount.
- OID
- 05efe5…55e4:53
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.ExecutionInfoNewExecutionInfo creates execution data for a parameter-change proposal. Parameters: - num: Number of encoded parameter-change messages to execute. - msgs: Encoded parameter-change messages, one message per execution. Returns: - \*ExecutionInfo: execution data containing the declared count and messages.
- OID
- 05efe5…55e4:54
NewExecutionInfo details
ParameterChangeInfo
typeParameterChangeInfo represents a single parameter change to be executed.
Value
governance.ParameterChangeInfo
NewParameterChangeInfo
func(pkgPath string, function string, params []string) governance.ParameterChangeInfoNewParameterChangeInfo creates one encoded parameter-change target description. Parameters: - pkgPath: Package path containing the parameter-change handler. - function: Handler function name to invoke. - params: String arguments passed to the handler in order. Returns: - ParameterChangeInfo: parameter-change target and its encoded arguments.
- OID
- 05efe5…55e4:55
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.ProposalScheduleStatusNewProposalScheduleStatus creates a proposal schedule from its lifecycle timestamps. Parameters: - createTime: Unix timestamp when the proposal was created - activeTime: Unix timestamp when voting starts - votingEndTime: Unix timestamp when voting ends - executableTime: Unix timestamp when the execution window starts - expiredTime: Unix timestamp when the execution window closes Returns: - \*ProposalScheduleStatus: schedule containing the supplied lifecycle timestamps
- OID
- 05efe5…55e4:56
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.ProposalStatusNewProposalStatusBy combines schedule, action, and vote state into a proposal status. Parameters: - schedule: time-based lifecycle schedule for the proposal - actionStatus: execution and cancellation state for the proposal - voteStatus: vote tallies and voting requirements for the proposal Returns: - \*ProposalStatus: status object containing the supplied lifecycle components
- OID
- 05efe5…55e4:58
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:60
NewProposalVoteStatus details
ProposeText
func(title string, description string) int64ProposeText creates a new text proposal with the provided data. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - title: The title of the proposal. - description: The description of the proposal. Returns: - proposalId: The ID of the proposal. Halt check: reverts while the Governance halt scope is active.
- OID
- 05efe5…55e4:62
ProposeText details
ProposeCommunityPoolSpend
func(title string, description string, to .uverse.address, tokenPath string, amount int64) int64ProposeCommunityPoolSpend creates a CommunityPoolSpend proposal with the provided data. The transfer is attempted when an approved proposal executes. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - title: The title of the proposal. - description: The description of the proposal. - to: A valid address to receive the spent token. - tokenPath: A registered token path. - amount: A strictly positive amount in the token's smallest unit. The community-pool balance is checked at execution, not proposal creation. Returns: - proposalId: The ID of the proposal. Halt check: reverts while the Governance halt scope is active.
- OID
- 05efe5…55e4:64
ProposeCommunityPoolSpend details
ProposeParameterChange
func(title string, description string, numToExecute int64, executions string) int64ProposeParameterChange creates a ParameterChange proposal with the provided data. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - title: The title of the proposal. - description: The description of the proposal. - numToExecute: The number of changes to execute. - executions: The list of changes to execute. Returns: - proposalId: The ID of the proposal. Halt check: reverts while the Governance halt scope is active, except for halt-recovery proposals that only target the halt realm.
- OID
- 05efe5…55e4:65
ProposeParameterChange details
Vote
func(proposalId int64, yes bool) stringVote allows a user to vote on a given proposal. The proposal's timestamp-based smoothing calculation determines the applied weight. A vote cannot be changed after it is recorded. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - proposalId: The ID of the proposal to vote. - yes: The flag to vote as yes or not. Returns: - voteWeight: The caller's calculated vote weight, formatted as a decimal string. Halt check: reverts while the Governance halt scope is active, except for halt-recovery proposals that only target the halt realm.
- OID
- 05efe5…55e4:66
Vote details
Execute
func(proposalId int64) int64Execute executes the given proposal. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - proposalId: The ID of the proposal to execute. Returns: - proposalId: The ID of the proposal. Halt check: reverts while the Governance halt scope is active, except for halt-recovery proposals that only target the halt realm.
- OID
- 05efe5…55e4:67
Execute details
Cancel
func(proposalId int64) int64Cancel cancels the proposal with the given ID. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - proposalId: The ID of the proposal to cancel. Returns: - proposalId: The ID of the proposal. Halt check: reverts while the Governance halt scope is active.
- OID
- 05efe5…55e4:68
Cancel details
RemoveInactiveProposalFromIndex
func(proposalID int64)RemoveInactiveProposalFromIndex removes an inactive proposal from the timestamp-ordered index without deleting its proposal or voting history. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - proposalID: Identifier of the inactive proposal to remove from the active index. Halt check: reverts while the Governance halt scope is active.
- OID
- 05efe5…55e4:69
RemoveInactiveProposalFromIndex 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: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - 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 Halt check: reverts while the Governance halt scope is active.
- OID
- 05efe5…55e4:70
Reconfigure details
Render
func(path string) stringRender delegates web rendering to the active implementation.
- OID
- 05efe5…55e4:71
Render 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
*v1.kvStore- OID
- 05efe5…55e4:97
kvStore details
versionManager
*v1.versionManager- OID
- 05efe5…55e4:101
versionManager details
implementation
*v1.governanceV1- OID
- 0db2d2…952d:93
implementation details
init.90
func()- OID
- 05efe5…55e4:78
init.90 details
initializeDomainStore
func(int, rlm .uverse.realm, kvStore v1.KVStore) interface{...}- OID
- 05efe5…55e4:80
initializeDomainStore details
getImplementation
func() governance.IGovernance- OID
- 05efe5…55e4:81
getImplementation details
updateImplementation
func() .uverse.error- OID
- 05efe5…55e4:82
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>
StoreKeyActiveProposalsBySnapshot
governance.StoreKeyValue
<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 v1.KVStore) governance.IGovernanceStoreNewGovernanceStore creates a governance store backed by the provided KV store. The returned interface is used by governance implementations and upgrades. Parameters: - kvStore: KV store used for governance counters, trees, and records Returns: - IGovernanceStore: governance store implementation backed by kvStore
- OID
- 05efe5…55e4:83
NewGovernanceStore details
formatInt64Key
func(id int64) stringformatInt64Key formats int64 identifiers for storage keys.
- OID
- 05efe5…55e4:85
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. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - initializer: Callback that receives the proxy-authorized realm context, governance store, and staker accessor and returns the versioned implementation.
- OID
- 05efe5…55e4:86
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. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - targetPackagePath: Registered implementation package path to activate.
- OID
- 05efe5…55e4:88
UpgradeImpl details
GetImplementationPackagePath
func() stringGetImplementationPackagePath returns the package path of the currently active implementation. Returns: - packagePath: package path of the active implementation
- OID
- 05efe5…55e4:89
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 value
- OID
- 05efe5…55e4:90
NewVotingInfo details
DefaultVotingInfo
func() governance.VotingInfoDefaultVotingInfo creates an empty voting information value. Returns: - VotingInfo: zero-valued voting record with no available weight and no vote recorded
- OID
- 05efe5…55e4:92
DefaultVotingInfo details
NewVotedVotingInfo
func(availableVoteWeight int64, votedYes bool, votedWeight int64, votedHeight int64, votedAt int64) governance.VotingInfoNewVotedVotingInfo creates a voting information value with a recorded vote. Parameters: - availableVoteWeight: total voting weight available to the user for this proposal - votedYes: true when the recorded vote is yes, false when it is no - votedWeight: voting weight applied to the recorded vote - votedHeight: block height at which the vote was recorded - votedAt: Unix timestamp at which the vote was recorded Returns: - VotingInfo: voting record populated with the supplied weight, choice, height, and timestamp and marked as voted
- OID
- 05efe5…55e4:93