/1 The Genesis – Setting the Stage – Creating the Initial Smart Contract Analyser (Solidsight v1 & v2)

IsaIsa
1 min read

Overview

When I started building Solidsight, the idea was straightforward yet ambitious: automate the process of reviewing Solidity smart contracts by leveraging local Large Language Models (LLMs). I envisioned an app that could quickly dissect contracts and produce clear, informative reports detailing their functionality, potential vulnerabilities, and user interactions.


Building the Core Functionality

The initial goal was simple: parse Solidity files, generate a detailed functions report, describe the typical user journey, and visualise the function interactions using Mermaid diagrams.

Here’s the basic API interaction function I started with:

pythonCopyEditdef call_llm(prompt):
    headers = {"Content-Type": "application/json"}
    payload = {
        "model": "deepseek-r1",
        "prompt": prompt,
        "temperature": 0.7,
        "max_tokens": 8000
    }
    try:
        response = requests.post(LLM_API_URL, json=payload, headers=headers)
        response.raise_for_status()
        return response.json()["choices"][0]["text"].strip()
    except Exception as e:
        print(f"LLM API call failed: {e}")
        return ""

Challenges Encountered

The early versions struggled significantly with handling large Solidity files, often hitting token limits or experiencing API timeouts. Error handling at this stage was minimal, causing unexpected failures that required restarting the entire analysis—a frustrating user experience.

Reflections and Improvements

From these initial setbacks, I learned how crucial robust error handling was. Implementing structured error catching and refining my prompts reduced crashes and improved reliability, paving the way for more ambitious developments.

We will stop here, and I’ll see you on the next one.

pxng0lin.

0
Subscribe to my newsletter

Read articles from Isa directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Isa
Isa

Former analyst with expertise in data, forecasting, and resource modeling, transitioned to cybersecurity over the past 4 years (as of May 2024). Passionate about security and problem-solving, utilising skills in data and analysis, for cybersecurity challenges. Experience: Extensive background in data analytics, forecasting, and predictive modelling. Experience with platforms like Bugcrowd, Intigriti, and HackerOne. Transitioned to Web3 cybersecurity with Immunefi, exploring smart contract vulnerabilities. Spoken languages: English (Native, British), Arabic (Fus-ha)