[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to main content

Model-Based Testing Approach for EIP-1559 Ethereum Smart Contracts

  • Conference paper
  • First Online:
Model and Data Engineering (MEDI 2023)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 14396))

Included in the following conference series:

  • 372 Accesses

Abstract

Smart contracts are computer programs that are deployed and executed on the blockchain without the need of third parties. They are characterized by their immutability because once deployed, they cannot be modified. Thus, it is highly demanded to verify and validate them at development phase before their deployment. This work introduces a Model-Based Testing (MBT) approach for checking functional and execution related properties of Ethereum smart contracts. Our MBT solution supports the transaction pricing mechanism set by the Ethereum Improvement Proposal EIP-1559. It consists of four steps: (1) modelling the smart contract and its blockchain environment as UPPAAL Timed Automata while defining the contract gas usage regarding the EIP-1559 proposal, (2) generating abstract test cases, (3) executing dynamically the obtained tests, and at the end (4) analyzing and reporting the obtained test results. To illustrate the feasibility of our MBT approach, tests for the smart banking case study are generated and executed.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
£29.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
GBP 19.95
Price includes VAT (United Kingdom)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
GBP 47.99
Price includes VAT (United Kingdom)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
GBP 59.99
Price includes VAT (United Kingdom)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

Notes

  1. 1.

    https://www.alchemy.com/overviews/ethereum-statistics.

  2. 2.

    Note that the pending state in which transaction in the pool waiting for minor validation is out the scope of this paper.

  3. 3.

    https://trufflesuite.com/ganache/.

  4. 4.

    https://trufflesuite.com/.

  5. 5.

    https://web3js.readthedocs.io/en/v1.10.0/.

  6. 6.

    Application Binary Interface.

References

  1. Krichen, M., Ammi, M., Mihoub, A., Almutiq, M.: Blockchain for modern applications: a survey. Sensors 22(14), 5274 (2022)

    Article  Google Scholar 

  2. Nakamoto, S., et al.: Bitcoin: a peer-to-peer electronic cash system (2008)

    Google Scholar 

  3. Finley, K.: A \$50 million hack just showed that the DAO was all too human (2016)

    Google Scholar 

  4. Lahami, M., Maâlej, A.J., Krichen, M., Hammami, M.A.: A comprehensive review of testing blockchain oriented software. In: Proceedings of the 17th International Conference on Evaluation of Novel Approaches to Software Engineering, ENASE 2022, Online Streaming, 25–26 April 2022, pp. 355–362. SCITEPRESS (2022)

    Google Scholar 

  5. Krichen, M., Lahami, M., Al-Haija, Q.A.: Formal methods for the verification of smart contracts: a review. In: 15th International Conference on Security of Information and Networks, SIN 2022, pp. 1–8. IEEE (2022)

    Google Scholar 

  6. Nelaturu, K., Mavridou, A., Veneris, A., Laszka, A.: Verified development and deployment of multiple interacting smart contracts with VeriSolid. In: Proceedings of the 2nd IEEE International Conference on Blockchain and Cryptocurrency (ICBC) (2020)

    Google Scholar 

  7. Ben Fekih, R., Lahami, M., Jmaiel, M., Ben Ali, A., Genestier, P.: Towards model checking approach for smart contract validation in the EIP-1559 Ethereum. In: Proceeding of the 46th IEEE Annual Computers, Software, and Applications Conference, (COMPSAC), pp. 83–88 (2022)

    Google Scholar 

  8. Ben Fekih, R., Lahami, M., Jmaiel, M., Bradai, S.: Formal modeling and verification of ERC smart contracts: application to NFT. In: The proceeding of IEEE Symposium on Computers and Communications (ISCC). IEEE (2023)

    Google Scholar 

  9. Amani, S., Bégel, M., Bortin, M., Staples, M.: Towards verifying Ethereum smart contract bytecode in Isabelle/HOL. In: Proceedings of the 7th ACM SIGPLAN International Conference on Certified Programs and Proofs, pp. 66–77 (2018)

    Google Scholar 

  10. Annenkov, D., Milo, M., Nielsen, J.B., Spitters, B.: Extracting smart contracts tested and verified in Coq. In: Proceedings of the 10th ACM SIGPLAN International Conference on Certified Programs and Proofs, pp. 105–121 (2021)

    Google Scholar 

  11. Akca, S., Rajan, A., Peng, C.: SolAnalyser: a framework for analysing and testing smart contracts. In: Proceeding of the 26th Asia-Pacific Software Engineering Conference (APSEC), pp. 482–489 (2019)

    Google Scholar 

  12. Sánchez-Gómez, N., Torres-Valderrama, J., García-García, J.A., Gutiérrez, J.J., Escalona, M.J.: Model-based software design and testing in blockchain smart contracts: a systematic literature review. IEEE Access 8, 164556–164569 (2020)

    Article  Google Scholar 

  13. Andesta, E., Faghih, F., Fooladgar, M.: Testing smart contracts gets smarter. In: Proceeding of the 10th International Conference on Computer and Knowledge Engineering (ICCKE 2020), pp. 405–412 (2020)

    Google Scholar 

  14. Wang, H., Li, Y., Lin, S.W., Artho, C., Ma, L., Liu, Y.: Oracle-supported dynamic exploit generation for smart contracts (2019)

    Google Scholar 

  15. Jiang, B., Liu, Y., Chan, W.K.: ContractFuzzer: fuzzing smart contracts for vulnerability detection. In: Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering, pp. 259–269 (2018)

    Google Scholar 

  16. Hammami, M.A., Lahami, M., Maâlej, A.J.: Towards a dynamic testing approach for checking the correctness of Ethereum smart contracts. In: 17th International Conference of Risks and Security of Internet and Systems, (CRiSIS) (2022)

    Google Scholar 

  17. Kim, J.H., Larsen, K.G., Nielsen, B., Mikučionis, M., Olsen, P.: Formal analysis and testing of real-time automotive systems using UPPAAL tools. In: Núñez, M., Güdemann, M. (eds.) FMICS 2015. LNCS, vol. 9128, pp. 47–61. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-19458-5_4

    Chapter  Google Scholar 

  18. Szabo, N.: Formalizing and securing relationships on public networks. 2(9) (1997)

    Google Scholar 

  19. Liu, Y., Lu, Y., Nayak, K., Zhang, F., Zhang, L., Zhao, Y.: Empirical analysis of EIP-1559: transaction fees, waiting time, and consensus security. In: CCS ’22: 2022 ACM SIGSAC Conference on Computer and Communications Security Los Angeles CA USA 7–11 November 2022, pp. 2099–2113. IEEE (2022)

    Google Scholar 

  20. Buterin, V., Conner, E., Dudley, R., Slipper, M., Norden, I., Bakhta, A.: EIP-1559: Fee market change for eth 1.0 chain. https://eips.ethereum.org/eips/eip-1559. Accessed May 2023

  21. Azouvi, S., Goren, G., Heimbach, L., Hicks, A.: Base fee manipulation in ethereum’s EIP-1559 transaction fee mechanism (2023)

    Google Scholar 

  22. Wood, G., et al.: Ethereum: a secure decentralised generalised transaction ledger. Ethereum Proj. Yellow Paper 151(2014), 1–32 (2014)

    Google Scholar 

  23. Felderer, M., Büchler, M., Johns, M., Brucker, A.D., Breu, R., Pretschner, A.: Chapter one - security testing: a survey. Adv. Comput. 101, 1–51 (2016)

    Google Scholar 

  24. Pan, Z., Hu, T., Qian, C., Li, B.: ReDefender: a tool for detecting reentrancy vulnerabilities in smart contracts effectively. In: Proceedings of the IEEE 21st International Conference on Software Quality, Reliability and Security (QRS), pp. 915–925 (2021)

    Google Scholar 

  25. Grieco, G., Song, W., Cygan, A., Feist, J., Groce, A.: Echidna: effective, usable, and fast fuzzing for smart contracts. In: Proceedings of the 29th ACM SIGSOFT International Symposium on Software Testing and Analysis, pp. 557–560 (2020)

    Google Scholar 

  26. Liu, Y., Li, Y., Lin, S.W., Yan, Q.: ModCon: a model-based testing platform for smart contracts. In: Proceedings of the 28th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering, pp. 1601–1605 (2020)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Mariam Lahami .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2024 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Hammami, M.A., Lahami, M. (2024). Model-Based Testing Approach for EIP-1559 Ethereum Smart Contracts. In: Mosbah, M., Kechadi, T., Bellatreche, L., Gargouri, F. (eds) Model and Data Engineering. MEDI 2023. Lecture Notes in Computer Science, vol 14396. Springer, Cham. https://doi.org/10.1007/978-3-031-49333-1_4

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-49333-1_4

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-49332-4

  • Online ISBN: 978-3-031-49333-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics