Skip to content

Conversation

@fadeev
Copy link
Member

@fadeev fadeev commented Mar 7, 2025

Summary by CodeRabbit

  • Documentation
    • Added a new section with a link to a Solana Gateway tutorial for practical applications.
    • Introduced new sections for Solana and Sui in the tutorial listings, while removing the previous NFT content.
    • Launched a comprehensive tutorial on bridging tokens from Solana to ZetaChain, detailing the deposit and withdrawal processes.
    • Added a new tutorial guiding users on interacting with ZetaChain applications from the Sui blockchain.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 7, 2025

📝 Walkthrough

Walkthrough

This pull request updates the Solana documentation and tutorials. An additional section with a tutorial link for using the Solana Gateway has been appended to the chains documentation. In the tutorials metadata file, new entries for "solana" and "sui" are added while the obsolete "nft" section is removed. New tutorials on bridging tokens from Solana and interacting with ZetaChain from Sui have also been introduced, providing detailed instructions for users.

Changes

File(s) Change Summary
src/pages/developers/chains/solana.mdx Added a new section with a tutorial link for using the Solana Gateway.
src/pages/developers/tutorials/_meta.json Updated tutorial metadata: added new sections for "solana" and "sui" with title, read time, and description; removed the obsolete "nft" tutorial section.
src/pages/developers/tutorials/solana.mdx Introduced a comprehensive tutorial on bridging tokens from Solana to ZetaChain, detailing the deposit-and-call process and withdrawal commands.
src/pages/developers/tutorials/sui.mdx Created a new tutorial guiding users on interacting with ZetaChain universal applications from the Sui blockchain, including setup and deposit instructions.

Possibly related PRs

  • Update Solana docs to match current state of testnet #570: The changes in the main PR do not modify any existing functionality or logic in the Solana documentation, while the retrieved PR updates specific command examples and removes outdated notes in the same file, indicating a direct code-level relationship.
  • Update Solana gateway docs #480: The changes in the main PR focus on enhancing documentation with a tutorial link, while the retrieved PR introduces new functionality and detailed instructions for the Solana Gateway, indicating a direct modification to the same section of the Solana documentation.
  • Solana deposit and call #520: The changes in the main PR, which enhance documentation for the Solana Gateway, are related to the modifications in the retrieved PR that update the deposit and deposit_and_call functionalities in the same file, as both PRs focus on the Solana Gateway's operations.

Suggested reviewers

  • hernan-clich
  • GMaiolo

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

🪧 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.
    • Generate unit testing code for this file.
    • 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. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

Documentation and Community

  • 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.

@vercel
Copy link

vercel bot commented Mar 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview Mar 13, 2025 2:05pm

@fadeev fadeev marked this pull request as ready for review March 7, 2025 14:34
@fadeev fadeev requested review from a team as code owners March 7, 2025 14:34
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

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

67-75: Deposit Command Block
The command example for depositing SOL using npx hardhat localnet:solana-deposit is clear. Please ensure that the placeholder receiver address is updated appropriately in real-world use.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~75-~75: Loose punctuation mark.
Context: ...bB7 \ --amount 0.1 ``` - --receiver: The address of a universal contract on ...

(UNLIKELY_OPENING_PUNCTUATION)


91-107: Withdrawal Command and Parameter Documentation
The instructions for withdrawing tokens from ZetaChain to Solana are clear. Note that some minor punctuation inconsistencies (as flagged by static analysis) could be tidied up to boost clarity—for example, reviewing the bullet list formatting.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~102-~102: Loose punctuation mark.
Context: ...amount 0.1 ``` - --gateway-zeta-chain: Address of the ZetaChain gateway. - `--...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~103-~103: Loose punctuation mark.
Context: ...of the ZetaChain gateway. - --receiver: A Solana wallet address to receive the ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~104-~104: Loose punctuation mark.
Context: ...eceive the withdrawn tokens. - --zrc20: The ZetaChain representation of the tok...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~106-~106: Loose punctuation mark.
Context: ...ithdraw (ZRC-20 address). - --amount: The amount to withdraw. ## Withdraw an...

(UNLIKELY_OPENING_PUNCTUATION)


147-160: Withdraw SOL and Call Command Discrepancy
The command provided for withdrawing SOL and calling a Solana program is comprehensive. However, note that the accompanying bullet list references an encoded data variable ("$ENCODED_ACCOUNTS_AND_DATA") that does not appear in the command itself (which uses a direct command substitution via npx ts-node ...). Consider updating the explanatory text to reflect the actual implementation.


186-190: Tutorial Conclusion and Summary
The conclusion succinctly recaps the tutorial’s content. A minor stylistic improvement—such as the inclusion of a comma for better flow—could be considered.

🧰 Tools
🪛 LanguageTool

[typographical] ~186-~186: It appears that a comma is missing.
Context: ...s of SPL-20 USDC on ZetaChain. In this tutorial you’ve learned how to deploy a universa...

(DURING_THAT_TIME_COMMA)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between e680c20 and ff388ce.

📒 Files selected for processing (3)
  • src/pages/developers/chains/solana.mdx (1 hunks)
  • src/pages/developers/tutorials/_meta.json (1 hunks)
  • src/pages/developers/tutorials/solana.mdx (1 hunks)
🧰 Additional context used
🪛 LanguageTool
src/pages/developers/tutorials/solana.mdx

[grammar] ~6-~6: The word ‘withdraw’ is not a noun. Did you mean “withdrawal”?
Context: ... calling Solana programs as part of the withdraw process. Below are instructions to set...

(PREPOSITION_VERB)


[uncategorized] ~75-~75: Loose punctuation mark.
Context: ...bB7 \ --amount 0.1 ``` - --receiver: The address of a universal contract on ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~77-~77: Loose punctuation mark.
Context: ... will receive the tokens. - --amount: The amount of SOL tokens to deposit. #...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~102-~102: Loose punctuation mark.
Context: ...amount 0.1 ``` - --gateway-zeta-chain: Address of the ZetaChain gateway. - `--...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~103-~103: Loose punctuation mark.
Context: ...of the ZetaChain gateway. - --receiver: A Solana wallet address to receive the ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~104-~104: Loose punctuation mark.
Context: ...eceive the withdrawn tokens. - --zrc20: The ZetaChain representation of the tok...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~106-~106: Loose punctuation mark.
Context: ...ithdraw (ZRC-20 address). - --amount: The amount to withdraw. ## Withdraw an...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~162-~162: Loose punctuation mark.
Context: ...s "sol" "$USDC_SPL") ``` - --receiver: The Solana program ID you want to call....

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~163-~163: Loose punctuation mark.
Context: ...ou want to call. - --types '["bytes"]': Specifies that the contract call argume...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~165-~165: Loose punctuation mark.
Context: ... data). - "$ENCODED_ACCOUNTS_AND_DATA": The encoded Solana program call argumen...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~167-~167: Loose punctuation mark.
Context: ...erated in the previous step. - --zrc20: ZRC-20 address of SOL on ZetaChain. ##...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~184-~184: Loose punctuation mark.
Context: ...s.ts "spl" "$USDC_SPL") ``` - --zrc20: ZRC-20 address of SPL-20 USDC on ZetaCh...

(UNLIKELY_OPENING_PUNCTUATION)


[typographical] ~186-~186: It appears that a comma is missing.
Context: ...s of SPL-20 USDC on ZetaChain. In this tutorial you’ve learned how to deploy a universa...

(DURING_THAT_TIME_COMMA)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build
🔇 Additional comments (14)
src/pages/developers/chains/solana.mdx (1)

136-139: Added Tutorial Link Section
A new section has been appended that directs users to the comprehensive Solana tutorial. The link and accompanying text are clear and contextually appropriate.

src/pages/developers/tutorials/_meta.json (1)

17-21: New "solana" Tutorial Metadata Added
The addition of the "solana" section (with title, readTime, and description) is well structured. This change complements the updated documentation and the new tutorial, and the obsolete NFT section appears to have been correctly removed.

src/pages/developers/tutorials/solana.mdx (12)

1-10: Introduction and Title Clarity
The header "# Universal Apps and Solana" and the introductory paragraph clearly state the tutorial’s purpose and scope. This sets a solid foundation for the reader.

🧰 Tools
🪛 LanguageTool

[grammar] ~6-~6: The word ‘withdraw’ is not a noun. Did you mean “withdrawal”?
Context: ... calling Solana programs as part of the withdraw process. Below are instructions to set...

(PREPOSITION_VERB)


11-13: Solana Gateway Reference
The brief mention of the Solana Gateway program—with a link directing users to additional documentation—is effective. Please verify that the referenced URL remains current.


14-17: Prerequisites Section Review
The prerequisites section nicely highlights the need for the solana CLI. Consider periodically checking the external link for the CLI installation to ensure its ongoing accuracy.


18-24: Repository Cloning Instructions
The cloning and dependency installation instructions are straightforward. The command examples using git clone and yarn are clear, which will help developers set up the example environment without confusion.


26-34: Running Localnet Instruction
The guidance on launching the local development environment using npx hardhat localnet is concise. It may be beneficial to ensure that any required dependencies or environmental variables are documented elsewhere for clarity.


37-45: Contract Compilation and Deployment
The steps to compile and deploy the universal contract (using npx hardhat compile --force and npx hardhat deploy ...) are clear and follow a logical sequence.


47-56: Deployment Output & Address Tracking
The section advising users to track the deployed contract address is well written. Emphasizing storing the address securely for later use might further help users avoid potential mishaps.


57-67: Overview of Deposit and Call Workflow
This part clearly introduces the dual functionality to deposit SOL and trigger contract calls. The breakdown between depositing only versus depositing and calling is helpful.


79-87: Deposit and Call Command Block
The command for depositing SOL and immediately calling a universal contract is well detailed. Verify that the specified parameter type (["string"]) and argument (hello) match the universal contract’s expectations.


108-120: Withdraw and Call – Program Integration Explanation
This section effectively explains how to combine token withdrawal with a Solana program call. The detailed explanation adds valuable context for advanced interactions.


127-138: Example Solana Program Setup
The instructions for building and deploying the example Solana program (using anchor build and a subsequent ts-node command) are clear. Please ensure that environment variables (like USDC_SPL) are properly communicated to avoid setup issues.


169-182: Withdraw SPL-20 and Call Command Block
The instructions for withdrawing SPL-20 tokens and calling a Solana program mirror the previous section well. The command and its parameters are consistent.

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 (1)
src/pages/developers/tutorials/solana.mdx (1)

87-94: 🛠️ Refactor suggestion

Formatting Improvement: Merge Withdraw Command Blocks
The withdraw command is split into two code blocks, which may confuse readers. Consider merging the entire command into a single code block to improve clarity and reduce potential misinterpretation.

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

5-6: Grammatical Correction: Use "withdrawal" as a Noun
The sentence “calling Solana programs as part of the withdraw process” could be clearer if “withdraw” is replaced with “withdrawal” to accurately use a noun form.

🧰 Tools
🪛 LanguageTool

[grammar] ~6-~6: The word ‘withdraw’ is not a noun. Did you mean “withdrawal”?
Context: ... calling Solana programs as part of the withdraw process. Below are instructions to set...

(PREPOSITION_VERB)


157-165: Command Snippet Cleanup: Remove Extraneous Marker
Within the SPL-20 withdrawal command block, an extraneous line starting with a “-” (indicating a removed or duplicate parameter explanation) is present. Please remove this marker so that the command syntax is clean and unambiguous.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~160-~160: Loose punctuation mark.
Context: ...s "sol" "$USDC_SPL") ``` - --receiver: The Solana program ID you want to call....

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~161-~161: Loose punctuation mark.
Context: ...ou want to call. - --types '["bytes"]': Specifies that the contract call argume...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~163-~163: Loose punctuation mark.
Context: ... data). - "$ENCODED_ACCOUNTS_AND_DATA": The encoded Solana program call argumen...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~165-~165: Loose punctuation mark.
Context: ...erated in the previous step. - --zrc20: ZRC-20 address of SOL on ZetaChain. ##...

(UNLIKELY_OPENING_PUNCTUATION)


167-171: Content Redundancy: Eliminate Duplicate Summary Paragraphs
The concluding summary of the tutorial’s workflows appears twice—once on lines 167–171 and again on lines 184–188. Removing the duplicate will enhance conciseness and prevent redundancy.

Also applies to: 184-188


73-104: Punctuation Consistency: Verify Command Block Formatting
Static analysis hints indicate potential loose punctuation (e.g., extra or misplaced backslashes and punctuation markers) in several command blocks within these lines. Please review and adjust the punctuation on lines 73–104 to ensure consistent, clean formatting throughout.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~73-~73: Loose punctuation mark.
Context: ...bB7 \ --amount 0.1 ``` - --receiver: The address of a universal contract on ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~75-~75: Loose punctuation mark.
Context: ... will receive the tokens. - --amount: The amount of SOL tokens to deposit. #...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~100-~100: Loose punctuation mark.
Context: ...amount 0.1 ``` - --gateway-zeta-chain: Address of the ZetaChain gateway. - `--...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~101-~101: Loose punctuation mark.
Context: ...of the ZetaChain gateway. - --receiver: A Solana wallet address to receive the ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~102-~102: Loose punctuation mark.
Context: ...eceive the withdrawn tokens. - --zrc20: The ZetaChain representation of the tok...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~104-~104: Loose punctuation mark.
Context: ...ithdraw (ZRC-20 address). - --amount: The amount to withdraw. ## Withdraw an...

(UNLIKELY_OPENING_PUNCTUATION)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between ff388ce and 208d296.

📒 Files selected for processing (7)
  • src/pages/developers/tutorials/solana.mdx (1 hunks)
  • src/pages/developers/tutorials/solana.mdx (3 hunks)
  • src/pages/developers/tutorials/solana.mdx (2 hunks)
  • src/pages/developers/tutorials/solana.mdx (2 hunks)
  • src/pages/developers/tutorials/solana.mdx (4 hunks)
  • src/pages/developers/tutorials/solana.mdx (1 hunks)
  • src/pages/developers/tutorials/solana.mdx (0 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/pages/developers/tutorials/solana.mdx
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/pages/developers/tutorials/solana.mdx
  • src/pages/developers/tutorials/solana.mdx
🧰 Additional context used
🪛 LanguageTool
src/pages/developers/tutorials/solana.mdx

[grammar] ~6-~6: The word ‘withdraw’ is not a noun. Did you mean “withdrawal”?
Context: ... calling Solana programs as part of the withdraw process. Below are instructions to set...

(PREPOSITION_VERB)


[uncategorized] ~73-~73: Loose punctuation mark.
Context: ...bB7 \ --amount 0.1 ``` - --receiver: The address of a universal contract on ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~75-~75: Loose punctuation mark.
Context: ... will receive the tokens. - --amount: The amount of SOL tokens to deposit. #...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~100-~100: Loose punctuation mark.
Context: ...amount 0.1 ``` - --gateway-zeta-chain: Address of the ZetaChain gateway. - `--...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~101-~101: Loose punctuation mark.
Context: ...of the ZetaChain gateway. - --receiver: A Solana wallet address to receive the ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~102-~102: Loose punctuation mark.
Context: ...eceive the withdrawn tokens. - --zrc20: The ZetaChain representation of the tok...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~104-~104: Loose punctuation mark.
Context: ...ithdraw (ZRC-20 address). - --amount: The amount to withdraw. ## Withdraw an...

(UNLIKELY_OPENING_PUNCTUATION)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build

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

🧹 Nitpick comments (3)
src/pages/developers/tutorials/solana.mdx (3)

29-34: Deposit-and-Call Command Clarity
This code block demonstrates the deposit-and-call process using a simple parameter (hello). Ensure that the argument aligns with the expected input for the universal contract function. Note that a similar command is presented later; if intentional for reinforcement, consider adding context to clarify the differences between the two occurrences.


80-85: Repeated Deposit-and-Call Command
A similar deposit-and-call command appears again in the document. If this repetition is intentional to emphasize usage in a different context, consider adding a brief explanation of the differences (if any) to avoid confusion among users.


148-161: Withdraw SOL and Call Program Command
This command correctly calls the ZetaChain Gateway to withdraw SOL and simultaneously execute a Solana program. While the command is well-formed, consider standardizing how call arguments are passed between this and the earlier withdrawal command (i.e. inline command substitution vs. using a pre-defined variable) for consistency.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 208d296 and 2e02e7c.

📒 Files selected for processing (8)
  • src/pages/developers/tutorials/solana.mdx (1 hunks)
  • src/pages/developers/tutorials/solana.mdx (3 hunks)
  • src/pages/developers/tutorials/solana.mdx (2 hunks)
  • src/pages/developers/tutorials/solana.mdx (2 hunks)
  • src/pages/developers/tutorials/solana.mdx (4 hunks)
  • src/pages/developers/tutorials/solana.mdx (1 hunks)
  • src/pages/developers/tutorials/solana.mdx (0 hunks)
  • src/pages/developers/tutorials/solana.mdx (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/pages/developers/tutorials/solana.mdx
  • src/pages/developers/tutorials/solana.mdx
  • src/pages/developers/tutorials/solana.mdx
  • src/pages/developers/tutorials/solana.mdx
🧰 Additional context used
🪛 LanguageTool
src/pages/developers/tutorials/solana.mdx

[uncategorized] ~103-~103: Loose punctuation mark.
Context: ...amount 0.1 ``` - --gateway-zeta-chain: Address of the ZetaChain gateway. - `--...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~104-~104: Loose punctuation mark.
Context: ...of the ZetaChain gateway. - --receiver: A Solana wallet address to receive the ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~105-~105: Loose punctuation mark.
Context: ...eceive the withdrawn tokens. - --zrc20: The ZetaChain representation of the tok...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~107-~107: Loose punctuation mark.
Context: ...ithdraw (ZRC-20 address). - --amount: The amount to withdraw. ## Withdraw an...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~166-~166: Loose punctuation mark.
Context: ... data). - "$ENCODED_ACCOUNTS_AND_DATA": The encoded Solana program call argumen...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~168-~168: Loose punctuation mark.
Context: ...erated in the previous step. - --zrc20: ZRC-20 address of SOL on ZetaChain. ##...

(UNLIKELY_OPENING_PUNCTUATION)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: build
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (20)
src/pages/developers/tutorials/solana.mdx (20)

1-5: Clear Repository Cloning Instructions
The initial code block clearly outlines the steps to clone the example contracts repository and install dependencies via Yarn. Ensure that the repository URL stays up-to-date as the project evolves.


7-9: Validate the Hardhat Localnet Command
The command to start a local Hardhat network is succinct and clear. Verify that this command is compatible with the targeted Hardhat version and that users have the required configuration in place.


11-14: Deployment Command for Universal Contract
This code block compiles and deploys the "Universal" contract using Hardhat. The use of flags (including the gateway address) is explicit. Consider parameterizing the gateway address in future iterations if multiple environments need to be supported.


16-19: Sample Deployment Output Provided
Including the sample output enhances clarity regarding successful deployment. Remember that actual output may differ slightly, so this sample should be periodically verified against the latest deployment logs.


23-27: Deposit Command from Solana
The deposit command is clearly documented with explicit flags (such as --receiver and --amount). Double-check that the provided receiver address consistently matches the deployed contract’s address, minimizing user error in tutorial execution.


38-45: Withdrawal from ZetaChain to Solana Command
The withdrawal command is well-structured with clear flags for gateway, receiver, network, token address, and amount. Confirm that all provided addresses are current and that users verify these values within their own deployment contexts.


49-52: Build and Deploy Solana Program Command
This command efficiently builds the Solana program using Anchor, executes a setup script, and reverts to the previous directory. Ensure users are aware that tools like Anchor and ts-node must be installed and configured on their systems before proceeding.


53-55: Display of Deployment Output for Solana Program
Providing the connected program deployment output is helpful for user verification. It would be beneficial to mention that the program ID may differ per deployment, so users should adjust subsequent commands accordingly.


61-69: Withdrawal-and-Call Command with Pre-Encoded Data
The command leverages the pre-encoded call arguments stored in $ENCODED_ACCOUNTS_AND_DATA and correctly passes multiple flags. Double-check that the encoding script returns the expected format; consistency in the encoding process is key for smooth operation.


94-101: Clear Withdrawal Command for Tokens to Solana
This code block cleanly demonstrates withdrawing tokens with all required parameters. The consistency in using flags (e.g., --gateway-zeta-chain, --receiver, etc.) is commendable.


103-108: Parameter Explanations are Concise
The bullet list succinctly explains the parameters used in the withdrawal command. This clarity aids users in understanding the function of each flag.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~103-~103: Loose punctuation mark.
Context: ...amount 0.1 ``` - --gateway-zeta-chain: Address of the ZetaChain gateway. - `--...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~104-~104: Loose punctuation mark.
Context: ...of the ZetaChain gateway. - --receiver: A Solana wallet address to receive the ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~105-~105: Loose punctuation mark.
Context: ...eceive the withdrawn tokens. - --zrc20: The ZetaChain representation of the tok...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~107-~107: Loose punctuation mark.
Context: ...ithdraw (ZRC-20 address). - --amount: The amount to withdraw. ## Withdraw an...

(UNLIKELY_OPENING_PUNCTUATION)


109-117: Comprehensive Overview for Withdraw-and-Call Process
The section details how to withdraw tokens and simultaneously trigger an on-chain Solana program. The explanation is thorough, ensuring that users understand complex interactions like automatic staking or swaps.


118-120: Detailing the Solana Program Usage
This brief explanation regarding the Solana program and its on_call function is clear. Users are directed to the appropriate directory for further details, which is beneficial.


122-127: Guidance on Withdraw-and-Call Setup
The steps provided to set up the example Solana program are clear. The note indicating that withdraw-and-call is currently available only on localnet is particularly useful.


133-135: Defining the USDC_SPL Environment Variable
This code block sets the USDC_SPL variable with a sample SPL token address. It is crucial that users update this value if necessary, depending on whether they are testing or deploying to production.


137-139: Enhanced Build and Setup Command
The updated command now passes the USDC_SPL variable to the setup script, ensuring the program is built with the correct SPL token address. Make sure that the setup script validates this input and handles invalid addresses gracefully.


144-146: Sample Program Deployment Output
Including sample program deployment output helps users verify success. Just note that actual outputs may vary, so users should adapt any subsequent commands accordingly.


163-169: Clear Explanation of Command Parameters
The bullet list following the command thoroughly explains each parameter used in the withdrawal-and-call process. This clarity is useful for users unfamiliar with the specifics.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~163-~163: Loose punctuation mark.
Context: ...s "sol" "$USDC_SPL") ``` - --receiver: The Solana program ID you want to call....

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~164-~164: Loose punctuation mark.
Context: ...ou want to call. - --types '["bytes"]': Specifies that the contract call argume...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~166-~166: Loose punctuation mark.
Context: ... data). - "$ENCODED_ACCOUNTS_AND_DATA": The encoded Solana program call argumen...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~168-~168: Loose punctuation mark.
Context: ...erated in the previous step. - --zrc20: ZRC-20 address of SOL on ZetaChain. ##...

(UNLIKELY_OPENING_PUNCTUATION)


175-183: Withdraw SPL-20 and Call Program Command
This code block mirrors the SOL withdrawal command with modifications for SPL-20 tokens. The use of the "spl" argument when encoding call data is appropriate. Ensure that the correct ZRC-20 address for SPL-20 USDC is maintained and updated as needed.


185-190: Effective Concluding Summary
The final section recaps the tutorial comprehensively, reinforcing the key steps that users have learned. This summary effectively consolidates the instructions provided throughout the document.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~185-~185: Loose punctuation mark.
Context: ...s.ts "spl" "$USDC_SPL") ``` - --zrc20: ZRC-20 address of SPL-20 USDC on ZetaCh...

(UNLIKELY_OPENING_PUNCTUATION)


[typographical] ~187-~187: It appears that a comma is missing.
Context: ...s of SPL-20 USDC on ZetaChain. In this tutorial you’ve learned how to deploy a universa...

(DURING_THAT_TIME_COMMA)

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

🧹 Nitpick comments (6)
src/pages/developers/tutorials/solana.mdx (6)

15-16: Solana Gateway Mention & Documentation Link

The mention of the Solana Gateway program and the link to the documentation is well placed. Please verify that the linked docs at /developers/chains/solana are current.


43-51: Compiling and Deploying the Universal Contract

The instructions to compile and deploy the universal contract are clear. You might consider adding a note about ensuring all necessary dependencies (e.g., Hardhat, network configuration) are installed before proceeding.


72-75: Deposit Flags Explanation

The parameter explanations for --receiver and --amount are clear. Note that static analysis flagged some punctuation concerns in similar markdown lists; double-check that the markdown renders the bullet points as intended (though these are likely false positives).


103-108: Withdrawal Flags Detailed Explanation

The detailed bullet list explaining each flag for the withdrawal command is very useful. Although static analysis has flagged some loose punctuation issues in these lines, the markdown formatting appears correct. Consider a brief review of punctuation if clarity is ever questioned by users.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~103-~103: Loose punctuation mark.
Context: ...amount 0.1 ``` - --gateway-zeta-chain: Address of the ZetaChain gateway. - `--...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~104-~104: Loose punctuation mark.
Context: ...of the ZetaChain gateway. - --receiver: A Solana wallet address to receive the ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~105-~105: Loose punctuation mark.
Context: ...eceive the withdrawn tokens. - --zrc20: The ZetaChain representation of the tok...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~107-~107: Loose punctuation mark.
Context: ...ithdraw (ZRC-20 address). - --amount: The amount to withdraw. ## Withdraw an...

(UNLIKELY_OPENING_PUNCTUATION)


134-136: Command for Building and Deploying the Solana Program

The compound command that changes directories, builds the project, and runs the TypeScript setup script is comprehensive. It might be beneficial to note prerequisites such as having Anchor and ts-node installed prior to running this command.


184-187: Conclusion and Tutorial Summary

The closing summary neatly encapsulates the tutorial’s content. As a minor nitpick, review the punctuation—especially around the list items—to ensure optimal readability (a comma might be beneficial after the contract type list).

🧰 Tools
🪛 LanguageTool

[typographical] ~184-~184: It appears that a comma is missing.
Context: ...s of SPL-20 USDC on ZetaChain. In this tutorial you’ve learned how to deploy a universa...

(DURING_THAT_TIME_COMMA)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2e02e7c and ad9f287.

📒 Files selected for processing (1)
  • src/pages/developers/tutorials/solana.mdx (1 hunks)
🧰 Additional context used
🪛 LanguageTool
src/pages/developers/tutorials/solana.mdx

[uncategorized] ~103-~103: Loose punctuation mark.
Context: ...amount 0.1 ``` - --gateway-zeta-chain: Address of the ZetaChain gateway. - `--...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~104-~104: Loose punctuation mark.
Context: ...of the ZetaChain gateway. - --receiver: A Solana wallet address to receive the ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~105-~105: Loose punctuation mark.
Context: ...eceive the withdrawn tokens. - --zrc20: The ZetaChain representation of the tok...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~107-~107: Loose punctuation mark.
Context: ...ithdraw (ZRC-20 address). - --amount: The amount to withdraw. ## Withdraw an...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~160-~160: Loose punctuation mark.
Context: ...s "sol" "$USDC_SPL") ``` - --receiver: The Solana program ID you want to call....

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~161-~161: Loose punctuation mark.
Context: ...ou want to call. - --types '["bytes"]': Specifies that the contract call argume...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~163-~163: Loose punctuation mark.
Context: ... data). - "$ENCODED_ACCOUNTS_AND_DATA": The encoded Solana program call argumen...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~165-~165: Loose punctuation mark.
Context: ...erated in the previous step. - --zrc20: ZRC-20 address of SOL on ZetaChain. ##...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~182-~182: Loose punctuation mark.
Context: ...s.ts "spl" "$USDC_SPL") ``` - --zrc20: ZRC-20 address of SPL-20 USDC on ZetaCh...

(UNLIKELY_OPENING_PUNCTUATION)


[typographical] ~184-~184: It appears that a comma is missing.
Context: ...s of SPL-20 USDC on ZetaChain. In this tutorial you’ve learned how to deploy a universa...

(DURING_THAT_TIME_COMMA)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: build
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (20)
src/pages/developers/tutorials/solana.mdx (20)

1-5: Introduction Text Clarity

The opening paragraph clearly introduces the idea of building universal applications with ZetaChain and Solana. The messaging is concise and engaging.


6-14: Tutorial Objectives List is Well-Structured

The bullet list neatly outlines all the steps the tutorial will cover. It provides a clear roadmap for the reader.


18-23: Prerequisites Section is Clear

The prerequisites are clearly stated, and the link to the solana CLI is helpful. No changes are necessary here.


24-30: Cloning the Example Project

The instructions for cloning the project and changing to the appropriate directory are straightforward and well documented.


32-40: Launching Localnet

The steps provided for launching the local development environment (localnet) are precise. The command and the note to keep it running are very clear.


41-41: Running Localnet Reminder

The reminder to keep localnet running in a separate terminal window is a good usability note.


52-60: Contract Deployment Confirmation Output

Providing an example of the successful deployment output helps users confirm that their deployment was successful.


62-70: SOL Deposit Command

The deposit command and its explanation (including flag descriptions) are accurate and user friendly.


76-85: Deposit and Call Command

The command for depositing tokens and simultaneously calling a universal app is well formatted. The flag usage and structure are consistent with the intended functionality.


87-89: Command Explanation for Deposit and Call

The explanatory text following the command clearly informs the reader about the outcome of the operation.


90-101: Withdraw Tokens Command

The command for withdrawing tokens from ZetaChain back to Solana is precise, with all necessary parameters provided.


109-116: Introduction to Withdraw and Call Program

The section introducing the advanced “withdraw and call” functionality is well articulated and provides a smooth transition into more complex interactions.


117-120: Reference to the Example Solana Program

Mentioning that the Solana directory contains an example program (with an on_call function) is clear and informative.


122-124: Guidance for Setting Up the Solana Program

The introductory text for setting up the example Solana program is concise and sets appropriate expectations for the upcoming steps.


125-125: Build and Set Up Heading

The heading “Build and Set Up the Example Solana Program” appropriately signifies the beginning of this setup guide.


127-132: Setting the SPL-20 USDC Address

The command to set the USDC_SPL variable is simple and clear. Make sure that the provided address is verified and current as per the latest network settings.


138-144: Deployment Output for the Solana Program

The expected output example is useful for confirming a successful deployment. It reinforces the guidance provided in the setup steps.


145-157: Withdraw SOL and Call Command

The command for withdrawing SOL and calling a Solana program is well structured. It correctly includes dynamic generation of the call arguments via a ts-node script.


167-180: Withdraw SPL-20 and Call Command

The command block for withdrawing SPL-20 tokens and calling a Solana program mirrors the earlier SOL withdrawal command effectively. It maintains consistency in flag usage and structure.


182-182: SPL-20 Flag Explanation

The description for the --zrc20 parameter for SPL-20 USDC is clear and correct.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~182-~182: Loose punctuation mark.
Context: ...s.ts "spl" "$USDC_SPL") ``` - --zrc20: ZRC-20 address of SPL-20 USDC on ZetaCh...

(UNLIKELY_OPENING_PUNCTUATION)

@fadeev
Copy link
Member Author

fadeev commented Mar 13, 2025

@hernan-clich please, review.

Copy link
Member

@hernan-clich hernan-clich left a comment

Choose a reason for hiding this comment

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

Tested ACK

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

🧹 Nitpick comments (8)
src/pages/developers/tutorials/_meta.json (2)

17-21: New "solana" section addition is clear.
The JSON object for the Solana tutorial is formatted correctly with the required keys ("title", "readTime", "description"). Verify that the corresponding tutorial file (e.g. solana.mdx) exists and that any links or references are updated accordingly.


22-26: New "sui" section addition is well-structured.
The Sui tutorial metadata follows the same schema as other entries. Ensure that cross-references and navigation elements on the site properly integrate this new section.

src/pages/developers/tutorials/sui.mdx (6)

7-14: Bullet list for tutorial objectives is well-structured.
The list outlining the tutorial steps is clear and concise. Please double-check that the embedded link for [localnet] points to the correct tutorial page.


97-111: Deposit and Call section is concise.
Combining the deposit and contract call steps in one command is clearly illustrated. Please verify that the syntax for options such as --types is correctly interpreted by the CLI.


112-127: Sui contract build and deployment guidance is thorough.
The instructions including the Move.toml configuration and the explanation for local versus public repository imports are helpful. Ensure that the local path specified matches the actual setup and consider clarifying any differences for testnet/mainnet deployments if necessary.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~125-~125: Possible missing comma found.
Context: ...s published on localnet. On testnet and mainnet the Gateway will be imported from a pub...

(AI_HYDRA_LEO_MISSING_COMMA)


191-211: Deposit and Call from a Sui Contract is comprehensively explained.
This section provides a clear multi-step guide for executing a deposit and simultaneous function call, including the use of ABI encoding via Foundry's cast. It is advisable to verify tool version compatibility and ensure that the command options are current.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~205-~205: Possible missing comma found.
Context: ...tring)" "alice") ``` Note that in this example we're calling the deposit_and_call fu...

(AI_HYDRA_LEO_MISSING_COMMA)


124-127: Minor punctuation suggestion in narrative text.
The sentence describing the Gateway import for testnet/mainnet could benefit from a slight punctuation revision for enhanced clarity.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~125-~125: Possible missing comma found.
Context: ...s published on localnet. On testnet and mainnet the Gateway will be imported from a pub...

(AI_HYDRA_LEO_MISSING_COMMA)


205-207: Minor punctuation suggestion.
Consider adding a comma after the ABI encoding guideline for improved readability in the final paragraph.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~205-~205: Possible missing comma found.
Context: ...tring)" "alice") ``` Note that in this example we're calling the deposit_and_call fu...

(AI_HYDRA_LEO_MISSING_COMMA)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between ad9f287 and af7c2c4.

📒 Files selected for processing (2)
  • src/pages/developers/tutorials/_meta.json (1 hunks)
  • src/pages/developers/tutorials/sui.mdx (1 hunks)
🧰 Additional context used
🪛 LanguageTool
src/pages/developers/tutorials/sui.mdx

[uncategorized] ~125-~125: Possible missing comma found.
Context: ...s published on localnet. On testnet and mainnet the Gateway will be imported from a pub...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~185-~185: Loose punctuation mark.
Context: ...13d98a0A55aEB8ab9FbB7 ``` - --package: package ID of the Sui contract deployed...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~205-~205: Possible missing comma found.
Context: ...tring)" "alice") ``` Note that in this example we're calling the deposit_and_call fu...

(AI_HYDRA_LEO_MISSING_COMMA)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build
🔇 Additional comments (12)
src/pages/developers/tutorials/_meta.json (1)

1-42: Overall JSON structure is consistent and valid.
The removal of the obsolete "nft" section and the addition of new sections align with the intended documentation update. No structural issues were observed.

src/pages/developers/tutorials/sui.mdx (11)

1-6: Introduction section clarity.
The opening paragraph clearly explains the benefits of interacting with ZetaChain universal apps via Sui. This sets a solid context for readers.


15-18: Tutorial outcome is effectively communicated.
The statement detailing the learning outcome provides clear expectations for the reader.


19-26: Prerequisites are comprehensive.
The list of required tools along with external documentation links (e.g., Sui CLI, Foundry) is clear. It might be beneficial to periodically verify that these links remain current.


27-36: Example project cloning instructions are clear.
The commands for cloning the repository and installing dependencies are straightforward. Ensure that the repository URL remains valid.


38-60: Localnet launch instructions are detailed.
The section explains the process of starting a local development environment and provides a sample table output for verification. Please ensure that the displayed values (e.g., object IDs, mnemonic) are generic or obfuscated if necessary.


62-77: Universal contract deployment instructions.
The Hardhat commands for compiling and deploying the universal contract are well laid out. Confirm that these commands and the sample outputs are up-to-date with the current deployment process.


78-96: Deposit instructions are clear.
The deposit command along with its parameters is well documented. It would be prudent to double-check that the parameter ordering and values conform to the latest implementation.


133-138: Build command clarity.
The build command sui move build --force is straightforward. Including this command in the tutorial minimizes ambiguity for the reader.


139-149: Deployment instructions detailed.
The deployment process using sui client publish along with the jq extraction is comprehensively documented. The sample package ID output aids clarity.


154-170: Coin retrieval command is accurate.
The command for obtaining a list of coins via sui client objects is well detailed. Ensure that the filtering criteria (using jq) remains aligned with any CLI changes.


172-183: Deposit from Sui Contract instructions are explicit.
The sample command for depositing from a Sui contract effectively demonstrates the required arguments. Confirm that the order of arguments matches the current contract interface.

@fadeev fadeev merged commit cbac10d into main Mar 13, 2025
6 checks passed
@fadeev fadeev deleted the solana-doc branch March 13, 2025 15:57
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