Skip to content

Set a New Settings Authority

Hands the reconfiguration authority of a controlled smart account to a new key — or renounces it entirely, permanently converting the account to autonomous.

Pass new_settings_authority: nil to renounce: the program stores Pubkey::default(), after which the account can only be reconfigured through settings transactions. This is irreversible.

Program method — set_new_settings_authority_as_authority

Signs with payer + settings_authority (the current one) + rent_payer, then sends.

ParameterTypeRequiredDefaultDescription
payerKeypairyesPays the fee; co-signs.
settings#to_syesThe settings account address.
settings_authority#to_s · KeypairyesThe current settings authority; must sign.
rent_payer#to_s · KeypairyesFunds any settings-account reallocation; must sign.
new_settings_authority#to_s, nilyesThe new authority pubkey, or nil to renounce (→ autonomous).
memoStringnonilOptional indexing memo.

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

ruby
program.set_new_settings_authority_as_authority(
  payer:                  authority,
  settings:               identity.settings_address,
  settings_authority:     authority,
  rent_payer:             authority,
  new_settings_authority: new_authority.address # or nil to renounce
)

Composer — SquadsSmartAccountsSetNewSettingsAuthorityAsAuthorityComposer

ParameterTypeRequiredDefaultDescription
settings#to_syesThe settings account address.
settings_authority#to_s · KeypairyesThe current settings authority; must sign.
rent_payer#to_s · KeypairyesFunds reallocation; must sign.
new_settings_authority#to_s, nilyesNew authority, or nil to renounce (stored as the default pubkey).
memoStringnonilIndexing memo.
ruby
composer = Solace::Composers::SquadsSmartAccountsSetNewSettingsAuthorityAsAuthorityComposer.new(
  settings:               identity.settings_address,
  settings_authority:     authority.address,
  rent_payer:             authority.address,
  new_settings_authority: new_authority.address
)

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: [221, 112, 133, 229, 146, 58, 90, 56]
  • Encodes (data): pubkey(new_settings_authority) + option_string(memo) (renounce ⇒ the default pubkey)
ParameterTypeRequiredDefaultDescription
new_settings_authority#to_syesNew authority pubkey (the default pubkey to renounce).
memoString, nilyesIndexing memo, or nil.
settings_indexIntegeryesIndex of the settings account.
settings_authority_indexIntegeryesIndex of the current 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::SetNewSettingsAuthorityAsAuthorityInstruction.build(
  new_settings_authority:   new_authority.address,
  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