Skip to content

Update smart contract CLI examples#45

Merged
kalepail merged 1 commit into
mainfrom
codex/update-smart-contract-cli-examples
Jul 7, 2026
Merged

Update smart contract CLI examples#45
kalepail merged 1 commit into
mainfrom
codex/update-smart-contract-cli-examples

Conversation

@kalepail

@kalepail kalepail commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • update smart-contract examples from wasm32-unknown-unknown to wasm32v1-none
  • remove obsolete stellar keys generate --global usage
  • prefer canonical --source-account in contract deploy/invoke and SAC examples

Closes #44.

Why

Current Stellar Docs say stellar contract build targets wasm32v1-none and emits artifacts under target/wasm32v1-none/release/. Current stellar 27.0.0 CLI help uses --source-account <SOURCE_ACCOUNT> for deploy/invoke, while --source remains accepted as an alias. stellar keys generate --help no longer lists --global.

Verification

  • rg -n "wasm32-unknown-unknown|--global|--source " skills/smart-contracts skills/assets returns no matches
  • git diff --check

Copilot AI review requested due to automatic review settings July 7, 2026 20:36
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-07-07 20:58 UTC

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 the repository’s smart-contract and Stellar Asset Contract (SAC) documentation examples to match current Stellar CLI behavior and the current Soroban/Rust target output layout.

Changes:

  • Update build artifact paths from wasm32-unknown-unknown to wasm32v1-none (including CI snippet guidance).
  • Remove obsolete stellar keys generate --global usage from examples.
  • Replace --source with the canonical --source-account flag in deploy/invoke and SAC deploy examples.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
skills/smart-contracts/testing.md Updates local/testnet deploy + invoke examples and CI target guidance to wasm32v1-none and --source-account.
skills/smart-contracts/SKILL.md Updates the primary build/deploy/invoke quickstart examples to the new target path and canonical flags.
skills/smart-contracts/development.md Updates contract import path, size-check commands, and troubleshooting CLI identity fix to the current target/CLI usage.
skills/assets/SKILL.md Updates SAC deploy example to use --source-account instead of --source.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kalepail kalepail merged commit 3d75a15 into main Jul 7, 2026
7 checks passed
@kalepail kalepail deleted the codex/update-smart-contract-cli-examples branch July 7, 2026 20:57
marcelosalloum added a commit to marcelosalloum/stellar-dev-skill that referenced this pull request Jul 8, 2026
The rebase resolution takes this branch's rewrite over stellar#45's edits to the
old files; the target and --global fixes from stellar#45 are already covered, but
its --source → --source-account spelling was the one change worth keeping.
kaankacar pushed a commit that referenced this pull request Jul 8, 2026
* Update smart-contracts skill to protocol 27 (soroban-sdk/env v27)

Every technical claim was verified against rs-soroban-sdk v27.0.0-rc.1,
rs-soroban-env v27.0.0, stellar-cli 27.0.0, and live network settings;
the example contract and test compile and pass against the rc SDK.

Corrections to stale facts:
- wasm32v1-none is the only supported target (was wasm32-unknown-unknown)
- contract size limit is 128KB on mainnet (was 64KB); limits table refreshed
  from live `stellar network settings` with a pointer to requery
- #[contractevent] example gained the required #[topic] markers; the
  deprecated env.events().publish() is no longer shown
- token::TokenClient replaces the deprecated token::Client alias;
  SEP-41 transfer destination is MuxedAddress since v23
- crate-type includes "lib" (matches stellar contract init scaffold)

New protocol coverage:
- CAP-71 (p27): custom-account auth delegation via env.custom_account()
- CAP-78 (p26): extend_ttl_with_limits; CAP-73: SAC trust(); CAP-82:
  checked 256-bit arithmetic
- p23+ auto-restore of archived persistent entries in the rw footprint
- SDK 25+ mainnet resource limits enforced in unit tests (cost_estimate)

Deepened from a correctness pass on auth/storage/fees semantics: auth
trees and cross-contract propagation (authorize_as_current_contract),
__check_auth with correct Hash<32> signature, TTL-is-not-a-security-
boundary, footprint/parallelism guidance, contract-side SEP-41/SAC
semantics, and token-consumer + fee-griefing review checklists.

* Link Stellar Lab network-limits page for live resource limits

The quoted limits are the current on-chain mainnet config settings and
drift by validator vote; the Lab page is the canonical human-friendly
view of the live values.

* Strengthen skill description triggers for Soroban-phrased prompts

Skill selection matches on the frontmatter description text; name the
terms users actually type (Soroban, soroban-sdk, SEP-41, SAC, auth/
storage/TTL errors) so Soroban-phrased requests reliably route here.

* Fix CLI syntax, restore token event table, polish from review pass

An adversarial fact-check pass against CLI v27 caught that
`stellar keys generate --global` no longer exists (keys are stored
globally by default) — fixed in all four occurrences.

A coverage diff against the pre-merge sources flagged genuinely lost
content, restored here verified against v27 source:
- SEP-41 token event shapes table (re-derived from soroban-token-sdk
  and the env SAC event code, which also corrects the older shapes:
  mint has no admin topic, SAC appends the SEP-0011 asset topic,
  muxed transfers use a {to_muxed_id, amount} map)
- "never require_auth your own address inside __check_auth" rule
- routing table now lists constructors/factories/governance explicitly

* Make SDK version guidance self-updating instead of a hardcoded pin

27.0.0 final ships imminently and later majors will follow, so a pinned
rc string would rot fast. Teach the durable rule instead: SDK major =
protocol version, resolve the current release from crates.io / GitHub
releases, and check the network's live protocol via getVersionInfo or
Stellar Lab. The Cargo.toml example now pins the major only.

* Restore exact rc pin in the setup snippet

soroban-sdk = "27" won't resolve on crates.io until 27.0.0 final ships,
so the copy-paste snippet pins the rc explicitly; the Versions section
still teaches how to resolve the current release.

* Use --source-account in CLI examples, matching #45

The rebase resolution takes this branch's rewrite over #45's edits to the
old files; the target and --global fixes from #45 are already covered, but
its --source → --source-account spelling was the one change worth keeping.

* Clarify that test snippets live in src/test.rs, not lib.rs

The inner #![cfg(test)] attribute is correct for the src/test.rs module
that stellar contract init scaffolds, but pasted into lib.rs it would
gate the whole crate behind cfg(test). Say so next to the snippets.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update smart-contract CLI examples for wasm32v1-none and --source-account

2 participants