Skip to content

Create a Proposal ​

Opens the voting record for a stored transaction. A proposal created with draft: false (the default) starts Active and is ready to vote on; draft: true starts Draft and must be activated first.

The creator must hold the Initiate permission. A proposal is 1:1 with its transaction (both derived from the same index). See the async lifecycle.

Program method — create_proposal ​

Signs with payer + creator + rent_payer, then sends. The Proposal PDA is derived from the settings address and transaction index.

ParameterTypeRequiredDefaultDescription
payerKeypairyes—Pays the fee; co-signs.
settings#to_syes—The settings account address.
creator#to_s · Keypairyes—An Initiate-holding member; must sign.
rent_payer#to_s · Keypairyes—Funds the Proposal account's rent; must sign.
transaction_indexIntegeryes—Index of the transaction this proposal tracks.
draftBooleannofalseStart as Draft (needs activation) instead of Active.

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

ruby
program.create_proposal(
  payer:             creator,
  settings:          identity.settings_address,
  creator:,
  rent_payer:        creator,
  transaction_index: 1
)

Composer — SquadsSmartAccountsCreateProposalComposer ​

ParameterTypeRequiredDefaultDescription
settings#to_syes—The settings account address.
proposal#to_syes—The Proposal PDA to create (from get_proposal_address).
creator#to_s · Keypairyes—An Initiate-holding member; must sign.
rent_payer#to_s · Keypairyes—Funds the account's rent; must sign.
transaction_indexIntegeryes—Index of the tracked transaction.
draftBooleannofalseStart as Draft instead of Active.
ruby
proposal, = program.get_proposal_address(
  settings_address:  identity.settings_address,
  transaction_index: 1
)

composer = Solace::Composers::SquadsSmartAccountsCreateProposalComposer.new(
  settings:          identity.settings_address,
  proposal:,
  creator:           creator.address,
  rent_payer:        creator.address,
  transaction_index: 1
)

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: [132, 116, 68, 174, 216, 160, 198, 22]
  • Encodes (data): le_u64(transaction_index) + bool(draft)
ParameterTypeRequiredDefaultDescription
transaction_indexIntegeryes—Index of the tracked transaction.
draftBooleanyes—Start as Draft instead of Active.
settings_indexIntegeryes—Index of the settings account.
proposal_indexIntegeryes—Index of the Proposal PDA.
creator_indexIntegeryes—Index of the creator.
rent_payer_indexIntegeryes—Index of the rent payer.
system_program_indexIntegeryes—Index of the System program.
program_indexIntegeryes—Index of the Squads program.

Built on Solace