> ## Documentation Index
> Fetch the complete documentation index at: https://new-docs.squads.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel Proposal

## Overview

Cancel a proposal to invalidate it. This requires the member to have `Voter` permissions and the proposal to be of `Approved` status. An `Approved` proposal can be cancelled even if it has become stale.

Use `proposalCancelV2`. It resizes the proposal account when members have changed since the proposal was created. `proposalCancel` still exists and takes the same parameters, but only works when the proposal account is still large enough.

## Prerequisites

* Existing proposal in Approved status
* `@sqds/multisig` package installed
* Member with Voter permissions

## Quick Example

```typescript theme={null}
import * as multisig from "@sqds/multisig";
import { Connection, PublicKey } from "@solana/web3.js";

const connection = new Connection("<your rpc url>");

const ix = await multisig.instructions.proposalCancelV2({
  multisigPda,
  transactionIndex,
  member: member,
});
```

## Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `multisigPda` | `PublicKey` | Yes | PDA of the multisig |
| `transactionIndex` | `bigint` | Yes | Index of the transaction to cancel |
| `member` | `PublicKey` | Yes | Member cancelling the proposal (must have Voter permissions) |

## Full Example

```typescript theme={null}
import * as multisig from "@sqds/multisig";
import { Connection, PublicKey } from "@solana/web3.js"

async function main(member: PublicKey) {
    // Cluster Connection
    const connection = new Connection("<your rpc url>");

    // If you've saved your createKey, you can define it as a static PublicKey
    const createKey = new PublicKey("<your createkey>")

    // Derive the multisig PDA
    const [multisigPda] = multisig.getMultisigPda({
        createKey,
    });
    // or
    // const multisigPda = new PublicKey("<your multisig key>");

    // Get deserialized multisig account info
    const multisigInfo = await multisig.accounts.Multisig.fromAccountAddress(
      connection,
      multisigPda
    );

    // Get the current transaction index
    const transactionIndex = BigInt(multisigInfo.transactionIndex.toString());
    // or, if this is tied to your first transaction
    // const transactionIndex = 1n;

    const ix = await multisig.instructions.proposalCancelV2({
        multisigPda,
        transactionIndex,
        // Member must have "Voter" permissions
        member: member,
    });
}
```

## When to Cancel

* Proposal is in `Approved` status but should not be executed
* Proposal is in `Approved` status and has become stale (`transactionIndex` ≤ `staleTransactionIndex`). An approved vault transaction can still be executed after it becomes stale, so cancel it if it should no longer run. A stale config transaction can never be executed, so cancelling it is optional

## Error Handling

| Error | Cause | Solution |
| - | - | - |
| Invalid status | Proposal is not Approved | Can only cancel Approved proposals |
| Insufficient permissions | Member lacks Voter permission | Use a member with Voter permissions |

## See Also

* [Proposal Account](/developers/typescript-sdk/accounts/proposal)
* [Approve Proposal](/developers/typescript-sdk/instructions/approve-proposal)
* [Reject Proposal](/developers/typescript-sdk/instructions/reject-proposal)
* [Multisig Reference](/developers/reference/accounts#multisig)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.