Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

governance state

Back to all declarations

govStakerAccessor

type

Value

governance.govStakerAccessor

newGovStakerAccessor

func() governance.GovStakerAccessor
Open
OID
05efe5…55e4:3
newGovStakerAccessor details

Inspect func

Config

type

Config 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.Config

NewConfig 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

Open
OID
05efe5…55e4:5
NewConfig details

Inspect func

NewConfigPtr

func(votingStartDelay int64, votingPeriod int64, votingWeightSmoothingDuration int64, quorum int64, proposalCreationThreshold int64, executionDelay int64, executionWindow int64) *governance.Config

NewConfigPtr 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

Open
OID
05efe5…55e4:7
NewConfigPtr details

Inspect func

NewDefaultConfig

func() governance.Config

NewDefaultConfig 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

Open
OID
05efe5…55e4:8
NewDefaultConfig details

Inspect func

NewConfigTree

func() *v0.BPTree

NewConfigTree creates an empty BPTree used to index configuration values by their encoded int64 version. Returns: - \*bptree.BPTree: empty configuration index tree

Open
OID
05efe5…55e4:9
NewConfigTree details

Inspect func

Counter

type

Counter manages unique incrementing IDs.

Value

governance.Counter

NewCounter

func() *governance.Counter

NewCounter creates a new Counter whose current ID is initialized to zero. Returns: - \*Counter: counter initialized with current ID 0

Open
OID
05efe5…55e4:10
NewCounter details

Inspect func

GetLatestConfigVersion

func() int64

GetLatestConfigVersion returns the current governance configuration version. Returns: - int64: latest configuration version stored by governance

Open
OID
05efe5…55e4:12
GetLatestConfigVersion details

Inspect func

GetCurrentProposalID

func() int64

GetCurrentProposalID returns the current proposal ID counter. Returns: - int64: current proposal ID counter used for newly created proposals

Open
OID
05efe5…55e4:14
GetCurrentProposalID details

Inspect func

GetMaxSmoothingPeriod

func() int64

GetMaxSmoothingPeriod returns the maximum smoothing period for delegation history cleanup. Returns: - int64: maximum permitted smoothing period in seconds

Open
OID
05efe5…55e4:15
GetMaxSmoothingPeriod details

Inspect func

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

Open
OID
05efe5…55e4:16
GetLatestConfig details

Inspect func

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

Open
OID
05efe5…55e4:17
GetConfig details

Inspect func

GetProposals

func() *v0.ReadOnlyTree

GetProposals retrieves the persisted proposals tree. Storage or type-cast failures panic. Returns: - \*bptree.BPTree: tree containing proposals keyed by formatted proposal ID

Open
OID
05efe5…55e4:18
GetProposals details

Inspect func

ExistsProposal

func(proposalID int64) bool

ExistsProposal checks whether a proposal is stored. Parameters: - proposalID: proposal identifier to look up Returns: - bool: true when proposalID is stored, otherwise false

Open
OID
05efe5…55e4:19
ExistsProposal details

Inspect func

GetProposerByProposalId

func(proposalId int64) (.uverse.address, .uverse.error)
Open
OID
05efe5…55e4:20
GetProposerByProposalId details

Inspect func

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

Open
OID
05efe5…55e4:21
GetProposalTypeByProposalId details

Inspect func

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

Open
OID
05efe5…55e4:22
GetYeaByProposalId details

Inspect func

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

Open
OID
05efe5…55e4:23
GetNayByProposalId details

Inspect func

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

Open
OID
05efe5…55e4:24
GetConfigVersionByProposalId details

Inspect func

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

Open
OID
05efe5…55e4:25
GetQuorumAmountByProposalId details

Inspect func

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

Open
OID
05efe5…55e4:26
GetTitleByProposalId details

Inspect func

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

Open
OID
05efe5…55e4:27
GetDescriptionByProposalId details

Inspect func

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

Open
OID
05efe5…55e4:28
GetProposalStatusByProposalId details

Inspect func

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

Open
OID
05efe5…55e4:29
GetProposalCreatedAt details

Inspect func

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

Open
OID
05efe5…55e4:30
GetProposalCreatedHeight details

Inspect func

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

Open
OID
05efe5…55e4:31
GetVoteStatus details

Inspect func

GetVotingInfos

func(proposalID int64) *v0.ReadOnlyTree

GetVotingInfos 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

Open
OID
05efe5…55e4:32
GetVotingInfos details

Inspect func

ExistsVotingInfo

func(proposalID int64, addr .uverse.address) bool

ExistsVotingInfo 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

Open
OID
05efe5…55e4:33
ExistsVotingInfo details

Inspect func

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

Open
OID
05efe5…55e4:34
GetVoteWeight details

Inspect func

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

Open
OID
05efe5…55e4:35
GetVotedHeight details

Inspect func

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

Open
OID
05efe5…55e4:36
GetVotedAt details

Inspect func

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

Open
OID
05efe5…55e4:37
GetProposalCommunityPoolSpendInfo details

Inspect func

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

Open
OID
05efe5…55e4:38
GetProposalExecutionInfo details

Inspect func

GetUserProposals

func() *v0.ReadOnlyTree

GetUserProposals retrieves the persisted user-to-proposals index. Storage or type-cast failures panic. Returns: - \*bptree.BPTree: tree mapping user strings to proposal ID slices

Open
OID
05efe5…55e4:39
GetUserProposals details

Inspect func

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

Open
OID
05efe5…55e4:40
GetOldestActiveProposalSnapshotTime details

Inspect func

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

Open
OID
05efe5…55e4:41
GetCurrentVotingWeightSnapshot details

Inspect func

Proposal

type

Proposal 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.Proposal

NewProposal 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

Open
OID
05efe5…55e4:42
NewProposal details

Inspect func

NewProposalTree

func() *v0.BPTree

NewProposalTree creates an empty B+ tree for proposals keyed by proposal ID. Returns: - \*bptree.BPTree: empty 16-way proposal tree

Open
OID
05efe5…55e4:44
NewProposalTree details

Inspect func

NewUserProposalTree

func() *v0.BPTree

NewUserProposalTree creates an empty B+ tree mapping users to proposal IDs. Returns: - \*bptree.BPTree: empty 16-way user-proposal index tree

Open
OID
05efe5…55e4:45
NewUserProposalTree details

Inspect func

NewVotingInfoTree

func() *v0.BPTree

NewVotingInfoTree creates an empty B+ tree for per-user voting information. Returns: - \*bptree.BPTree: empty 16-way voting-information tree

Open
OID
05efe5…55e4:46
NewVotingInfoTree details

Inspect func

NewProposalUserVotingInfoTree

func() *v0.BPTree

NewProposalUserVotingInfoTree 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

Open
OID
05efe5…55e4:47
NewProposalUserVotingInfoTree details

Inspect func

ProposalActionStatus

type

ProposalActionStatus 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.ProposalActionStatus

NewProposalActionStatus 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

Open
OID
05efe5…55e4:48
NewProposalActionStatus details

Inspect func

ProposalMetadata

type

ProposalMetadata 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.ProposalMetadata

NewProposalMetadata creates a new proposal metadata instance with trimmed input. Parameters: - title: proposal title - description: proposal description Returns: - \*ProposalMetadata: new metadata instance with trimmed whitespace

Open
OID
05efe5…55e4:50
NewProposalMetadata details

Inspect func

ProposalData

type

ProposalData 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.ProposalData

NewProposalData 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

Open
OID
05efe5…55e4:52
NewProposalData details

Inspect func

CommunityPoolSpendInfo

type

CommunityPoolSpendInfo contains information for community pool spending proposals.

Value

governance.CommunityPoolSpendInfo

NewCommunityPoolSpendInfo

func(to .uverse.address, tokenPath string, amount int64) *governance.CommunityPoolSpendInfo

NewCommunityPoolSpendInfo 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.

Open
OID
05efe5…55e4:53
NewCommunityPoolSpendInfo details

Inspect func

ExecutionInfo

type

ExecutionInfo 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

NewExecutionInfo 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.

Open
OID
05efe5…55e4:54
NewExecutionInfo details

Inspect func

ParameterChangeInfo

type

ParameterChangeInfo represents a single parameter change to be executed.

Value

governance.ParameterChangeInfo

NewParameterChangeInfo

func(pkgPath string, function string, params []string) governance.ParameterChangeInfo

NewParameterChangeInfo 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.

Open
OID
05efe5…55e4:55
NewParameterChangeInfo details

Inspect func

ProposalScheduleStatus

type

ProposalScheduleStatus 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

NewProposalScheduleStatus 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

Open
OID
05efe5…55e4:56
NewProposalScheduleStatus details

Inspect func

ProposalStatusType

type

ProposalStatusType 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

type

ProposalStatus 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

NewProposalStatusBy 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

Open
OID
05efe5…55e4:58
NewProposalStatusBy details

Inspect func

ProposalType

type

ProposalType 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.ProposalType

CommunityPoolSpend 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

type

ProposalVoteStatus 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.ProposalVoteStatus

NewProposalVoteStatus 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

Open
OID
05efe5…55e4:60
NewProposalVoteStatus details

Inspect func

ProposeText

func(title string, description string) int64

ProposeText 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.

Open
OID
05efe5…55e4:62
ProposeText details

Inspect func

ProposeCommunityPoolSpend

func(title string, description string, to .uverse.address, tokenPath string, amount int64) int64

ProposeCommunityPoolSpend 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.

Open
OID
05efe5…55e4:64
ProposeCommunityPoolSpend details

Inspect func

ProposeParameterChange

func(title string, description string, numToExecute int64, executions string) int64

ProposeParameterChange 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.

Open
OID
05efe5…55e4:65
ProposeParameterChange details

Inspect func

Vote

func(proposalId int64, yes bool) string

Vote 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.

Open
OID
05efe5…55e4:66
Vote details

Inspect func

Execute

func(proposalId int64) int64

Execute 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.

Open
OID
05efe5…55e4:67
Execute details

Inspect func

Cancel

func(proposalId int64) int64

Cancel 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.

Open
OID
05efe5…55e4:68
Cancel details

Inspect func

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.

Open
OID
05efe5…55e4:69
RemoveInactiveProposalFromIndex details

Inspect func

Reconfigure

func(votingStartDelay int64, votingPeriod int64, votingWeightSmoothingDuration int64, quorum int64, proposalCreationThreshold int64, executionDelay int64, executionWindow int64) int64

Reconfigure 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.

Open
OID
05efe5…55e4:70
Reconfigure details

Inspect func

Render

func(path string) string

Render delegates web rendering to the active implementation.

Open
OID
05efe5…55e4:71
Render details

Inspect func

ErrSpoofedRealm

untyped string

Value

"rlm does not match the current crossing frame"

currentAddress

.uverse.address

Value

<gnolang.StringValue>

domainPath

string

Value

"gno.land/r/gnoswap/gov/governance"

initializeDomainStore

func(int, rlm .uverse.realm, kvStore v1.KVStore) interface{...}
Open
OID
05efe5…55e4:80
initializeDomainStore details

Inspect func

getImplementation

func() governance.IGovernance
Open
OID
05efe5…55e4:81
getImplementation details

Inspect func

updateImplementation

func() .uverse.error
Open
OID
05efe5…55e4:82
updateImplementation details

Inspect func

StoreKey

type

Value

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.StoreKey

Value

<gnolang.StringValue>

StoreKeyProposalUserVotingInfos

governance.StoreKey

// Proposal voting infos BPTree

Value

<gnolang.StringValue>

StoreKeyUserProposals

governance.StoreKey

// User proposals mapping BPTree

Value

<gnolang.StringValue>

governanceStore

type

Value

governance.governanceStore

NewGovernanceStore

func(kvStore v1.KVStore) governance.IGovernanceStore

NewGovernanceStore 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

Open
OID
05efe5…55e4:83
NewGovernanceStore details

Inspect func

formatInt64Key

func(id int64) string

formatInt64Key formats int64 identifiers for storage keys.

Open
OID
05efe5…55e4:85
formatInt64Key details

Inspect func

IGovernance

type

Value

governance.IGovernance

IGovernanceManager

type

Value

governance.IGovernanceManager

IGovernanceGetter

type

IGovernanceGetter provides read-only access to governance data.

Value

governance.IGovernanceGetter

IGovernanceStore

type

Value

governance.IGovernanceStore

GovStakerAccessor

type

GovStakerAccessor 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.

Open
OID
05efe5…55e4:86
RegisterInitializer details

Inspect func

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.

Open
OID
05efe5…55e4:88
UpgradeImpl details

Inspect func

GetImplementationPackagePath

func() string

GetImplementationPackagePath returns the package path of the currently active implementation. Returns: - packagePath: package path of the active implementation

Open
OID
05efe5…55e4:89
GetImplementationPackagePath details

Inspect func

VotingInfo

type

VotingInfo 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.VotingInfo

NewVotingInfo 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

Open
OID
05efe5…55e4:90
NewVotingInfo details

Inspect func

DefaultVotingInfo

func() governance.VotingInfo

DefaultVotingInfo creates an empty voting information value. Returns: - VotingInfo: zero-valued voting record with no available weight and no vote recorded

Open
OID
05efe5…55e4:92
DefaultVotingInfo details

Inspect func

NewVotedVotingInfo

func(availableVoteWeight int64, votedYes bool, votedWeight int64, votedHeight int64, votedAt int64) governance.VotingInfo

NewVotedVotingInfo 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

Open
OID
05efe5…55e4:93
NewVotedVotingInfo details

Inspect func
govStakerAccessor : type =governance.govStakerAccessor
newGovStakerAccessor : func() governance.GovStakerAccessor Inspect
Config : type =governance.Config
NewConfig : func(votingStartDelay int64, votingPeriod int64, votingWeightSmoothingDuration int64, quorum int64, proposalCreationThreshold int64, executionDelay int64, executionWindow int64) governance.Config Inspect
NewConfigPtr : func(votingStartDelay int64, votingPeriod int64, votingWeightSmoothingDuration int64, quorum int64, proposalCreationThreshold int64, executionDelay int64, executionWindow int64) *governance.Config Inspect
NewDefaultConfig : func() governance.Config Inspect
NewConfigTree : func() *v0.BPTree Inspect
Counter : type =governance.Counter
NewCounter : func() *governance.Counter Inspect
GetLatestConfigVersion : func() int64 Inspect
GetCurrentProposalID : func() int64 Inspect
GetMaxSmoothingPeriod : func() int64 Inspect
GetLatestConfig : func() (governance.Config, .uverse.error) Inspect
GetConfig : func(configVersion int64) (governance.Config, .uverse.error) Inspect
GetProposals : func() *v0.ReadOnlyTree Inspect
ExistsProposal : func(proposalID int64) bool Inspect
GetProposerByProposalId : func(proposalId int64) (.uverse.address, .uverse.error) Inspect
GetProposalTypeByProposalId : func(proposalId int64) (governance.ProposalType, .uverse.error) Inspect
GetYeaByProposalId : func(proposalId int64) (int64, .uverse.error) Inspect
GetNayByProposalId : func(proposalId int64) (int64, .uverse.error) Inspect
GetConfigVersionByProposalId : func(proposalId int64) (int64, .uverse.error) Inspect
GetQuorumAmountByProposalId : func(proposalId int64) (int64, .uverse.error) Inspect
GetTitleByProposalId : func(proposalId int64) (string, .uverse.error) Inspect
GetDescriptionByProposalId : func(proposalId int64) (string, .uverse.error) Inspect
GetProposalStatusByProposalId : func(proposalId int64) (string, .uverse.error) Inspect
GetProposalCreatedAt : func(proposalId int64) (int64, .uverse.error) Inspect
GetProposalCreatedHeight : func(proposalId int64) (int64, .uverse.error) Inspect
GetVoteStatus : func(proposalId int64) (quorum int64, maxVotingWeight int64, yesWeight int64, noWeight int64, err .uverse.error) Inspect
GetVotingInfos : func(proposalID int64) *v0.ReadOnlyTree Inspect
ExistsVotingInfo : func(proposalID int64, addr .uverse.address) bool Inspect
GetVoteWeight : func(proposalID int64, addr .uverse.address) (int64, .uverse.error) Inspect
GetVotedHeight : func(proposalID int64, addr .uverse.address) (int64, .uverse.error) Inspect
GetVotedAt : func(proposalID int64, addr .uverse.address) (int64, .uverse.error) Inspect
GetProposalCommunityPoolSpendInfo : func(proposalID int64) (*governance.CommunityPoolSpendInfo, .uverse.error) Inspect
GetProposalExecutionInfo : func(proposalID int64) (*governance.ExecutionInfo, .uverse.error) Inspect
GetUserProposals : func() *v0.ReadOnlyTree Inspect
GetOldestActiveProposalSnapshotTime : func() (int64, bool, .uverse.error) Inspect
GetCurrentVotingWeightSnapshot : func() (int64, int64, .uverse.error) Inspect
Proposal : type =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.Proposal Inspect
NewProposalTree : func() *v0.BPTree Inspect
NewUserProposalTree : func() *v0.BPTree Inspect
NewVotingInfoTree : func() *v0.BPTree Inspect
NewProposalUserVotingInfoTree : func() *v0.BPTree Inspect
ProposalActionStatus : type =governance.ProposalActionStatus
NewProposalActionStatus : func(executable bool) *governance.ProposalActionStatus Inspect
ProposalMetadata : type =governance.ProposalMetadata
NewProposalMetadata : func(title string, description string) *governance.ProposalMetadata Inspect
ProposalData : type =governance.ProposalData
NewProposalData : func(proposalType governance.ProposalType, communityPoolSpend *governance.CommunityPoolSpendInfo, execution *governance.ExecutionInfo) *governance.ProposalData Inspect
CommunityPoolSpendInfo : type =governance.CommunityPoolSpendInfo
NewCommunityPoolSpendInfo : func(to .uverse.address, tokenPath string, amount int64) *governance.CommunityPoolSpendInfo Inspect
ExecutionInfo : type =governance.ExecutionInfo
NewExecutionInfo : func(num int64, msgs []string) *governance.ExecutionInfo Inspect
ParameterChangeInfo : type =governance.ParameterChangeInfo
NewParameterChangeInfo : func(pkgPath string, function string, params []string) governance.ParameterChangeInfo Inspect
ProposalScheduleStatus : type =governance.ProposalScheduleStatus
NewProposalScheduleStatus : func(createTime int64, activeTime int64, votingEndTime int64, executableTime int64, expiredTime int64) *governance.ProposalScheduleStatus Inspect
ProposalStatusType : type =governance.ProposalStatusType
StatusUpcoming : governance.ProposalStatusType =<zero>
StatusActive : governance.ProposalStatusType =<zero>
StatusPassed : governance.ProposalStatusType =<zero>
StatusRejected : governance.ProposalStatusType =<zero>
StatusExecutable : governance.ProposalStatusType =<zero>
StatusExecuted : governance.ProposalStatusType =<zero>
StatusExpired : governance.ProposalStatusType =<zero>
StatusCanceled : governance.ProposalStatusType =<zero>
ProposalStatus : type =governance.ProposalStatus
NewProposalStatusBy : func(schedule *governance.ProposalScheduleStatus, actionStatus *governance.ProposalActionStatus, voteStatus *governance.ProposalVoteStatus) *governance.ProposalStatus Inspect
ProposalType : type =governance.ProposalType
Text : governance.ProposalType =<gnolang.StringValue>
CommunityPoolSpend : governance.ProposalType =<gnolang.StringValue>
ParameterChange : governance.ProposalType =<gnolang.StringValue>
ProposalVoteStatus : type =governance.ProposalVoteStatus
NewProposalVoteStatus : func(maxVotingWeight int64, quorumAmount int64) *governance.ProposalVoteStatus Inspect
ProposeText : func(title string, description string) int64 Inspect
ProposeCommunityPoolSpend : func(title string, description string, to .uverse.address, tokenPath string, amount int64) int64 Inspect
ProposeParameterChange : func(title string, description string, numToExecute int64, executions string) int64 Inspect
Vote : func(proposalId int64, yes bool) string Inspect
Execute : func(proposalId int64) int64 Inspect
Cancel : func(proposalId int64) int64 Inspect
RemoveInactiveProposalFromIndex : func(proposalID int64) Inspect
Reconfigure : func(votingStartDelay int64, votingPeriod int64, votingWeightSmoothingDuration int64, quorum int64, proposalCreationThreshold int64, executionDelay int64, executionWindow int64) int64 Inspect
Render : func(path string) string Inspect
ErrSpoofedRealm : untyped string ="rlm does not match the current crossing frame"
currentAddress : .uverse.address =<gnolang.StringValue>
domainPath : string ="gno.land/r/gnoswap/gov/governance"
kvStore : *v1.kvStore Inspect
versionManager : *v1.versionManager Inspect
implementation : *v1.governanceV1 Inspect
init.90 : func() Inspect
initializeDomainStore : func(int, rlm .uverse.realm, kvStore v1.KVStore) interface{...} Inspect
getImplementation : func() governance.IGovernance Inspect
updateImplementation : func() .uverse.error Inspect
StoreKey : type =governance.StoreKey
StoreKeyConfigCounter : governance.StoreKey =<gnolang.StringValue>
StoreKeyProposalCounter : governance.StoreKey =<gnolang.StringValue>
StoreKeyConfigs : governance.StoreKey =<gnolang.StringValue>
StoreKeyProposals : governance.StoreKey =<gnolang.StringValue>
StoreKeyActiveProposalsBySnapshot : governance.StoreKey =<gnolang.StringValue>
StoreKeyProposalUserVotingInfos : governance.StoreKey =<gnolang.StringValue>
StoreKeyUserProposals : governance.StoreKey =<gnolang.StringValue>
governanceStore : type =governance.governanceStore
NewGovernanceStore : func(kvStore v1.KVStore) governance.IGovernanceStore Inspect
formatInt64Key : func(id int64) string Inspect
IGovernance : type =governance.IGovernance
IGovernanceManager : type =governance.IGovernanceManager
IGovernanceGetter : type =governance.IGovernanceGetter
IGovernanceStore : type =governance.IGovernanceStore
GovStakerAccessor : type =governance.GovStakerAccessor
RegisterInitializer : func(initializer func(...)) Inspect
UpgradeImpl : func(targetPackagePath string) Inspect
GetImplementationPackagePath : func() string Inspect
VotingInfo : type =governance.VotingInfo
NewVotingInfo : func(availableVoteWeight int64) governance.VotingInfo Inspect
DefaultVotingInfo : func() governance.VotingInfo Inspect
NewVotedVotingInfo : func(availableVoteWeight int64, votedYes bool, votedWeight int64, votedHeight int64, votedAt int64) governance.VotingInfo Inspect