Lessons on developing smart contracts on FunC for The Open Network(TON)

August 8, 2023 ยท View on GitHub

Lessons on developing smart contracts on FunC for The Open Network(TON). The lessons are located in the appropriate folders in .md format, and a code is attached to each lesson. Our community - here. The lessons are first done in Russian here, and then I gradually translate them into English, if you want to help - the donation addresses are below.

Create Smart Contracts on TON

NumberLessonConsidered conceptsLink
1Simple FunC Smart ContractTypes, exceptions, functions, contract deployment, GET requests in testnetLINK
2FunC tests for the first smart contractFunC test logic, test structure, tuplesLINK
3Messages, let's write a proxy contractMessages, message modes, primitives, cell referencesLINK
4Testing messagesAddresses, TL-B, register c5 and output actionsLINK
5Flags and data storage in a contractOp - for identification of operations, Computational fees, primitive data storage in the contractLINK
6Testing flags and data storage in the contractVarious tests for flag messages and data storage in register c4LINK
7HashMap storageWorking with Dictionaries (hashmap): storage, deletion, searchLINK
8Testing HashMap storageTesting HashMap(dictionaries), special toncli functions for testing, register c7LINK
9Analyzing the Jetton Standard(Fungible Token)Tokens, standards, Jetton standard, StateInit, workchainsLINK
10Analyzing the NFT Standard (Non-Fungible Token)NFT, standard NFT, collections and individual NFTsLINK

Writing such tutorials is a lot of work - I will be glad to see your star on the repository ๐ŸŒŸ

Create a Pipeline to work with smart contracts

LessonConsidered conceptsLink
Simple smart contract in ton-community/sandboxcreate a ton-community/sandbox project, write and compile a contractLINK
Writing tests in ton-community/sandboxjest framework testsLINK
Deploying a smart contract using a QR codepipeline for deploying a smart contract to the test networkLINK
Chatbot smart contractanalyzing the smart contract for future message testsLINK
Writing onchain tests on the testnetmessage test logic, onchain testsLINK

Author of lessons publishes new tutorials, writes about interesting blockchain companies here

Get requests in TON

LessonConsidered conceptsLink
ton.jsGetting data from a smart contract using JS(ton.js)LINK
ADNL Protocol IntroConnection to ADNL, getAccountState, getMasterchaininfoLINK
ADNL Run GetMethodGet method call, NFT sales analytics logicLINK
Collect account txes using ADNLLogical time, recent account transactionsLINK

Authorization and sending transactions from UI in 5 minutes with TON Connect React UI

LessonConsidered conceptsLink
TON Connect auth buttona simple site with authorization through TonConnect, the concept of separation into wallets and Web3 applicationsLINK
TON Connect send transactioncontract wrapper usage, send transaction, call get-method from uiLINK

Golang Scripts - convenient scripts for working with TON

LessonConsidered conceptsLink
Create a wallet and deploy a smart contractWorking with TON using GO, creating a wallet, hexBOC contract form, sending messages, calling the GET methodLINK
NFT collection creationWe get information about the NFT collection and an individual element, Deploy the collection and element to the networkLINK
We issue our own tokens: ICOJettons ICO, Jetton wallet balanceLINK

Bonus

LessonConsidered conceptsLink
Random in TONRaffle Smart Contract, global variables and c4, admin functions for contract balanceLINK
NFT SaleSale logic based on smart contracts,how to "burn" contractLINK
Hacking a simple contractVulnerability due to compiler optimization of the code in the absence of impureLINK

ะั€ั…ะธะฒ

Go to the lesson arhive

Development assistance

Ton: EQAvmc9oVnOvLFlUAgeNmZNZoKeDg9vTEiAQxNFw-t5mh3m7

LICENSE

CC BY-NC-ND 4.0 https://creativecommons.org/licenses/by-nc-nd/4.0/