Differential Testing Solidity Compiler through Deep Contract Manipulation and Mutation

preprint OA: closed CC-BY-4.0
📄 Open PDF Full text JSON View at publisher
Full text 13,603 characters · extracted from preprint-html · click to expand
Differential Testing Solidity Compiler through Deep Contract Manipulation and Mutation | Research Square window.SnipcartSettings = { analytics: { enabled: false } }; (function() { var accessVector = localStorage.getItem('access_vector') || ''; window.dataLayer = window.dataLayer || []; if (accessVector) { window.dataLayer.push({ user: { profile: { profileInfo: { snid: accessVector } } } }); } })(); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-K279D39R'); Browse Preprints In Review Journals COVID-19 Preprints AJE Video Bytes Research Tools Research Promotion AJE Professional Editing AJE Rubriq About Preprint Platform In Review Editorial Policies Our Team Advisory Board Help Center Sign In Submit a Preprint Cite Share Download PDF Research Article Differential Testing Solidity Compiler through Deep Contract Manipulation and Mutation Zhenzhou Tian, Fanfan Wang, Yanping Chen, Lingwei Chen This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-3924118/v1 This work is licensed under a CC BY 4.0 License Status: Published Journal Publication published 23 Apr, 2024 Read the published version in Software Quality Journal → Version 1 posted 7 You are reading this latest preprint version Abstract Solidity, the language utilized for developing smart contracts, has been gainingincreased importance in blockchain system. Ensuring bug-free of its accompanying language compiler, which converts the contract source codes into executablesfinally deployed on the blockchain, is thus of paramount importance. This studypresents DeSCDT, a Deep learning-based Solidity Compiler Differential Testingapproach, to explore possible defects in solidity compiler. At the core lies a wellbehaving deep contract generator following the Transformer architecture andlearnt with diverse contract code. From an initial seed pool of contracts carefully picked through semantic encoding and clustering, the generator is capableof stably producing highly syntactic-valid and functional-rich smart contracts,with three meticulously formulated generation strategies and a set of mutationoperations. Subsequently, in the meantime of compiling these generated contractsto trigger compiler crashes, a differential testing environment is setup to exploremisoptimization bugs, by observing the inconsistencies between the outcomes and the aspects including gas consumption and opcode size of the optimized and nonoptimized bytecodes. For the experiments, the syntactic validity and diversity ofthe contracts generated with DeSCDT, as well as its ability in discovering compiler defects, are investigated. The findings indicate that DeSCDT can effectivelygenerate syntactically correct contracts with a pass rate of 90.8% alongside highdiversity. Among the contracts tested for a 24-hour running of DeSCDT, 37.4%of them expose inconsistencies across the optimized and non-optimized versionof the same contract. Six bugs that could trigger direct crashing of the compilerhave also detected. Smart Contract Differential Testing Solidity Compiler Fuzzing Contract Generation Deep Learning Bug Detection Full Text Additional Declarations No competing interests reported. Cite Share Download PDF Status: Published Journal Publication published 23 Apr, 2024 Read the published version in Software Quality Journal → Version 1 posted Editorial decision: Revision requested 25 Mar, 2024 Reviews received at journal 10 Mar, 2024 Reviewers agreed at journal 22 Feb, 2024 Reviewers invited by journal 22 Feb, 2024 Submission checks completed at journal 05 Feb, 2024 Editor assigned by journal 05 Feb, 2024 First submitted to journal 03 Feb, 2024 You are reading this latest preprint version Research Square lets you share your work early, gain feedback from the community, and start making changes to your manuscript prior to peer review in a journal. As a division of Research Square Company, we’re committed to making research communication faster, fairer, and more useful. We do this by developing innovative software and high quality services for the global research community. Our growing team is made up of researchers and industry professionals working together to solve the most critical problems facing scientific publishing. Also discoverable on Platform About Our Team In Review Editorial Policies Advisory Board Help Center Resources Author Services Accessibility API Access RSS feed Manage Cookie Preferences © Research Square 2026 | ISSN 2693-5015 (online) Privacy Policy Terms of Service Do Not Sell My Personal Information {"props":{"pageProps":{"initialData":{"identity":"rs-3924118","acceptedTermsAndConditions":true,"allowDirectSubmit":false,"archivedVersions":[],"articleType":"Research Article","associatedPublications":[],"authors":[{"id":271244989,"identity":"87c76fe3-28b4-45b8-91f5-ec791377d759","order_by":0,"name":"Zhenzhou Tian","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAA90lEQVRIiWNgGAWjYDACZiBmbAASEkD8ASoogU8HD7IWxhkgEYJaGJC0MPMQo8WenfnZw587bPLkZzcfk7ZtO5xnz8B88DYPg10eboexmRtInkkrZpxzLE0658zhYh4GtmRrHobkYjx+MZMwbDuc2CyRYyadU3E4sYeBx0yah+FAYgNOLezfJBLb/ie2gbRYGIC08H8joIXHTOJg24HEHpAWBogtbPi1HOYpk2xsS06cIZGWbNlzJr2Y5zCbseUcg2ScWtj7j2+T/Nlmlzh/RvLBGz/brPPY25sf3nhTYYdTCwZIAKcHBgNi1YO1jIJRMApGwShAAwBjGktvKU7EkgAAAABJRU5ErkJggg==","orcid":"","institution":"Xi’an University of Posts and Telecommunications, China","correspondingAuthor":true,"prefix":"","firstName":"Zhenzhou","middleName":"","lastName":"Tian","suffix":""},{"id":271244990,"identity":"60ccec0a-2486-4994-817a-906907883e91","order_by":1,"name":"Fanfan Wang","email":"","orcid":"","institution":"Xi’an University of Posts and Telecommunications, China","correspondingAuthor":false,"prefix":"","firstName":"Fanfan","middleName":"","lastName":"Wang","suffix":""},{"id":271244991,"identity":"a80fa9a6-2e28-4da9-b09b-4fb89b88a7c6","order_by":2,"name":"Yanping Chen","email":"","orcid":"","institution":"Xi’an University of Posts and Telecommunications, China","correspondingAuthor":false,"prefix":"","firstName":"Yanping","middleName":"","lastName":"Chen","suffix":""},{"id":271244992,"identity":"ba251dc2-86bb-4066-ad85-59fdf60957b8","order_by":3,"name":"Lingwei Chen","email":"","orcid":"","institution":"Wright State University","correspondingAuthor":false,"prefix":"","firstName":"Lingwei","middleName":"","lastName":"Chen","suffix":""}],"badges":[],"createdAt":"2024-02-03 13:44:19","currentVersionCode":1,"declarations":"","doi":"10.21203/rs.3.rs-3924118/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-3924118/v1","draftVersion":[],"editorialEvents":[{"content":"https://doi.org/10.1007/s11219-024-09673-5","type":"published","date":"2024-04-23T22:56:22+00:00"}],"editorialNote":"","failedWorkflow":false,"files":[{"id":55690958,"identity":"f68e4401-2f3d-4fd8-bbf9-c63cd157a7d2","added_by":"auto","created_at":"2024-05-01 22:56:32","extension":"pdf","order_by":1,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":4604529,"visible":true,"origin":"","legend":"","description":"","filename":"DeSCDTSN.pdf","url":"https://assets-eu.researchsquare.com/files/rs-3924118/v1_covered_d855e453-f727-417e-ad53-cecc5c775f2c.pdf"}],"financialInterests":"No competing interests reported.","formattedTitle":"Differential Testing Solidity Compiler through Deep Contract Manipulation and Mutation","fulltext":[],"fulltextSource":"","fullText":"","funders":[],"hasAdminPriorityOnWorkflow":false,"hasManuscriptDocX":false,"hasOptedInToPreprint":true,"hasPassedJournalQc":"","hasAnyPriority":false,"hideJournal":false,"highlight":"","institution":"","isAcceptedByJournal":true,"isAuthorSuppliedPdf":true,"isDeskRejected":"","isHiddenFromSearch":false,"isInQc":false,"isInWorkflow":false,"isPdf":true,"isPdfUpToDate":true,"isWithdrawnOrRetracted":false,"journal":{"display":true,"email":"[email protected]","identity":"software-quality-journal","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":false,"externalIdentity":"sqjo","sideBox":"Learn more about [Software Quality Journal](http://link.springer.com/journal/11219)","snPcode":"11219","submissionUrl":"https://submission.nature.com/new-submission/11219/3","title":"Software Quality Journal","twitterHandle":"","acdcEnabled":true,"dfaEnabled":true,"editorialSystem":"em","reportingPortfolio":"Springer Hybrid","inReviewEnabled":true,"inReviewRevisionsEnabled":false},"keywords":"Smart Contract, Differential Testing, Solidity Compiler Fuzzing, Contract Generation, Deep Learning, Bug Detection","lastPublishedDoi":"10.21203/rs.3.rs-3924118/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-3924118/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"Solidity, the language utilized for developing smart contracts, has been gainingincreased importance in blockchain system. Ensuring bug-free of its accompanying language compiler, which converts the contract source codes into executablesfinally deployed on the blockchain, is thus of paramount importance. This studypresents DeSCDT, a Deep learning-based Solidity Compiler Differential Testingapproach, to explore possible defects in solidity compiler. At the core lies a wellbehaving deep contract generator following the Transformer architecture andlearnt with diverse contract code. From an initial seed pool of contracts carefully picked through semantic encoding and clustering, the generator is capableof stably producing highly syntactic-valid and functional-rich smart contracts,with three meticulously formulated generation strategies and a set of mutationoperations. Subsequently, in the meantime of compiling these generated contractsto trigger compiler crashes, a differential testing environment is setup to exploremisoptimization bugs, by observing the inconsistencies between the outcomes and the aspects including gas consumption and opcode size of the optimized and nonoptimized bytecodes. For the experiments, the syntactic validity and diversity ofthe contracts generated with DeSCDT, as well as its ability in discovering compiler defects, are investigated. The findings indicate that DeSCDT can effectivelygenerate syntactically correct contracts with a pass rate of 90.8% alongside highdiversity. Among the contracts tested for a 24-hour running of DeSCDT, 37.4%of them expose inconsistencies across the optimized and non-optimized versionof the same contract. Six bugs that could trigger direct crashing of the compilerhave also detected.","manuscriptTitle":"Differential Testing Solidity Compiler through Deep Contract Manipulation and Mutation","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2024-02-07 04:08:39","doi":"10.21203/rs.3.rs-3924118/v1","editorialEvents":[{"type":"communityComments","content":0},{"type":"decision","content":"Revision requested","date":"2024-03-25T16:45:39+00:00","index":"","fulltext":""},{"type":"editorInvitedReview","content":"","date":"2024-03-10T11:43:28+00:00","index":"hide","fulltext":""},{"type":"reviewerAgreed","content":"765278e6-fffc-410e-a7e7-74d1e5b8e5c3","date":"2024-02-22T14:48:28+00:00","index":"hide","fulltext":""},{"type":"reviewersInvited","content":"","date":"2024-02-22T14:44:50+00:00","index":"","fulltext":""},{"type":"checksComplete","content":"","date":"2024-02-06T00:50:49+00:00","index":"","fulltext":""},{"type":"editorAssigned","content":"","date":"2024-02-06T00:50:49+00:00","index":"","fulltext":""},{"type":"submitted","content":"Software Quality Journal","date":"2024-02-03T13:42:29+00:00","index":"","fulltext":""}],"status":"published","journal":{"display":true,"email":"[email protected]","identity":"software-quality-journal","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":false,"externalIdentity":"sqjo","sideBox":"Learn more about [Software Quality Journal](http://link.springer.com/journal/11219)","snPcode":"11219","submissionUrl":"https://submission.nature.com/new-submission/11219/3","title":"Software Quality Journal","twitterHandle":"","acdcEnabled":true,"dfaEnabled":true,"editorialSystem":"em","reportingPortfolio":"Springer Hybrid","inReviewEnabled":true,"inReviewRevisionsEnabled":false}}],"origin":"","ownerIdentity":"8eb99667-9932-413d-807a-629be2bd5212","owner":[],"postedDate":"February 7th, 2024","published":true,"recentEditorialEvents":[],"rejectedJournal":[],"revision":"","amendment":"","status":"published-in-journal","subjectAreas":[],"tags":[],"updatedAt":"2024-05-01T22:56:22+00:00","versionOfRecord":{"articleIdentity":"rs-3924118","link":"https://doi.org/10.1007/s11219-024-09673-5","journal":{"identity":"software-quality-journal","isVorOnly":false,"title":"Software Quality Journal"},"publishedOn":"2024-04-23 22:56:22","publishedOnDateReadable":"April 23rd, 2024"},"versionCreatedAt":"2024-02-07 04:08:39","video":"","vorDoi":"10.1007/s11219-024-09673-5","vorDoiUrl":"https://doi.org/10.1007/s11219-024-09673-5","workflowStages":[]},"version":"v1","identity":"rs-3924118","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-3924118","identity":"rs-3924118","version":["v1"]},"buildId":"qtupq5eGEP_6zYnWcrvyt","isFallback":false,"isExperimentalCompile":false,"dynamicIds":[84888],"gssp":true,"scriptLoader":[]}

Text is read by the "Ask this paper" AI Q&A widget below. Extraction quality varies by source — PMC NXML preserves structure cleanly, OA-HTML may include some navigation residue, and OA-PDF can have broken hyphenation. The publisher copy (via DOI) is the canonical version.

My notes (saved in your browser only)

Ask this paper AI returns verbatim quotes from the full text · source: preprint-html

Answers must be backed by verbatim quotes from this paper's full text. Hallucinated quotes are dropped automatically; if no verbatim passage answers the question, we say so. How this works

Citation neighborhood (no data yet)

We don't have any in-corpus citations linked to this paper yet. This is a recent paper (2024) — citers typically take a year or two to land, and the OpenAlex reference graph may still be filling in.

Source provenance

europepmc
last seen: 2026-05-20T01:45:00.602351+00:00
unpaywall
last seen: 2026-05-24T02:00:01.246996+00:00
License: CC-BY-4.0