There is a newer version of the record available.

Published June 30, 2024 | Version 1.1
Software Open

Supplementary Material: Secure Smart Contracts with Isabelle/Solidity

  • 1. ROR icon University of Exeter

Contributors

  • 1. ROR icon University of Exeter

Description

This is supplementary material for the paper

Secure Smart Contracts with Isabelle/Solidity

It consists of a VM which contains an Isabelle installation and a copy of the theory files containing the formalization:

  • Utils.thy: A set of general functions and lemmas independent of Solidity.
  • State_Monad.thy: A formalizaton of a state monad with exceptions and non-termination. It provides also a new mode sm for the partial function package.
  • State.thy: A formalization of the Solidity storage model consisting of definitions for storage, memory, calldata, and stack. In addition it contains several useful functions for the different types of stores such as functions to copy data structures from one store to another.
  • Solidity.thy: A formalization of Solidity expressions and statements in terms of our state monad.
  • WP.thy: A weakest precondition calculus and corresponding verification condition generator for our Solidity monads.
  • Unit_tests.thy: A test suite to validate conformance of the semantics to the original Solidity documentation. The test cases were executed using the [Remix IDE](https://remix.ethereum.org/).
  • Contract.thy: An Isabelle/ML implementation of two new commands: `contract` and `invariant` to support the specification of Solidity contracts and verification of invariants in Isabelle.
  • Solidity_Main.thy: Main entry point to Isabelle/Solidity.
  • Token.thy: A formalization of a simple banking contract and verification of a key invariant using Isabelle/Solidity.
  • Casino.thy: A formalization of a casino contract and verification of a key invariant using Isabelle/Solidity.
  • Voting.thy: A formalization of a delegated voting contract and verification of a key invariant using Isabelle/Solidity.

In addition, the artifact contains also a series of tutorials (not described in the paper) which provide step-by-step guides to specify and verify simple smart contracts:

  • Tutorial.thy: A step-by-step guide on how to use Isabelle/Solidity to formalize a simple example contract.
  • Typespec.thy: A formal specification of an example contract to demonstrate the variable declaration in Isabelle/Solidity.
  • Ctrlfunctions.thy: A formal specification of an example contract to show the implementation of control functions in a smart contract using Isabelle/Solidity.
  • Invarspec.thy: A formal specification of an example contract to illustrate the specification of Invariants in Isabelle/Solidity.

Files

README.md

Files (4.6 GB)

Name Size Download all
md5:990d17c70add726ea402537e9d6b43d1
1.3 kB Download
md5:bc818c48321dbb0c0fba6fc0689cfb36
4.5 kB Preview Download
md5:c16a231f0852bba23eee53191ae24b77
4.6 GB Download

Additional details

Funding

Engineering and Physical Sciences Research Council
Secure Smart Contracts with Isabelle/Solidity EP/X027619/1

Software

Programming language
Isabelle
Development Status
Active