Skip to content

fix: stabilize quickstart on OZ v0.6.0 — deps, contract code, and constructor args#190

Merged
zachfedor merged 5 commits intotheahaco:mainfrom
oceans404:fix/missing-constructor-args
Apr 13, 2026
Merged

fix: stabilize quickstart on OZ v0.6.0 — deps, contract code, and constructor args#190
zachfedor merged 5 commits intotheahaco:mainfrom
oceans404:fix/missing-constructor-args

Conversation

@oceans404
Copy link
Copy Markdown
Contributor

@oceans404 oceans404 commented Apr 1, 2026

Problem

The quickstart is broken. Running stellar scaffold init + npm run dev fails for 2 of 3 example contracts (fungible-allowlist and nft-enumerable). There are three compounding issues:

  1. Dep version mismatch: Cargo.toml pins OZ crates to v0.5.1 and soroban-sdk to 23.1.0, but OZ v0.6.0 requires soroban-sdk ^23.4.0. The CLI (after theahaco/scaffold-stellar#451) pulls v0.6.0 examples, which fail to resolve against the template's pinned deps.

  2. Contract code uses v0.7.x syntax: The contract source on main was updated to use #[default_impl] (OZ v0.7.x), but the deps were never bumped to match — so stellar_macros::default_impl doesn't exist and compilation fails regardless of this PR.

  3. Missing constructor args: fungible_allowlist_example is missing --name and --symbol. nft_enumerable_example is missing --uri, --name, and --symbol. Client generation fails with Missing required argument.

Additionally, the install:contracts script in package.json uses --workspace=packages (targeting a workspace named "packages" which doesn't exist) instead of --workspaces (targeting all workspaces). This causes CI failures.

What this PR does

Stabilizes everything on OZ v0.6.0 (the latest stable release that works with soroban-sdk 23.x):

Change 1: Bump deps to v0.6.0 (Cargo.toml)

  • soroban-sdk: 23.1.023.4.0
  • stellar-access, stellar-macros, stellar-tokens: v0.5.1v0.6.0

Change 2: Revert contract code to v0.6.0 syntax

  • Replace #[default_impl] + #[contractimpl] with #[contractimpl(contracttrait)] (v0.6.0 API)
  • Remove stellar_macros::default_impl imports
  • Accept name/symbol/uri as constructor params instead of hardcoding them
  • Fix grant_role_no_auth argument order for v0.6.0 API

Change 3: Add missing constructor args (environments.toml)

  • fungible_allowlist_example: add --name ExampleToken --symbol EXT
  • nft_enumerable_example: add --uri https://example.com/nft/ --name ExampleNFT --symbol ENFT

Change 4: Fix install:contracts script (package.json)

  • --workspace=packages--workspaces (plural, targets all workspaces)

v0.7.x upgrade path

This PR intentionally targets v0.6.0 to unblock the quickstart now. OZ v0.7.0 (stable Apr 3) and v0.7.1 (Apr 10) require soroban-sdk 25.x, which is a larger upgrade. The contract code for v0.7.x is already written — a follow-up PR just needs to bump Cargo.toml to soroban-sdk 25.x + OZ v0.7.x and revert the macro syntax back to #[default_impl].

Test plan

  • Fresh stellar scaffold init + npm run dev builds, deploys, and generates clients for all 3 contracts with zero errors
  • Client Generation Summary: Successfully processed: 3, Failed: 0
  • Contract Explorer at /debug works for all 3 contracts

Companion to theahaco/scaffold-stellar#451 (merged).
Closes theahaco/scaffold-stellar#450.
Addresses theahaco/scaffold-stellar#370.

@oceans404 oceans404 changed the title fix: add missing constructor args for OZ example contracts fix: bump soroban-sdk to 23.4.0, OZ deps to v0.6.0, and add missing constructor args Apr 1, 2026
oceans404 and others added 2 commits April 13, 2026 12:03
The `fungible_allowlist_example` constructor requires `--name` and
`--symbol`, and `nft_enumerable_example` requires `--uri`, `--name`,
and `--symbol`. Without these, contract client generation fails with
"Missing required argument" after successful compilation and deploy.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The CLI pulls OZ v0.6.0 examples which require soroban-sdk 23.4.0.
The template was pinned to soroban-sdk 23.1.0 and OZ v0.5.1, causing
compile errors (unknown `contracttrait` attribute, type mismatches).

Note: the CLI's dest_path fix (scaffold-stellar#451) will auto-update
the OZ tags going forward, but the soroban-sdk version still needs to
be compatible in the template as a baseline.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@oceans404 oceans404 force-pushed the fix/missing-constructor-args branch from 3b15b28 to 5cb4a68 Compare April 13, 2026 19:03
The contract code on main was updated to v0.7.x syntax (#[default_impl])
but the deps were never bumped to match, so nothing compiles. This reverts
to v0.6.0 syntax (#[contractimpl(contracttrait)]) which matches the deps
bumped in the previous commits and what scaffold init generates.

Changes:
- Replace #[default_impl] + #[contractimpl] with #[contractimpl(contracttrait)]
- Remove stellar_macros::default_impl imports
- Accept name/symbol/uri as constructor params instead of hardcoding
- Fix grant_role_no_auth argument order for v0.6.0 API

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@oceans404 oceans404 changed the title fix: bump soroban-sdk to 23.4.0, OZ deps to v0.6.0, and add missing constructor args fix: stabilize quickstart on OZ v0.6.0 — deps, contract code, and constructor args Apr 13, 2026
--workspace=packages targets a workspace named "packages" which doesn't
exist. The config is "packages/*" so the actual workspaces are the
individual subdirectories. --workspaces targets all of them.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@zachfedor zachfedor merged commit a44d784 into theahaco:main Apr 13, 2026
1 check passed
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.

Quickstart: 2 of 3 contracts fail to compile out of the box + missing constructor args

2 participants