{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2025,11,15]],"date-time":"2025-11-15T10:36:56Z","timestamp":1763203016308,"version":"build-2065373602"},"reference-count":41,"publisher":"MDPI AG","issue":"7","license":[{"start":{"date-parts":[[2025,7,21]],"date-time":"2025-07-21T00:00:00Z","timestamp":1753056000000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"funder":[{"name":"Gansu Province Higher Education Institutions Industrial","award":["2020C-29","61562002"],"award-info":[{"award-number":["2020C-29","61562002"]}]},{"DOI":"10.13039\/501100001809","name":"National Natural Science Foundation of China","doi-asserted-by":"publisher","award":["2020C-29","61562002"],"award-info":[{"award-number":["2020C-29","61562002"]}],"id":[{"id":"10.13039\/501100001809","id-type":"DOI","asserted-by":"publisher"}]}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Symmetry"],"abstract":"<jats:p>Driven by blockchain technology, numerous industries are increasingly adopting smart contracts to enhance efficiency, reduce costs, and improve transparency. As a result, ensuring the security of smart contracts has become critical. Traditional detection methods often suffer from low efficiency, are prone to missing complex vulnerabilities, and have limited accuracy. Although deep learning approaches address some of these challenges, issues with both accuracy and efficiency remain in current solutions. To overcome these limitations, this paper proposes a symmetry-inspired solution that harmonizes bidirectional and generative semantic patterns. First, we generate distinct feature extraction segments for different vulnerabilities. We then use the Bidirectional Encoder Representations from Transformers (BERT) module to extract original semantic features from these segments and the Generative Pre-trained Transformer (GPT) module to extract generative semantic features. Finally, the two sets of semantic features are fused using a multi-attention mechanism and input into a classifier for result prediction. Our method was tested on three datasets, achieving F1 scores of 93.33%, 93.65%, and 92.31%, respectively. The results demonstrate that our approach outperforms most existing methods in smart contract detection.<\/jats:p>","DOI":"10.3390\/sym17071161","type":"journal-article","created":{"date-parts":[[2025,7,21]],"date-time":"2025-07-21T09:33:53Z","timestamp":1753090433000},"page":"1161","update-policy":"https:\/\/doi.org\/10.3390\/mdpi_crossmark_policy","source":"Crossref","is-referenced-by-count":1,"title":["A Hybrid Semantic and Multi-Attention Mechanism Approach for Detecting Vulnerabilities in Smart Contract Code"],"prefix":"10.3390","volume":"17","author":[{"ORCID":"https:\/\/orcid.org\/0009-0004-8441-9534","authenticated-orcid":false,"given":"Zhenxiang","family":"He","sequence":"first","affiliation":[{"name":"School of Cyber Space Security, Gansu University of Political Science and Law, Lanzhou 730070, China"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0009-0008-5485-6361","authenticated-orcid":false,"given":"Yanling","family":"Liu","sequence":"additional","affiliation":[{"name":"School of Cyber Space Security, Gansu University of Political Science and Law, Lanzhou 730070, China"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Xiaohui","family":"Sun","sequence":"additional","affiliation":[{"name":"School of Cyber Space Security, Gansu University of Political Science and Law, Lanzhou 730070, China"}],"role":[{"role":"author","vocabulary":"crossref"}]}],"member":"1968","published-online":{"date-parts":[[2025,7,21]]},"reference":[{"key":"ref_1","doi-asserted-by":"crossref","first-page":"100605","DOI":"10.1016\/j.jik.2024.100605","article-title":"An overview of blockchain research and future agenda: Insights from structural topic modeling","volume":"9","author":"Shukla","year":"2024","journal-title":"J. Innov. Knowl."},{"key":"ref_2","first-page":"100674","article-title":"An overview of blockchain smart contract execution mechanism","volume":"41","author":"Liu","year":"2024","journal-title":"J. Ind. Inf. Integr."},{"key":"ref_3","doi-asserted-by":"crossref","unstructured":"Sujeetha, R., and Preetha, C.S.D. (2021, January 17). A literature survey on smart contract testing and analysis for smart contract based blockchain application development. Proceedings of the 2021 2nd International Conference on Smart Electronics and Communication (ICOSEC), Sanya, China.","DOI":"10.1109\/ICOSEC51865.2021.9591750"},{"key":"ref_4","doi-asserted-by":"crossref","unstructured":"Khvostenko, V., Milevskyi, S., Bukatych, I., Yevseiev, D., Iegrashyn, O., and Kyryk, V. (2025, January 28\u201330). Smart Contracts: Classification Problems. Proceedings of the 2025 7th International Congress on Human-Computer Interaction, Optimization and Robotic Applications (ICHORA), Wuhan, China.","DOI":"10.1109\/ICHORA65333.2025.11017320"},{"key":"ref_5","first-page":"69","article-title":"A Review on the Security of the Ethereum-Based DeFi Ecosystem","volume":"139","author":"Xue","year":"2024","journal-title":"Cmes-Comput. Model. Eng. Sci."},{"key":"ref_6","doi-asserted-by":"crossref","unstructured":"Mienye, I.D., Swart, T.G., and Obaido, G. (2024). Recurrent neural networks: A comprehensive review of architectures, variants, and applications. Information, 15.","DOI":"10.20944\/preprints202408.0748.v1"},{"key":"ref_7","doi-asserted-by":"crossref","first-page":"102068","DOI":"10.1016\/j.jksuci.2024.102068","article-title":"RNN-LSTM: From applications to modeling techniques and beyond\u2014Systematic review","volume":"36","author":"Hassan","year":"2024","journal-title":"J. King Saud-Univ.-Comput. Inf. Sci."},{"key":"ref_8","doi-asserted-by":"crossref","first-page":"70870","DOI":"10.1109\/ACCESS.2024.3401623","article-title":"A survey of vulnerability detection techniques by smart contract tools","volume":"12","author":"Khan","year":"2024","journal-title":"IEEE Access"},{"key":"ref_9","doi-asserted-by":"crossref","unstructured":"Feist, J., Grieco, G., and Groce, A. (2019, January 27). Slither: A static analysis framework for smart contracts. Proceedings of the 2019 IEEE\/ACM 2nd International Workshop on Emerging Trends in Software Engineering for Blockchain (WETSEB), Montreal, QC, Canada.","DOI":"10.1109\/WETSEB.2019.00008"},{"key":"ref_10","unstructured":"Dimitrijevi\u0107, N., and Zdravkovi\u0107, N. (2024, January 10\u201313). A review on security vulnerabilities of smart contracts written in solidity. Proceedings of the Information Society of Serbia\u2014ISOS, Kopaonik, Serbia."},{"key":"ref_11","first-page":"39","article-title":"A survey of Mythril, a smart contract security analysis tool for EVM bytecode","volume":"13","author":"Sharma","year":"2022","journal-title":"Indian J. Nat. Sci."},{"key":"ref_12","doi-asserted-by":"crossref","unstructured":"Mossberg, M., Manzano, F., Hennenfent, E., Groce, A., Grieco, G., Feist, J., Brunson, T., and Dinaburg, A. (2019, January 10\u201315). Manticore: A user-friendly symbolic execution framework for binaries and smart contracts. Proceedings of the 2019 34th IEEE\/ACM International Conference on Automated Software Engineering (ASE), San Diego, CA, USA.","DOI":"10.1109\/ASE.2019.00133"},{"key":"ref_13","doi-asserted-by":"crossref","first-page":"150184","DOI":"10.1109\/ACCESS.2019.2946988","article-title":"Smart contract security: A software lifecycle perspective","volume":"7","author":"Huang","year":"2019","journal-title":"IEEE Access"},{"key":"ref_14","doi-asserted-by":"crossref","first-page":"103076","DOI":"10.1016\/j.scico.2023.103076","article-title":"CrossFuzz: Cross-contract fuzzing for smart contract vulnerability detection","volume":"234","author":"Yang","year":"2024","journal-title":"Sci. Comput. Program."},{"key":"ref_15","doi-asserted-by":"crossref","unstructured":"Grieco, G., Song, W., Cygan, A., Feist, J., and Groce, A. (2020, January 18\u201322). Echidna: Effective, usable, and fast fuzzing for smart contracts. Proceedings of the 29th ACM SIGSOFT International Symposium on Software Testing and Analysis, Virtual.","DOI":"10.1145\/3395363.3404366"},{"key":"ref_16","doi-asserted-by":"crossref","unstructured":"Hildenbrandt, E., Saxena, M., Rodrigues, N., Zhu, X., Daian, P., Guth, D., Moore, B., Park, D., Zhang, Y., and Stefanescu, A. (2018, January 9\u201312). Kevm: A complete formal semantics of the ethereum virtual machine. Proceedings of the 2018 IEEE 31st Computer Security Foundations Symposium (CSF), Oxford, UK.","DOI":"10.1109\/CSF.2018.00022"},{"key":"ref_17","doi-asserted-by":"crossref","first-page":"126353","DOI":"10.1016\/j.eswa.2024.126353","article-title":"Machine learning methods for detecting smart contracts vulnerabilities within Ethereum blockchain\u2014A review","volume":"268","author":"Crisostomo","year":"2025","journal-title":"Expert Syst. Appl."},{"key":"ref_18","doi-asserted-by":"crossref","unstructured":"Kiani, R., and Sheng, V.S. (2024). Ethereum smart contract vulnerability detection and machine learning-driven solutions: A systematic literature review. Electronics, 13.","DOI":"10.3390\/electronics13122295"},{"key":"ref_19","unstructured":"Huang, T.H.D. (2018). Hunting the Ethereum smart contract: Color-inspired inspection of potential attacks. arXiv."},{"key":"ref_20","doi-asserted-by":"crossref","unstructured":"Tahir, U., Siyal, F., Ianni, M., Guzzo, A., and Fortino, G. (2023, January 7\u20139). Exploiting Bytecode Analysis for Reentrancy Vulnerability Detection in Ethereum Smart Contracts. Proceedings of the 2023 IEEE Intl Conf on Dependable, Autonomic and Secure Computing, Intl Conf on Pervasive Intelligence and Computing, Intl Conf on Cloud and Big Data Computing, Intl Conf on Cyber Science and Technology Congress (DASC\/PiCom\/CBDCom\/CyberSciTech), Tampa, FL, USA.","DOI":"10.1109\/DASC\/PiCom\/CBDCom\/Cy59711.2023.10361441"},{"key":"ref_21","doi-asserted-by":"crossref","unstructured":"Zhuang, Y., Liu, Z., Qian, P., Liu, Q., Wang, X., and He, Q. (2021, January 7\u201315). Smart contract vulnerability detection using graph neural networks. Proceedings of the Twenty-Ninth International Conference on International Joint Conferences on Artificial Intelligence, Yokohama, Japan.","DOI":"10.24963\/ijcai.2020\/454"},{"key":"ref_22","doi-asserted-by":"crossref","unstructured":"Tang, X., Du, Y., Lai, A., Zhang, Z., and Shi, L. (2023). Deep learning-based solution for smart contract vulnerabilities detection. Sci. Rep., 13.","DOI":"10.1038\/s41598-023-47219-0"},{"key":"ref_23","doi-asserted-by":"crossref","first-page":"37979","DOI":"10.1007\/s11042-023-17007-z","article-title":"A detailed review on word embedding techniques with emphasis on word2vec","volume":"83","author":"Johnson","year":"2024","journal-title":"Multimed. Tools Appl."},{"key":"ref_24","unstructured":"Bu, J., Li, W., Li, Z., Zhang, Z., and Li, X. (2025). Enhancing smart contract vulnerability detection in dapps leveraging fine-tuned llm. arXiv."},{"key":"ref_25","doi-asserted-by":"crossref","first-page":"1","DOI":"10.1145\/3717060","article-title":"When chatgpt meets smart contract vulnerability detection: How far are we?","volume":"34","author":"Chen","year":"2025","journal-title":"Acm Trans. Softw. Eng. Methodol."},{"key":"ref_26","unstructured":"Bu, J., Li, W., Li, Z., Zhang, Z., and Li, X. (2025). Smartbugbert: Bert-enhanced vulnerability detection for smart contract bytecode. arXiv."},{"key":"ref_27","doi-asserted-by":"crossref","unstructured":"Chen, Y., Sun, Z., Gong, Z., and Hao, D. (2024, January 14\u201320). Improving smart contract security with contrastive learning-based vulnerability detection. Proceedings of the IEEE\/ACM 46th International Conference on Software Engineering, Lisbon, Portugal.","DOI":"10.1145\/3597503.3639173"},{"key":"ref_28","doi-asserted-by":"crossref","unstructured":"Zeng, S., Chen, R., Zhang, H., and Wang, J. (2023, January 10\u201314). A High-Performance Smart Contract Vulnerability Detection Scheme Based on BERT. Proceedings of the 2023 IEEE 29th International Conference on Parallel and Distributed Systems (ICPADS), Melbourne, Australia.","DOI":"10.1109\/ICPADS60453.2023.00101"},{"key":"ref_29","doi-asserted-by":"crossref","unstructured":"Patel, K. (2024). Crypto Coins and Ethereum: Pioneering Decentralized Finance. Decentralizing the Online Experience with Web3 Technologies, IGI Global.","DOI":"10.4018\/979-8-3693-1532-3.ch005"},{"key":"ref_30","doi-asserted-by":"crossref","unstructured":"Song, S., Liao, Z., Chen, T., Luo, X., Zhang, Y., and Wang, G. (2024, January 12\u201314). An Empirical Study on the Performance of EVMs and Wasm VMs for Smart Contract Execution. Proceedings of the International Conference on Blockchain and Trustworthy Systems, Hangzhou, China.","DOI":"10.1007\/978-981-96-1411-0_17"},{"key":"ref_31","doi-asserted-by":"crossref","first-page":"200","DOI":"10.1007\/s12083-023-01598-3","article-title":"A study on gas cost of ethereum smart contracts and performance of blockchain on simulation tool","volume":"17","author":"Ta","year":"2024","journal-title":"Peer-Peer Netw. Appl."},{"key":"ref_32","doi-asserted-by":"crossref","unstructured":"Dhillon, D., and Mehrotra, D. (2024). Smart Contract Vulnerabilities: Exploring the Technical and Economic Aspects. Blockchain Transformations: Navigating the Decentralized Protocols Era, Springer.","DOI":"10.1007\/978-3-031-49593-9_5"},{"key":"ref_33","doi-asserted-by":"crossref","unstructured":"Al-E\u2019mari, S., and Sanjalawe, Y. (2023, January 17\u201318). A Review of Reentrancy Attack in Ethereum Smart Contracts. Proceedings of the International Conference on Computing and Communication Networks, Manchester, UK.","DOI":"10.1007\/978-981-97-2671-4_5"},{"key":"ref_34","doi-asserted-by":"crossref","unstructured":"Kumar, N.K., Honnungar, N.V., Prakash, M.S., and Lohith, J. (2024, January 22\u201324). Vulnerabilities in Smart Contracts: A Detailed Survey of Detection and Mitigation Methodologies. Proceedings of the 2024 International Conference on Emerging Technologies in Computer Science for Interdisciplinary Applications (ICETCS), Hyderabad, India.","DOI":"10.1109\/ICETCS61022.2024.10544155"},{"key":"ref_35","doi-asserted-by":"crossref","unstructured":"Huang, Q., Zeng, Z., and Shang, Y. (2024, January 13\u201315). An Empirical Study of Integer Overflow Detection and False Positive Analysis in Smart Contracts. Proceedings of the 2024 8th International Conference on Big Data and Internet of Things, Xiamen, China.","DOI":"10.1145\/3697355.3697396"},{"key":"ref_36","unstructured":"Devlin, J., Chang, M.W., Lee, K., and Toutanova, K. (2024, January 16\u201321). Bert: Pre-training of deep bidirectional transformers for language understanding. Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Mexico City, Mexico."},{"key":"ref_37","unstructured":"Radford, A., Narasimhan, K., Salimans, T., and Sutskever, I. (2025, July 08). Improving Language Understanding by Generative Pre-Training. Available online: https:\/\/www.mikecaptain.com\/resources\/pdf\/GPT-1.pdf."},{"key":"ref_38","unstructured":"Dehimi, N.E.H., and Tolba, Z. (2024, January 25\u201327). Attention mechanisms in deep learning: Towards explainable artificial intelligence. Proceedings of the 2024 6th International Conference on Pattern Analysis and Intelligent Systems (PAIS), Hongkong, China."},{"key":"ref_39","doi-asserted-by":"crossref","first-page":"19685","DOI":"10.1109\/ACCESS.2020.2969429","article-title":"Towards automated reentrancy detection for smart contracts based on sequential models","volume":"8","author":"Qian","year":"2020","journal-title":"IEEE Access"},{"key":"ref_40","doi-asserted-by":"crossref","first-page":"1123","DOI":"10.1007\/s13198-024-02684-2","article-title":"A review of recent advances and strategies in transfer learning","volume":"16","author":"Gholizade","year":"2025","journal-title":"Int. J. Syst. Assur. Eng. Manag."},{"key":"ref_41","first-page":"3389","article-title":"Enhancing Oyente: Four new vulnerability detections for improved smart contract security analysis","volume":"16","author":"JJ","year":"2024","journal-title":"Int. J. Inf. Technol."}],"container-title":["Symmetry"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.mdpi.com\/2073-8994\/17\/7\/1161\/pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,10,9]],"date-time":"2025-10-09T18:13:09Z","timestamp":1760033589000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.mdpi.com\/2073-8994\/17\/7\/1161"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2025,7,21]]},"references-count":41,"journal-issue":{"issue":"7","published-online":{"date-parts":[[2025,7]]}},"alternative-id":["sym17071161"],"URL":"https:\/\/doi.org\/10.3390\/sym17071161","relation":{},"ISSN":["2073-8994"],"issn-type":[{"type":"electronic","value":"2073-8994"}],"subject":[],"published":{"date-parts":[[2025,7,21]]}}}