Skip to main content

Extend a deployed contract instance's TTL

You can use the Stellar CLI to extend the TTL of a contract instance like so:

stellar contract extend \
--source S... \
--network testnet \
--id C... \
--ledgers-to-extend 535679 \
--durability persistent

This example uses 535,679 ledgers as the new archival TTL. This is the maximum allowable value for this argument on the CLI. This corresponds to roughly 30 days (averaging 5 second ledger close times).

When you extend a contract instance, this includes:

  • the contract instance itself
  • any env.storage().instance() entries in the contract
  • the contract's Wasm code