> For the complete documentation index, see [llms.txt](https://docs.gnoswap.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gnoswap.io/contracts/gov/governance/governance_vote.gno.md).

# governance\_vote.gno

{% embed url="<https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/gov/governance/v1/governance_vote.gno>" %}

## Vote

```go
func Vote(
	cur realm,
	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.

> **Halt check:** reverts while the Governance halt scope is active, except for halt-recovery proposals that only target the halt realm.

#### Parameters

| Name         | Type  | Description                                                                  |
| ------------ | ----- | ---------------------------------------------------------------------------- |
| `cur`        | realm | Current realm context; callers use cross(cur) when crossing into this realm. |
| `proposalId` | int64 | The ID of the proposal to vote.                                              |
| `yes`        | bool  | The flag to vote as yes or not.                                              |

#### Return Values

| Name         | Type   | Description                                                         |
| ------------ | ------ | ------------------------------------------------------------------- |
| `voteWeight` | string | The caller's calculated vote weight, formatted as a decimal string. |

[source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/gov/governance/proxy.gno#L104)
