Sound analysis and extraction of data from Smart Contract | 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 Sound analysis and extraction of data from Smart Contract Maha Ayub, Waiz Khan, Muhammad Umar Janjua This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-3241488/v1 This work is licensed under a CC BY 4.0 License Status: Published Journal Publication published 29 Feb, 2024 Read the published version in Automated Software Engineering → Version 1 posted 7 You are reading this latest preprint version Abstract With the addition of multiple blockchain platforms in the ecosystem, the Dapp owners need to migrate their smart contracts from one platform to another to remain competitive , cost-effective, and secure. A smart contract is a piece of code that contain logic and data. To migrate a smart contract, whether it’s on the same blockchain platform or a different one, we need both its source code that represents the logic and data which indicate the state of the contract. The source code can be easily set up, but to complete the migration, we have to extract the current state of the contract. In this paper, we have developed an advanced state extraction technique that uses static analysis to analyze the smart contract’s call graph and events, and extracts the entire storage state from the storage trie, along with the proper associations across function calls, enabling users to visualize, manage, and transform the state as desired for migration. The soundness of the extracted state was confirmed using the method of abstract interpretation. Further, the migration adapter is designed that transform extracted state into slot-value pair and migrated it to the target blockchain. Our new approach has allowed us to analyze 14% more smart contracts with the extraction of 15% more data from 67,993 contracts, and migrate some of them to the Polygon test-net. Blockchain Smart Contract State Extraction Migration State verification Full Text Additional Declarations No competing interests reported. Cite Share Download PDF Status: Published Journal Publication published 29 Feb, 2024 Read the published version in Automated Software Engineering → Version 1 posted Editorial decision: Revision requested 04 Nov, 2023 Reviews received at journal 25 Oct, 2023 Reviewers agreed at journal 28 Sep, 2023 Reviewers invited by journal 28 Sep, 2023 Submission checks completed at journal 08 Aug, 2023 Editor assigned by journal 08 Aug, 2023 First submitted to journal 07 Aug, 2023 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-3241488","acceptedTermsAndConditions":true,"allowDirectSubmit":false,"archivedVersions":[],"articleType":"Research Article","associatedPublications":[],"authors":[{"id":224954537,"identity":"fa502ffb-d11d-45f1-adf0-d7ba7f0f9065","order_by":0,"name":"Maha Ayub","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAA40lEQVRIiWNgGAWjYFACHghlwN7YAKIZgSQzkVp4DoL1kKJFIoGROC267WcPfmCoOZy4XfJx+2MeBhvZDQd4Dxvg02J2Ji9ZguHY4cSdsxMbm3kY0ow3HOBLTsCr5UCOgQQD2+HEDbfBWoCMAzzGB/BqOf/G+AfDP6DKmwdBWv4ToeVGjpkEYxtQyw1GkJYDYC34HXbjjZlFYl+68c6exMaZcwySjWce5kvG7/3zOcY3Pnyzlt3OfvzBhzcVdrJ9x3sPS+DTAgYJDM1QFsh4Zh6CGkCgDplDnJZRMApGwSgYOQAAOUBRlbKoSnUAAAAASUVORK5CYII=","orcid":"","institution":"Information Technology University","correspondingAuthor":true,"prefix":"","firstName":"Maha","middleName":"","lastName":"Ayub","suffix":""},{"id":224954538,"identity":"e3a1239c-5f4c-4db0-b5ef-c5e07d678d8d","order_by":1,"name":"Waiz Khan","email":"","orcid":"","institution":"Information Technology University","correspondingAuthor":false,"prefix":"","firstName":"Waiz","middleName":"","lastName":"Khan","suffix":""},{"id":224954539,"identity":"ed21cd7e-c5a4-41f7-83d4-5ff637664490","order_by":2,"name":"Muhammad Umar Janjua","email":"","orcid":"","institution":"Information Technology University","correspondingAuthor":false,"prefix":"","firstName":"Muhammad","middleName":"Umar","lastName":"Janjua","suffix":""}],"badges":[],"createdAt":"2023-08-07 09:44:20","currentVersionCode":1,"declarations":"","doi":"10.21203/rs.3.rs-3241488/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-3241488/v1","draftVersion":[],"editorialEvents":[{"content":"https://doi.org/10.1007/s10515-024-00422-3","type":"published","date":"2024-02-29T15:01:22+00:00"}],"editorialNote":"","failedWorkflow":false,"files":[{"id":51958267,"identity":"2e0b2435-62d0-42d1-994d-661aa4cf82a6","added_by":"auto","created_at":"2024-03-04 15:14:52","extension":"pdf","order_by":1,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":674428,"visible":true,"origin":"","legend":"","description":"","filename":"SpringerSmartcontractmigration.pdf","url":"https://assets-eu.researchsquare.com/files/rs-3241488/v1_covered_9ff9c03d-8efe-4b0c-9656-24a07fa368f5.pdf"}],"financialInterests":"No competing interests reported.","formattedTitle":"Sound analysis and extraction of data from Smart Contract","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":"automated-software-engineering","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":false,"externalIdentity":"ause","sideBox":"Learn more about [Automated Software Engineering](http://link.springer.com/journal/10515)","snPcode":"10515","submissionUrl":"https://submission.nature.com/new-submission/10515/3","title":"Automated Software Engineering","twitterHandle":"","acdcEnabled":true,"dfaEnabled":true,"editorialSystem":"em","reportingPortfolio":"Springer Hybrid","inReviewEnabled":true,"inReviewRevisionsEnabled":false},"keywords":"Blockchain, Smart Contract, State Extraction, Migration, State verification","lastPublishedDoi":"10.21203/rs.3.rs-3241488/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-3241488/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"With the addition of multiple blockchain platforms in the ecosystem, the Dapp owners need to migrate their smart contracts from one platform to another to remain competitive , cost-effective, and secure. A smart contract is a piece of code that contain logic and data. To migrate a smart contract, whether it’s on the same blockchain platform or a different one, we need both its source code that represents the logic and data which indicate the state of the contract. The source code can be easily set up, but to complete the migration, we have to extract the current state of the contract. In this paper, we have developed an advanced state extraction technique that uses static analysis to analyze the smart contract’s call graph and events, and extracts the entire storage state from the storage trie, along with the proper associations across function calls, enabling users to visualize, manage, and transform the state as desired for migration. The soundness of the extracted state was confirmed using the method of abstract interpretation. Further, the migration adapter is designed that transform extracted state into slot-value pair and migrated it to the target blockchain. Our new approach has allowed us to analyze 14% more smart contracts with the extraction of 15% more data from 67,993 contracts, and migrate some of them to the Polygon test-net.","manuscriptTitle":"Sound analysis and extraction of data from Smart Contract","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2023-08-14 03:51:32","doi":"10.21203/rs.3.rs-3241488/v1","editorialEvents":[{"type":"communityComments","content":0},{"type":"decision","content":"Revision requested","date":"2023-11-04T13:13:20+00:00","index":"","fulltext":""},{"type":"editorInvitedReview","content":"","date":"2023-10-25T08:11:18+00:00","index":"hide","fulltext":""},{"type":"reviewerAgreed","content":"28e5bae8-71bb-422c-a334-f77a965d0034","date":"2023-09-28T06:47:23+00:00","index":"hide","fulltext":""},{"type":"reviewersInvited","content":"","date":"2023-09-28T06:21:32+00:00","index":"","fulltext":""},{"type":"checksComplete","content":"","date":"2023-08-08T14:09:06+00:00","index":"","fulltext":""},{"type":"editorAssigned","content":"","date":"2023-08-08T14:09:06+00:00","index":"","fulltext":""},{"type":"submitted","content":"Automated Software Engineering","date":"2023-08-07T09:35:07+00:00","index":"","fulltext":""}],"status":"published","journal":{"display":true,"email":"
[email protected]","identity":"automated-software-engineering","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":false,"externalIdentity":"ause","sideBox":"Learn more about [Automated Software Engineering](http://link.springer.com/journal/10515)","snPcode":"10515","submissionUrl":"https://submission.nature.com/new-submission/10515/3","title":"Automated Software Engineering","twitterHandle":"","acdcEnabled":true,"dfaEnabled":true,"editorialSystem":"em","reportingPortfolio":"Springer Hybrid","inReviewEnabled":true,"inReviewRevisionsEnabled":false}}],"origin":"","ownerIdentity":"ea9df514-df0e-4db5-90d8-35b7c316a374","owner":[],"postedDate":"August 14th, 2023","published":true,"recentEditorialEvents":[],"rejectedJournal":[],"revision":"","amendment":"","status":"published-in-journal","subjectAreas":[],"tags":[],"updatedAt":"2024-03-04T15:06:32+00:00","versionOfRecord":{"articleIdentity":"rs-3241488","link":"https://doi.org/10.1007/s10515-024-00422-3","journal":{"identity":"automated-software-engineering","isVorOnly":false,"title":"Automated Software Engineering"},"publishedOn":"2024-02-29 15:01:22","publishedOnDateReadable":"February 29th, 2024"},"versionCreatedAt":"2023-08-14 03:51:32","video":"","vorDoi":"10.1007/s10515-024-00422-3","vorDoiUrl":"https://doi.org/10.1007/s10515-024-00422-3","workflowStages":[]},"version":"v1","identity":"rs-3241488","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-3241488","identity":"rs-3241488","version":["v1"]},"buildId":"_2-kVJe1T_tPrBINL-cwx","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.