Skip to content

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

Closed

Description

@kaankacar

What version are you using?

Stellar CLI v23.2.1

What did you do?

Followed example contract tutorials (Storage, Events, Logging, Auth, Tokens). They instruct running:

stellar contract invoke \
  --wasm target/wasm32v1-none/release/soroban_logging_contract.wasm \
  --id 1 \
  -- \
  hello \
  --value friend

Documentation URL: https://developers.stellar.org/docs/build/smart-contracts/example-contracts/logging (and others)

What did you expect to see?

The contract function executing and returning a result.

What did you see instead?

error: unexpected argument '--wasm' found

The --wasm flag was removed from stellar contract invoke in PR # 997 (in the stellar-cli repo, October 2023). The sandbox mode that allowed invoking directly from a WASM file no longer exists. Contracts must be deployed first, then invoked by contract ID.

Fix: Replace all invoke-with-wasm patterns with a two-step deploy-then-invoke workflow:

# Step 1: Deploy
stellar contract deploy \
  --wasm target/wasm32v1-none/release/soroban_logging_contract.wasm \
  --alias logging-contract \
  --source-account alice \
  --network testnet

# Step 2: Invoke
stellar contract invoke \
  --id logging-contract \
  --source-account alice \
  --network testnet \
  -- \
  hello \
  --value friend

Activity

  1. self-assigned this
    on Jan 27, 2026
  2. moved this to To Do in Dev Docson Jan 27, 2026
  3. added a commit that references this issue on Feb 2, 2026
    b1302f2
  4. added a commit that references this issue on Mar 17, 2026
    657b2fe
  5. added a commit that references this issue on Mar 19, 2026
    563e016
  6. added a commit that references this issue on Jun 18, 2026
    617169a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

  • Status
    To Do

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions