-
Notifications
You must be signed in to change notification settings - Fork 63
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
Ton Gateway #588
Ton Gateway #588
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
📝 WalkthroughWalkthroughThis pull request updates the chain metadata and developer documentation. The metadata JSON modifies the "solana" description by removing the specific mention of "tokens" and adds a new "ton" entry. The documentation for the Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant TG as TON Gateway
participant GC as Gateway Contract
participant UA as Universal App
%% Flow for deposit TON operation
U->>TG: Request deposit TON (op_code=101)
TG->>GC: Send deposit message (query_id, evm_recipient)
GC-->>TG: Confirm deposit (mint ZRC-20 TON)
TG-->>U: Return deposit confirmation
%% Flow for deposit and call operation
U->>TG: Request deposit & call (op_code=102, call_data)
TG->>GC: Send deposit & call message
GC->>UA: Trigger onCall() with call_data
UA-->>GC: Process onCall result
GC-->>TG: Confirm deposit & call
TG-->>U: Return deposit & call confirmation
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
🪧 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 (
|
@swift1337 please, take a look and lmk if this is technically accurate. Thanks! |
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 (5)
src/pages/developers/chains/evm.mdx (1)
124-127
: Clarify Revert Handling ExplanationThe updated text for the
call
function’s revert handling is clear, but you might consider rewording it slightly for enhanced clarity. For example, you could consolidate the explanation into a single sentence that emphasizes that the function fails due to the lack of token transfer for covering gas fees upon revert.-is because executing a contract call on revert requires tokens to cover gas fees -on ZetaChain, and the `call` function doesn't transfer any assets. If you need -to handle reverts, use `depositAndCall` instead and ensure sufficient tokens are -deposited to cover potential gas fees. +because executing a contract call after a revert requires tokens to cover gas fees on ZetaChain—which the `call` function does not transfer—the transaction will fail. If you need to handle reverts, please use `depositAndCall` instead and ensure that enough tokens are deposited to cover the potential gas fees.src/pages/developers/chains/ton.mdx (4)
9-28
: Deposit TON Section – Message Structure ClarityThe "Deposit TON" section is well structured and clearly outlines the required internal message format with a custom
fc
code block. Consider adding a brief note (or a link) to explain the notation used in the code block if it isn’t common knowledge among your readers.🧰 Tools
🪛 LanguageTool
[uncategorized] ~24-~24: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...he deposited TON. This can be either an externally-owned account (EOA) or a universal app addres...(HYPHENATED_LY_ADVERB_ADJECTIVE)
29-51
: Deposit TON and Call – Operation GuidanceThis section accurately details the structure for deposit-and-call operations, including the role of
call_data
for invoking theonCall
function. For further clarity, a short explanation of what contents might be expected incall_data
(or a reference to more detailed documentation) could be beneficial.
52-63
: Gas Fees ExplanationThe gas fees for various operations are clearly listed, which helps users understand the cost implications. As gas fee values can evolve over time, consider referencing a dynamic source or a version note to ensure users can verify the current fees if needed.
23-25
: Minor Style Note on Compound ModifiersA static analysis hint mentioned compound modifiers with adverbs ending in “ly”. While the phrase “externally-owned account (EOA)” is standard, please double-check that no unnecessary hyphenation appears in adjacent or similar phrases. The current usage appears acceptable, but a quick review could prevent future stylistic inconsistencies.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~24-~24: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...he deposited TON. This can be either an externally-owned account (EOA) or a universal app addres...(HYPHENATED_LY_ADVERB_ADJECTIVE)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/pages/developers/chains/_meta.json
(1 hunks)src/pages/developers/chains/evm.mdx
(1 hunks)src/pages/developers/chains/ton.mdx
(1 hunks)
🧰 Additional context used
🪛 LanguageTool
src/pages/developers/chains/ton.mdx
[uncategorized] ~24-~24: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...he deposited TON. This can be either an externally-owned account (EOA) or a universal app addres...
(HYPHENATED_LY_ADVERB_ADJECTIVE)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build
🔇 Additional comments (2)
src/pages/developers/chains/_meta.json (1)
19-25
: Verify Metadata Consistency for Chain EntriesThe updated description for the Solana entry and the new Ton entry are correctly formatted and consistent with the overall style of the metadata file. Ensure that the phrasing matches other entries in similar sections for uniformity (for example, check if “deposit from” is intentionally generic compared to “deposit BTC from Bitcoin”).
src/pages/developers/chains/ton.mdx (1)
1-8
: Introduction and Supported OperationsThe introductory section clearly explains that TON users should leverage the TON gateway to interact with universal applications. The list of supported operations is concise and matches the style of analogous documentation.
Co-authored-by: Dmitry S <11892559+swift1337@users.noreply.github.com>
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 (5)
src/pages/developers/chains/ton.mdx (5)
14-20
: Deposit Message Structure Detail
The code block using thefunc
identifier precisely defines the message format for TON deposits. It would be helpful to explicitly mention that thequery_id
field is reserved for future use and should be set to0
by default. This change would align with previous recommendations.
22-30
: Deposit TON Message Clarifications
This section correctly specifies thatop_code
must be101
and explains the role ofevm_recipient
. Consider adding a brief note about the reserved nature ofquery_id
(i.e., it should remain0
) to avoid any ambiguity.🧰 Tools
🪛 LanguageTool
[uncategorized] ~25-~25: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...he deposited TON. This can be either an externally-owned account (EOA) or a universal app addres...(HYPHENATED_LY_ADVERB_ADJECTIVE)
24-26
: Terminology Consistency
Consider removing the hyphen in "externally-owned account" to adopt the more common form, "externally owned account (EOA)". This adjustment will help maintain consistency with industry-standard documentation.🧰 Tools
🪛 LanguageTool
[uncategorized] ~25-~25: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...he deposited TON. This can be either an externally-owned account (EOA) or a universal app addres...(HYPHENATED_LY_ADVERB_ADJECTIVE)
31-35
: Deposit and Call Section Overview
The section introducing deposit-and-call operations is clear and informative. For consistency with the deposit section, reiterate thatquery_id
is reserved (typically set to0
) and mention if there are any special conditions regarding the universal app address.
36-42
: Deposit-and-Call Message Structure Enhancements
The code block using thefc
language label accurately outlines the message structure for deposit-and-call operations. To further enhance clarity, consider noting that:
- The
query_id
field should be set to0
by default.- The
call_data
cell must be encoded using TON’s "snake data" format (see TON guidelines for reference).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/pages/developers/chains/ton.mdx
(1 hunks)
🧰 Additional context used
🪛 LanguageTool
src/pages/developers/chains/ton.mdx
[uncategorized] ~25-~25: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...he deposited TON. This can be either an externally-owned account (EOA) or a universal app addres...
(HYPHENATED_LY_ADVERB_ADJECTIVE)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build
🔇 Additional comments (5)
src/pages/developers/chains/ton.mdx (5)
1-2
: Introduction Clarity and Context
The opening line clearly introduces the TON gateway concept. For enhanced clarity, consider adding a brief note or link to further technical documentation if available.
3-8
: Supported Operations Listing
The bulleted list neatly summarizes the supported operations for the TON gateway. Ensure that the terminology (e.g., "universal app" and "account") is consistently used across all documentation pages.
9-13
: Deposit TON Section Introduction
The header and introductory text provide a clear description of the deposit process. You might consider including a note about any prerequisites or assumptions (e.g., default network settings) if relevant to users.
44-52
: Deposit-and-Call Operation Details
The explanatory text following the code block clearly defines the purpose of each field. For added value, consider providing a short example snippet or a link to an external resource that demonstrates the encoding ofcall_data
in practice.
54-65
: Gas Fees Section
The gas fee breakdown is informative and straightforward. Ensure that these values remain updated to reflect any changes in the underlying smart contract parameters or network conditions over time.
Co-authored-by: Dmitry S <11892559+swift1337@users.noreply.github.com>
Co-authored-by: Dmitry S <11892559+swift1337@users.noreply.github.com>
Co-authored-by: Dmitry S <11892559+swift1337@users.noreply.github.com>
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/chains/ton.mdx (8)
1-3
: Introduction Clarity and Context
The opening lines succinctly introduce the TON gateway and its role in interacting with universal applications. Consider expanding briefly on the context or linking to an overview for readers new to TON.
3-7
: Bullet List Format
The bulleted list of supported operations is clear and easy to follow. Ensure that the formatting is consistent with other similar documentation pages.
18-19
: Technical Details: op_code and query_id
The details specifying that the depositop_code
is101
and thatquery_id
is reserved (set to0
) are clearly stated. Emphasizing thatquery_id
is reserved for potential future use could further clarify its non-functional role.
21-23
: Clarification onevm_recipient
Field
The explanation of theevm_recipient
field clearly outlines its purpose. Consider revisiting the hyphenation in “externally-owned account”—the current style is acceptable, but for stylistic consistency, you might opt for “externally owned account” if that aligns with your overall documentation guidelines.🧰 Tools
🪛 LanguageTool
[uncategorized] ~22-~22: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...he deposited TON. This can be either an externally-owned account (EOA) or a universal app addres...(HYPHENATED_LY_ADVERB_ADJECTIVE)
25-30
: TypeScript Example for Deposit Message
The provided TypeScript snippet is concise and demonstrates how to construct the deposit message. Adding inline comments, especially around the usage ofbeginCell()
andstoreUint
, could enhance clarity for readers less familiar with these APIs.
35-38
: Deposit-and-Call Section Overview
The header and introductory text for the deposit-and-call functionality are clear. It might be beneficial to mention any prerequisites or highlight the differences between a simple deposit and a deposit-and-call operation.
44-47
: op_code and call_data Details for Deposit-and-Call
The explanation clearly states that the depositAndCallop_code
is102
, and it notes thatcall_data
must be a cell encoded in snake data format. Including a brief summary of what “snake data encoding” entails could be a helpful addition for new developers.
54-65
: TypeScript Example for Deposit-and-Call Operation
The TypeScript example effectively demonstrates how to build the deposit-and-call message, including the proper use ofstoreRef
for the payload. Consider inserting inline commentary (e.g., a note afterstoreRef
) for extra clarity on handling the cell payload.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/pages/developers/chains/ton.mdx
(1 hunks)
🧰 Additional context used
🪛 LanguageTool
src/pages/developers/chains/ton.mdx
[uncategorized] ~22-~22: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...he deposited TON. This can be either an externally-owned account (EOA) or a universal app addres...
(HYPHENATED_LY_ADVERB_ADJECTIVE)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build
🔇 Additional comments (6)
src/pages/developers/chains/ton.mdx (6)
9-13
: Deposit TON Section Introduction
The header and accompanying explanation provide a clear directive on depositing TON. The instructions are concise and lead well into the detailed technical specifications.
14-16
: Deposit Message Structure Example
The code snippet using the “func” notation accurately reflects the required structure for the deposit message. This matches previous style suggestions; ensure that this notation remains consistent across related documents.
32-33
: Post-Deposit Outcome Explanation
The note indicating that the receiver obtains the ZRC-20 version of TON is succinct. Please verify that the ZRC-20 version link is current and directs users to the appropriate reference.
40-42
: Deposit-and-Call Message Structure Example
The code snippet in “func” notation detailing the deposit-and-call message structure is accurate and complete. It neatly includes the additionalcall_data
field, consistent with the intended functionality.
49-52
: Clarification of Common Fields
The subsequent explanation on the roles ofevm_recipient
andcall_data
is precise and informative. The details provided match the expected behavior of the gateway message structure.
67-68
: Concluding Execution Note
The final lines clearly communicate that theonCall
function is executed after processing the cross-chain transaction. Ensure that any downstream documentation references this behavior consistently.
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.
A few comments below
First iteration, just to have some docs. Going to be updating it in follow up PRs with additional info.
Summary by CodeRabbit
New Features
Documentation