### Abstract

Smart contracts are automatically executed programs, usually representing 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 saw $280M worth of Ether destroyed. Ether is the cryptocurrency of the Ethereum blockchain that uses Solidity for expressing smart contracts. We address this problem by formalizing 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 them 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 a simple verified token.

### License

BSD License

### History

August 2, 2023
  Changing expressions do not have side effects anymore. Adding support for instantiation of contracts. Adding weakest precondition calculus for the verification of statements. (revision fb4d111b2dde)

### Topics

- Computer science/Programming languages
- Computer science/Semantics and reasoning

### Session Solidity

- Utils
- Solidity_Symbex
- ReadShow
- StateMonad
- Valuetypes
- Storage
- Accounts
- Environment
- Contracts
- Expressions
- Statements
- Solidity_Main
- Solidity_Evaluator
- Weakest_Precondition
- Reentrancy
- Constant_Folding
- Compile_Evaluator

### Depends on

- Finite Map Extras

### Auto-related entries

- A Verified Imperative Implementation of B-Trees
- Flow Networks and the Min-Cut-Max-Flow Theorem
- Formalizing Push-Relabel Algorithms
- Formalizing the Edmonds-Karp Algorithm
- Pop-Refinement

## Cite

×

Solidity-AFP

    @article{Solidity-AFP,
      author  = {Diego Marmsoler and Achim D. Brucker},
      title   = {Isabelle/Solidity: A deep Embedding of Solidity in Isabelle/HOL},
      journal = {Archive of Formal Proofs},
      month   = {July},
      year    = {2022},
      note    = {\url{https://isa-afp.org/entries/Solidity.html},
                 Formal proof development},
      ISSN    = {2150-914x},
    }

Download

## Download

× Download latest

Older releases:

- Sep 13, 2023 : Isabelle2023
- Oct 27, 2022 : Isabelle2022
- Aug 12, 2022 : Isabelle2021-1