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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
- 2.
Note that the pending state in which transaction in the pool waiting for minor validation is out the scope of this paper.
- 3.
- 4.
- 5.
- 6.
Application Binary Interface.
References
Krichen, M., Ammi, M., Mihoub, A., Almutiq, M.: Blockchain for modern applications: a survey. Sensors 22(14), 5274 (2022)
Nakamoto, S., et al.: Bitcoin: a peer-to-peer electronic cash system (2008)
Finley, K.: A \$50 million hack just showed that the DAO was all too human (2016)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
Wang, H., Li, Y., Lin, S.W., Artho, C., Ma, L., Liu, Y.: Oracle-supported dynamic exploit generation for smart contracts (2019)
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)
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)
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
Szabo, N.: Formalizing and securing relationships on public networks. 2(9) (1997)
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)
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
Azouvi, S., Goren, G., Heimbach, L., Hicks, A.: Base fee manipulation in ethereum’s EIP-1559 transaction fee mechanism (2023)
Wood, G., et al.: Ethereum: a secure decentralised generalised transaction ledger. Ethereum Proj. Yellow Paper 151(2014), 1–32 (2014)
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)
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)
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)
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)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2024 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
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)