StateGuard: Detecting State Derailment Defects in Decentralized Exchange Smart Contract

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Li, Zongwei, Li, Wenkai, Li, Xiaoqi, Zhang, Yuqing
Formato: Preprint
Publicado: 2024
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866916247383310336
author Li, Zongwei
Li, Wenkai
Li, Xiaoqi
Zhang, Yuqing
author_facet Li, Zongwei
Li, Wenkai
Li, Xiaoqi
Zhang, Yuqing
contents Decentralized Exchanges (DEXs), leveraging blockchain technology and smart contracts, have emerged in decentralized finance. However, the DEX project with multi-contract interaction is accompanied by complex state logic, which makes it challenging to solve state defects. In this paper, we conduct the first systematic study on state derailment defects of DEXs. These defects could lead to incorrect, incomplete, or unauthorized changes to the system state during contract execution, potentially causing security threats. We propose StateGuard, a deep learning-based framework to detect state derailment defects in DEX smart contracts. StateGuard constructs an Abstract Syntax Tree (AST) of the smart contract, extracting key features to generate a graph representation. Then, it leverages a Graph Convolutional Network (GCN) to discover defects. Evaluating StateGuard on 46 DEX projects with 5,671 smart contracts reveals its effectiveness, with a precision of 92.24%. To further verify its practicality, we used StateGuard to audit real-world smart contracts and successfully authenticated multiple novel CVEs.
format Preprint
id arxiv_https___arxiv_org_abs_2405_09181
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle StateGuard: Detecting State Derailment Defects in Decentralized Exchange Smart Contract
Li, Zongwei
Li, Wenkai
Li, Xiaoqi
Zhang, Yuqing
Software Engineering
Decentralized Exchanges (DEXs), leveraging blockchain technology and smart contracts, have emerged in decentralized finance. However, the DEX project with multi-contract interaction is accompanied by complex state logic, which makes it challenging to solve state defects. In this paper, we conduct the first systematic study on state derailment defects of DEXs. These defects could lead to incorrect, incomplete, or unauthorized changes to the system state during contract execution, potentially causing security threats. We propose StateGuard, a deep learning-based framework to detect state derailment defects in DEX smart contracts. StateGuard constructs an Abstract Syntax Tree (AST) of the smart contract, extracting key features to generate a graph representation. Then, it leverages a Graph Convolutional Network (GCN) to discover defects. Evaluating StateGuard on 46 DEX projects with 5,671 smart contracts reveals its effectiveness, with a precision of 92.24%. To further verify its practicality, we used StateGuard to audit real-world smart contracts and successfully authenticated multiple novel CVEs.
title StateGuard: Detecting State Derailment Defects in Decentralized Exchange Smart Contract
topic Software Engineering
url https://arxiv.org/abs/2405.09181