Skip to content

Conversation

@fadeev
Copy link
Member

@fadeev fadeev commented Oct 21, 2025

Summary by CodeRabbit

  • Chores
    • Bumped Zetachain SDK version across example projects.
    • Updated example setup scripts to read from the new localnet registry layout and to echo resolved addresses immediately.
    • Example configs no longer auto-load certain example task plugins, reducing pre-registered CLI tasks.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 21, 2025

📝 Walkthrough

Walkthrough

Removed side-effect ZetaChain task imports from multiple Hardhat configs and updated example dependencies to zetachain v7.0.0. Several example scripts were migrated to read addresses from ~/.zetachain/localnet/registry.json with updated jq filters targeting zrc20Tokens and contracts.

Changes

Cohort / File(s) Summary
Hardhat Task Plugin Removals
examples/{call,hello,nft,swap,token}/hardhat.config.ts
Deleted side-effect imports @zetachain/localnet/tasks and @zetachain/toolkit/tasks; retained other imports (e.g., getHardhatConfig, dotenv).
Dependency Version Updates
examples/call/package.json, examples/hello/package.json, examples/messaging/package.json, examples/nft/package.json, examples/swap/package.json, examples/token/package.json
Bumped zetachain dependency versions to 7.0.0 across examples; no other dependency or runtime code changes in these files.
Registry Migration — Address & Contract Lookups
examples/{call,swap,nft,token}/scripts/localnet.sh
Replaced earlier localnet.json queries with reads from ~/.zetachain/localnet/registry.json; updated jq queries to use .zrc20Tokens[] (filters: coinType, originChainId, symbol) and .contracts[] (filters: contractType like gateway, zetaToken, uniswapV2Router02); now echo resolved addresses.
Private Key / Recipient Handling & Echoes
examples/{swap,token,nft}/scripts/localnet.sh
Adjusted PRIVATE_KEY/RECIPIENT retrieval (e.g., .private_keys[0] from registry and private key extraction from anvil.json), compute/echo RECIPIENT and other resolved values immediately; no exported API changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Script as localnet.sh
  participant FS as ~/.zetachain/localnet/registry.json
  participant JQ as jq
  participant Shell as ShellEnv

  Note over Script,FS: New registry-based lookup flow
  Script->>FS: read registry.json
  Script->>JQ: query .<chain>.zrc20Tokens[] / .<chain>.contracts[] with filters
  JQ-->>Script: return address / contract object
  Script->>Shell: export VAR=address
  Script-->>Shell: echo VAR
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "chore: update CLI to 7.0.0" accurately reflects the primary objective of the changeset: upgrading the zetachain CLI dependency to version 7.0.0 across multiple example projects. The title is concise, clear, and specific—a teammate reviewing the repository history would immediately understand this update involves a major version bump to the CLI tooling. While the changeset includes supporting modifications (removing deprecated task imports and updating shell scripts to accommodate the new registry structure), these are necessary adaptations to ensure compatibility with the new CLI version, and the title appropriately captures the main change without excessive detail.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore-update-cli

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 8a0035a and 2abceb7.

⛔ Files ignored due to path filters (1)
  • examples/swap/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (1)
  • examples/swap/package.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • examples/swap/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
  • GitHub Check: test (examples/hello)
  • GitHub Check: test (examples/nft)
  • GitHub Check: test (examples/token)
  • GitHub Check: test (examples/call)
  • GitHub Check: test (examples/swap)
  • GitHub Check: test (examples/token)
  • GitHub Check: test (examples/swap)
  • GitHub Check: test (examples/call)
  • GitHub Check: test (examples/hello)
  • GitHub Check: test (examples/nft)
  • GitHub Check: slither (examples/swap, swap.sarif)
  • GitHub Check: slither (examples/call, call.sarif)
  • GitHub Check: slither (examples/hello, hello.sarif)

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.

@fadeev
Copy link
Member Author

fadeev commented Oct 21, 2025

Broken, because zetachain localnet check checks for localnet.json to be present in the current dir to check if localnet is running, and in the newer version of localnet we no longer use this file.

@fadeev fadeev changed the title chore: update CLI to 7.0.0-rc1 chore: update CLI to 7.0.0 Oct 21, 2025
@fadeev fadeev marked this pull request as ready for review October 21, 2025 12:49
@fadeev fadeev requested a review from a team as a code owner October 21, 2025 12:49
@fadeev fadeev marked this pull request as draft October 21, 2025 12:55
@fadeev
Copy link
Member Author

fadeev commented Oct 21, 2025

Before merging this should be updated to CLI 7.0.0 stable. done

@fadeev fadeev marked this pull request as ready for review October 21, 2025 14:08
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 333fb98 and 8a0035a.

⛔ Files ignored due to path filters (5)
  • examples/call/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
  • examples/hello/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
  • examples/messaging/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
  • examples/nft/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
  • examples/token/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (5)
  • examples/call/package.json (1 hunks)
  • examples/hello/package.json (1 hunks)
  • examples/messaging/package.json (1 hunks)
  • examples/nft/package.json (1 hunks)
  • examples/token/package.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • examples/call/package.json
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: hernan-clich
PR: zeta-chain/example-contracts#280
File: examples/hello/frontend/src/utils/ethersHelpers.ts:1-6
Timestamp: 2025-09-18T17:59:04.889Z
Learning: Commit 1c6cffd3d29499bf0544987a9116c7c6571ff895 in zeta-chain/example-contracts resolves the noble/hashes esbuild build failure by adding resolutions for "noble/hashes": "1.8.0" and "noble/curves": "1.9.7" to examples/hello/frontend/package.json.
Learnt from: hernan-clich
PR: zeta-chain/example-contracts#280
File: examples/hello/frontend/src/ConnectedContent.tsx:3-10
Timestamp: 2025-09-18T18:00:10.177Z
Learning: Commit 1c6cffd3d29499bf0544987a9116c7c6571ff895 in zeta-chain/example-contracts#280 successfully resolved the noble/hashes "anumber" export error by adding resolutions in examples/hello/frontend/package.json to pin noble/hashes to 1.8.0 and noble/curves to 1.9.7, eliminating the version conflicts that were causing esbuild build failures.
Learnt from: hernan-clich
PR: zeta-chain/example-contracts#280
File: examples/hello/frontend/src/AppContent.tsx:6-6
Timestamp: 2025-09-17T21:47:04.873Z
Learning: The noble/hashes version conflict issue in zeta-chain/example-contracts should be resolved at the zetachain/wallet library level by adding resolutions to force compatible versions, protecting all consumers from this transitive dependency issue.
📚 Learning: 2025-09-18T17:59:04.889Z
Learnt from: hernan-clich
PR: zeta-chain/example-contracts#280
File: examples/hello/frontend/src/utils/ethersHelpers.ts:1-6
Timestamp: 2025-09-18T17:59:04.889Z
Learning: Commit 1c6cffd3d29499bf0544987a9116c7c6571ff895 in zeta-chain/example-contracts resolves the noble/hashes esbuild build failure by adding resolutions for "noble/hashes": "1.8.0" and "noble/curves": "1.9.7" to examples/hello/frontend/package.json.

Applied to files:

  • examples/nft/package.json
  • examples/hello/package.json
📚 Learning: 2025-09-18T18:00:10.177Z
Learnt from: hernan-clich
PR: zeta-chain/example-contracts#280
File: examples/hello/frontend/src/ConnectedContent.tsx:3-10
Timestamp: 2025-09-18T18:00:10.177Z
Learning: Commit 1c6cffd3d29499bf0544987a9116c7c6571ff895 in zeta-chain/example-contracts#280 successfully resolved the noble/hashes "anumber" export error by adding resolutions in examples/hello/frontend/package.json to pin noble/hashes to 1.8.0 and noble/curves to 1.9.7, eliminating the version conflicts that were causing esbuild build failures.

Applied to files:

  • examples/hello/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: slither (examples/call, call.sarif)
  • GitHub Check: slither (examples/hello, hello.sarif)
🔇 Additional comments (3)
examples/token/package.json (1)

64-64: Clarify use of RC version for @zetachain/standard-contracts and version consistency.

Line 61 pins @zetachain/standard-contracts to 4.0.0-rc9, a release candidate, while examples/messaging/package.json uses the stable 3.0.0. Confirm this inconsistency is intentional. If standardization is desired, align this across all examples or document why version divergence is needed.

examples/hello/package.json (1)

60-60: LGTM.

The zetachain 7.0.0 update is consistent with the PR objectives and maintains exact version pinning for stability. The absence of @zetachain/standard-contracts in this example appears intentional based on its simpler scope compared to other examples.

examples/nft/package.json (1)

64-64: LGTM on the zetachain 7.0.0 bump.

The version update is consistent with the PR objectives. Note that this example (like examples/token/package.json) uses @zetachain/standard-contracts@4.0.0-rc9 (RC), whereas examples/messaging/package.json pins the stable 3.0.0. Verify this split is intentional across the examples.

@fadeev fadeev merged commit 11e5c24 into main Oct 21, 2025
20 checks passed
@fadeev fadeev deleted the chore-update-cli branch October 21, 2025 14:35
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.

3 participants