Great News. We have launched Sol2Ligo Interactive handbook. We want to make Ligo as clear and simple as possible for more blockchain developers and the Sol2Ligo handbook should help reach this goal.
What is the Sol2Ligo handbook?
Sol2Ligo handbook is an online interactive tool oriented towards Solidity developers willing to migrate their smart-contract development knowledge to the Tezos ecosystem. With this tool, you may learn Ligo from scratch, build smart-contracts on Tezos, work with Solidity and Ligo constructions, run your code, and much more.
What is included in the Sol2Ligo handbook?
- Step-by-Step guide - we tried to describe the major differences between EVM and Tezos-based contracts with examples on each topic.
- Integrated transpiler - handbook features integrated transpiler allowing everybody to experiment with Solidity and LIGO constructions
- Code Launcher - create and test your code examples on Ligo.
Main topics of Sol2Ligo handbook
The handbook includes 23 sections with examples for each topic. You will learn how to work with: variables, mappings, functions, structures, arrays, loops, imports, and much more.
In future updates, we will add sections and explanations that will cover more Solidity usage cases. We invite you to share your thoughts and provide feedback on using our handbook in our telegram development community.
List of the last updates and features for Sol2Ligo
We have improved the transpiler's overall stability during the last development phase, ensuring that it won't break on more complex contracts and produce useful LIGO code.
Here is the list of the recent changes that we have made:
1) ERC20->FA1.2 transpilation. Stable work. Both for token calls and for creating new tokens.
2) Inheritance, modifiers, and more. We integrated this part of Solidity into our transpiler. It's experimental functionality and you may encounter some minor bugs in the transpilation process, but we are working on a more stable version. To understand the importance of this update, you must know that 90%+ of solidity working contracts use these features.
3) Typecasts between address and other types. In Solidity, you could substitute uint256 with an address, and everything worked fine. You can't do that in Tezos. We had many cases when everything broke because of this difference. Now we have much better support of typecasts.
4) Calls to other contracts. In addition to the individual cases of ERC20 and ERC721, we also improved other smart contracts' calls. Previously, you had to know a smart contract's router type; from now you need to know only the signature of a specific endpoint. Now the transpiler works well with accepting and retrieving values in calls.
5) Support the latest Solidity versions (0.6.x and 0.7.x). Our transpiler learned to check Solidity versions and convert code for newer versions. It works with popular examples (SPDX-License-Identifier) and we are implementing a support of more complex Solidity structures.
6) Multiple contract files for input and output. When creating complex smart-contracts, it's quite common to separate reusable logic into different files. Moreover, there are pluggable libraries that are usually located separately from the main logic file. By respecting the files' initial hierarchy, the transpiler can produce an output similar to the input in terms of the folder structure. This feature is available in console mode.
7) Better Solidity understanding. Our transpiler understands Solidity so well that maker-dao is already compiling to Ligo. The resulting code needs improvement in the current stage, but it's already good enough to show our significant progress. It is a good milestone, but it consisted of many improvements that would not fit in one article.
8) Improved function signature generation. View, internal, pure, and functions that cause money to be sent. In Solidity and Ligo, the semantics of these functions are very different. We have brought it to the acceptable form and now we generate the minimum function signature. For example, if you don't need opList, you can remove it. Accordingly, all function calls are now changed as required.
9) Structs. We just fixed the correct work with Structs.
10) Fixed work with Multidimensional arrays.
11) Conducted tests on the Tezos and Ethereum virtual machine with a real results comparison and fixed discrepancies that occurred in the process of these tests. Also, we covered our transpiler with a new category of tests (npm run test-emulator)
12) Updated warning and other messages from the transpiler. We added links on which you can read what the problem is. Inside the transpiler, we already have links to the original files and line numbers in Solidity's source code.
Our team faces challenges to make Sol2Ligo transpiler more functional and stable, but we are excited about new opportunities that our project can give to developers. We have also created a discord channel where you can talk to our core dev team and share real problematic pieces of code that cause problems in broadcasting from Solidity to Ligo.