Conversation
The --wasm flag was removed from `stellar contract invoke` in CLI PR #997 (October 2023) when sandbox mode was removed. Contracts must now be deployed first, then invoked by contract ID. Updated 7 example contract tutorials to use the correct two-step workflow: 1. Deploy with `stellar contract deploy --wasm ... --alias ... --network testnet` 2. Invoke with `stellar contract invoke --id <alias> --network testnet` Files updated: - TEMPLATE.mdx - auth.mdx - events.mdx - liquidity-pool.mdx - logging.mdx - storage.mdx (also fixed incorrect wasm filename reference) - tokens.mdx Fixes #2212
There was a problem hiding this comment.
Pull request overview
This PR updates several example smart contract tutorials to reflect the current Stellar CLI workflow, which no longer supports stellar contract invoke --wasm and requires a deploy-then-invoke pattern using contract IDs or aliases. The docs now consistently show: building the WASM, deploying it with stellar contract deploy --wasm ... --alias ... --network testnet, and then invoking via stellar contract invoke --id <alias> --network testnet.
Changes:
- Replaced all
stellar contract invoke --wasm ... --id 1patterns in example contracts with a two-step deploy (contract deploy --wasm ... --alias ... --source-account ... --network testnet) then invoke (contract invoke --id <alias> --source-account ... --network testnet) workflow. - Standardized deployment/invocation sections with
### Deploy/### Invoketabs and consistent use of--source-accountand--network testnetacross UNIX and PowerShell examples. - Fixed the storage example to reference the correct WASM filename for the increment contract and aligned its deploy/invoke examples with the new pattern.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
docs/build/smart-contracts/example-contracts/TEMPLATE.mdx |
Updates the template example to first deploy the hello-world contract with an alias (hello) on testnet and then invoke it by alias, replacing the deprecated invoke --wasm usage. |
docs/build/smart-contracts/example-contracts/auth.mdx |
Adds identity setup on testnet, introduces a deploy step with --alias auth, and updates all auth contract invocations (including --auth and contract read) to use --id auth and --network testnet. |
docs/build/smart-contracts/example-contracts/events.mdx |
Replaces direct invoke --wasm calls with explicit deploy of the events contract (--alias events) followed by invoke examples that target --id events on testnet. |
docs/build/smart-contracts/example-contracts/liquidity-pool.mdx |
Refactors the liquidity pool “Run the Contract” section into deploy (with alias liquidity-pool) and invoke sections, updating commands to use --id liquidity-pool and --network testnet instead of invoke --wasm. |
docs/build/smart-contracts/example-contracts/logging.mdx |
Splits logging example into deploy (with --alias logging) and verbose invoke (stellar -v contract invoke --id logging ... --network testnet), removing the invalid --wasm flag from invoke. |
docs/build/smart-contracts/example-contracts/storage.mdx |
Adjusts the storage example to deploy the correct increment contract WASM under alias increment and invoke it via --id increment on testnet, eliminating the old invoke --wasm example. |
docs/build/smart-contracts/example-contracts/tokens.mdx |
Updates token contract docs to deploy the token contract as alias token and show balance queries via contract invoke --id token ... --network testnet for both UNIX and PowerShell. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Preview is available here: |
|
Preview is available here: |
The --wasm flag was removed from
stellar contract invokein CLI. Contracts must now be deployed first, then invoked by contract ID.Updated 7 example contract tutorials to use the correct two-step workflow:
stellar contract deploy --wasm ... --alias ... --network testnetstellar contract invoke --id <alias> --network testnetFiles updated:
Fixes #2212