Extend a deployed contract's Wasm code TTL
You can use the Stellar CLI to extend the TTL of a contract's Wasm bytecode. This can be done in two forms: if you do or do not have the compiled contract locally. If you do have the compiled binary on your local machine:
stellar contract extend \
--source S... \
--network testnet \
--wasm ../relative/path/to/soroban_contract.wasm \
--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).
If you do not have the compiled binary on your local machine, you can still use the CLI to extend the bytecode TTL. You'll need to know the Wasm hash of the installed contract code:
stellar contract extend \
--source S... \
--network testnet \
--wasm-hash <hex-encoded-wasm-hash> \
--ledgers-to-extend 535679 \
--durability persistent
You can learn more about finding the correct Wasm hash for a contract instance here (JavaScript) and here (Python).
Guides in this category:
๐๏ธ Contract Lifecycle
Manage the lifecycle of a Stellar smart contract using the CLI
๐๏ธ Deploy a contract from installed Wasm bytecode
Deploy an instance of a compiled contract that is already installed on the network
๐๏ธ Deploy the Stellar Asset Contract for a Stellar asset
Deploy an SAC for a Stellar asset so that it can interact with smart contracts
๐๏ธ Extend a deployed contract instance's TTL
Use the CLI to extend the time to live (TTL) of a contract instance
๐๏ธ Extend a deployed contract's storage entry TTL
Use the CLI to extend the time to live (TTL) of a contract's persistent storage entry
๐๏ธ Extend a deployed contract's Wasm code TTL
Use Stellar CLI to extend contract's Wasm bytecode TTL, with or without local binary
๐๏ธ Install and deploy a smart contract
Combine the install and deploy commands in the Stellar CLI to accomplish both tasks
๐๏ธ Install Wasm bytecode
Use the Stellar CLI to install a compiled smart contract on the ledger
๐๏ธ Payments and Assets
Send XLM, stellar classic, or a soroban asset using the Stellar CLI
๐๏ธ Restore an archived contract using the Stellar CLI
Restore an archived contract instance using the Stellar CLI
๐๏ธ Restore archived contract data using the Stellar CLI
Restore archived contract storage entries using Stellar CLI