用大模型系统识别以太坊智能合约中的不良编码习惯。
SCALM: Detecting Bad Practices in Smart Contracts Through LLMs
- 结合回溯提示与检索增强生成,提升检测精度。
- 覆盖35种以上不良实践,多模型测试表现更优。
- 适合安全审计员和开发者快速发现代码隐患。
随着以太坊平台的成熟与广泛应用,保持智能合约编写质量至关重要。虽然不良编码习惯不会直接引发安全漏洞,但会增加出错风险。为此,本文首次系统研究智能合约中的35种以上不良实践,提出基于大语言模型(LLM)的SCALM框架。该框架融合步骤回溯提示(Step-Back Prompting)与检索增强生成(RAG),有效识别并分析各类不良实践。通过在多个大模型和数据集上的广泛实验,SCALM在检测效率与准确率上均优于现有工具,为智能合约质量保障提供新方法。
原文摘要 · Abstract (English)
As the Ethereum platform continues to mature and gain widespread usage, it is crucial to maintain high standards of smart contract writing practices. While bad practices in smart contracts may not directly lead to security issues, they do elevate the risk of encountering problems. Therefore, to understand and avoid these bad practices, this paper introduces the first systematic study of bad practices in smart contracts, delving into over 35 specific issues. Specifically, we propose a large language models (LLMs)-based framework, SCALM. It combines Step-Back Prompting and Retrieval-Augmented Generation (RAG) to identify and address various bad practices effectively. Our extensive experiments using multiple LLMs and datasets have shown that SCALM outperforms existing tools in detecting bad practices in smart contracts.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。