> 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_execute.gno.md).

# governance\_execute.gno

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

## Cancel

```go
func Cancel(
	cur realm,
	proposalId int64
) int64
```

Cancel cancels the proposal with the given ID.

> **Halt check:** reverts while the Governance halt scope is active.

#### 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 cancel.                                            |

#### Return Values

| Name         | Type  | Description             |
| ------------ | ----- | ----------------------- |
| `proposalId` | int64 | The ID of the proposal. |

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

## Execute

```go
func Execute(
	cur realm,
	proposalId int64
) int64
```

Execute executes the given proposal.

> **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 execute.                                           |

#### Return Values

| Name         | Type  | Description             |
| ------------ | ----- | ----------------------- |
| `proposalId` | int64 | The ID of the proposal. |

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

## RemoveInactiveProposalFromIndex

```go
func RemoveInactiveProposalFromIndex(
	cur realm,
	proposalID int64
)
```

RemoveInactiveProposalFromIndex removes an inactive proposal from the timestamp-ordered index without deleting its proposal or voting history.

> **Halt check:** reverts while the Governance halt scope is active.

#### Parameters

| Name         | Type  | Description                                                                  |
| ------------ | ----- | ---------------------------------------------------------------------------- |
| `cur`        | realm | Current realm context; callers use cross(cur) when crossing into this realm. |
| `proposalID` | int64 | Identifier of the inactive proposal to remove from the active index.         |

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