Skip to content

Activate a Proposal

Moves a proposal from Draft to Active so it can be voted on. Only needed for proposals created with draft: true; the common path (create_proposal with draft: false) skips this and starts Active.

The signer must hold the Initiate permission, and the proposal must currently be Draft. This is the one proposal instruction with no trailing program account.

Program method — activate_proposal

Signs with payer + signer, then sends.

ParameterTypeRequiredDefaultDescription
payerKeypairyesPays the fee; co-signs.
settings#to_syesThe settings account address.
signer#to_s · KeypairyesAn Initiate-holding member; must sign.
transaction_indexIntegeryesIndex of the proposal's transaction.

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

ruby
program.activate_proposal(
  payer:             creator,
  settings:          identity.settings_address,
  signer:            creator,
  transaction_index: 1
)

Composer — SquadsSmartAccountsActivateProposalComposer

ParameterTypeRequiredDefaultDescription
settings#to_syesThe settings account address.
signer#to_s · KeypairyesAn Initiate-holding member; must sign.
proposal#to_syesThe Proposal PDA to activate.
ruby
proposal, = program.get_proposal_address(
  settings_address:  identity.settings_address,
  transaction_index: 1
)

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

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

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

Low-level instruction (advanced)

  • Discriminator: [90, 186, 203, 234, 70, 185, 191, 21]
  • Encodes (data): the discriminator only — activateProposal takes no arguments.
ParameterTypeRequiredDefaultDescription
settings_indexIntegeryesIndex of the settings account.
signer_indexIntegeryesIndex of the activating signer.
proposal_indexIntegeryesIndex of the Proposal PDA.
program_indexIntegeryesIndex of the Squads program (the invoked program).

Note: the three accounts are settings, signer, proposal — there is no trailing program account in the account-metas list (unlike the other proposal instructions); the program is only the invoked program.

Built on Solace