-
Notifications
You must be signed in to change notification settings - Fork 148
Solana withdraw and call #561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughThis 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
Possibly related PRs
Suggested reviewers
Tip ⚡🧪 Multi-step agentic review comment chat (experimental)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this 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 usingnpx hardhat localnet:solana-depositis 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 vianpx 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
📒 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 thesolanaCLI. 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 usinggit cloneandyarnare 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 usingnpx hardhat localnetis 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 (usingnpx hardhat compile --forceandnpx 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 (usinganchor buildand a subsequentts-nodecommand) are clear. Please ensure that environment variables (likeUSDC_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.
There was a problem hiding this 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 suggestionFormatting 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
📒 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
There was a problem hiding this 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
📒 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--receiverand--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_DATAand 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 itson_callfunction 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 theUSDC_SPLvariable 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 theUSDC_SPLvariable 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)
There was a problem hiding this 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 LinkThe mention of the Solana Gateway program and the link to the documentation is well placed. Please verify that the linked docs at
/developers/chains/solanaare current.
43-51: Compiling and Deploying the Universal ContractThe 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 ExplanationThe parameter explanations for
--receiverand--amountare 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 ExplanationThe 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 ProgramThe 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 SummaryThe 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
📒 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 ClarityThe 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-StructuredThe bullet list neatly outlines all the steps the tutorial will cover. It provides a clear roadmap for the reader.
18-23: Prerequisites Section is ClearThe prerequisites are clearly stated, and the link to the
solanaCLI is helpful. No changes are necessary here.
24-30: Cloning the Example ProjectThe instructions for cloning the project and changing to the appropriate directory are straightforward and well documented.
32-40: Launching LocalnetThe 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 ReminderThe reminder to keep localnet running in a separate terminal window is a good usability note.
52-60: Contract Deployment Confirmation OutputProviding an example of the successful deployment output helps users confirm that their deployment was successful.
62-70: SOL Deposit CommandThe deposit command and its explanation (including flag descriptions) are accurate and user friendly.
76-85: Deposit and Call CommandThe 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 CallThe explanatory text following the command clearly informs the reader about the outcome of the operation.
90-101: Withdraw Tokens CommandThe command for withdrawing tokens from ZetaChain back to Solana is precise, with all necessary parameters provided.
109-116: Introduction to Withdraw and Call ProgramThe 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 ProgramMentioning that the Solana directory contains an example program (with an
on_callfunction) is clear and informative.
122-124: Guidance for Setting Up the Solana ProgramThe 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 HeadingThe heading “Build and Set Up the Example Solana Program” appropriately signifies the beginning of this setup guide.
127-132: Setting the SPL-20 USDC AddressThe command to set the
USDC_SPLvariable 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 ProgramThe 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 CommandThe command for withdrawing SOL and calling a Solana program is well structured. It correctly includes dynamic generation of the call arguments via a
ts-nodescript.
167-180: Withdraw SPL-20 and Call CommandThe 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 ExplanationThe description for the
--zrc20parameter 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)
|
@hernan-clich please, review. |
hernan-clich
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested ACK
There was a problem hiding this 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--typesis correctly interpreted by the CLI.
112-127: Sui contract build and deployment guidance is thorough.
The instructions including theMove.tomlconfiguration 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'scast. 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 thedeposit_and_callfu...(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 thedeposit_and_callfu...(AI_HYDRA_LEO_MISSING_COMMA)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 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 commandsui move build --forceis straightforward. Including this command in the tutorial minimizes ambiguity for the reader.
139-149: Deployment instructions detailed.
The deployment process usingsui client publishalong 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 viasui client objectsis 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.
Summary by CodeRabbit