Skip to content

Cancel a Proposal ​

Casts a cancellation vote on an Approved proposal — a way to call off a transaction that was approved but not yet executed. Once cancellations reach the threshold, the proposal becomes Cancelled (terminal) and should be closed.

The signer must hold the Vote permission, and the proposal must currently be Approved. Unlike approve/reject, this instruction requires the System program account (it may grow the proposal to record the cancellation).

Program method — cancel_proposal ​

Signs with payer + signer, then sends.

ParameterTypeRequiredDefaultDescription
payerKeypairyes—Pays the fee; co-signs.
settings#to_syes—The settings account address.
signer#to_s · Keypairyes—A Vote-holding member; must sign.
transaction_indexIntegeryes—Index of the proposal's transaction.
memoStringnonilOptional indexing memo.

Plus the shared sign: / execute: controls and Solace::Transaction return — see Conventions.

ruby
program.cancel_proposal(
  payer:             member,
  settings:          identity.settings_address,
  signer:            member,
  transaction_index: 1
)

Composer — SquadsSmartAccountsCancelProposalComposer ​

ParameterTypeRequiredDefaultDescription
settings#to_syes—The settings account address.
signer#to_s · Keypairyes—A Vote-holding member; must sign.
proposal#to_syes—The Proposal PDA to cancel (must be Approved).
memoStringnonilIndexing memo.
ruby
proposal, = program.get_proposal_address(
  settings_address:  identity.settings_address,
  transaction_index: 1
)

composer = Solace::Composers::SquadsSmartAccountsCancelProposalComposer.new(
  settings: identity.settings_address,
  signer:   member.address,
  proposal:
)

tx = Solace::TransactionComposer.new(connection:)
                                .add_instruction(composer)
                                .set_fee_payer(member)
                                .compose_transaction

tx.sign(member)
connection.send_transaction(tx.serialize)

Low-level instruction (advanced) ​

  • Discriminator: [106, 74, 128, 146, 19, 65, 39, 23]
  • Encodes (data): option_string(memo)
ParameterTypeRequiredDefaultDescription
memoString, nilyes—Indexing memo, or nil.
settings_indexIntegeryes—Index of the settings account.
signer_indexIntegeryes—Index of the voting signer.
proposal_indexIntegeryes—Index of the Proposal PDA.
system_program_indexIntegeryes—Index of the System program (required for cancel).
program_indexIntegeryes—Index of the Squads program.

Built on Solace