Skip to content

init fails to build contract clients due to soroban-sdk version conflict #388

@oceans404

Description

@oceans404

When running stellar scaffold init, the project initialization completes, but the contract client generation fails due to a Cargo dependency conflict between the generated project and the OpenZeppelin example contracts.

Steps to Reproduce:

  1. After installing scaffold stellar dependencies, run stellar scaffold init my-project

  2. Observe the output during the "Building contracts and generating client code" phase.

Actual Behavior:

The build fails to build contracts with a version selection error for soroban-sdk:

stellar-access v0.6.0 requires ^23.4.0.

The local package fungible-allowlist-example is locked to v23.1.0.

Expected Behavior:

The scaffolded project should have compatible version constraints so that cargo metadata and contract builds succeed out of the box.

Error Message

stellar scaffold init my-project
ℹ️  Creating new Stellar project in /Users/steph/Desktop/kb/build/scaffold-tutorial/my-project
Downloading theahaco/scaffold-stellar-frontend from GitHub to /Users/steph/Desktop/kb/build/scaffold-tutorial/my-project
  Done...                                                                                                                                    ℹ️  Successfully added OpenZeppelin example contract: nft-enumerable
ℹ️  Successfully added OpenZeppelin example contract: fungible-allowlist
ℹ️  Installing npm dependencies...
ℹ️  Building contracts and generating client code...
⚠️  Failed to build contract clients: `cargo metadata` exited with an error:     Updating git repository `https://github.com/OpenZeppelin/stellar-contracts`
    Updating crates.io index
    Updating crates.io index
error: failed to select a version for `soroban-sdk`.
    ... required by package `stellar-access v0.6.0 (https://github.com/OpenZeppelin/stellar-contracts?tag=v0.6.0#82f97111)`
    ... which satisfies git dependency `stellar-access` of package `fungible-allowlist-example v0.0.1 (/Users/steph/Desktop/kb/build/scaffold-tutorial/my-project/contracts/fungible-allowlist)`
versions that meet the requirements `^23.4.0` are: 23.5.1, 23.5.0, 23.4.1, 23.4.0

all possible versions conflict with previously selected packages.

  previously selected package `soroban-sdk v23.1.0`
    ... which satisfies dependency `soroban-sdk = "^23.1.0"` (locked to 23.1.0) of package `fungible-allowlist-example v0.0.1 (/Users/steph/Desktop/kb/build/scaffold-tutorial/my-project/contracts/fungible-allowlist)`

failed to select a version for `soroban-sdk` which could resolve this conflict

   


✅ Project successfully created at ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions