Skip to content

Set the Time Lock

Sets the cooling-off period (in seconds) between a proposal's approval and when it may execute, on a controlled smart account, authorized by the settings authority.

Controlled accounts only. An autonomous account uses the SetTimeLocksettings transaction action. See The Async Transaction Lifecycle for how the time lock gates execution.

Program method — set_time_lock_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.
time_lockIntegeryesSeconds between approval and execution (0 to disable).
memoStringnonilOptional indexing memo.

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

ruby
program.set_time_lock_as_authority(
  payer:              authority,
  settings:           identity.settings_address,
  settings_authority: authority,
  rent_payer:         authority,
  time_lock:          3600 # one hour
)

Composer — SquadsSmartAccountsSetTimeLockAsAuthorityComposer

ParameterTypeRequiredDefaultDescription
settings#to_syesThe settings account address.
settings_authority#to_s · KeypairyesThe settings authority; must sign.
rent_payer#to_s · KeypairyesFunds reallocation; must sign.
time_lockIntegeryesSeconds between approval and execution.
memoStringnonilIndexing memo.
ruby
composer = Solace::Composers::SquadsSmartAccountsSetTimeLockAsAuthorityComposer.new(
  settings:           identity.settings_address,
  settings_authority: authority.address,
  rent_payer:         authority.address,
  time_lock:          3600
)

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: [2, 234, 93, 93, 40, 92, 31, 234]
  • Encodes (data): le_u32(time_lock) + option_string(memo)
ParameterTypeRequiredDefaultDescription
time_lockIntegeryesSeconds between approval and execution.
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::SetTimeLockAsAuthorityInstruction.build(
  time_lock:                3600,
  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