assertCallerIsProposer
func(gv *v1.governanceV1, proposalID int64, caller .uverse.address)assertCallerIsProposer panics if the caller is not the proposer of the given proposal.
- OID
- 0db2d2…952d:3
assertCallerIsProposer details
assertIsValidSmoothingPeriod
func(smoothingPeriod int64)- OID
- 0db2d2…952d:5
assertIsValidSmoothingPeriod details
assertIsValidToken
func(tokenPath string)- OID
- 0db2d2…952d:6
assertIsValidToken details
makeConfig
func(votingStartDelay int64, votingPeriod int64, votingWeightSmoothingDuration int64, quorum int64, proposalCreationThreshold int64, executionDelay int64, executionWindow int64) governance.ConfigmakeConfig creates a new governance configuration.
- OID
- 0db2d2…952d:7
makeConfig details
parameterSeparator
untyped stringValue
"*EXE*"
messageSeparator
untyped stringValue
"*GOV*"
maxTitleLength
untyped bigintValue
(255 <untyped> bigint)
maxDescriptionLength
untyped bigintValue
(10000 <untyped> bigint)
maxNumberOfExecution
untyped bigintValue
(10 <untyped> bigint)
maxSmoothingPeriod
untyped bigint// 30 days
Value
(2592000 <untyped> bigint)
errInvalidInput
untyped stringValue
"[GNOSWAP-GOVERNANCE-001] invalid input"
errDataNotFound
untyped stringValue
"[GNOSWAP-GOVERNANCE-002] requested data not found"
errNotEnoughBalance
untyped stringValue
"[GNOSWAP-GOVERNANCE-003] not enough balance"
errAlreadyVoted
untyped stringValue
"[GNOSWAP-GOVERNANCE-004] cannot vote twice"
errNotEnoughVotingWeight
untyped stringValue
"[GNOSWAP-GOVERNANCE-005] not enough voting power"
errAlreadyCanceledProposal
untyped stringValue
"[GNOSWAP-GOVERNANCE-006] cannot cancel already canceled proposal"
errUnableToCancelVotingProposal
untyped stringValue
"[GNOSWAP-GOVERNANCE-007] unable to cancel voting proposal"
errTextProposalNotExecutable
untyped stringValue
"[GNOSWAP-GOVERNANCE-008] cannot execute text proposal"
errUnableToVoteOutOfPeriod
untyped stringValue
"[GNOSWAP-GOVERNANCE-009] unable to vote out of voting period"
errInvalidMessageFormat
untyped stringValue
"[GNOSWAP-GOVERNANCE-010] invalid message format"
errAlreadyActiveProposal
untyped stringValue
"[GNOSWAP-GOVERNANCE-011] already active proposal"
errProposalNotFound
untyped stringValue
"[GNOSWAP-GOVERNANCE-012] proposal not found"
errProposalNotExecutable
untyped stringValue
"[GNOSWAP-GOVERNANCE-013] proposal not executable"
errNotProposer
untyped stringValue
"[GNOSWAP-GOVERNANCE-014] not proposer"
errInvalidConfiguration
untyped stringValue
"[GNOSWAP-GOVERNANCE-015] invalid configuration"
errInvalidExecution
untyped stringValue
"[GNOSWAP-GOVERNANCE-016] invalid execution: handler not found"
errInvalidSmoothingPeriod
untyped stringValue
"[GNOSWAP-GOVERNANCE-017] invalid smoothing period"
errSpoofedRealm
untyped stringValue
"[GNOSWAP-GOVERNANCE-018] spoofed realm: captured cur no longer matches live frame"
makeErrorWithDetails
func(message string, detail string) .uverse.errormakeErrorWithDetails creates an error with additional context.
- OID
- 0db2d2…952d:9
makeErrorWithDetails details
executeCommunityPoolSpend
func(int, rlm .uverse.realm, proposal *governance.Proposal, parameterRegistry *v1.ParameterRegistry, executedAt int64, executedHeight int64, executedBy .uverse.address) .uverse.errorexecuteCommunityPoolSpend executes community pool spending proposals. Handles token transfers from community pool to specified recipients.
- OID
- 0db2d2…952d:11
executeCommunityPoolSpend details
executeParameterChange
func(int, rlm .uverse.realm, proposal *governance.Proposal, parameterRegistry *v1.ParameterRegistry, executedAt int64, executedHeight int64, executedBy .uverse.address) .uverse.errorexecuteParameterChange executes parameter change proposals. Handles governance configuration updates and system parameter modifications.
- OID
- 0db2d2…952d:13
executeParameterChange details
init.31
func()- OID
- 0db2d2…952d:14
init.31 details
registerGovernanceV1
func()- OID
- 0db2d2…952d:16
registerGovernanceV1 details
initStoreData
func(int, rlm .uverse.realm, governanceStore governance.IGovernanceStore) .uverse.error- OID
- 0db2d2…952d:17
initStoreData details
formatConfigKey
func(version int64) string- OID
- 0db2d2…952d:18
formatConfigKey details
governanceV1
typeValue
v1.governanceV1
NewGovernanceV1
func(governanceStore governance.IGovernanceStore, stakerAccessor governance.GovStakerAccessor) governance.IGovernance- OID
- 0db2d2…952d:19
NewGovernanceV1 details
globalParameterRegistry
*v1.ParameterRegistryglobalParameterRegistry is initialized once and reused for all validation and execution. This provides consistent validation at proposal creation time and execution time.
- OID
- 0db2d2…952d:82
globalParameterRegistry details
init.38
func()- OID
- 0db2d2…952d:22
init.38 details
GNS_TOKEN_KEY
untyped stringPackage paths
Value
"gno.land/r/gnoswap/gns.GNS"
HALT_PATH
untyped stringPackage paths
Value
"gno.land/r/gnoswap/halt"
RBAC_PATH
untyped stringPackage paths
Value
"gno.land/r/gnoswap/rbac"
ACCESS_PATH
untyped stringPackage paths
Value
"gno.land/r/gnoswap/access"
EMISSION_PATH
untyped stringPackage paths
Value
"gno.land/r/gnoswap/emission"
COMMON_PATH
untyped stringPackage paths
Value
"gno.land/r/gnoswap/common"
POOL_PATH
untyped stringPackage paths
Value
"gno.land/r/gnoswap/pool"
POSITION_PATH
untyped stringPackage paths
Value
"gno.land/r/gnoswap/position"
ROUTER_PATH
untyped stringPackage paths
Value
"gno.land/r/gnoswap/router"
STAKER_PATH
untyped stringPackage paths
Value
"gno.land/r/gnoswap/staker"
LAUNCHPAD_PATH
untyped stringPackage paths
Value
"gno.land/r/gnoswap/launchpad"
PROTOCOL_FEE_PATH
untyped stringPackage paths
Value
"gno.land/r/gnoswap/protocol_fee"
COMMUNITY_POOL_PATH
untyped stringPackage paths
Value
"gno.land/r/gnoswap/community_pool"
GOV_GOVERNANCE_PATH
untyped stringPackage paths
Value
"gno.land/r/gnoswap/gov/governance"
GOV_STAKER_PATH
untyped stringPackage paths
Value
"gno.land/r/gnoswap/gov/staker"
ParameterHandler
typeParameterHandler interface defines the contract for parameter execution handlers. Each handler is responsible for executing specific parameter changes in the system.
Value
v1.ParameterHandler
ParameterHandlerOptions
typeParameterHandlerOptions contains the configuration and execution logic for a parameter handler. This struct encapsulates all information needed to identify and execute a parameter change. NOTE: handlerFunc uses \`rlm realm\` (rather than \`cur realm\`) as the realm parameter name. The v2 preprocessor reserves the \`cur\` name for the first realm-type parameter of top-level crossing function declarations and \`t.Run\` closures only; using it as the realm-parameter name on a multi-parameter struct-field function value trips a parser check ("only the first realm type argument of a crossing function may have name \`cur\`"). Naming it \`rlm\` keeps the lowering identical without the syntax constraint.
Value
v1.ParameterHandlerOptions
paramValidator
typeparamValidator validates a single parameter value and returns an error on failure.
Value
v1.paramValidator
NewParameterHandlerOptions
func(pkgPath string, function string, paramCount int, handlerFunc func(...), paramValidators []v1.paramValidator) v1.ParameterHandlerNewParameterHandlerOptions creates a new parameter handler with the specified configuration. Parameters: - pkgPath: package path of the target contract - function: function name to be called - paramCount: expected number of parameters - handlerFunc: function that executes the parameter change - paramValidators: optional validators for each parameter (must match paramCount if provided) Returns: - ParameterHandler: configured parameter handler interface
- OID
- 0db2d2…952d:24
NewParameterHandlerOptions details
ParameterRegistry
typeParameterRegistry manages the collection of parameter handlers for governance execution. This registry allows proposals to execute parameter changes across different system contracts.
Value
v1.ParameterRegistry
NewParameterRegistry
func() *v1.ParameterRegistryNewParameterRegistry creates a new empty parameter registry. Returns: - \*ParameterRegistry: new registry instance
- OID
- 0db2d2…952d:25
NewParameterRegistry details
makeHandlerKey
func(pkgPath string, function string) stringmakeHandlerKey creates a unique identifier for a handler based on package path and function. Parameters: - pkgPath: package path of the target contract - function: function name to be called Returns: - string: unique key in format "pkgPath:function"
- OID
- 0db2d2…952d:26
makeHandlerKey details
CreateParameterHandlers
func() *v1.ParameterRegistrycreateParameterHandlers initializes and configures all supported parameter handlers. This function defines all the parameter changes that can be executed through governance proposals. It covers configuration changes for various system components including pools, staking, fees, etc. Returns: - \*ParameterRegistry: fully configured registry with all supported handlers
- OID
- 0db2d2…952d:27
CreateParameterHandlers details
registerHandlers
func(registry *v1.ParameterRegistry, handlerOptions []*v1.ParameterHandlerOptions)registerHandlers batch registers all configured handlers into the registry. This helper function processes the handler configuration array and adds each handler to the registry. Parameters: - registry: the parameter registry to add handlers to - handlerOptions: slice of handler configurations to register
- OID
- 0db2d2…952d:28
registerHandlers details
runValidator
func(fn func(...)) err .uverse.errorrunValidator executes a validator function and converts panics to errors.
- OID
- 0db2d2…952d:29
runValidator details
stringValidator
func(s string) .uverse.errorBasic reusable validators for proposal-time type checking.
- OID
- 0db2d2…952d:31
stringValidator details
boolValidator
func(s string) .uverse.errorBasic reusable validators for proposal-time type checking.
- OID
- 0db2d2…952d:33
boolValidator details
uint64Validator
func(s string) .uverse.errorBasic reusable validators for proposal-time type checking.
- OID
- 0db2d2…952d:35
uint64Validator details
addressValidator
func(s string) .uverse.errorBasic reusable validators for proposal-time type checking.
- OID
- 0db2d2…952d:37
addressValidator details
numberValidator
func(kind v1.numberKind) v1.paramValidator- OID
- 0db2d2…952d:38
numberValidator details
uint8RangeValidator
func(name string) v1.paramValidator- OID
- 0db2d2…952d:39
uint8RangeValidator details
roleNameValidator
func(s string) .uverse.error- OID
- 0db2d2…952d:40
roleNameValidator details
updatableRoleNameValidator
func(s string) .uverse.error- OID
- 0db2d2…952d:41
updatableRoleNameValidator details
removableRoleNameValidator
func(s string) .uverse.error- OID
- 0db2d2…952d:42
removableRoleNameValidator details
nonNegativeInt64Validator
func(name string) v1.paramValidator- OID
- 0db2d2…952d:43
nonNegativeInt64Validator details
splitExecutionsRaw
func(executions string) []string- OID
- 0db2d2…952d:44
splitExecutionsRaw details
parseExecutionMessage
func(msg string) (pkgPath string, function string, params []string, partCount int)- OID
- 0db2d2…952d:45
parseExecutionMessage details
validateExecutions
func(numToExecute int64, msgs []string) .uverse.errorvalidateExecutions validates that all executions in a parameter change proposal correspond to registered handlers in the global parameter registry. This function performs comprehensive validation including: - Basic format validation (count, structure) - Handler existence verification in the registry - Parameter count validation against handler expectations Parameters: - numToExecute: number of parameter changes to execute - msgs: pre-split slice of execution messages, where each message is formatted as \<pkgPath>\*EXE\*\<function>\*EXE\*\<params> Returns: - error: validation error if any execution is invalid
- OID
- 0db2d2…952d:46
validateExecutions details
ProposalResolver
typeValue
v1.ProposalResolver
NewProposalResolver
func(proposal *governance.Proposal) *v1.ProposalResolver- OID
- 0db2d2…952d:47
NewProposalResolver details
ProposalActionStatusResolver
typeValue
v1.ProposalActionStatusResolver
NewProposalActionStatusResolver
func(status *governance.ProposalActionStatus) *v1.ProposalActionStatusResolver- OID
- 0db2d2…952d:49
NewProposalActionStatusResolver details
ProposalMetadataResolver
typeValue
v1.ProposalMetadataResolver
NewProposalMetadataResolver
func(metadata *governance.ProposalMetadata) *v1.ProposalMetadataResolver- OID
- 0db2d2…952d:51
NewProposalMetadataResolver details
ProposalDataResolver
typeProposalDataResolver handles business logic for proposal data.
Value
v1.ProposalDataResolver
NewProposalDataResolver
func(proposalData *governance.ProposalData) *v1.ProposalDataResolver- OID
- 0db2d2…952d:53
NewProposalDataResolver details
NewProposalTextData
func() *governance.ProposalDataNewProposalTextData creates proposal data for a text proposal. Text proposals have no additional data requirements. Returns: - \*ProposalData: proposal data configured for text proposal
- OID
- 0db2d2…952d:54
NewProposalTextData details
NewProposalCommunityPoolSpendData
func(tokenPath string, to .uverse.address, amount int64, communityPoolPackagePath string) *governance.ProposalDataNewProposalCommunityPoolSpendData creates proposal data for a community pool spend proposal. Automatically generates the execution message for the token transfer. Parameters: - tokenPath: path of the token to transfer - to: recipient address for the transfer - amount: amount of tokens to transfer - communityPoolPackagePath: package path of the community pool contract Returns: - \*ProposalData: proposal data configured for community pool spending
- OID
- 0db2d2…952d:55
NewProposalCommunityPoolSpendData details
NewProposalExecutionData
func(numToExecute int64, executions string) *governance.ProposalDataNewProposalExecutionData creates proposal data for a parameter change proposal. Each message in executions should be formatted as \<pkgPath>\*EXE\*\<function>\*EXE\*\<params>, separated by \*GOV\* when there are multiple messages. Parameters: - numToExecute: number of parameter changes to execute - executions: raw encoded execution string with parameter changes Returns: - \*ProposalData: proposal data configured for parameter changes
- OID
- 0db2d2…952d:56
NewProposalExecutionData details
makeExecuteMessage
func(pkgPath string, function string, params []string) stringmakeExecuteMessage creates a message to execute a function. Message format: \<pkgPath>\*EXE\*\<function>\*EXE\*\<params>.
- OID
- 0db2d2…952d:57
makeExecuteMessage details
ProposalScheduleStatusResolver
typeValue
v1.ProposalScheduleStatusResolver
NewProposalScheduleStatusResolver
func(status *governance.ProposalScheduleStatus) *v1.ProposalScheduleStatusResolver- OID
- 0db2d2…952d:58
NewProposalScheduleStatusResolver details
NewProposalScheduleStatus
func(votingStartDelay int64, votingPeriod int64, executionDelay int64, executionWindow int64, createdAt int64) *governance.ProposalScheduleStatusNewProposalScheduleStatus creates a new schedule status with calculated timestamps. This constructor takes the governance timing parameters and calculates all important timestamps for the proposal's lifecycle. Parameters: - votingStartDelay: delay before voting starts (seconds) - votingPeriod: duration of voting period (seconds) - executionDelay: delay before execution can start (seconds) - executionWindow: window during which execution is allowed (seconds) - createdAt: timestamp when proposal was created Returns: - \*ProposalScheduleStatus: new schedule status with calculated times
- OID
- 0db2d2…952d:60
NewProposalScheduleStatus details
ProposalStatusResolver
typeValue
v1.ProposalStatusResolver
NewProposalStatusResolver
func(status *governance.ProposalStatus) *v1.ProposalStatusResolver- OID
- 0db2d2…952d:61
NewProposalStatusResolver details
NewProposalStatus
func(config governance.Config, maxVotingWeight int64, executable bool, createdAt int64, quorumWeight int64) *governance.ProposalStatusNewProposalStatus creates a new proposal status with the specified configuration. This initializes all status components with the governance configuration and timing. Parameters: - config: governance configuration to use - maxVotingWeight: maximum voting weight for this proposal - executable: whether this proposal type can be executed - createdAt: timestamp when proposal was created Returns: - \*ProposalStatus: new proposal status instance
- OID
- 0db2d2…952d:63
NewProposalStatus details
ProposalVoteStatusResolver
typeValue
v1.ProposalVoteStatusResolver
NewProposalVoteStatusResolver
func(voteStatus *governance.ProposalVoteStatus) *v1.ProposalVoteStatusResolver- OID
- 0db2d2…952d:64
NewProposalVoteStatusResolver details
numberKind
typenumberKind represents the type of number to parse.
Value
v1.numberKind
kindInt
v1.numberKindValue
<zero>
kindInt64
v1.numberKindValue
<zero>
kindUint64
v1.numberKindValue
<zero>
parseNumber
func(s string, kind v1.numberKind) interface{...}parseNumber parses a string to a number (int, int64, or uint64) with proper validation.
- OID
- 0db2d2…952d:66
parseNumber details
parseBool
func(s string) boolparseBool parses a string to a boolean.
- OID
- 0db2d2…952d:68
parseBool details
parseInt
func(s string) intparseInt parses a string to int with proper validation and overflow checking.
- OID
- 0db2d2…952d:69
parseInt details
parseInt64
func(s string) int64parseInt64 parses a string to int64 with proper validation.
- OID
- 0db2d2…952d:70
parseInt64 details
parseUint64
func(s string) uint64parseUint64 parses a string to uint64 with proper validation.
- OID
- 0db2d2…952d:71
parseUint64 details
VotingInfoResolver
typeValue
v1.VotingInfoResolver
NewVotingInfoResolver
func(votingInfo *governance.VotingInfo) *v1.VotingInfoResolver- OID
- 0db2d2…952d:72