SmartContractTransformer-GAN (SCT-GAN): A Framework for Smart Contract Vulnerability Detection and Synthetic Generation
Abstract
Detecting vulnerabilities in smart contracts is challenging due to their complex semantics, structural diversity, and class imbalance. Existing deep learning approaches often treat contracts as plain text, overlooking the rich structural information in Abstract Syntax Trees (ASTs). To address these limitations, we propose SmartContractTransformer-GAN (SCT-GAN), a multi-task transformer-based framework for vulnerability detection and adversarial contract generation. SCT-GAN introduces three key innovations: (1) fusion of source code tokens and AST paths for enhanced semantic and structural modeling, (2) hierarchical detection at contract and line levels, enabling fine-grained identification even with limited context, and (3) a syntax-aware GAN generator-discriminator loop producing realistic and semantically meaningful smart contract code. Evaluation shows that while contract-level detection does not significantly improve the state of the art, line-level detection benefits most from the generative components, leveraging richer latent representations to capture logical patterns in individual lines. SCT-GAN’s modular, memory-efficient design supports large-scale auditing, continual adaptation to emerging vulnerabilities, and synthetic dataset generation for low-data scenarios. Overall, SCT-GAN provides a scalable, interpretable, and generative solution for proactive smart contract security, advancing automated auditing and vulnerability synthesis in blockchain ecosystems.
Community
0 commentsNo discussion yet
Be the first to share a question or observation.