SoliDiffy: AST Differencing for Solidity Smart Contracts

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Eshghie, Mojtaba, Åryd, Viktor, Artho, Cyrille, Monperrus, Martin
Formato: Preprint
Publicado: 2024
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866917961681338368
author Eshghie, Mojtaba
Åryd, Viktor
Artho, Cyrille
Monperrus, Martin
author_facet Eshghie, Mojtaba
Åryd, Viktor
Artho, Cyrille
Monperrus, Martin
contents Structured code differencing is the act of comparing the hierarchical structure of code via its abstract syntax tree (AST) to capture modifications. AST-based source code differencing enables tasks such as vulnerability detection and automated repair where traditional line-based differencing falls short. We introduce SoliDiffy, the first AST differencing tool for Solidity smart contracts with the ability to generate an edit script that soundly shows the structural differences between two smart-contracts using insert, delete, update, move operations. In our evaluation on 353,262 contract pairs, SoliDiffy achieved a 96.1% diffing success rate, surpassing the state-of-the-art, and produced significantly shorter edit scripts. Additional experiments on 925 real-world commits further confirmed its superiority compared to Git line-based differencing. SoliDiffy provides accurate representations of smart contract evolution even in the existence of multiple complex modifications to the source code. SoliDiffy is made publicly available at https://github.com/mojtaba-eshghie/SoliDiffy.
format Preprint
id arxiv_https___arxiv_org_abs_2411_07718
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle SoliDiffy: AST Differencing for Solidity Smart Contracts
Eshghie, Mojtaba
Åryd, Viktor
Artho, Cyrille
Monperrus, Martin
Software Engineering
Programming Languages
Structured code differencing is the act of comparing the hierarchical structure of code via its abstract syntax tree (AST) to capture modifications. AST-based source code differencing enables tasks such as vulnerability detection and automated repair where traditional line-based differencing falls short. We introduce SoliDiffy, the first AST differencing tool for Solidity smart contracts with the ability to generate an edit script that soundly shows the structural differences between two smart-contracts using insert, delete, update, move operations. In our evaluation on 353,262 contract pairs, SoliDiffy achieved a 96.1% diffing success rate, surpassing the state-of-the-art, and produced significantly shorter edit scripts. Additional experiments on 925 real-world commits further confirmed its superiority compared to Git line-based differencing. SoliDiffy provides accurate representations of smart contract evolution even in the existence of multiple complex modifications to the source code. SoliDiffy is made publicly available at https://github.com/mojtaba-eshghie/SoliDiffy.
title SoliDiffy: AST Differencing for Solidity Smart Contracts
topic Software Engineering
Programming Languages
url https://arxiv.org/abs/2411.07718