Skip to content

Conversation

@fadeev
Copy link
Member

@fadeev fadeev commented Aug 18, 2025

Related: zeta-chain/example-contracts#285

Summary by CodeRabbit

  • Documentation
    • Updated tutorials (Call, Hello, Swap) to use the TSX-based deploy CLI for Localnet/Testnet, replacing previous methods.
    • Standardized deployment output parsing to use the contract address and echo it for clarity.
    • Preserved RPC and gateway usage with simplified flags.
    • Reformatted code blocks and command/output examples for readability (wrapped long lines, multi-line values).
    • Harmonized command snippets and entry points across pages.

@fadeev fadeev requested review from a team as code owners August 18, 2025 12:06
@vercel
Copy link

vercel bot commented Aug 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
docs-v2 Ready Ready Preview Aug 18, 2025 0:16am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 18, 2025

📝 Walkthrough

Walkthrough

The tutorials update deployment commands from Forge/ts-node to a TSX-based CLI across call, hello, and swap guides. Output parsing switches from .deployedTo to .contractAddress. hello.mdx also includes presentational line-wrapping changes. No API or code signatures are altered.

Changes

Cohort / File(s) Summary
Deployment tooling switch (Forge → TSX CLI)
src/pages/developers/tutorials/call.mdx, src/pages/developers/tutorials/hello.mdx, src/pages/developers/tutorials/swap.mdx
Replace Forge/ts-node deploy commands with npx tsx commands deploy. Swap .deployedTo parsing for .contractAddress. In call.mdx, switch flags to --rpc/--gateway and adjust output key. In hello.mdx, apply same TSX deploy for Localnet/Testnet and echo the result. In swap.mdx, change ts-node commands/index.ts to tsx commands.
Formatting/presentation updates
src/pages/developers/tutorials/hello.mdx
Wrapped long lines in code/output blocks and split multi-line command examples without altering semantics or behavior.

Sequence Diagram(s)

sequenceDiagram
  participant Dev as Developer Shell
  participant CLI as TSX Deploy CLI
  participant RPC as RPC/Gateway

  Dev->>CLI: npx tsx commands deploy --private-key ... [--rpc --gateway]
  CLI->>RPC: Send deploy transaction
  RPC-->>CLI: Deployment receipt (includes contractAddress)
  CLI-->>Dev: JSON output
  Dev->>Dev: jq -r .contractAddress -> store/echo
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch use-deploy-commands

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 0

🔭 Outside diff range comments (3)
src/pages/developers/tutorials/swap.mdx (1)

462-467: Use TSX CLI for consistency in swap tutorial

The swap.mdx tutorial still invokes the deploy script via ts-node, while all other tutorials uniformly use the npx tsx commands deploy entrypoint. Please update the snippet at src/pages/developers/tutorials/swap.mdx (around lines 462–467) as follows:

-UNIVERSAL=$(npx ts-node commands/index.ts deploy \
-  --private-key $PRIVATE_KEY \
-  --rpc http://localhost:8545 \
-  --gateway $GATEWAY_ZETACHAIN \
-  --uniswap-router $UNISWAP_ROUTER | jq -r .contractAddress) && echo $UNIVERSAL
+UNIVERSAL=$(npx tsx commands deploy \
+  --private-key $PRIVATE_KEY \
+  --rpc http://localhost:8545 \
+  --gateway $GATEWAY_ZETACHAIN \
+  --uniswap-router $UNISWAP_ROUTER | jq -r .contractAddress) && echo $UNIVERSAL

This aligns swap.mdx with the call.mdx and hello.mdx tutorials.

src/pages/developers/tutorials/call.mdx (2)

313-314: Grammar fix: double period.

Replace “use zero address..” with a single period.

-  `call` with no token transfer, use zero address..
+  `call` with no token transfer, use zero address.

453-470: Switch Localnet Deploy Commands to TSX CLI

Replace the forge create invocations in src/pages/developers/tutorials/call.mdx (around lines 453–470) with the TSX deploy CLI to match the pattern used elsewhere:

-UNIVERSAL=$(forge create Universal \
-  --rpc-url $RPC \
-  --private-key $PRIVATE_KEY \
-  --broadcast \
-  --json \
-  --constructor-args $GATEWAY_ZETACHAIN | jq -r .deployedTo) && echo $UNIVERSAL
+UNIVERSAL=$(npx tsx commands deploy \
+  --private-key $PRIVATE_KEY \
+  --rpc $RPC \
+  --gateway $GATEWAY_ZETACHAIN | jq -r .contractAddress) && echo $UNIVERSAL
-CONNECTED=$(forge create Connected \
-  --rpc-url $RPC \
-  --private-key $PRIVATE_KEY \
-  --broadcast \
-  --json \
-  --constructor-args $GATEWAY_ETHEREUM | jq -r .deployedTo) && echo $CONNECTED
+CONNECTED=$(npx tsx commands deploy \
+  --private-key $PRIVATE_KEY \
+  --rpc $RPC \
+  --gateway $GATEWAY_ETHEREUM | jq -r .contractAddress) && echo $CONNECTED

This ensures localnet deployments use the same TSX CLI approach already established in this tutorial and others.

🧹 Nitpick comments (4)
src/pages/developers/tutorials/swap.mdx (1)

282-283: Switch to TSX deploy CLI looks good; consider explicit network flags for clarity.

The move to npx tsx commands deploy with .contractAddress extraction aligns with the PR objective. For parity with the “call” tutorial and to avoid any ambiguity about implicit defaults, consider passing --rpc and --gateway explicitly or add a short note stating that the deploy script auto-selects testnet RPC/gateway.

src/pages/developers/tutorials/hello.mdx (3)

286-287: Testnet deploy: correct migration to TSX CLI and .contractAddress.

Consider mirroring this approach in the Localnet section above (which still uses Forge) for a consistent developer experience. Suggested Localnet command:

UNIVERSAL=$(npx tsx commands deploy \
  --private-key $PRIVATE_KEY \
  --rpc http://localhost:8545 \
  --gateway $GATEWAY_ZETACHAIN | jq -r .contractAddress) && echo $UNIVERSAL

343-345: Inline code span split across lines; tighten wording.

The inline code for the command is broken across lines, which can render awkwardly. Rephrase and keep the code span on one line.

-After the transaction is initiated on Base Sepolia, ZetaChain's protocol
-facilitates its cross-chain transfer and execution on the destination chain
-(ZetaChain). To monitor the status of this cross-chain transaction, the `npx
-zetachain query cctx` command is used, providing real-time updates on the
-transaction's journey.
+After the transaction is initiated on Base Sepolia, ZetaChain's protocol
+facilitates its cross-chain transfer and execution on the destination chain
+(ZetaChain). To monitor the status of this cross-chain transaction, use the
+`npx zetachain query cctx` command, which provides real-time updates on the
+transaction's journey.

379-382: Minor formatting polish on wrapped bullet items.

The wrapped code spans within bullets are readable, but consider keeping each bullet’s code span on one line to avoid broken emphasis and improve scanability.

Also applies to: 391-392

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • 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 4cfbed3 and 775559f.

📒 Files selected for processing (3)
  • src/pages/developers/tutorials/call.mdx (1 hunks)
  • src/pages/developers/tutorials/hello.mdx (4 hunks)
  • src/pages/developers/tutorials/swap.mdx (1 hunks)
🧰 Additional context used
🪛 LanguageTool
src/pages/developers/tutorials/hello.mdx

[grammar] ~344-~344: There might be a mistake here.
Context: ...used, providing real-time updates on the transaction's journey. The command for ...

(QB_NEW_EN)


[grammar] ~384-~384: There might be a mistake here.
Context: ...fully called on the destination chain. - Sender: 0x4955a3F38ff86ae92A914445099caa8eA2B9bA32: The address of the sender on the ori...

(QB_NEW_EN)


[grammar] ~386-~386: There might be a mistake here.
Context: ...f the sender on the originating chain. - Receiver: 0xFeb4F33d424D6685104624d985095dacab567151: The address of the receiver contract...

(QB_NEW_EN)

⏰ 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). (1)
  • GitHub Check: build
🔇 Additional comments (3)
src/pages/developers/tutorials/call.mdx (2)

280-281: Testnet deploy: good migration to TSX CLI and .contractAddress extraction.


286-287: Connected deploy: good migration to TSX CLI and .contractAddress extraction.

src/pages/developers/tutorials/hello.mdx (1)

249-251: OK to wrap the log line; rendering remains clear.

@fadeev fadeev merged commit 16ceb01 into main Aug 20, 2025
8 checks passed
@fadeev fadeev deleted the use-deploy-commands branch August 20, 2025 11:10
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.

4 participants