{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,6,4]],"date-time":"2026-06-04T05:03:19Z","timestamp":1780549399480,"version":"3.54.1"},"reference-count":61,"publisher":"MDPI AG","issue":"6","license":[{"start":{"date-parts":[[2026,5,23]],"date-time":"2026-05-23T00:00:00Z","timestamp":1779494400000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"funder":[{"DOI":"10.13039\/501100012456","name":"National Social Science Fund of China","doi-asserted-by":"publisher","award":["No. 24BGL111"],"award-info":[{"award-number":["No. 24BGL111"]}],"id":[{"id":"10.13039\/501100012456","id-type":"DOI","asserted-by":"publisher"}]},{"name":"Singapore\u2013UK Cyber Security of EPSRC","award":["No. EP\/N020170\/1"],"award-info":[{"award-number":["No. EP\/N020170\/1"]}]}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Systems"],"abstract":"<jats:p>Blockchain-based crowdsourcing logistics is a promising decentralized paradigm for solving the \u201clast-mile delivery\u201d problem, in which smart contracts automatically execute the business logic. Since crowdsourcing logistics inherently involves frequent fund transfers, its smart contracts are particularly susceptible to reentrancy vulnerabilities. Existing works address reentrancy by inserting a lock mechanism at design-time, which lacks dynamic responsiveness and incurs additional gas overhead. To overcome this limitation, we propose RE4SC, the first runtime enforcement framework for vulnerable smart contracts. RE4SC contains two components: off-Blockchain granularity segmentation and on-Blockchain granular block reordering. At the off-Blockchain level, bytecode is segmented into granular blocks through control flow analysis. This yields a finer granularity than conventional basic blocks in a control flow graph. These granular blocks are then organized into a tree structure that captures their hierarchical nesting relationships. A data flow analysis further ensures data dependency consistency after reordering. At the on-Blockchain level, a runtime enforcer retrieves the pre-computed reordering specifications from off-Blockchain analysis. It applies a depth-first reordering algorithm to reposition key state variable assignments before transfer operations, eliminating reentrancy vulnerabilities without introducing additional bytecode. We implement a prototype tool and make it open-source. Experiments on self-constructed crowdsourcing logistics contracts and three public datasets demonstrate that RE4SC repairs vulnerable contracts with zero gas overhead, outperforming existing approaches.<\/jats:p>","DOI":"10.3390\/systems14060600","type":"journal-article","created":{"date-parts":[[2026,5,25]],"date-time":"2026-05-25T02:32:28Z","timestamp":1779676348000},"page":"600","update-policy":"https:\/\/doi.org\/10.3390\/mdpi_crossmark_policy","source":"Crossref","is-referenced-by-count":0,"title":["A Runtime Enforcement Framework for Vulnerable Smart Contracts of Crowdsourcing Logistics"],"prefix":"10.3390","volume":"14","author":[{"given":"Tianhuan","family":"Miao","sequence":"first","affiliation":[{"name":"Institute of Logistics Science and Engineering, Shanghai Maritime University, Shanghai 201306, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Yang","family":"Liu","sequence":"additional","affiliation":[{"name":"Institute of Logistics Science and Engineering, Shanghai Maritime University, Shanghai 201306, China"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"1968","published-online":{"date-parts":[[2026,5,23]]},"reference":[{"key":"ref_1","doi-asserted-by":"crossref","first-page":"595","DOI":"10.1287\/opre.2023.0125","article-title":"Robust workforce management with crowdsourced delivery","volume":"73","author":"Cheng","year":"2025","journal-title":"Oper. Res."},{"key":"ref_2","doi-asserted-by":"crossref","first-page":"791","DOI":"10.1287\/msom.2021.0973","article-title":"Crowdsourcing last-mile deliveries","volume":"24","author":"Fatehi","year":"2022","journal-title":"Manuf. Serv. Oper. Manag."},{"key":"ref_3","doi-asserted-by":"crossref","first-page":"1565","DOI":"10.1287\/isre.2022.0065","article-title":"And No One Gets the Short End of the Stick: A Blockchain-Based Approach to Solving the Two-Sided Opportunism Problem in Interorganizational Information Sharing","volume":"36","author":"Bossler","year":"2025","journal-title":"Inf. Syst. Res."},{"key":"ref_4","doi-asserted-by":"crossref","first-page":"7306","DOI":"10.1287\/mnsc.2023.00281","article-title":"Scaling smart contracts via layer-2 technologies: Some empirical evidence","volume":"69","author":"Cong","year":"2023","journal-title":"Manag. Sci."},{"key":"ref_5","first-page":"101083","article-title":"Analyzing the delivery determination problem of new retail stores considering crowdsourcing under the background of blockchain","volume":"52","author":"Li","year":"2024","journal-title":"Res. Transp. Bus. Manag."},{"key":"ref_6","doi-asserted-by":"crossref","first-page":"475","DOI":"10.1016\/j.future.2019.12.019","article-title":"An Overview on Smart Contracts: Challenges, Advances and Platforms","volume":"105","author":"Zheng","year":"2020","journal-title":"Future Gener. Comput. Syst."},{"key":"ref_7","doi-asserted-by":"crossref","first-page":"2266","DOI":"10.1109\/TSMC.2019.2895123","article-title":"Blockchain-enabled smart contracts: Architecture, applications, and future trends","volume":"49","author":"Wang","year":"2019","journal-title":"IEEE Trans. Syst. Man Cybern. Syst."},{"key":"ref_8","doi-asserted-by":"crossref","first-page":"327","DOI":"10.1109\/TSE.2020.2989002","article-title":"Defining smart contract defects on ethereum","volume":"48","author":"Chen","year":"2020","journal-title":"IEEE Trans. Softw. Eng."},{"key":"ref_9","doi-asserted-by":"crossref","first-page":"4291","DOI":"10.1109\/TSE.2021.3116808","article-title":"Challenges and Common Solutions in Smart Contract Development","volume":"48","author":"Kannengieser","year":"2022","journal-title":"IEEE Trans. Softw. Eng."},{"key":"ref_10","doi-asserted-by":"crossref","first-page":"1","DOI":"10.1145\/3464421","article-title":"A survey of smart contract formal specification and verification","volume":"54","author":"Tolmach","year":"2021","journal-title":"ACM Comput. Surv."},{"key":"ref_11","doi-asserted-by":"crossref","unstructured":"Ferreira Torres, C., Jonker, H., and State, R. (2022). Elysium: Context-Aware Bytecode-Level Patching to Automatically Heal Vulnerable Smart Contracts. Proceedings of the 25th International Symposium on Research in Attacks, Intrusions and Defenses, Limassol, Cyprus, 26\u201328 October 2022, ACM.","DOI":"10.1145\/3545948.3545975"},{"key":"ref_12","doi-asserted-by":"crossref","unstructured":"Nguyen, T.D., Pham, L.H., and Sun, J. (2021). SGUARD: Towards Fixing Vulnerable Smart Contracts Automatically. Proceedings of the 2021 IEEE Symposium on Security and Privacy (SP), San Francisco, CA, USA, 24\u201327 May 2021, IEEE.","DOI":"10.1109\/SP40001.2021.00057"},{"key":"ref_13","doi-asserted-by":"crossref","unstructured":"Bartocci, E., and Falcone, Y. (2018). Introduction to Runtime Verification. Lectures on Runtime Verification, Springer International Publishing. Lecture Notes in Computer Science.","DOI":"10.1007\/978-3-319-75632-5"},{"key":"ref_14","doi-asserted-by":"crossref","first-page":"117","DOI":"10.1016\/j.is.2017.08.002","article-title":"Decentralized enforcement of document lifecycle constraints","volume":"74","author":"Khoury","year":"2018","journal-title":"Inf. Syst."},{"key":"ref_15","doi-asserted-by":"crossref","unstructured":"Amani, S., B\u00e9gel, M., Bortin, M., and Staples, M. (2018). Towards verifying ethereum smart contract bytecode in Isabelle\/HOL. Proceedings of the 7th ACM SIGPLAN International Conference on Certified Programs and Proofs, Los Angeles, CA, USA, 8\u20139 January 2018, ACM.","DOI":"10.1145\/3176245.3167084"},{"key":"ref_16","doi-asserted-by":"crossref","first-page":"2189","DOI":"10.1109\/TSE.2021.3054928","article-title":"DEFECTCHECKER: Automated Smart Contract Defect Detection by Analyzing EVM Bytecode","volume":"48","author":"Chen","year":"2022","journal-title":"IEEE Trans. Softw. Eng."},{"key":"ref_17","doi-asserted-by":"crossref","unstructured":"Luu, L., Chu, D.H., Olickel, H., Saxena, P., and Hobor, A. (2016). Making Smart Contracts Smarter. Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, Vienna, Austria, 24\u201328 October 2016, ACM.","DOI":"10.1145\/2976749.2978309"},{"key":"ref_18","doi-asserted-by":"crossref","unstructured":"Torres, C.F., Sch\u00fctte, J., and State, R. (2018). Osiris: Hunting for Integer Bugs in Ethereum Smart Contracts. Proceedings of the 34th Annual Computer Security Applications Conference, San Juan, PR, USA, 3\u20137 December 2018, ACM.","DOI":"10.1145\/3274694.3274737"},{"key":"ref_19","doi-asserted-by":"crossref","unstructured":"Tsankov, P., Dan, A., Drachsler-Cohen, D., Gervais, A., Buenzli, F., and Vechev, M. (2018). Securify: Practical security analysis of smart contracts. Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security, ACM.","DOI":"10.1145\/3243734.3243780"},{"key":"ref_20","unstructured":"(2024, November 21). Mythril. Available online: https:\/\/github.com\/ConsenSys\/mythril\/."},{"key":"ref_21","doi-asserted-by":"crossref","first-page":"e2556","DOI":"10.1002\/smr.2556","article-title":"Evmfuzz: Differential fuzz testing of ethereum virtual machine","volume":"36","author":"Fu","year":"2024","journal-title":"J. Softw. Evol. Process"},{"key":"ref_22","doi-asserted-by":"crossref","unstructured":"Contro, F., Crosara, M., Ceccato, M., and Dalla Preda, M. (2021). Ethersolve: Computing an accurate control-flow graph from ethereum bytecode. Proceedings of the 2021 IEEE\/ACM 29th International Conference on Program Comprehension (ICPC), IEEE.","DOI":"10.1109\/ICPC52881.2021.00021"},{"key":"ref_23","doi-asserted-by":"crossref","first-page":"111653","DOI":"10.1016\/j.jss.2023.111653","article-title":"Enhancing Ethereum smart-contracts static analysis by computing a precise Control-Flow Graph of Ethereum bytecode","volume":"200","author":"Pasqua","year":"2023","journal-title":"J. Syst. Softw."},{"key":"ref_24","doi-asserted-by":"crossref","unstructured":"Bose, P., Das, D., Chen, Y., Feng, Y., Kruegel, C., and Vigna, G. (2022). SAILFISH: Vetting Smart Contract State-Inconsistency Bugs in Seconds. Proceedings of the 2022 IEEE Symposium on Security and Privacy (SP), San Francisco, CA, USA, 22\u201326 May 2022, IEEE.","DOI":"10.1109\/SP46214.2022.9833721"},{"key":"ref_25","doi-asserted-by":"crossref","first-page":"2144","DOI":"10.1109\/TIFS.2021.3050051","article-title":"Hunting Vulnerable Smart Contracts via Graph Embedding Based Bytecode Matching","volume":"16","author":"Huang","year":"2021","journal-title":"IEEE Trans. Inform. Forensic Secur."},{"key":"ref_26","unstructured":"Rodler, M., Li, W., Karame, G.O., and Davi, L. (2021). EVMPatch: Timely and automated patching of ethereum smart contracts. Proceedings of the 30th USENIX Security Symposium (USENIX Security 21), USENIX Association."},{"key":"ref_27","unstructured":"(2024, June 27). Contract Upgrade Anti-Patterns. Available online: https:\/\/blog.trailofbits.com\/2018\/09\/05\/contract-upgrade-anti-patterns\/."},{"key":"ref_28","doi-asserted-by":"crossref","unstructured":"Zhang, Y., Ma, S., Li, J., Li, K., Nepal, S., and Gu, D. (2020). SMARTSHIELD: Automatic Smart Contract Protection Made Easy. Proceedings of the 2020 IEEE 27th International Conference on Software Analysis, Evolution and Reengineering (SANER), London, ON, Canada, 18\u201321 February 2020, IEEE.","DOI":"10.1109\/SANER48275.2020.9054825"},{"key":"ref_29","doi-asserted-by":"crossref","first-page":"4611","DOI":"10.1109\/TSE.2021.3123170","article-title":"Aroc: An Automatic Repair Framework for On-Chain Smart Contracts","volume":"48","author":"Jin","year":"2022","journal-title":"IEEE Trans. Softw. Eng."},{"key":"ref_30","doi-asserted-by":"crossref","first-page":"112107","DOI":"10.1016\/j.jss.2024.112107","article-title":"ReenRepair: Automatic and semantic equivalent repair of reentrancy in smart contracts","volume":"216","author":"Huang","year":"2024","journal-title":"J. Syst. Softw."},{"key":"ref_31","unstructured":"(2024, November 23). OpenZeppelin. Available online: https:\/\/github.com\/OpenZeppelin\/openzeppelin-contracts\/."},{"key":"ref_32","doi-asserted-by":"crossref","unstructured":"Ellul, J., and Pace, G.J. (2018). Runtime Verification of Ethereum Smart Contracts. Proceedings of the 2018 14th European Dependable Computing Conference (EDCC), Iasi, Romania, 10\u201314 September 2018, IEEE.","DOI":"10.1109\/EDCC.2018.00036"},{"key":"ref_33","doi-asserted-by":"crossref","unstructured":"Li, A., Choi, J.A., and Long, F. (2020). Securing smart contract with runtime validation. Proceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation, London, UK, 15\u201320 June 2020, ACM.","DOI":"10.1145\/3385412.3385982"},{"key":"ref_34","doi-asserted-by":"crossref","unstructured":"Rodler, M., Li, W., Karame, G.O., and Davi, L. (2019). Sereum: Protecting Existing Smart Contracts Against Re-Entrancy Attacks. Proceedings of the 2019 Network and Distributed System Security Symposium, Internet Society.","DOI":"10.14722\/ndss.2019.23413"},{"key":"ref_35","doi-asserted-by":"crossref","unstructured":"Ma, F., Fu, Y., Ren, M., Wang, M., Jiang, Y., Zhang, K., Li, H., and Shi, X. (2019). EVM: From Offline Detection to Online Reinforcement for Ethereum Virtual Machine. Proceedings of the 2019 IEEE 26th International Conference on Software Analysis, Evolution and Reengineering (SANER), Hangzhou, China, 24-27 February 2019, IEEE.","DOI":"10.1109\/SANER.2019.8668038"},{"key":"ref_36","doi-asserted-by":"crossref","first-page":"102565","DOI":"10.1016\/j.ipm.2021.102565","article-title":"Security reinforcement for Ethereum virtual machine","volume":"58","author":"Ma","year":"2021","journal-title":"Inf. Process. Manag."},{"key":"ref_37","doi-asserted-by":"crossref","first-page":"1","DOI":"10.1145\/3158136","article-title":"Online detection of effectively callback free objects with applications to smart contracts","volume":"2","author":"Grossman","year":"2018","journal-title":"Proc. ACM Program. Lang."},{"key":"ref_38","doi-asserted-by":"crossref","first-page":"2517","DOI":"10.1109\/TIFS.2024.3349852","article-title":"EVM-Shield: In-Contract State Access Control for Fast Vulnerability Detection and Prevention","volume":"19","author":"Zhang","year":"2024","journal-title":"IEEE Trans. Inf. Forensics Secur."},{"key":"ref_39","doi-asserted-by":"crossref","first-page":"1345","DOI":"10.1109\/TPDS.2024.3389153","article-title":"On Off-chaining Smart Contract Runtime Protection: A Queuing Model Approach","volume":"35","author":"Ali","year":"2024","journal-title":"IEEE Trans. Parallel Distrib. Syst."},{"key":"ref_40","doi-asserted-by":"crossref","unstructured":"Falcone, Y. (2010). You Should Better Enforce Than Verify. Proceedings of the 1st International Conference on Runtime Verification (RV 2010), Springer.","DOI":"10.1007\/978-3-642-16612-9_9"},{"key":"ref_41","doi-asserted-by":"crossref","unstructured":"Soueidi, C., Kassem, A., and Falcone, Y. (2020). BISM: Bytecode-level instrumentation for software monitoring. Proceedings of the 20th International Conference on Runtime Verification (RV 2020), Los Angeles, CA, USA, 6\u20139 October 2020, Springer.","DOI":"10.1007\/978-3-030-60508-7_18"},{"key":"ref_42","doi-asserted-by":"crossref","unstructured":"Sun, Y., Poskitt, C.M., Zhang, X., and Sun, J. (2024). REDriver: Runtime Enforcement for Autonomous Vehicles. Proceedings of the IEEE\/ACM 46th International Conference on Software Engineering, ACM.","DOI":"10.1145\/3597503.3639151"},{"key":"ref_43","doi-asserted-by":"crossref","first-page":"111605","DOI":"10.1016\/j.jss.2022.111605","article-title":"A component framework for the runtime enforcement of safety properties","volume":"198","author":"Bonfanti","year":"2023","journal-title":"J. Syst. Softw."},{"key":"ref_44","doi-asserted-by":"crossref","unstructured":"Coenen, N., Finkbeiner, B., Hahn, C., Hofmann, J., and Schillo, Y. (2021). Runtime enforcement of hyperproperties. Proceedings of the International Symposium on Automated Technology for Verification and Analysis, Springer.","DOI":"10.1007\/978-3-030-88885-5_19"},{"key":"ref_45","doi-asserted-by":"crossref","unstructured":"Falcone, Y., and Pinisetty, S. (2019). On the Runtime Enforcement of Timed Properties. Proceedings of the 19th International Conference on Runtime Verification (RV 2019), Springer.","DOI":"10.1007\/978-3-030-32079-9_4"},{"key":"ref_46","doi-asserted-by":"crossref","unstructured":"Azzopardi, S., Ellul, J., Falzon, R., and Pace, G.J. (2022). Tainting in Smart Contracts: Combining Static and Runtime Verification. Proceedings of the 22nd International Conference on Runtime Verification (RV 2022), Springer.","DOI":"10.1007\/978-3-031-17196-3_8"},{"key":"ref_47","doi-asserted-by":"crossref","first-page":"27","DOI":"10.1016\/j.cosrev.2012.01.001","article-title":"Which security policies are enforceable by runtime monitors? A survey","volume":"6","author":"Khoury","year":"2012","journal-title":"Comput. Sci. Rev."},{"key":"ref_48","doi-asserted-by":"crossref","unstructured":"Liu, Z., Xia, S., Liang, Y., Song, L., and Hu, H. (2022). Who goes first? Detecting go concurrency bugs via message reordering. Proceedings of the 27th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Lausanne, Switzerland, 28 February\u20134 March 2022, ACM.","DOI":"10.1145\/3503222.3507753"},{"key":"ref_49","doi-asserted-by":"crossref","unstructured":"Albert, E., Genaim, S., Kirchner, D., and Martin-Martin, E. (2023). Formally Verified EVM Block-Optimizations. Proceedings of the 35th International Conference on Computer Aided Verification (CAV 2023), Springer.","DOI":"10.1007\/978-3-031-37709-9_9"},{"key":"ref_50","doi-asserted-by":"crossref","first-page":"1","DOI":"10.1145\/3506800","article-title":"Super-optimization of Smart Contracts","volume":"31","author":"Albert","year":"2022","journal-title":"ACM Trans. Softw. Eng. Methodol."},{"key":"ref_51","doi-asserted-by":"crossref","first-page":"1784","DOI":"10.1109\/TC.2020.2982888","article-title":"Improved Basic Block Reordering","volume":"69","author":"Newell","year":"2020","journal-title":"IEEE Trans. Comput."},{"key":"ref_52","doi-asserted-by":"crossref","unstructured":"Liu, Y., and Song, W. (2024). FunRedisp: Reordering Function Dispatch in Smart Contract to Reduce Invocation Gas Fees. Proceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis, Vienna, Austria, 16\u201320 September 2024, ACM.","DOI":"10.1145\/3650212.3652146"},{"key":"ref_53","unstructured":"(2024, September 21). Eth-Reentrancy-Attack-Patterns. Available online: https:\/\/github.com\/uni-due-syssec\/eth-reentrancy-attack-patterns\/."},{"key":"ref_54","unstructured":"(2024, September 21). ReentrancyStudy-Data. Available online: https:\/\/github.com\/InPlusLab\/ReentrancyStudy-Data\/."},{"key":"ref_55","doi-asserted-by":"crossref","unstructured":"Zheng, Z., Zhang, N., Su, J., Zhong, Z., Ye, M., and Chen, J. (2023). Turn the rudder: A beacon of reentrancy detection for smart contracts on ethereum. Proceedings of the 2023 IEEE\/ACM 45th International Conference on Software Engineering (ICSE), IEEE.","DOI":"10.1109\/ICSE48619.2023.00036"},{"key":"ref_56","doi-asserted-by":"crossref","unstructured":"Durieux, T., Ferreira, J.F., Abreu, R., and Cruz, P. (2020). Empirical Review of Automated Analysis Tools on 47,587 Ethereum Smart Contracts. Proceedings of the ACM\/IEEE 42nd International Conference on Software Engineering, ACM.","DOI":"10.1145\/3377811.3380364"},{"key":"ref_57","unstructured":"(2024, September 21). Elysium. Available online: https:\/\/github.com\/christoftorres\/Elysium\/."},{"key":"ref_58","doi-asserted-by":"crossref","unstructured":"Ferreira, J.F., Cruz, P., Durieux, T., and Abreu, R. (2020). Smartbugs: A framework to analyze solidity smart contracts. Proceedings of the 35th IEEE\/ACM International Conference on Automated Software Engineering, IEEE.","DOI":"10.1145\/3324884.3415298"},{"key":"ref_59","doi-asserted-by":"crossref","unstructured":"Fang, P., Gao, P., Peng, Y., Zhang, Q., Xie, T., Song, D.X., Mittal, P., Kulkarni, S.R., Liu, Z., and Xiao, X. (2024). Vfix: Facilitating software maintenance of smart contracts via automatically fixing vulnerabilities. Proceedings of the 2024 IEEE International Conference on Software Maintenance and Evolution (ICSME), IEEE.","DOI":"10.1109\/ICSME58944.2024.00013"},{"key":"ref_60","unstructured":"(2024, October 13). Ethereum Virtual Machine Opcodes. Available online: https:\/\/ethervm.io\/."},{"key":"ref_61","unstructured":"(2024, September 10). Remix. Available online: https:\/\/remix.ethereum.org\/."}],"container-title":["Systems"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.mdpi.com\/2079-8954\/14\/6\/600\/pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,6,4]],"date-time":"2026-06-04T04:18:31Z","timestamp":1780546711000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.mdpi.com\/2079-8954\/14\/6\/600"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2026,5,23]]},"references-count":61,"journal-issue":{"issue":"6","published-online":{"date-parts":[[2026,6]]}},"alternative-id":["systems14060600"],"URL":"https:\/\/doi.org\/10.3390\/systems14060600","relation":{},"ISSN":["2079-8954"],"issn-type":[{"value":"2079-8954","type":"electronic"}],"subject":[],"published":{"date-parts":[[2026,5,23]]}}}