Skip to content

add stellar metadata section to contract cargo.toml files - #680

Merged
ozgunozerk merged 3 commits into
OpenZeppelin:mainfrom
knQzx:add-stellar-metadata
Apr 10, 2026
Merged

ozgunozerk merged 3 commits into
OpenZeppelin:mainfrom
knQzx:add-stellar-metadata

Conversation

@knQzx

@knQzx knQzx commented Apr 5, 2026 •

Copy link
Copy Markdown
Contributor

summary

test plan

  • verified cargo.toml files parse correctly

fixes #341

Summary by CodeRabbit

  • Chores
    • Updated build configuration metadata across package and example manifests to support Stellar tooling configuration.

@coderabbitai

coderabbitai Bot commented Apr 5, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3ea9097b-8d3a-41d9-98f8-0fda1971f711

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

This pull request adds a [package.metadata.stellar] section with cargo_inherit = true to 47 Cargo.toml files across example and package crates, establishing Stellar-specific package metadata configuration for the toolchain without altering functional code or dependencies.

Changes

Cohort / File(s) Summary
Fee Forwarder Examples
examples/fee-forwarder-permissioned/Cargo.toml, examples/fee-forwarder-permissionless/Cargo.toml
Added [package.metadata.stellar] section with cargo_inherit = true.
Fungible Token Examples
examples/fungible-allowlist/Cargo.toml, examples/fungible-blocklist/Cargo.toml, examples/fungible-capped/Cargo.toml, examples/fungible-governor-timelock/(governor|token)/Cargo.toml, examples/fungible-governor/(governor|token)/Cargo.toml, examples/fungible-merkle-airdrop/Cargo.toml, examples/fungible-pausable/Cargo.toml, examples/fungible-vault/Cargo.toml, examples/fungible-votes/Cargo.toml
Added [package.metadata.stellar] section with cargo_inherit = true.
NFT Examples
examples/nft-access-control/Cargo.toml, examples/nft-consecutive/Cargo.toml, examples/nft-enumerable/Cargo.toml, examples/nft-royalties/Cargo.toml, examples/nft-sequential-minting/Cargo.toml
Added [package.metadata.stellar] section with cargo_inherit = true.
Multi-Signature Smart Account Examples
examples/multisig-smart-account/(account|ed25519-verifier|spending-limit-policy|threshold-policy|webauthn-verifier|weighted-threshold-policy)/Cargo.toml
Added [package.metadata.stellar] section with cargo_inherit = true.
RWA Examples
examples/rwa/(claim-issuer|claim-topics-and-issuers|compliance|identity-registry|identity-verifier|identity|sign-claim|token)/Cargo.toml
Added [package.metadata.stellar] section with cargo_inherit = true.
Miscellaneous Examples
examples/merkle-voting/Cargo.toml, examples/ownable/Cargo.toml, examples/pausable/Cargo.toml, examples/sac-admin-generic/Cargo.toml, examples/sac-admin-wrapper/Cargo.toml, examples/timelock-controller/Cargo.toml, examples/upgradeable/(lazy-v1|lazy-v2|upgrader|v1|v2)/Cargo.toml
Added [package.metadata.stellar] section with cargo_inherit = true.
Package Crates
packages/(access|accounts|contract-utils|fee-abstraction|governance|macros|test-utils\/event-assertion|tokens|zk-email)/Cargo.toml
Added [package.metadata.stellar] section with cargo_inherit = true.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested reviewers

  • ozgunozerk

Poem

🐇 With metadata we sow the seeds,
cargo_inherit = true fulfills our needs,
Forty-seven files now inherit with care,
Stellar tooling config everywhere!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding Stellar metadata sections to Cargo.toml files across the project.
Description check ✅ Passed The description covers the main change, references the relevant issue and standard (SEP-49), provides test verification, but lacks explicit test and documentation checklist items.
Linked Issues check ✅ Passed The PR successfully addresses issue #341 by adding [package.metadata.stellar] sections with cargo_inherit = true to all contract Cargo.toml files, meeting the stated objective.
Out of Scope Changes check ✅ Passed All changes are narrowly scoped to adding the [package.metadata.stellar] metadata section to Cargo.toml files, with no modifications to actual Rust code or dependencies.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@examples/fungible-allowlist/Cargo.toml`:
- Around line 9-10: The root Cargo.toml is missing a
[workspace.metadata.stellar] section so the per-crate setting
package.metadata.stellar.cargo_inherit = true is a no-op; add a top-level
[workspace.metadata.stellar] block in the root Cargo.toml containing the
canonical SEP-49 fields you expect to share (the same keys present in individual
package.metadata.stellar blocks) so cargo_inherit works, or alternatively remove
cargo_inherit = true from crates and copy those explicit values into each
package.metadata.stellar block; locate usages by searching for
package.metadata.stellar and cargo_inherit to mirror the shared metadata into
workspace.metadata.stellar.

In `@examples/fungible-governor-timelock/governor/Cargo.toml`:
- Around line 9-10: The crates declare cargo_inherit = true under
[package.metadata.stellar] but there is no root source to inherit from; add a
[workspace.metadata.stellar] block to the root Cargo.toml providing the shared
SEP-49 metadata (the keys that child crates expect) so cargo_inherit can work;
update the root Cargo.toml to include a [workspace.metadata.stellar] section
with the canonical fields used by child crates (matching the names under
package.metadata.stellar) rather than adding metadata to each crate.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9b5f7d0f-1576-453b-acad-de36c1c2cbcd

📥 Commits

Reviewing files that changed from the base of the PR and between 4a5efba and cfde273.

📒 Files selected for processing (52)
  • examples/fee-forwarder-permissioned/Cargo.toml
  • examples/fee-forwarder-permissionless/Cargo.toml
  • examples/fungible-allowlist/Cargo.toml
  • examples/fungible-blocklist/Cargo.toml
  • examples/fungible-capped/Cargo.toml
  • examples/fungible-governor-timelock/governor/Cargo.toml
  • examples/fungible-governor-timelock/token/Cargo.toml
  • examples/fungible-governor/governor/Cargo.toml
  • examples/fungible-governor/token/Cargo.toml
  • examples/fungible-merkle-airdrop/Cargo.toml
  • examples/fungible-pausable/Cargo.toml
  • examples/fungible-vault/Cargo.toml
  • examples/fungible-votes/Cargo.toml
  • examples/merkle-voting/Cargo.toml
  • examples/multisig-smart-account/account/Cargo.toml
  • examples/multisig-smart-account/ed25519-verifier/Cargo.toml
  • examples/multisig-smart-account/spending-limit-policy/Cargo.toml
  • examples/multisig-smart-account/threshold-policy/Cargo.toml
  • examples/multisig-smart-account/webauthn-verifier/Cargo.toml
  • examples/multisig-smart-account/weighted-threshold-policy/Cargo.toml
  • examples/nft-access-control/Cargo.toml
  • examples/nft-consecutive/Cargo.toml
  • examples/nft-enumerable/Cargo.toml
  • examples/nft-royalties/Cargo.toml
  • examples/nft-sequential-minting/Cargo.toml
  • examples/ownable/Cargo.toml
  • examples/pausable/Cargo.toml
  • examples/rwa/claim-issuer/Cargo.toml
  • examples/rwa/claim-topics-and-issuers/Cargo.toml
  • examples/rwa/compliance/Cargo.toml
  • examples/rwa/identity-registry/Cargo.toml
  • examples/rwa/identity-verifier/Cargo.toml
  • examples/rwa/identity/Cargo.toml
  • examples/rwa/sign-claim/Cargo.toml
  • examples/rwa/token/Cargo.toml
  • examples/sac-admin-generic/Cargo.toml
  • examples/sac-admin-wrapper/Cargo.toml
  • examples/timelock-controller/Cargo.toml
  • examples/upgradeable/lazy-v1/Cargo.toml
  • examples/upgradeable/lazy-v2/Cargo.toml
  • examples/upgradeable/upgrader/Cargo.toml
  • examples/upgradeable/v1/Cargo.toml
  • examples/upgradeable/v2/Cargo.toml
  • packages/access/Cargo.toml
  • packages/accounts/Cargo.toml
  • packages/contract-utils/Cargo.toml
  • packages/fee-abstraction/Cargo.toml
  • packages/governance/Cargo.toml
  • packages/macros/Cargo.toml
  • packages/test-utils/event-assertion/Cargo.toml
  • packages/tokens/Cargo.toml
  • packages/zk-email/Cargo.toml

Comment thread examples/fungible-allowlist/Cargo.toml Resolved
@knQzx

knQzx commented Apr 5, 2026

Copy link
Copy Markdown
Contributor Author

hey, thanks for flagging but this is actually fine - cargo_inherit = true in the stellar context inherits from the crate's own [package] section (name -> name, version -> binver, authors -> authors, etc.), not from workspace.metadata.stellar. it's processed by stellar-scaffold-cli, not standard cargo. you can see the same pattern in the contracts-wizard PR #613 and in stellar-core's own test contracts. no workspace-level section needed here.

@ozgunozerk

Copy link
Copy Markdown
Collaborator

@knQzx thanks for this! Could you also add authors section to all the examples, so that they inherit these from the workspace, and stellar scaffold can have that information as well?

@knQzx

knQzx commented Apr 9, 2026 •

Copy link
Copy Markdown
Contributor Author

@ozgunozerk done, added authors.workspace = true to all examples

@ozgunozerk ozgunozerk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

@brozorec, does this sound ok to you? If so, we can merge

@ozgunozerk
ozgunozerk merged commit 44bb991 into OpenZeppelin:main Apr 10, 2026
3 checks 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.

Add [metadata.stellar] section to Stellar contracts

3 participants