Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
Where can I find a good starter project for a smart contract in FunC for TON blockchain?

There's a lot of setup for a project to implement a smart contract in FunC for TON blockchain (ton.org). Is there a good practice setup project that provides the following:

  • Skeleton and directory structure for the contract .fc files (FunC)
  • Compilation script that takes the FunC source code and compiles to TVM bytecode
  • Unit tests for the contracts to help me test them before deploying
  • Deployment script that takes the TVM bytecode and uploads to TON mainnet or testnet
  • End to end tests for the deployed contracts to make sure they're actually working
5
5
Posted 2 years ago
Tal Kol
359 × 3 Administrator
Votes Newest

Answers 2



  
  
Posted 9 months ago
pic
Deleted user

I created a template repo to fullfil the above requirements:

https://github.com/ton-defi-org/tonstarter-contracts

Simply clone this repo and rename the directory and you can start working. The README has a very thorough explanation how everything works.


There is no one official way to develop smart contracts for TON. Every developer has their own best practices. This setup is definitely opinionated and some developers may not appreciate the choices made. Nevertheless, I stand by every choice made here and believe that this is the optimal setup to develop fully tested contracts in the most seamless way possible.

Some of the opinionated choices made here include:

  • Cross platform support - allow developers to work on Mac M1, Mac Intel, Windows or Linux
  • Strong belief in tests - contracts often manage money - they must be developed under high scrutiny
  • Clear and documented code to help users audit the contracts sources and understand what they do
  • Reliance on modern TypeScript to develop clean and typed scripts and tests in a modern framework
  • Reliance on TypeScript for deployment instead of working with fift CLI tools - it's simply easier
  • Tests are executed in JavaScript with TVM in web-assembly - a great balance of speed and convenience
  • Following of the TON contract best practices appearing in the official docs
2
2
Posted 2 years ago
Tal Kol
359 × 3 Administrator