{"title":"A BiLSTM-Attention Model for Detecting Smart Contract Defects More Accurately","authors":"Chen Qian, Tianyuan Hu, Bixin Li","doi":"10.1109/QRS57517.2022.00016","DOIUrl":null,"url":null,"abstract":"Smart contracts are applications running on the blockchain which control many virtual currencies. Since smart contracts are composed of code, they inevitably have defects. In recent years, many smart contract defects have caused lots of economic losses and harmful impacts. A contract that has defects may have some errors that cause unwanted results. As smart contracts cannot be modified once deployed, it is necessary to ensure that they are free from defects. In this paper, we focus on eleven defects of smart contracts and construct a deep learning-based model to detect these contract defects more accurately. Our model regards the smart contract’s operation codes as a sequential sentence and uses an Attention-based bidirectional long short term memory (BiLSTM-Attention) model to find smart contract defects. We evaluate our model’s and other models’ performance on 45622 real-world smart contracts. The experimental results show that our model can achieve higher accuracy (95.40%) and F1-score (95.38%). In addition, our model is highly efficient and can quickly detect large numbers of contracts.","PeriodicalId":143812,"journal":{"name":"2022 IEEE 22nd International Conference on Software Quality, Reliability and Security (QRS)","volume":null,"pages":null},"PeriodicalIF":0.0000,"publicationDate":"2022-12-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2022 IEEE 22nd International Conference on Software Quality, Reliability and Security (QRS)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/QRS57517.2022.00016","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0
Abstract
Smart contracts are applications running on the blockchain which control many virtual currencies. Since smart contracts are composed of code, they inevitably have defects. In recent years, many smart contract defects have caused lots of economic losses and harmful impacts. A contract that has defects may have some errors that cause unwanted results. As smart contracts cannot be modified once deployed, it is necessary to ensure that they are free from defects. In this paper, we focus on eleven defects of smart contracts and construct a deep learning-based model to detect these contract defects more accurately. Our model regards the smart contract’s operation codes as a sequential sentence and uses an Attention-based bidirectional long short term memory (BiLSTM-Attention) model to find smart contract defects. We evaluate our model’s and other models’ performance on 45622 real-world smart contracts. The experimental results show that our model can achieve higher accuracy (95.40%) and F1-score (95.38%). In addition, our model is highly efficient and can quickly detect large numbers of contracts.