tact-docs icon indicating copy to clipboard operation
tact-docs copied to clipboard

More context and better snippets for `cookbook/jettons`

Open anton-trunov opened this issue 1 year ago • 5 comments

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 avatar Sep 25 '24 07:09 anton-trunov

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

anton-trunov avatar Sep 25 '24 07:09 anton-trunov

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

Yep, this is on me

a-bahdanau avatar Sep 25 '24 10:09 a-bahdanau

Awesome!

anton-trunov avatar Sep 25 '24 10:09 anton-trunov

@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

a-bahdanau avatar Sep 30 '24 13:09 a-bahdanau

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

anton-trunov avatar Sep 30 '24 14:09 anton-trunov