Skip to content
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

More context and better snippets for cookbook/jettons #399

Open
anton-trunov opened this issue Sep 25, 2024 · 5 comments · May be fixed by #403
Open

More context and better snippets for cookbook/jettons #399

anton-trunov opened this issue Sep 25, 2024 · 5 comments · May be fixed by #403
Assignees
Labels
help wanted Extra attention is needed tact-docs: Cookbook /cookbook section of the docs: "How-Tos" and complete code examples for various use-cases

Comments

@anton-trunov
Copy link
Member

This is a follow-up issue after #321.

Snippets requirements:

  • Snippets showing recipes MUST (in the sense of RFC 2119) compile, for instance the snippet in "Sending jetton transfer" is not valid Tact and needs to be manually augmented to compile
  • All recipes MUST be self-contained and have a (simple) purpose, for instance, we need to replace // your logic of processing token notification with some exact logic
  • "myJettonWalletAddress may also be stored in contract storage to use less gas in every transaction" -- we should refactor the examples to use this approach
  • "forwardTonAmount: 1" isn't it too much Toncoins?

We should expand the explanations by adding more context aiming at novice TON developers.

  • Explain what are Jettons and what structure they have
  • What is "Transfer notification message", this should explain the "YOUR contract's jetton wallet"
  • Explain why "Sender of transfer notification must be validated!"
  • "Wallet initial data layout is shown below, but sometimes it can differ" -- we need to at least briefly mention the other cases
@anton-trunov anton-trunov added help wanted Extra attention is needed tact-docs: Cookbook /cookbook section of the docs: "How-Tos" and complete code examples for various use-cases labels Sep 25, 2024
@anton-trunov
Copy link
Member Author

@a-bahdanau Could you please help us with this follow-up?

@a-bahdanau
Copy link
Contributor

@a-bahdanau Could you please help us with this follow-up?

Yep, this is on me

@anton-trunov
Copy link
Member Author

Awesome!

@a-bahdanau
Copy link
Contributor

@anton-trunov Hello!

  • Snippets showing recipes MUST

Do you mean that all code should be placed in one block of code? Or it can be devided into separate parts to avoid dublication? Like with JettonTransferNotification

@anton-trunov
Copy link
Member Author

Hey @a-bahdanau, the cookbook format usually implies every snippet to be self-contained. Would be nice if Tact users could just copy-paste examples and have something immediately compilable

@a-bahdanau a-bahdanau linked a pull request Sep 30, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed tact-docs: Cookbook /cookbook section of the docs: "How-Tos" and complete code examples for various use-cases
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants