Smart Contract Code Repair Recommendation based on Reinforcement Learning and Multi-metric Optimization

Author:

Guo Hanyang1,Chen Yingye2,Chen Xiangping3,Huang Yuan1,Zheng Zibin1

Affiliation:

1. School of Software Engineering, Sun Yat-Sen University, China

2. School of Computer Science and Engineering, Sun Yat-Sen University, China

3. School of Communication and Design, Sun Yat-Sen University, China

Abstract

A smart contract is a kind of code deployed on the blockchain that executes automatically once an event triggers a clause in the contract. Since smart contracts involve businesses such as asset transfer, they are more vulnerable to attacks, so it is crucial to ensure the security of smart contracts. Because a smart contract cannot be tampered with once deployed on the blockchain, for smart contract developers, it is necessary to fix vulnerabilities before deployment. Compared with many vulnerability detection tools for smart contracts, the amount of automatic fix approaches for smart contracts is relatively limited. These approaches mainly use defined pattern-based methods or heuristic search algorithms for vulnerability repairs. In this paper, we propose RLRep , a reinforcement learning-based approach to provide smart contract repair recommendations for smart contract developers automatically. This approach adopts an agent to provide repair action suggestions based on the vulnerable smart contract without any supervision, which can solve the problem of missing labeled data in machine learning-based repair methods. We evaluate our approach on a dataset containing 853 smart contract programs (programming language: Solidity) with different kinds of vulnerabilities. We split them into training and test set. The result shows that our approach can provide 54.97% correct repair recommendations for smart contracts.

Publisher

Association for Computing Machinery (ACM)

Subject

Software

Reference82 articles.

1. Oxford Analytica . 2021. Poly Network attack underlines growing DeFi risks. Emerald Expert Briefingsoxan-es ( 2021 ). Oxford Analytica. 2021. Poly Network attack underlines growing DeFi risks. Emerald Expert Briefingsoxan-es (2021).

2. A survey of robot learning from demonstration

3. Johannes Bader , Andrew Scott , Michael Pradel , and Satish Chandra . 2019 . Getafix: Learning to Fix Bugs Automatically . Proc. ACM Program. Lang. 3, OOPSLA, Article 159 (oct 2019), 27 pages. https://doi.org/10.1145/3360585 10.1145/3360585 Johannes Bader, Andrew Scott, Michael Pradel, and Satish Chandra. 2019. Getafix: Learning to Fix Bugs Automatically. Proc. ACM Program. Lang. 3, OOPSLA, Article 159 (oct 2019), 27 pages. https://doi.org/10.1145/3360585

4. Dzmitry Bahdanau , Kyunghyun Cho , and Yoshua Bengio . 2015 . Neural Machine Translation by Jointly Learning to Align and Translate . In 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, Yoshua Bengio and Yann LeCun (Eds.). http://arxiv.org/abs/1409 .0473 Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. 2015. Neural Machine Translation by Jointly Learning to Align and Translate. In 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, Yoshua Bengio and Yann LeCun (Eds.). http://arxiv.org/abs/1409.0473

5. Karthikeyan Bhargavan , Antoine Delignat-Lavaud , Cédric Fournet , Anitha Gollamudi , Georges Gonthier , Nadim Kobeissi , Natalia Kulatova , Aseem Rastogi , Thomas Sibut-Pinote , Nikhil Swamy , and Santiago Zanella Béguelin . 2016 . Formal Verification of Smart Contracts: Short Paper . In Proceedings of the 2016 ACM Workshop on Programming Languages and Analysis for Security, PLAS@CCS 2016 , Vienna, Austria , October 24, 2016, Toby C. Murray and Deian Stefan (Eds.). ACM, 91–96. https://doi.org/10.1145/2993600.2993611 10.1145/2993600.2993611 Karthikeyan Bhargavan, Antoine Delignat-Lavaud, Cédric Fournet, Anitha Gollamudi, Georges Gonthier, Nadim Kobeissi, Natalia Kulatova, Aseem Rastogi, Thomas Sibut-Pinote, Nikhil Swamy, and Santiago Zanella Béguelin. 2016. Formal Verification of Smart Contracts: Short Paper. In Proceedings of the 2016 ACM Workshop on Programming Languages and Analysis for Security, PLAS@CCS 2016, Vienna, Austria, October 24, 2016, Toby C. Murray and Deian Stefan (Eds.). ACM, 91–96. https://doi.org/10.1145/2993600.2993611

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3