-
Notifications
You must be signed in to change notification settings - Fork 61
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
Hello and Echo Contracts #485
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
📝 Walkthrough📝 WalkthroughWalkthroughThe pull request introduces modifications to the tutorial documentation and related contract code. Specifically, the Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 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 (
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
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 and nitpick comments (7)
src/pages/developers/tutorials/hello.mdx (7)
22-23
: Alert update approved with suggestion.The updated alert effectively communicates the current limitations of the gateway availability. To enhance clarity, consider rephrasing the second sentence as follows:
- Therefore, deploying this tutorial on testnet is not possible at this time. + Consequently, this tutorial cannot be deployed on testnet at present.This rephrasing maintains a more formal tone and improves readability.
Line range hint
64-85
: Contract code modifications approved with suggestion.The changes to the
Hello
contract are well-implemented:
- The
immutable
keyword forgateway
is a gas optimization best practice.- The updated
onRevert
function signature aligns with theUniversalContract
interface.- The new
call
andwithdrawAndCall
functions enhance cross-chain interaction capabilities.To improve code consistency, consider updating the event emission in
onRevert
:- emit RevertEvent("Revert on ZetaChain", revertContext); + emit RevertEvent("Revert on ZetaChain", revertContext);This change maintains consistency with the "ZetaChain" terminology used throughout the contract.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~146-~146: Loose punctuation mark.
Context: ...h the following parameters: -context
: AzContext
struct containing: - `or...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~149-~149: Loose punctuation mark.
Context: ...n the connected chain. -chainID
: The integer ID of the connected chain f...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~151-~151: Loose punctuation mark.
Context: ...-chain call originated. -sender
: Reserved for future use (currently empt...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~152-~152: Loose punctuation mark.
Context: ... future use (currently empty). -zrc20
: The address of the ZRC-20 token represe...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~154-~154: Loose punctuation mark.
Context: ...sset from the source chain. -amount
: The number of tokens transferred. - `me...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~155-~155: Loose punctuation mark.
Context: ...umber of tokens transferred. -message
: The encoded data payload. The `onCross...(UNLIKELY_OPENING_PUNCTUATION)
87-124
: New functionscall
andwithdrawAndCall
approved with suggestion.The addition of
call
andwithdrawAndCall
functions significantly enhances the contract's cross-chain interaction capabilities. The implementation includes proper error handling and efficient gas fee management.To improve code readability, consider adding inline comments explaining the purpose of key operations:
function call( bytes memory receiver, address zrc20, bytes calldata message, uint256 gasLimit, RevertOptions memory revertOptions ) external { + // Calculate and transfer gas fee (, uint256 gasFee) = IZRC20(zrc20).withdrawGasFeeWithGasLimit(gasLimit); IZRC20(zrc20).transferFrom(msg.sender, address(this), gasFee); IZRC20(zrc20).approve(address(gateway), gasFee); + // Initiate cross-chain call gateway.call(receiver, zrc20, message, gasLimit, revertOptions); }Similar inline comments can be added to the
withdrawAndCall
function to enhance code comprehension.
165-205
: New sections on outgoing contract calls and withdrawals approved with suggestion.The addition of detailed explanations for the
call
andwithdrawAndCall
functions significantly enhances the tutorial's comprehensiveness. The step-by-step breakdowns provide valuable insights into the cross-chain interaction process.To further improve clarity, consider adding a brief example or diagram illustrating the flow of tokens and data in a typical cross-chain interaction scenario. This visual aid would complement the textual explanations and help readers grasp the concepts more easily.
Line range hint
207-243
: UpdatedEcho
contract code approved with suggestion.The modifications to the
Echo
contract, including the addition of new functions and events, effectively align with the changes made to theHello
contract. These updates enhance the contract's capability to handle cross-chain interactions.To improve code consistency and readability, consider the following minor adjustment:
contract Echo { GatewayEVM public immutable gateway; event RevertEvent(string, RevertContext); event HelloEvent(string, string); constructor(address payable gatewayAddress) { gateway = GatewayEVM(gatewayAddress); } function hello(string memory message) external payable { emit HelloEvent("Hello on EVM", message); } function onRevert(RevertContext calldata revertContext) external { - emit RevertEvent("Revert on EVM", revertContext); + emit RevertEvent("Revert on connected chain", revertContext); } function call( address receiver, bytes calldata message, RevertOptions memory revertOptions ) external { gateway.call(receiver, message, revertOptions); } receive() external payable {} fallback() external payable {} }This change in the
onRevert
function makes the event message more generic, accommodating potential future deployments on non-EVM chains.🧰 Tools
🪛 LanguageTool
[uncategorized] ~146-~146: Loose punctuation mark.
Context: ...h the following parameters: -context
: AzContext
struct containing: - `or...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~149-~149: Loose punctuation mark.
Context: ...n the connected chain. -chainID
: The integer ID of the connected chain f...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~151-~151: Loose punctuation mark.
Context: ...-chain call originated. -sender
: Reserved for future use (currently empt...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~152-~152: Loose punctuation mark.
Context: ... future use (currently empty). -zrc20
: The address of the ZRC-20 token represe...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~154-~154: Loose punctuation mark.
Context: ...sset from the source chain. -amount
: The number of tokens transferred. - `me...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~155-~155: Loose punctuation mark.
Context: ...umber of tokens transferred. -message
: The encoded data payload. The `onCross...(UNLIKELY_OPENING_PUNCTUATION)
248-340
: Updated deployment and interaction instructions approved with suggestion.The revised instructions for deploying and interacting with the contracts provide a clear and comprehensive guide for users. The new commands accurately reflect the changes made to the contracts and offer valuable insights into cross-chain interactions.
To enhance user experience, consider adding a brief troubleshooting section addressing common issues that users might encounter during the deployment and interaction process. This addition would make the tutorial more robust and user-friendly.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~296-~296: Loose punctuation mark.
Context: ...ice ``` Parameters: ---contract
: Address of the `Echo` contract on the c...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~297-~297: Loose punctuation mark.
Context: ... the connected EVM chain. ---receiver
: Address of theHello
contract on Zeta...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~298-~298: Loose punctuation mark.
Context: ...locontract on ZetaChain. -
--network: Network to interact with (
localhost` f...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~299-~299: Loose punctuation mark.
Context: ... (localhost
for localnet). ---types
: ABI types of the message parameters (e....(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~300-~300: Loose punctuation mark.
Context: ...rameters (e.g.,["string"]
). -alice
: The message to send. Overview: - EVM:...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~337-~337: Loose punctuation mark.
Context: ...2 ``` Parameters: ---revert-address
: Address of the `Echo` contract on the s...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~338-~338: Loose punctuation mark.
Context: ...e source EVM chain. ---revert-message
: Data to pass to theEcho
contract's `...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~339-~339: Loose punctuation mark.
Context: ...onRevertfunction. -
--call-on-revert`: Flag indicating that the gateway should...(UNLIKELY_OPENING_PUNCTUATION)
371-424
: New sections on simulating and handling reverts approved with suggestion.The addition of sections explaining how to simulate and handle reverts significantly enhances the tutorial's completeness. These sections provide valuable insights into error handling in cross-chain interactions, with clear explanations and commands that align well with the contract implementations.
To further improve the educational value of these sections, consider adding a brief explanation of the importance of proper revert handling in production environments. This could include mentions of potential security implications and best practices for robust error management in cross-chain applications.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~396-~396: Loose punctuation mark.
Context: ...2 ``` Parameters: ---revert-address
: Address of the `Hello` contract on Zeta...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~397-~397: Loose punctuation mark.
Context: ...tract on ZetaChain. ---revert-message
: Data to pass to theHello
contract's ...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~399-~399: Loose punctuation mark.
Context: ...Revertfunction. -
--call-on-revert`: Flag indicating that the gateway should...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~418-~418: Possible missing comma found.
Context: ... to manage cross-chain calls and handle reverts you are now equipped to build robust an...(AI_HYDRA_LEO_MISSING_COMMA)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
- src/pages/developers/tutorials/_meta.json (1 hunks)
- src/pages/developers/tutorials/hello.mdx (6 hunks)
🧰 Additional context used
🪛 LanguageTool
src/pages/developers/tutorials/hello.mdx
[uncategorized] ~146-~146: Loose punctuation mark.
Context: ...h the following parameters: -context
: AzContext
struct containing: - `or...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~149-~149: Loose punctuation mark.
Context: ...n the connected chain. -chainID
: The integer ID of the connected chain f...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~151-~151: Loose punctuation mark.
Context: ...-chain call originated. -sender
: Reserved for future use (currently empt...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~152-~152: Loose punctuation mark.
Context: ... future use (currently empty). -zrc20
: The address of the ZRC-20 token represe...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~154-~154: Loose punctuation mark.
Context: ...sset from the source chain. -amount
: The number of tokens transferred. - `me...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~155-~155: Loose punctuation mark.
Context: ...umber of tokens transferred. -message
: The encoded data payload. The `onCross...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~296-~296: Loose punctuation mark.
Context: ...ice ``` Parameters: ---contract
: Address of the `Echo` contract on the c...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~297-~297: Loose punctuation mark.
Context: ... the connected EVM chain. ---receiver
: Address of theHello
contract on Zeta...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~298-~298: Loose punctuation mark.
Context: ...locontract on ZetaChain. -
--network: Network to interact with (
localhost` f...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~299-~299: Loose punctuation mark.
Context: ... (localhost
for localnet). ---types
: ABI types of the message parameters (e....(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~300-~300: Loose punctuation mark.
Context: ...rameters (e.g.,["string"]
). -alice
: The message to send. Overview: - EVM:...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~337-~337: Loose punctuation mark.
Context: ...2 ``` Parameters: ---revert-address
: Address of the `Echo` contract on the s...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~338-~338: Loose punctuation mark.
Context: ...e source EVM chain. ---revert-message
: Data to pass to theEcho
contract's `...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~339-~339: Loose punctuation mark.
Context: ...onRevertfunction. -
--call-on-revert`: Flag indicating that the gateway should...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~361-~361: Loose punctuation mark.
Context: ...' alice ``` Parameters: ---contract
: Address of the `Hello` contract on Zeta...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~362-~362: Loose punctuation mark.
Context: ...ocontract on ZetaChain. -
--receiver: Address of the
Echo` contract on the c...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~363-~363: Loose punctuation mark.
Context: ... on the connected EVM chain. ---zrc20
: Address of the ZRC-20 token representin...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~365-~365: Loose punctuation mark.
Context: ...es the destination chain. ---function
: Function signature to invoke on the `Ec...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~367-~367: Loose punctuation mark.
Context: ....g.,"hello(string)"
). ---network
: Network to interact with (localhost
f...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~368-~368: Loose punctuation mark.
Context: ... (localhost
for localnet). ---types
: ABI types of the message parameters (e....(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~369-~369: Loose punctuation mark.
Context: ...rameters (e.g.,["string"]
). -alice
: The message to send. ## Simulating a R...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~396-~396: Loose punctuation mark.
Context: ...2 ``` Parameters: ---revert-address
: Address of the `Hello` contract on Zeta...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~397-~397: Loose punctuation mark.
Context: ...tract on ZetaChain. ---revert-message
: Data to pass to theHello
contract's ...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~399-~399: Loose punctuation mark.
Context: ...Revertfunction. -
--call-on-revert`: Flag indicating that the gateway should...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~418-~418: Possible missing comma found.
Context: ... to manage cross-chain calls and handle reverts you are now equipped to build robust an...(AI_HYDRA_LEO_MISSING_COMMA)
🔇 Additional comments (5)
src/pages/developers/tutorials/_meta.json (1)
9-9
: Approved: Read time update for "First Universal App on Localnet" tutorial.The modification to increase the
readTime
from "10 min" to "30 min" for the "hello" tutorial appears appropriate, assuming the tutorial content has been substantially expanded or made more comprehensive.To ensure accuracy, please verify that the new 30-minute estimate aligns with the actual content of the tutorial. Consider the following:
- Word count: A typical reading speed is 200-250 words per minute. Verify if the tutorial's word count justifies a 30-minute read time.
- Complexity: Factor in any hands-on exercises or code implementations that may extend the time beyond mere reading.
- User feedback: If available, consider any user feedback on the time taken to complete the tutorial.
src/pages/developers/tutorials/hello.mdx (4)
7-10
: Introduction enhancement approved.The revised introduction effectively clarifies the universal app's functionality, accurately describing the cross-chain interaction between Ethereum and ZetaChain. This modification enhances the reader's understanding of the tutorial's objectives.
28-31
: Prerequisites update approved.The revised prerequisites section offers a more structured and comprehensive list of requirements. The addition of the "Getting Started with ZetaChain" prerequisite ensures that readers possess the necessary foundational knowledge before proceeding with this tutorial.
46-50
: Universal App Contract description enhancement approved.The expanded description of the
Hello
contract provides valuable context, particularly by mentioning the implementation of theUniversalContract
interface. This addition is crucial for understanding the contract's role in facilitating cross-chain interactions.
129-163
: EnhancedHello
contract explanation approved.The expanded explanation of the
Hello
contract and its functions significantly improves the tutorial's educational value. The detailed description of theUniversalContract
interface and theonCrossChainCall
function provides readers with a comprehensive understanding of the contract's role in facilitating cross-chain interactions.🧰 Tools
🪛 LanguageTool
[uncategorized] ~146-~146: Loose punctuation mark.
Context: ...h the following parameters: -context
: AzContext
struct containing: - `or...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~149-~149: Loose punctuation mark.
Context: ...n the connected chain. -chainID
: The integer ID of the connected chain f...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~151-~151: Loose punctuation mark.
Context: ...-chain call originated. -sender
: Reserved for future use (currently empt...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~152-~152: Loose punctuation mark.
Context: ... future use (currently empty). -zrc20
: The address of the ZRC-20 token represe...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~154-~154: Loose punctuation mark.
Context: ...sset from the source chain. -amount
: The number of tokens transferred. - `me...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~155-~155: Loose punctuation mark.
Context: ...umber of tokens transferred. -message
: The encoded data payload. The `onCross...(UNLIKELY_OPENING_PUNCTUATION)
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 and nitpick comments (2)
src/pages/developers/tutorials/hello.mdx (2)
Line range hint
44-132
: Enhanced contract functionality with room for more explanation.The
Hello
contract has been significantly improved with the addition ofcall
andwithdrawAndCall
functions, and thegateway
variable is now correctly marked asimmutable
. These changes enhance the contract's functionality and efficiency.However, to further improve the tutorial:
Consider adding more detailed explanations for the new
call
andwithdrawAndCall
functions. This could include:
- The purpose of each function
- When and why a developer might use one over the other
- Any potential risks or considerations when using these functions
This additional context would help readers better understand the contract's capabilities and make informed decisions when implementing their own universal apps.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~155-~155: Loose punctuation mark.
Context: ...oming data, which includes: -context
: AzContext
struct containing: - `or...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~158-~158: Loose punctuation mark.
Context: ...n the connected chain. -chainID
: The integer ID of the connected chain f...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~160-~160: Loose punctuation mark.
Context: ...-chain call originated. -sender
: Reserved for future use (currently empt...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~161-~161: Loose punctuation mark.
Context: ... future use (currently empty). -zrc20
: The address of the ZRC-20 token represe...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~163-~163: Loose punctuation mark.
Context: ...sset from the source chain. -amount
: The number of tokens transferred. - `me...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~164-~164: Loose punctuation mark.
Context: ...umber of tokens transferred. -message
: The encoded data payload. Within `onCr...(UNLIKELY_OPENING_PUNCTUATION)
262-486
: Comprehensive deployment and interaction guide with room for formatting improvement.The sections covering localnet setup, contract deployment, and interactions provide a thorough guide for users to follow. The addition of revert simulation and handling scenarios enhances the tutorial's practical value.
To improve readability, consider the following formatting suggestions for the long command lines:
- Use line breaks with
\
for multi-line commands.- Align parameters vertically for easier scanning.
Example:
npx hardhat hello-withdraw-and-call \ --contract 0xE6E340D132b5f46d1e472DebcD681B2aBc16e57E \ --receiver 0xc3e53F4d16Ae77Db1c982e75a937B9f60FE63690 \ --zrc20 0x9fd96203f7b22bCF72d9DCb40ff98302376cE09c \ --function "hello(string)" \ --amount 1 \ --network localhost \ --types '["string"]' \ helloThis formatting will make the commands easier to read and understand, especially for newcomers to the ZetaChain ecosystem.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~315-~315: Loose punctuation mark.
Context: ...ice ``` Parameters: ---contract
: Address of the `Echo` contract on the c...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~316-~316: Loose punctuation mark.
Context: ... the connected EVM chain. ---receiver
: Address of theHello
contract on Zeta...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~317-~317: Loose punctuation mark.
Context: ...locontract on ZetaChain. -
--network: Network to interact with (
localhost` f...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~318-~318: Loose punctuation mark.
Context: ... (localhost
for localnet). ---types
: ABI types of the message parameters (e....(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~319-~319: Loose punctuation mark.
Context: ...rameters (e.g.,["string"]
). -alice
: The message to send. Overview: - ...(UNLIKELY_OPENING_PUNCTUATION)
[typographical] ~344-~344: If the word ‘What’ starts a question, add a question mark at the end of the sentence.
Context: ...pes '["uint256"]' 42 ``` What Happens: - TheHello
contract's `onCrossCha...(WP_VB_QUESTION_MARK)
[uncategorized] ~369-~369: Loose punctuation mark.
Context: ...**Parameters:** -
--revert-address: Address of the
Echo` contract on the s...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~370-~370: Loose punctuation mark.
Context: ...e source EVM chain. ---revert-message
: Data to pass to theEcho
contract's `...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~371-~371: Loose punctuation mark.
Context: ...onRevertfunction. -
--call-on-revert`: Flag indicating that the gateway should...(UNLIKELY_OPENING_PUNCTUATION)
[typographical] ~374-~374: If the word ‘What’ starts a question, add a question mark at the end of the sentence.
Context: ... contract upon revert. What Happens: - When the revert occurs, the gatewa...(WP_VB_QUESTION_MARK)
[uncategorized] ~399-~399: Loose punctuation mark.
Context: ...ice ``` Parameters: ---contract
: Address of the `Hello` contract on Zeta...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~400-~400: Loose punctuation mark.
Context: ...ocontract on ZetaChain. -
--receiver: Address of the
Echo` contract on the c...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~401-~401: Loose punctuation mark.
Context: ... on the connected EVM chain. ---zrc20
: Address of the ZRC-20 token representin...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~401-~401: Possible missing comma found.
Context: ...ain. ---zrc20
: Address of the ZRC-20 token representing the gas token of the con...(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~403-~403: Loose punctuation mark.
Context: ...es the destination chain. ---function
: Function signature to invoke on the `Ec...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~405-~405: Loose punctuation mark.
Context: ....g.,"hello(string)"
). ---network
: Network to interact with (localhost
f...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~406-~406: Loose punctuation mark.
Context: ... (localhost
for localnet). ---types
: ABI types of the message parameters. - ...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~407-~407: Loose punctuation mark.
Context: ...pes of the message parameters. -alice
: The message to send. ## Simulating a R...(UNLIKELY_OPENING_PUNCTUATION)
[typographical] ~424-~424: If the word ‘What’ starts a question, add a question mark at the end of the sentence.
Context: ...pes '["uint256"]' 42 ``` What Happens: - TheEcho
contract expects a `str...(WP_VB_QUESTION_MARK)
[uncategorized] ~449-~449: Loose punctuation mark.
Context: ...**Parameters:** -
--revert-address: Address of the
Hello` contract on Zeta...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~450-~450: Loose punctuation mark.
Context: ...tract on ZetaChain. ---revert-message
: Data to pass to theHello
contract's ...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~452-~452: Loose punctuation mark.
Context: ...Revertfunction. -
--call-on-revert`: Flag indicating that the gateway should...(UNLIKELY_OPENING_PUNCTUATION)
[typographical] ~455-~455: If the word ‘What’ starts a question, add a question mark at the end of the sentence.
Context: ... contract upon revert. What Happens: - Upon revert, the gateway calls the...(WP_VB_QUESTION_MARK)
[uncategorized] ~479-~479: Loose punctuation mark.
Context: ...llo ``` Parameters: ---contract
: Address of the `Hello` contract on Zeta...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~480-~480: Loose punctuation mark.
Context: ...ocontract on ZetaChain. -
--receiver: Address of the
Echo` contract on the c...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~481-~481: Loose punctuation mark.
Context: ... on the connected EVM chain. ---zrc20
: Address of the ZRC-20 token representin...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~482-~482: Loose punctuation mark.
Context: ...ng the asset to withdraw. ---function
: Function signature to invoke on the `Ec...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~483-~483: Loose punctuation mark.
Context: ...oke on theEcho
contract. ---amount
: Amount of tokens to withdraw. - `--netw...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~483-~483: ‘Amount of’ should usually only be used with uncountable or mass nouns. Consider using “number” if this is not the case.
Context: ...e on theEcho
contract. ---amount
: Amount of tokens to withdraw. ---network
: N...(AMOUNTOF_TO_NUMBEROF)
[uncategorized] ~484-~484: Loose punctuation mark.
Context: ...unt of tokens to withdraw. ---network
: Network to interact with. ---types
: ...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~485-~485: Loose punctuation mark.
Context: ...: Network to interact with. -
--types`: ABI types of the message parameters. - ...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~486-~486: Loose punctuation mark.
Context: ...pes of the message parameters. -hello
: The message to send. ## Conclusion In...(UNLIKELY_OPENING_PUNCTUATION)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- src/pages/developers/tutorials/hello.mdx (4 hunks)
🧰 Additional context used
🪛 LanguageTool
src/pages/developers/tutorials/hello.mdx
[uncategorized] ~155-~155: Loose punctuation mark.
Context: ...oming data, which includes: -context
: AzContext
struct containing: - `or...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~158-~158: Loose punctuation mark.
Context: ...n the connected chain. -chainID
: The integer ID of the connected chain f...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~160-~160: Loose punctuation mark.
Context: ...-chain call originated. -sender
: Reserved for future use (currently empt...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~161-~161: Loose punctuation mark.
Context: ... future use (currently empty). -zrc20
: The address of the ZRC-20 token represe...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~163-~163: Loose punctuation mark.
Context: ...sset from the source chain. -amount
: The number of tokens transferred. - `me...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~164-~164: Loose punctuation mark.
Context: ...umber of tokens transferred. -message
: The encoded data payload. Within `onCr...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~315-~315: Loose punctuation mark.
Context: ...ice ``` Parameters: ---contract
: Address of the `Echo` contract on the c...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~316-~316: Loose punctuation mark.
Context: ... the connected EVM chain. ---receiver
: Address of theHello
contract on Zeta...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~317-~317: Loose punctuation mark.
Context: ...locontract on ZetaChain. -
--network: Network to interact with (
localhost` f...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~318-~318: Loose punctuation mark.
Context: ... (localhost
for localnet). ---types
: ABI types of the message parameters (e....(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~319-~319: Loose punctuation mark.
Context: ...rameters (e.g.,["string"]
). -alice
: The message to send. Overview: - ...(UNLIKELY_OPENING_PUNCTUATION)
[typographical] ~344-~344: If the word ‘What’ starts a question, add a question mark at the end of the sentence.
Context: ...pes '["uint256"]' 42 ``` What Happens: - TheHello
contract's `onCrossCha...(WP_VB_QUESTION_MARK)
[uncategorized] ~369-~369: Loose punctuation mark.
Context: ...**Parameters:** -
--revert-address: Address of the
Echo` contract on the s...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~370-~370: Loose punctuation mark.
Context: ...e source EVM chain. ---revert-message
: Data to pass to theEcho
contract's `...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~371-~371: Loose punctuation mark.
Context: ...onRevertfunction. -
--call-on-revert`: Flag indicating that the gateway should...(UNLIKELY_OPENING_PUNCTUATION)
[typographical] ~374-~374: If the word ‘What’ starts a question, add a question mark at the end of the sentence.
Context: ... contract upon revert. What Happens: - When the revert occurs, the gatewa...(WP_VB_QUESTION_MARK)
[uncategorized] ~399-~399: Loose punctuation mark.
Context: ...ice ``` Parameters: ---contract
: Address of the `Hello` contract on Zeta...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~400-~400: Loose punctuation mark.
Context: ...ocontract on ZetaChain. -
--receiver: Address of the
Echo` contract on the c...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~401-~401: Loose punctuation mark.
Context: ... on the connected EVM chain. ---zrc20
: Address of the ZRC-20 token representin...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~401-~401: Possible missing comma found.
Context: ...ain. ---zrc20
: Address of the ZRC-20 token representing the gas token of the con...(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~403-~403: Loose punctuation mark.
Context: ...es the destination chain. ---function
: Function signature to invoke on the `Ec...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~405-~405: Loose punctuation mark.
Context: ....g.,"hello(string)"
). ---network
: Network to interact with (localhost
f...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~406-~406: Loose punctuation mark.
Context: ... (localhost
for localnet). ---types
: ABI types of the message parameters. - ...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~407-~407: Loose punctuation mark.
Context: ...pes of the message parameters. -alice
: The message to send. ## Simulating a R...(UNLIKELY_OPENING_PUNCTUATION)
[typographical] ~424-~424: If the word ‘What’ starts a question, add a question mark at the end of the sentence.
Context: ...pes '["uint256"]' 42 ``` What Happens: - TheEcho
contract expects a `str...(WP_VB_QUESTION_MARK)
[uncategorized] ~449-~449: Loose punctuation mark.
Context: ...**Parameters:** -
--revert-address: Address of the
Hello` contract on Zeta...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~450-~450: Loose punctuation mark.
Context: ...tract on ZetaChain. ---revert-message
: Data to pass to theHello
contract's ...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~452-~452: Loose punctuation mark.
Context: ...Revertfunction. -
--call-on-revert`: Flag indicating that the gateway should...(UNLIKELY_OPENING_PUNCTUATION)
[typographical] ~455-~455: If the word ‘What’ starts a question, add a question mark at the end of the sentence.
Context: ... contract upon revert. What Happens: - Upon revert, the gateway calls the...(WP_VB_QUESTION_MARK)
[uncategorized] ~479-~479: Loose punctuation mark.
Context: ...llo ``` Parameters: ---contract
: Address of the `Hello` contract on Zeta...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~480-~480: Loose punctuation mark.
Context: ...ocontract on ZetaChain. -
--receiver: Address of the
Echo` contract on the c...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~481-~481: Loose punctuation mark.
Context: ... on the connected EVM chain. ---zrc20
: Address of the ZRC-20 token representin...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~482-~482: Loose punctuation mark.
Context: ...ng the asset to withdraw. ---function
: Function signature to invoke on the `Ec...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~483-~483: Loose punctuation mark.
Context: ...oke on theEcho
contract. ---amount
: Amount of tokens to withdraw. - `--netw...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~483-~483: ‘Amount of’ should usually only be used with uncountable or mass nouns. Consider using “number” if this is not the case.
Context: ...e on theEcho
contract. ---amount
: Amount of tokens to withdraw. ---network
: N...(AMOUNTOF_TO_NUMBEROF)
[uncategorized] ~484-~484: Loose punctuation mark.
Context: ...unt of tokens to withdraw. ---network
: Network to interact with. ---types
: ...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~485-~485: Loose punctuation mark.
Context: ...: Network to interact with. -
--types`: ABI types of the message parameters. - ...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~486-~486: Loose punctuation mark.
Context: ...pes of the message parameters. -hello
: The message to send. ## Conclusion In...(UNLIKELY_OPENING_PUNCTUATION)
🔇 Additional comments (5)
src/pages/developers/tutorials/hello.mdx (5)
7-23
: Improved introduction and learning objectives.The revised introduction and learning objectives provide a clearer context for the tutorial and set more specific expectations for the reader. This enhancement will help users better understand the purpose and outcomes of the tutorial.
28-31
: Updated prerequisites for better preparation.The addition of the "Getting Started with ZetaChain" tutorial as a prerequisite ensures that users have the necessary foundational knowledge before beginning this more advanced tutorial. This change will help users be better prepared for the concepts introduced in this tutorial.
35-41
: Clear environment setup instructions.The "Set Up Your Environment" section provides concise and easy-to-follow instructions for cloning the repository and installing dependencies. This clarity ensures a smooth start to the tutorial for users.
Line range hint
215-257
: Well-structured EVM Echo Contract example.The
Echo
contract serves as an excellent example of how to interact with ZetaChain from an EVM-compatible chain. The explanation is clear and concise, and the contract includes essential functions for handling cross-chain communication. This section provides valuable insights for developers looking to implement cross-chain functionality.🧰 Tools
🪛 LanguageTool
[uncategorized] ~155-~155: Loose punctuation mark.
Context: ...oming data, which includes: -context
: AzContext
struct containing: - `or...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~158-~158: Loose punctuation mark.
Context: ...n the connected chain. -chainID
: The integer ID of the connected chain f...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~160-~160: Loose punctuation mark.
Context: ...-chain call originated. -sender
: Reserved for future use (currently empt...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~161-~161: Loose punctuation mark.
Context: ... future use (currently empty). -zrc20
: The address of the ZRC-20 token represe...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~163-~163: Loose punctuation mark.
Context: ...sset from the source chain. -amount
: The number of tokens transferred. - `me...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~164-~164: Loose punctuation mark.
Context: ...umber of tokens transferred. -message
: The encoded data payload. Within `onCr...(UNLIKELY_OPENING_PUNCTUATION)
490-506
: Effective conclusion and valuable source code reference.The conclusion succinctly summarizes the key points covered in the tutorial, reinforcing the learning objectives. The inclusion of a link to the source code repository is a valuable addition, allowing users to explore the complete implementation and potentially contribute to the project.
@bbbeeeee @zeta-chain/fullstack @brewmaster012 please, review. |
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
Depends on zeta-chain/example-contracts#201
Summary by CodeRabbit