File Download

There are no files associated with this item.

  Links for fulltext
     (May Require Subscription)
Supplementary

Article: Unearthing Gas-Wasting Code Smells in Smart Contracts With Large Language Models

TitleUnearthing Gas-Wasting Code Smells in Smart Contracts With Large Language Models
Authors
KeywordsArtificial Intelligence
language models
patterns
program analysis
smart contracts
Issue Date1-Jan-2025
PublisherInstitute of Electrical and Electronics Engineers
Citation
IEEE Transactions on Software Engineering, 2025, v. 51, n. 4, p. 879-903 How to Cite?
Abstract

Smart contracts are automated programs stored on a blockchain, featuring unique attributes such as permissionlessness, trustlessness, immutability, and transparency. These properties underpin an array of unprecedented decentralized services. Compiled into bytecodes, Ethereum smart contracts are executed within the Ethereum Virtual Machine (EVM). Ethereum's distinct gas mechanism assigns a price to each bytecode execution, incentivizing resource-efficient computing. However, a disconnect exists between conventional coding practices and the less intuitive gas consumption computation mechanism, resulting in inadvertent gas wastage. Gas-wasting code smells at the source code level have been studied in various related works; however, the task of manually identifying such code smells by reading through codes and reasoning about them is both time-consuming and economically inefficient. In this work, we propose to leverage Large Language Models (LLMs), which have seen a surge in popularity recently, to facilitate undertaking the labor-intensive part of the code-smell-finding pipeline. In particular, we focus on Solidity, the predominant programming language for Ethereum smart contracts. Overall, we identified 26 gas-wasting code smells, out of which 13 were not presented in previous papers. On average, applying these code smells led to a reduction of approximately 10.534% in deployment costs and 21.528% in message call costs across our test codes. We further make a report on each of the identified code smells with associated example contracts sourced from either previous literature or recently deployed contracts.


Persistent Identifierhttp://hdl.handle.net/10722/361908
ISSN
2023 Impact Factor: 6.5
2023 SCImago Journal Rankings: 1.868

 

DC FieldValueLanguage
dc.contributor.authorJiang, Jinan-
dc.contributor.authorLi, Zihao-
dc.contributor.authorQin, Haoran-
dc.contributor.authorJiang, Muhui-
dc.contributor.authorLuo, Xiapu-
dc.contributor.authorWu, Xiaoming-
dc.contributor.authorWang, Haoyu-
dc.contributor.authorTang, Yutian-
dc.contributor.authorQian, Chenxiong-
dc.contributor.authorChen, Ting-
dc.date.accessioned2025-09-17T00:31:55Z-
dc.date.available2025-09-17T00:31:55Z-
dc.date.issued2025-01-01-
dc.identifier.citationIEEE Transactions on Software Engineering, 2025, v. 51, n. 4, p. 879-903-
dc.identifier.issn0098-5589-
dc.identifier.urihttp://hdl.handle.net/10722/361908-
dc.description.abstract<p>Smart contracts are automated programs stored on a blockchain, featuring unique attributes such as permissionlessness, trustlessness, immutability, and transparency. These properties underpin an array of unprecedented decentralized services. Compiled into bytecodes, Ethereum smart contracts are executed within the Ethereum Virtual Machine (EVM). Ethereum's distinct gas mechanism assigns a price to each bytecode execution, incentivizing resource-efficient computing. However, a disconnect exists between conventional coding practices and the less intuitive gas consumption computation mechanism, resulting in inadvertent gas wastage. Gas-wasting code smells at the source code level have been studied in various related works; however, the task of manually identifying such code smells by reading through codes and reasoning about them is both time-consuming and economically inefficient. In this work, we propose to leverage Large Language Models (LLMs), which have seen a surge in popularity recently, to facilitate undertaking the labor-intensive part of the code-smell-finding pipeline. In particular, we focus on Solidity, the predominant programming language for Ethereum smart contracts. Overall, we identified 26 gas-wasting code smells, out of which 13 were not presented in previous papers. On average, applying these code smells led to a reduction of approximately 10.534% in deployment costs and 21.528% in message call costs across our test codes. We further make a report on each of the identified code smells with associated example contracts sourced from either previous literature or recently deployed contracts.</p>-
dc.languageeng-
dc.publisherInstitute of Electrical and Electronics Engineers-
dc.relation.ispartofIEEE Transactions on Software Engineering-
dc.subjectArtificial Intelligence-
dc.subjectlanguage models-
dc.subjectpatterns-
dc.subjectprogram analysis-
dc.subjectsmart contracts-
dc.titleUnearthing Gas-Wasting Code Smells in Smart Contracts With Large Language Models-
dc.typeArticle-
dc.identifier.doi10.1109/TSE.2024.3491578-
dc.identifier.scopuseid_2-s2.0-105003245320-
dc.identifier.volume51-
dc.identifier.issue4-
dc.identifier.spage879-
dc.identifier.epage903-
dc.identifier.eissn1939-3520-
dc.identifier.issnl0098-5589-

Export via OAI-PMH Interface in XML Formats


OR


Export to Other Non-XML Formats