Politecnico di Torino (logo)

Smart Contracts and Solidity Code Summarization

Matteo Zhang

Smart Contracts and Solidity Code Summarization.

Rel. Valentina Gatteschi, Fabrizio Lamberti. Politecnico di Torino, Corso di laurea magistrale in Ict For Smart Societies (Ict Per La Società Del Futuro), 2021

PDF (Tesi_di_laurea) - Tesi
Licenza: Creative Commons Attribution Non-commercial No Derivatives.

Download (3MB) | Preview

Blockchain became a hot topic in the last decade. Blockchain is the underlying technology enabling Bitcoin transfers. In particular, this technology ensures the integrity of digital records and enables the transfer of decentralized digital currency. After the creation of bitcoin, Vitalik Buterin saw the unexpressed potential of this technology in other fields that go beyond a simple transfer of value and created Ethereum, an open-source, decentralized blockchain with smart contract functionality. Consequently, smart contracts became the centre of the Blockchain economy. Smart contracts are programs that run on the blockchain. In the Ethereum case, the most used programming language to code smart contracts is Solidity, a relatively new programming language. One of the main problems in computer science is source code documentation, and this is remarkably true for Solidity. When Solidity developers need to understand smart contracts code, the code generally lacks comments and proper documentation. In order to provide code documentation to programmers and provide a coherent summary of the source code in the Blockchain context, this thesis presents a system to automatically generate comments for Solidity smart contracts code. The created system "SoliditySummarizer" will significantly help beginners understand the code, given that the developers spend most of their time on this task. Furthermore, the system could also be useful for people with limited coding skills, according to our final survey, since it will help them understand the source code of smart contracts with detailed summaries. In the first part of the thesis, the state of the art in solidity code summarization is analyzed. In the second part, the state of the art in general code summarization techniques are presented. Then, the developed system is described. Such system relies on transformer models to perform natural language generation from source code. The thesis also presents the dataset created to train and test the system, which was created by collecting and cleaning Solidity smart contracts. Finally, results show that the created tool provides better results than the current state of the art solidity document generation tools.

Relators: Valentina Gatteschi, Fabrizio Lamberti
Academic year: 2021/22
Publication type: Electronic
Number of Pages: 83
Corso di laurea: Corso di laurea magistrale in Ict For Smart Societies (Ict Per La Società Del Futuro)
Classe di laurea: New organization > Master science > LM-27 - TELECOMMUNICATIONS ENGINEERING
Aziende collaboratrici: UNSPECIFIED
URI: http://webthesis.biblio.polito.it/id/eprint/20620
Modify record (reserved for operators) Modify record (reserved for operators)