Search Apps Documentation Source Content File Folder Download Copy Actions Download

proxy.gno

3.41 Kb ยท 156 lines
  1package governance
  2
  3// ProposeText creates a new text proposal for general governance decisions.
  4//
  5// Parameters:
  6//   - title: proposal title
  7//   - description: detailed proposal description
  8//
  9// Returns:
 10//   - int64: ID of the created proposal
 11func ProposeText(
 12	cur realm,
 13	title string,
 14	description string,
 15) int64 {
 16	return getImplementation().ProposeText(
 17		title,
 18		description,
 19	)
 20}
 21
 22// ProposeCommunityPoolSpend creates a new community pool spending proposal.
 23//
 24// Parameters:
 25//   - title: proposal title
 26//   - description: detailed proposal description
 27//   - to: recipient address
 28//   - tokenPath: token path to transfer
 29//   - amount: amount to transfer
 30//
 31// Returns:
 32//   - int64: ID of the created proposal
 33func ProposeCommunityPoolSpend(
 34	cur realm,
 35	title string,
 36	description string,
 37	to address,
 38	tokenPath string,
 39	amount int64,
 40) int64 {
 41	return getImplementation().ProposeCommunityPoolSpend(
 42		title,
 43		description,
 44		to,
 45		tokenPath,
 46		amount,
 47	)
 48}
 49
 50// ProposeParameterChange creates a new parameter change proposal.
 51//
 52// Parameters:
 53//   - title: proposal title
 54//   - description: detailed proposal description
 55//   - numToExecute: number of executions to perform
 56//   - executions: encoded execution messages
 57//
 58// Returns:
 59//   - int64: ID of the created proposal
 60func ProposeParameterChange(
 61	cur realm,
 62	title string,
 63	description string,
 64	numToExecute int64,
 65	executions string,
 66) int64 {
 67	return getImplementation().ProposeParameterChange(
 68		title,
 69		description,
 70		numToExecute,
 71		executions,
 72	)
 73}
 74
 75// Vote casts a vote on a proposal.
 76//
 77// Parameters:
 78//   - proposalId: ID of the proposal to vote on
 79//   - yes: true for yes vote, false for no vote
 80//
 81// Returns:
 82//   - string: voting result information
 83func Vote(
 84	cur realm,
 85	proposalId int64,
 86	yes bool,
 87) string {
 88	return getImplementation().Vote(
 89		proposalId,
 90		yes,
 91	)
 92}
 93
 94// Execute executes a passed proposal that is in the execution window.
 95//
 96// Parameters:
 97//   - proposalId: ID of the proposal to execute
 98//
 99// Returns:
100//   - int64: execution result code
101func Execute(
102	cur realm,
103	proposalId int64,
104) int64 {
105	return getImplementation().Execute(proposalId)
106}
107
108// Cancel cancels a proposal before voting begins.
109// Only callable by the proposer.
110//
111// Parameters:
112//   - proposalId: ID of the proposal to cancel
113//
114// Returns:
115//   - int64: cancellation result code
116func Cancel(
117	cur realm,
118	proposalId int64,
119) int64 {
120	return getImplementation().Cancel(proposalId)
121}
122
123// Reconfigure updates the governance configuration parameters.
124// Only callable by admin or governance.
125//
126// Parameters:
127//   - votingStartDelay: delay before voting starts (seconds)
128//   - votingPeriod: voting duration (seconds)
129//   - votingWeightSmoothingDuration: weight smoothing duration (seconds)
130//   - quorum: minimum voting weight required (percentage)
131//   - proposalCreationThreshold: minimum weight to create proposal
132//   - executionDelay: delay before execution (seconds)
133//   - executionWindow: execution time window (seconds)
134//
135// Returns:
136//   - int64: new configuration version
137func Reconfigure(
138	cur realm,
139	votingStartDelay int64,
140	votingPeriod int64,
141	votingWeightSmoothingDuration int64,
142	quorum int64,
143	proposalCreationThreshold int64,
144	executionDelay int64,
145	executionWindow int64,
146) int64 {
147	return getImplementation().Reconfigure(
148		votingStartDelay,
149		votingPeriod,
150		votingWeightSmoothingDuration,
151		quorum,
152		proposalCreationThreshold,
153		executionDelay,
154		executionWindow,
155	)
156}