atlas

Research map / Large language models / Retrieval and knowledge

SCALM: Detecting Bad Practices in Smart Contracts Through LLMs

AAAI 2025 · Large language models › Retrieval and knowledge · approach: Long-context and personalized retrieval · 11 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes SCALM, an LLM-based smart contract auditing framework combining RAG over a DAppSCAN-derived vector knowledge base with Step-Back Prompting to detect SWC-style bad practices and generate JSON audit reports.

Problem

Detecting bad coding practices in Ethereum smart contracts (SWC-categorized weaknesses that may not be direct security vulnerabilities), which existing pattern-matching tools handle poorly and with limited coverage.

Approach

Combine a vector database of code snippets with bad practices (retrieved via cosine similarity using embeddings) with Step-Back Prompting so the LLM abstracts high-level principles before reasoning about each code fragment, producing structured audit reports.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use SCALM instead of OyenteSmart contract bad-practice detection · SWC-101F1 (%): 66.03 -> 95.45Helped
Use SCALM instead of ConkasSmart contract bad-practice detection · SWC-104F1 (%): 33.00 -> 98.27Helped
Use SCALM instead of ConkasSmart contract bad-practice detection · SWC-107F1 (%): 77.50 -> 94.97Helped
Use SCALM instead of MythrilSmart contract bad-practice detection · SWC-112F1 (%): 70.37 -> 97.30Helped
Use SCALM instead of ConkasSmart contract bad-practice detection · SWC-116F1 (%): 88.50 -> 92.67Helped
Add RAG (ablation)SCALM with GPT-4o · SWC-101F1 (%): 79.71 -> 95.45Helped
Add RAG (ablation)SCALM with GPT-4o · SWC-104F1 (%): 79.19 -> 98.27Helped
Add RAG (ablation)SCALM with GPT-4o · SWC-107F1 (%): 75.35 -> 94.97Helped
Add RAG (ablation)SCALM with GPT-4o · SWC-112F1 (%): 73.99 -> 97.30Helped
Add RAG (ablation)SCALM with GPT-4o · SWC-116F1 (%): 83.13 -> 92.67Helped

Surprising findings

Limitations

Experimental setup

Datasets: DAppSCAN SmartBugs

Benchmarks: DAppSCAN SmartBugs

Metrics: accuracy recall F1

Baselines: Mythril Oyente Confuzzius Conkas

Builds on: retrieval-augmented generation step-back prompting Mythril

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy