Posted on by Achim D. Brucker, licensed under CC BY-ND 4.0.

A Denotational Semantics of Solidity in Isabelle/HOL

Smart contracts are programs, usually automating legal agreements such as financial transactions. Thus, bugs in smart contracts can lead to large financial losses. For example, an incorrectly initialized contract was the root cause of the Parity Wallet bug that made USD 280mil worth of Ether inaccessible. Ether is the cryptocurrency of the Ethereum blockchain that uses Solidity for expressing smart contracts.

In our SEFM paper [1], we address this problem by presenting an executable denotational semantics for Solidity in the interactive theorem prover Isabelle/HOL. This formal semantics builds the foundation of an interactive program verification environment for Solidity programs and allows for inspecting Solidity programs by (symbolic) execution. We combine the latter with grammar-based fuzzing to ensure that our formal semantics complies to the Solidity implementation on the Ethereum Blockchain. Finally, we demonstrate the formal verification of Solidity programs by two examples: constant folding and memory optimization.

The formalization and presented tools are available on Zenodo [???].

References

1. Marmsoler, D. and Brucker, A. D. “A Denotational Semantics of Solidity in Isabelle/HOLSoftware engineering and formal methods (sefm) (2021): URL: http://www.brucker.ch/bibliography/abstract/marmsoler.ea-solidity-semantics-2021