{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,5,13]],"date-time":"2026-05-13T18:12:45Z","timestamp":1778695965044,"version":"3.51.4"},"reference-count":36,"publisher":"Association for Computing Machinery (ACM)","issue":"6","funder":[{"DOI":"10.13039\/501100001809","name":"National Natural Science Foundation of China","doi-asserted-by":"crossref","award":["62372485"],"award-info":[{"award-number":["62372485"]}],"id":[{"id":"10.13039\/501100001809","id-type":"DOI","asserted-by":"crossref"}]},{"DOI":"10.13039\/501100003453","name":"Natural Science Foundation of Guangdong Province","doi-asserted-by":"crossref","award":["2023A1515011314"],"award-info":[{"award-number":["2023A1515011314"]}],"id":[{"id":"10.13039\/501100003453","id-type":"DOI","asserted-by":"crossref"}]},{"name":"Shanghai Committee of Science and Technology, China","award":["23511101000"],"award-info":[{"award-number":["23511101000"]}]}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["ACM Trans. Softw. Eng. Methodol."],"published-print":{"date-parts":[[2026,6,30]]},"abstract":"<jats:p>Smart contracts are self-executing computer programs on blockchains. With the development of blockchain technology, the number of smart contracts has grown rapidly, as has the concern for their security. Regrettably, inconsistencies between the logic implemented in the code and the intentions described in the comments, known as Code\u2013Comment Inconsistencies (CCI), are frequently present in some smart contracts. These inconsistencies can mislead readers in understanding the contract code and, in severe cases, may lead to vulnerabilities and economic losses. Existing learning-based methods are not tailored for smart contract languages, overlook the issue of insufficient context information caused by comment references and nested intentions, and rely on large-scale labeled data; whereas rule-based methods struggle to accommodate the flexibility with which developers express intentions, often resulting in false positives. To tackle the challenges posed by insufficient context information and the scarcity of labeled data, we introduce CCIHunter, a tool designed to detect CCIs in smart contracts. CCIHunter addresses the issue of insufficient context information during data modeling and incorporates a two-stage pre-training process that does not depend on labeled data to enhance its detection capabilities. Specifically, CCIHunter enhances comments based on templates and models code as a heterogeneous graph based on function calls. It utilizes CodeBERT and UniMp to generate embeddings for comments and code, respectively, and then calculates the similarity between these two embeddings. Consistency is judged by combining code embeddings, comment embeddings, and similarity scores. Notably, CCIHunter undergoes a two-stage pre-training that includes contrastive learning and mutation analysis, aiming to improve its ability to bridge the gap between code and comments and to focus on code elements at different granularities. Experimental results demonstrate that CCIHunter achieves a precision of 0.95, a recall of 0.90, and an F1 score of 0.93, outperforming existing tools.<\/jats:p>","DOI":"10.1145\/3764867","type":"journal-article","created":{"date-parts":[[2025,8,28]],"date-time":"2025-08-28T14:57:43Z","timestamp":1756393063000},"page":"1-28","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":1,"title":["CCIHunter: Enhancing Smart Contract Code\u2013Comment Inconsistencies Detection via Two-Stage Pre-Training"],"prefix":"10.1145","volume":"35","author":[{"ORCID":"https:\/\/orcid.org\/0009-0008-1998-7155","authenticated-orcid":false,"given":"Ziwei","family":"Li","sequence":"first","affiliation":[{"name":"School of Software Engineering, Sun Yat-Sen University, Zhuhai, China"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0000-0001-5155-8547","authenticated-orcid":false,"given":"Jiajing","family":"Wu","sequence":"additional","affiliation":[{"name":"School of Software Engineering, Sun Yat-Sen University, Zhuhai, China"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-4633-0008","authenticated-orcid":false,"given":"Zhiying","family":"Wu","sequence":"additional","affiliation":[{"name":"School of Computer Science, Sun Yat-Sen University, Guangzhou, China"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0009-0002-8799-1355","authenticated-orcid":false,"given":"Dongcheng","family":"Tan","sequence":"additional","affiliation":[{"name":"School of Software Engineering, Sun Yat-Sen University, Zhuhai, China"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0009-0009-6519-7493","authenticated-orcid":false,"given":"Weipeng","family":"Zou","sequence":"additional","affiliation":[{"name":"School of Software Engineering, Sun Yat-Sen University, Zhuhai, China"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-3349-5383","authenticated-orcid":false,"given":"Zigui","family":"Jiang","sequence":"additional","affiliation":[{"name":"School of Software Engineering, Sun Yat-Sen University, Zhuhai, China"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0009-0001-6610-0149","authenticated-orcid":false,"given":"Yi","family":"Zhen","sequence":"additional","affiliation":[{"name":"Sun Yat-Sen University, Guangzhou, China"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0009-0006-5803-5566","authenticated-orcid":false,"given":"Zheng","family":"Zhang","sequence":"additional","affiliation":[{"name":"Nanjing University of Aeronautics and Astronautics, Nanjing, China"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-7878-4330","authenticated-orcid":false,"given":"Zibin","family":"Zheng","sequence":"additional","affiliation":[{"name":"School of Software Engineering, Sun Yat-Sen University, Zhuhai, China"}],"role":[{"role":"author","vocabulary":"crossref"}]}],"member":"320","published-online":{"date-parts":[[2026,5,13]]},"reference":[{"key":"e_1_3_2_2_2","unstructured":"CVE-2022-25335 Detail. 2022. Retrieved from https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2022-25335"},{"key":"e_1_3_2_3_2","unstructured":"DAppRadar Leaderboard. 2022. Retrieved from https:\/\/dappradar.com\/rankings"},{"key":"e_1_3_2_4_2","unstructured":"Web3 Developer Report. 2022. Retrieved from https:\/\/www.alchemy.com\/blog\/web3-developer-report-q4-2022"},{"key":"e_1_3_2_5_2","unstructured":"Etherscan. 2024. Retrieved from https:\/\/etherscan.io\/"},{"key":"e_1_3_2_6_2","unstructured":"Solc Compiler. 2024. Retrieved from https:\/\/docs.soliditylang.org\/en\/v0.8.23\/using-the-compiler.html"},{"key":"e_1_3_2_7_2","unstructured":"DeepSeek. 2025. Retrieved from https:\/\/chat.deepseek.com\/"},{"key":"e_1_3_2_8_2","unstructured":"DeepSeek API. 2025. Retrieved from https:\/\/api-docs.deepseek.com\/api\/deepseek-api"},{"key":"e_1_3_2_9_2","doi-asserted-by":"publisher","DOI":"10.1145\/1639950.1640047"},{"key":"e_1_3_2_10_2","doi-asserted-by":"publisher","DOI":"10.1109\/AST52587.2021.00014"},{"key":"e_1_3_2_11_2","doi-asserted-by":"publisher","DOI":"10.1109\/SANER50967.2021.00050"},{"key":"e_1_3_2_12_2","doi-asserted-by":"publisher","DOI":"10.1109\/SEAA.2015.20"},{"key":"e_1_3_2_13_2","first-page":"68","volume-title":"Proceedings of the 23rd Annual International Conference on Design of Communication: Documenting and Designing for Pervasive Information","author":"Cozzetti Sergio","year":"2005","unstructured":"Sergio Cozzetti, B. de Souza, Nicolas Anquetil, and K\u00e1thia M. de Oliveira. 2005. A study of the documentation essential to software maintenance. In Proceedings of the 23rd Annual International Conference on Design of Communication: Documenting and Designing for Pervasive Information. ACM, New York, NY, 68\u201375."},{"key":"e_1_3_2_14_2","doi-asserted-by":"publisher","DOI":"10.18653\/v1\/2020.findings-emnlp.139"},{"key":"e_1_3_2_15_2","doi-asserted-by":"publisher","DOI":"10.1007\/s11219-009-9075-x"},{"key":"e_1_3_2_16_2","doi-asserted-by":"publisher","DOI":"10.1109\/ASE56229.2023.00142"},{"key":"e_1_3_2_17_2","doi-asserted-by":"publisher","DOI":"10.1016\/j.jss.2011.09.019"},{"key":"e_1_3_2_18_2","unstructured":"Jared Kaplan Sam McCandlish Tom Henighan Tom B. Brown Benjamin Chess Rewon Child Scott Gray Alec Radford Jeff Wu and Dario Amodei. 2020. Scaling laws for neural language models. arXiv:2001.08361. Retrieved from https:\/\/arxiv.org\/abs\/2001.08361"},{"key":"e_1_3_2_19_2","doi-asserted-by":"publisher","DOI":"10.1109\/COMPSAC.2018.00028"},{"key":"e_1_3_2_20_2","doi-asserted-by":"publisher","DOI":"10.1109\/ISSREW53611.2021.00063"},{"key":"e_1_3_2_21_2","doi-asserted-by":"publisher","DOI":"10.1609\/aaai.v35i1.16119"},{"key":"e_1_3_2_22_2","first-page":"392","volume-title":"The 32nd International Conference on Software Engineering and Knowledge Engineering (SEKE \u201920)","author":"Rabbi Fazle","year":"2020","unstructured":"Fazle Rabbi, Md Nazmul Haque, Md Eusha Kadir, Md Saeed Siddik, and Ahmedul Kabir. 2020. An ensemble approach to detect code comment inconsistencies using topic modeling. In The 32nd International Conference on Software Engineering and Knowledge Engineering (SEKE \u201920). KSI Research Inc., Virtual Event, 392\u2013395."},{"key":"e_1_3_2_23_2","doi-asserted-by":"publisher","DOI":"10.1145\/3387904.3389286"},{"key":"e_1_3_2_24_2","first-page":"8748","volume-title":"Proceedings of the 38th International Conference on Machine Learning","author":"Radford Alec","year":"2021","unstructured":"Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. 2021. Learning transferable visual models from natural language supervision. In Proceedings of the 38th International Conference on Machine Learning. PMLR, Virtual Event, 8748\u20138763."},{"key":"e_1_3_2_25_2","first-page":"112","volume-title":"2017 32nd IEEE\/ACM International Conference on Automated Software Engineering (ASE)","author":"Inderjot","year":"2017","unstructured":"Inderjot, Kaur Ratol, and Martin P. Robillard. 2017. Detecting fragile comments. In 2017 32nd IEEE\/ACM International Conference on Automated Software Engineering (ASE). IEEE Computer Society, Urbana, IL, 112\u2013122."},{"key":"e_1_3_2_26_2","doi-asserted-by":"publisher","DOI":"10.1145\/2601248.2601251"},{"key":"e_1_3_2_27_2","doi-asserted-by":"publisher","DOI":"10.24963\/ijcai.2021\/214"},{"key":"e_1_3_2_28_2","doi-asserted-by":"publisher","DOI":"10.1109\/ICPC.2013.6613836"},{"key":"e_1_3_2_29_2","doi-asserted-by":"publisher","DOI":"10.1145\/1294261.1294276"},{"key":"e_1_3_2_30_2","volume-title":"Proceedings of the 11th USENIX Workshop on Hot Topics in Operating Systems","author":"Tan Lin","year":"2007","unstructured":"Lin Tan, Ding Yuan, and Yuanyuan Zhou. 2007. Hotcomments: How to make program comments more useful? In Proceedings of the 11th USENIX Workshop on Hot Topics in Operating Systems. USENIX Association, San Diego, California, 49\u201354."},{"key":"e_1_3_2_31_2","doi-asserted-by":"publisher","DOI":"10.1145\/1985793.1985796"},{"key":"e_1_3_2_32_2","doi-asserted-by":"publisher","DOI":"10.1109\/ICST.2012.106"},{"key":"e_1_3_2_33_2","doi-asserted-by":"publisher","DOI":"10.1109\/ICPC.2019.00019"},{"key":"e_1_3_2_34_2","doi-asserted-by":"publisher","DOI":"10.1145\/3543507.3583537"},{"key":"e_1_3_2_35_2","doi-asserted-by":"publisher","DOI":"10.1109\/TSE.2024.3358489"},{"key":"e_1_3_2_36_2","doi-asserted-by":"publisher","DOI":"10.1109\/ICSE-SEIP58684.2023.00008"},{"key":"e_1_3_2_37_2","first-page":"1","volume-title":"Proceedings of the 37th IEEE\/ACM International Conference on Automated Software Engineering","volume":"56","author":"Zhu Chenguang","year":"2023","unstructured":"Chenguang Zhu, Ye Liu, Xiuheng Wu, and Yi Li. 2023. Identifying solidity smart contract API documentation errors. In Proceedings of the 37th IEEE\/ACM International Conference on Automated Software Engineering. ACM, New York, NY, Article 56, 1\u201313."}],"container-title":["ACM Transactions on Software Engineering and Methodology"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3764867","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,5,13]],"date-time":"2026-05-13T17:26:12Z","timestamp":1778693172000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3764867"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2026,5,13]]},"references-count":36,"journal-issue":{"issue":"6","published-print":{"date-parts":[[2026,6,30]]}},"alternative-id":["10.1145\/3764867"],"URL":"https:\/\/doi.org\/10.1145\/3764867","relation":{},"ISSN":["1049-331X","1557-7392"],"issn-type":[{"value":"1049-331X","type":"print"},{"value":"1557-7392","type":"electronic"}],"subject":[],"published":{"date-parts":[[2026,5,13]]},"assertion":[{"value":"2024-10-17","order":0,"name":"received","label":"Received","group":{"name":"publication_history","label":"Publication History"}},{"value":"2025-08-24","order":2,"name":"accepted","label":"Accepted","group":{"name":"publication_history","label":"Publication History"}},{"value":"2026-05-13","order":3,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}