Skip to content

Change the Threshold

Changes how many approvals a proposal needs, on a controlled smart account, authorized by the settings authority's signature.

Controlled accounts only. An autonomous account uses the ChangeThresholdsettings transaction action. The new threshold must be ≥ 1 and ≤ the number of Vote-holding signers — see Permissions & Threshold.

Program method — change_threshold_as_authority

Signs with payer + settings_authority + rent_payer, then sends.

ParameterTypeRequiredDefaultDescription
payerKeypairyesPays the fee; co-signs.
settings#to_syesThe settings account address.
settings_authority#to_s · KeypairyesThe account's settings authority; must sign.
rent_payer#to_s · KeypairyesFunds any settings-account reallocation; must sign.
new_thresholdIntegeryesThe new approval threshold.
memoStringnonilOptional indexing memo.

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

ruby
program.change_threshold_as_authority(
  payer:              authority,
  settings:           identity.settings_address,
  settings_authority: authority,
  rent_payer:         authority,
  new_threshold:      2
)

Composer — SquadsSmartAccountsChangeThresholdAsAuthorityComposer

ParameterTypeRequiredDefaultDescription
settings#to_syesThe settings account address.
settings_authority#to_s · KeypairyesThe settings authority; must sign.
rent_payer#to_s · KeypairyesFunds reallocation; must sign.
new_thresholdIntegeryesThe new approval threshold.
memoStringnonilIndexing memo.
ruby
composer = Solace::Composers::SquadsSmartAccountsChangeThresholdAsAuthorityComposer.new(
  settings:           identity.settings_address,
  settings_authority: authority.address,
  rent_payer:         authority.address,
  new_threshold:      2
)

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

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

Low-level instruction (advanced)

  • Discriminator: [51, 141, 78, 133, 70, 47, 95, 124]
  • Encodes (data): le_u16(new_threshold) + option_string(memo)
ParameterTypeRequiredDefaultDescription
new_thresholdIntegeryesThe new approval threshold.
memoString, nilyesIndexing memo, or nil.
settings_indexIntegeryesIndex of the settings account.
settings_authority_indexIntegeryesIndex of the settings authority.
rent_payer_indexIntegeryesIndex of the rent payer.
system_program_indexIntegeryesIndex of the System program.
program_indexIntegeryesIndex of the Squads program.
ruby
ix = Solace::SquadsSmartAccounts::Instructions::ChangeThresholdAsAuthorityInstruction.build(
  new_threshold:            2,
  memo:                     nil,
  settings_index:           context.index_of(settings),
  settings_authority_index: context.index_of(settings_authority),
  rent_payer_index:         context.index_of(rent_payer),
  system_program_index:     context.index_of(Solace::Constants::SYSTEM_PROGRAM_ID),
  program_index:            context.index_of(Solace::SquadsSmartAccounts::PROGRAM_ID)
)

Built on Solace