Skip to content

Conversation

@kaankacar
Copy link
Collaborator

The --wasm flag was removed from stellar contract invoke in CLI. 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

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
Copilot AI review requested due to automatic review settings February 2, 2026 18:10
@kaankacar kaankacar requested review from ElliotFriend and removed request for Copilot February 2, 2026 18:10
@kaankacar kaankacar self-assigned this Feb 2, 2026
@kaankacar kaankacar requested review from Copilot and removed request for ElliotFriend February 2, 2026 18:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 1 patterns 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 / ### Invoke tabs and consistent use of --source-account and --network testnet across 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.

@stellar-jenkins
Copy link

@stellar-jenkins
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stellar contract invoke --wasm is invalid — affects ~6 example contract tutorials

2 participants