Guardians of the Ledger: Protecting Decentralized Exchanges From State Derailment Defects

The decentralized exchange (DEX) leverages smart contracts to trade digital assets for users on the blockchain. Developers usually develop several smart contracts into one project, implementing complex logic functions and multiple transaction operations. However, the interaction among these contracts poses challenges for developers analyzing the state logic. Due to the complex state logic in DEX projects, many critical state derailment defects have emerged in recent years. In this article, we conduct the first systematic study of state derailment defects in DEX. We define five categories of state derailment defects and provide detailed analyses of them. Furthermore, we propose a novel deep learning-based framework S<sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">tateGuard</small> for detecting state derailment defects in DEX smart contracts. It leverages a smart contract deconstructor to deconstruct the contract into an abstract syntax tree (AST), from which five categories of dependency features are extracted. Next, it implements a graph optimizer to process the structured data. At last, the optimized data is analyzed by graph convolutional networks to identify potential state derailment defects. We evaluated S<sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">tateGuard</small> through a dataset of 46 DEX projects containing 5671 smart contracts, and it achieved 94.25% F1-score. In addition, in a comparison experiment with state-of-the-art, S<sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">tateGuard</small> leads the F1-score by 6.29%. To further verify its practicality, we used S<sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">tateGuard</small> to audit real-world contracts and successfully authenticated multiple novel common vulnerabilities and exposures.

Authors

Institutions

Publication Details

Journal
IEEE Transactions on Reliability
Published
2024-12-18
DOI
https://doi.org/10.1109/tr.2024.3509414
Citations
18
Primary Topic
State Capitalism and Financial Governance
Type
article
Field-Weighted Citation Impact
9.98

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Guardians of the Ledger: Protecting Decentralized Exchanges From State Derailment Defects

Wenkai Li, Yuqing Zhang, Xiaoqi Li, Zongwei Li
18 citations
IEEE Transactions on Reliability
State Capitalism and Financial Governance
9.98
article

Guardians of the Ledger: Protecting Decentralized Exchanges From State Derailment Defects

Wenkai Li, Yuqing Zhang, Xiaoqi Li, Zongwei Li
article en
18 citations

Abstract

The decentralized exchange (DEX) leverages smart contracts to trade digital assets for users on the blockchain. Developers usually develop several smart contracts into one project, implementing complex logic functions and multiple transaction operations. However, the interaction among these contracts poses challenges for developers analyzing the state logic. Due to the complex state logic in DEX projects, many critical state derailment defects have emerged in recent years. In this article, we conduct the first systematic study of state derailment defects in DEX. We define five categories of state derailment defects and provide detailed analyses of them. Furthermore, we propose a novel deep learning-based framework S<sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">tateGuard</small> for detecting state derailment defects in DEX smart contracts. It leverages a smart contract deconstructor to deconstruct the contract into an abstract syntax tree (AST), from which five categories of dependency features are extracted. Next, it implements a graph optimizer to process the structured data. At last, the optimized data is analyzed by graph convolutional networks to identify potential state derailment defects. We evaluated S<sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">tateGuard</small> through a dataset of 46 DEX projects containing 5671 smart contracts, and it achieved 94.25% F1-score. In addition, in a comparison experiment with state-of-the-art, S<sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">tateGuard</small> leads the F1-score by 6.29%. To further verify its practicality, we used S<sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">tateGuard</small> to audit real-world contracts and successfully authenticated multiple novel common vulnerabilities and exposures.

IEEE Transactions on ReliabilityVol. 74(3)
Hainan University (CN), Computer Network Information Center (CN), University of Chinese Academy of Sciences (CN)
National Natural Science Foundation of China
Reduced inequalities
Openalex Percentile: Top 2%
State Capitalism and Financial Governance
9.98
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.