Verifying Event Completeness and Consistency in Token Contracts via Static Analysis and LLMs

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

Abstract

To ensure transparency and auditability, smart contracts on blockchain support event mechanisms that systematically log and record critical state changes, enabling external applications and users to monitor contract execution and track important transactions. Token contracts such as ERC20 must implement specific events like Transfer and Approval to accurately track asset movements and maintain system transparency. However, malicious developers may exploit incomplete or inconsistent event implementations to conceal operations, mislead users, and introduce security risks. In this paper, we propose TEGuard, a novel approach to verify event completeness and consistency in Token contracts by combining static analysis with large language models (LLMs). For completeness, we use flow analysis to identify blocks modifying critical state variables and extract related control flow to check whether required events are emitted. For consistency, we construct structured data dependency graphs through backward data flow analysis to extract event semantics and code semantics, employing a dual-LLM framework integrated with contract code snippet to verify semantic consistency. Our approach is designed to strengthen the security foundation of token contracts by addressing critical event-related vulnerabilities. We presented preliminary experimental results to validate the effectiveness of TEGuard.

Original languageEnglish
Title of host publication2025 5th International Conference on Computer Science and Blockchain, CCSB 2025
PublisherInstitute of Electrical and Electronics Engineers Inc.
Pages199-203
Number of pages5
ISBN (Electronic)9781665477819
DOIs
StatePublished - 2025
Event5th International Conference on Computer Science and Blockchain, CCSB 2025 - Shenzhen, China
Duration: 1 Aug 20253 Aug 2025

Publication series

Name2025 5th International Conference on Computer Science and Blockchain, CCSB 2025

Conference

Conference5th International Conference on Computer Science and Blockchain, CCSB 2025
Country/TerritoryChina
CityShenzhen
Period1/08/253/08/25

Keywords

  • dataflow analysis
  • event analysis
  • LLM
  • smart contract

Fingerprint

Dive into the research topics of 'Verifying Event Completeness and Consistency in Token Contracts via Static Analysis and LLMs'. Together they form a unique fingerprint.

Cite this