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

Tutorial: "How to work with smart wallet contracts" #141

Closed
1 task
aSpite opened this issue Jan 31, 2023 · 8 comments
Closed
1 task

Tutorial: "How to work with smart wallet contracts" #141

aSpite opened this issue Jan 31, 2023 · 8 comments
Assignees
Labels
Approved This proposal is approved by the committee footstep This is a TON Footstep issue

Comments

@aSpite
Copy link
Contributor

aSpite commented Jan 31, 2023

Summary

"How to work with smart wallet contracts" tutorial creation.

Context

Currently, there is no detailed tutorial on working with smart wallet contracts, creating transactions, signing, and sending them. There are also no clear examples of the external/internal transaction difference and how wallets generally work. This tutorial will cover all such moments and will also touch on the topic of high-load wallets.

Goals

  • First, the tutorial will explain seqno, valid_until, and signature and why all this is stored in the contract memory

  • There will also be a detailed explanation of the need for two types of transactions (external/internal), as well as the difference between v3 and v4.

  • More will be told about external and why smart wallet contracts accept these transactions.

  • How to build an external transaction, sign it (without using ready-made methods in existing libraries to understand the process fully), and send it. The main job will be with ton & ton-crypto for JS/TS and tonutils-go for GO.

  • The next stage will be the explanation of wallets, stateInit building, mnemonic phrase generation, and other details related to the creation of the wallet. All this will be based on examples with the description of the code.

  • Next will be the stage of working with smart contract wallet: sending TONs, transactions with comments, GET methods. Also, special attention will be paid to building transactions within the contract for deploying new smart contracts.

  • The last step will be related to high-load wallets and how they differ from the usual wallets.

Many examples will be shown based on libraries ton (JS/TS) and tonutils-go (GO).

Deliverables

Create a tutorial

Definition of Done

  • Tutorial created and merged into documentation

Reward

  • Standard TON Footstep NFT
  • $2000 in TON equivalent

Total: $2000

@aSpite aSpite added the footstep This is a TON Footstep issue label Jan 31, 2023
@aSpite
Copy link
Contributor Author

aSpite commented Jan 31, 2023

I want to implement this footstep and can start after approval.

@Gusarich
Copy link
Collaborator

LGTM

@Gusarich Gusarich added the Approved This proposal is approved by the committee label Jan 31, 2023
@aSpite
Copy link
Contributor Author

aSpite commented Feb 20, 2023

I would like to raise the reward amount to minimum 1500 (the final price will be based on $30/h) for the following reasons:

  1. I want to cover in the tutorial every detail that may cause difficulties for new developers in using wallets and sending transactions. This means that everything from generating mnemonics and compiling code to deploying to the network will be done manually without using ready-made functions (except for the most basic ones like beginCell and others)
  2. It will be necessary to analyze in detail what structure external and internal transactions have, how CommonMessageInfo, stateInit and other details are stored in them. Now you can use ready-made functions for this, but this deprives the developer of understanding how it all works.
  3. Knowing such details, the developer can repeat them in any language in any library, but the ready-made methods in each library differ.
  4. When there is no necessary option in the library (for example, there is no higload wallet in ton), he can easily add it and use it without having to switch to another library (ton3).
  5. This tutorial is done with a view to the future. At the moment there are also examples in Golang, in the future it will be very easy to add examples from other languages.
    Knowing such details, the developer becomes independent of pre-made methods and can easily move from library to library. Also understanding how wallets and transactions work, it will be much easier to start learning how to write smart contracts, since there are a lot of tutorials on how to write smart contracts, but most often beginners ask how to make a certain transaction.
    Even if they successfully use ready-made methods, the lack of a complete understanding of all processes complicates the work and creates additional questions.
  6. Every day there are a lot of questions about these topics in dev chats. This tutorial will be very relevant and will be actively used by beginners.

I started in mid-February, as urgent matters appeared at the beginning of the month. At the moment I have about 25-30% of the finished tutorial.

@Hiyorimi @delovoyhomie

@Hiyorimi
Copy link
Contributor

LGTM

@aSpite
Copy link
Contributor Author

aSpite commented Mar 12, 2023

I want to inform you that, at the moment, the main part of the tutorial is ready. The remaining chapters deal with examples of working with various wallets and other details. I am actively working on examples and ensuring that all sources are located in the GitHub repository in a convenient form so that the reader can immediately run the examples (JS/TS and Go) they need from different chapters. After the end of all this, there will be a review of the entire tutorial in case of errors (checking the functionality of the codes, the structure of the material, and so on).

@SwiftAdviser
Copy link
Contributor

I want to inform you that, at the moment, the main part of the tutorial is ready. The remaining chapters deal with examples of working with various wallets and other details. I am actively working on examples and ensuring that all sources are located in the GitHub repository in a convenient form so that the reader can immediately run the examples (JS/TS and Go) they need from different chapters. After the end of all this, there will be a review of the entire tutorial in case of errors (checking the functionality of the codes, the structure of the material, and so on).

Good!

@aSpite
Copy link
Contributor Author

aSpite commented Mar 29, 2023

I would like to raise the prize by 500 (final prize - 2000$) for the following reasons:

  1. You need to spend more effort on a tutorial than on writing code in the same time period. It must be constantly taken into account that completely different people read it, and each of them should correctly understand the material presented. In addition, it is necessary to consider the smallest details that are often forgotten. All this takes a lot of time and effort.

  2. A large tutorial is much harder to write than a small article. The main problem is to correctly link the most diverse parts of the tutorial, especially if the text contains several tens of thousands of characters. The right structure is the most important detail and the most expensive in terms of human effort. The reader should smoothly go through the material and study it.

  3. I spent a lot of time on usually overlooked details. For example, I analyzed the difference between how to write bits, types of messages (CommonMsgInfo & CommonMsgInfoRelaxed), bitwise operations, and much more. All this was done so that you did not have to study extraneous material while reading the tutorial. The reader should be able to immediately find the information they need in the same tutorial. Such nuances require detailed study, which can be seen by reading the material.

  4. I considered not only the functions and methods themselves but also their details. For example, while learning GET methods, I looked at how you can work with data types and translate one data type into another, as this is one of the biggest problems for every beginner.

  5. Each choice in the tutorial was explained in detail so that the reader would not have questions about why some action was done in a certain way.

  6. I created a convenient repository where you can find examples of each chapter separately and run them right away. Each example is an independent code. Thus, if the reader cannot understand something within the tutorial, then he can always refer to the repository.

This is some of what I paid attention to while writing the material. It will be hard to remember everything, but I think this is enough. All these details had to be taken into account and organized so that they were harmoniously next to each other. Therefore, it took more effort for 1 hour of work than 1 hour of just writing the code.

@delovoyhomie @Naltox

@delovoyhomie
Copy link
Collaborator

@aSpite, we talked to the team and agreed to increase the amount of reward to $2k. Indeed, an important tutorial is written with the highest quality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved This proposal is approved by the committee footstep This is a TON Footstep issue
Projects
None yet
Development

No branches or pull requests

5 participants