-
Notifications
You must be signed in to change notification settings - Fork 158
docs(ton): update protocol contracts #773
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
Open
github-actions
wants to merge
1
commit into
main
Choose a base branch
from
docs/updates-from-protocol-contracts-ton
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| # TON Gateway Docs | ||
|
|
||
| ## gateway.fc | ||
|
|
||
| ### Constants | ||
|
|
||
| - **op::internal::donate** = 100 | ||
| - **op::internal::deposit** = 101 | ||
| - **op::internal::deposit_and_call** = 102 | ||
| - **op::internal::call** = 103 | ||
| - **op::external::withdraw** = 200 | ||
| - **op::external::increase_seqno** = 205 | ||
| - **op::authority::set_deposits_enabled** = 201 | ||
| - **op::authority::update_tss** = 202 | ||
| - **op::authority::update_code** = 203 | ||
| - **op::authority::update_authority** = 204 | ||
| - **op::authority::reset_seqno** = 206 | ||
|
|
||
| ### `handle_deposit` | ||
|
|
||
| ```func | ||
| () handle_deposit(int amount, slice in_msg_body) impure inline { | ||
| ``` | ||
|
|
||
| Deposit TON to the gateway and specify the EVM recipient on ZetaChain | ||
|
|
||
| ### `handle_call` | ||
|
|
||
| ```func | ||
| () handle_call(int amount, slice in_msg_body) impure inline { | ||
| ``` | ||
|
|
||
| Handles zeta's onCall method by ensuring call_data size and gas costs are covered; | ||
|
|
||
| NOTE that this operation DOESN'T rebate sent amount if it's bigger than tx fee! | ||
| We can consider sending surplus amount back in the future improvements. | ||
| For now, send amount that is equal to calculate_gas_fee(op::call) | ||
|
|
||
| ### `handle_set_deposits_enabled` | ||
|
|
||
| ```func | ||
| () handle_set_deposits_enabled(slice sender, slice message) impure inline { | ||
| ``` | ||
|
|
||
| Enables or disables deposits. | ||
|
|
||
| ### `handle_update_tss` | ||
|
|
||
| ```func | ||
| () handle_update_tss(slice sender, slice message) impure inline { | ||
| ``` | ||
|
|
||
| Updates the TSS address. WARNING! Execute with extra caution. | ||
| Wrong TSS address leads to loss of funds. | ||
|
|
||
| ### `handle_update_code` | ||
|
|
||
| ```func | ||
| () handle_update_code(slice sender, slice message) impure inline { | ||
| ``` | ||
|
|
||
| Updated the code of the contract | ||
| Handle_code_update (cell new_code) | ||
|
|
||
| ### `handle_reset_seqno` | ||
|
|
||
| ```func | ||
| () handle_reset_seqno(slice sender, slice message) impure inline { | ||
| ``` | ||
|
|
||
| Resets the seqno to the specified value | ||
| Handles reset_seqno (uint32 new_seqno) | ||
|
|
||
| ### `recv_internal` | ||
|
|
||
| ```func | ||
| () recv_internal(int my_balance, int msg_value, cell in_msg_full, slice in_msg_body) impure { | ||
| ``` | ||
|
|
||
| Input for all internal messages | ||
|
|
||
| ### `handle_withdrawal` | ||
|
|
||
| ```func | ||
| () handle_withdrawal(slice payload) impure inline { | ||
| ``` | ||
|
|
||
| Withdraws assets to the recipient | ||
|
|
||
| Handle_withdrawal (MsgAddr recipient, Coins amount, uint32 seqno) | ||
|
|
||
| ### `handle_increase_seqno` | ||
|
|
||
| ```func | ||
| () handle_increase_seqno(slice payload) impure inline { | ||
| ``` | ||
|
|
||
| Increases seqno by 1 without doing any other operations. | ||
| Handle_increase_seqno (uint32 failure_reason, uint32 seqno) | ||
|
|
||
| ### `recv_external` | ||
|
|
||
| ```func | ||
| () recv_external(slice message) impure { | ||
| ``` | ||
|
|
||
| Entry point for all external messages | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Duplicate file breaks i18n naming convention
Medium Severity
The new
ton.mdis identical to the already-existington.en-US.mdand is the only page insrc/pages/developers/protocol/without a locale suffix. All other pages (evm,solana,sui) use only*.en-US.mdand*.zh-CN.mdfiles. With Nextra's i18n configured withdefaultLocale: "en-US", a bareton.mdalongsideton.en-US.mdcreates an ambiguous routing situation and duplicates content unnecessarily.