• Stars
    star
    717
  • Rank 63,167 (Top 2 %)
  • Language
    Solidity
  • License
    Other
  • Created over 6 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Smart contracts which are formally verified

Formally Verified Smart Contracts

This repository contains smart contracts that have been formally verified by Runtime Verification and/or collaborators.

To verify a smart contract, we need to first produce a formal specification stating what the smart contract is supposed to do. This is often the most difficult part of the verification effort, requiring sometimes several rounds of discussions and meetings with the owners of the smart contract, to ensure that everybody is on the same page regarding the intended functionality of the smart contract. Not surprisingly, many bugs or opportunities for improvement in the smart contract code are found at this early stage. Then we need to show that the binary or low-level code (e.g., EVM binary or IELE code) generated by the compiler from the smart contract high level code (e.g., Solidity or Vyper) indeed satisfies the specification. In our approach the proofs use reachability logic, a generalization of Hoare logic, separation logic and modal logic, and are performed using the K-framework. The K framework takes a formal semantics of a language as trusted input (e.g., that of EVM or IELE), and then uses it to symbolically execute the smart contract exhaustively on all paths, making use of SMT solvers like Z3 to solve the mathematical domain constraints.

List of Verified Smart Contracts

Resources

We use the K-framework and its verification infrastructure throughout the formal verification effort. All of the formal specifications are mechanized within the K-framework as well. Therefore, some background knowledge about the K-framework would be necessary for reading and fully understanding the formal specifications and reproducing the mechanized proofs. We refer the reader to the following resources for background knowledge about the K-framework and its verification infrastructure.

License

Copyrightable work in this repository is licensed by Runtime Verification, Inc. under the terms of The Reproducibility License 1.1.0, a restrictive license. That license is very readable, and you should read it. Most will want to pay special attention to its Reproducibility section.

Other parts of the proof toolchain, including the K-framework, are licensed under different, open source terms, like those of The University of Illinois/NCSA Open Source License.

Disclaimer

This repository does not constitute legal or investment advice. The preparers of this repository present it as an informational exercise documenting the due diligence involved in the secure development of the target contract only, and make no material claims or guarantees concerning the contract's operation post-deployment. The preparers of this repository assume no liability for any and all potential consequences of the deployment or use of this contract.

The formal verification results presented here only show that the target contract behaviors meet the formal (functional) specifications. Moreover, the correctness of the generated formal proofs assumes the correctness of the specifications and their refinement, the correctness of KEVM, the correctness of the K-framework's reachability logic theorem prover, and the correctness of the Z3 SMT solver. The presented result makes no guarantee about properties not specified in the formal specification. Importantly, the presented formal specification considers only the behaviors within the EVM, without considering the block/transaction level properties or off-chain behaviors, meaning that the verification result does not completely rule out the possibility of the contract being vulnerable to existing and/or unknown attacks.

Smart contracts are still a nascent software arena, and their deployment and public offering carries substantial risk. This repository makes no claims that its analysis is fully comprehensive, and recommends always seeking multiple opinions and audits.

This repository is also not comprehensive in scope, excluding a number of components critical to the correct operation of this system.

The possibility of human error in the manual review process is very real, and we recommend seeking multiple independent opinions on any claims which impact a large quantity of funds.

More Repositories

1

evm-semantics

K Semantics of the Ethereum Virtual Machine (EVM)
Python
507
star
2

k

K Framework Tools 7.0
Java
447
star
3

haskell-backend

The symbolic execution engine powering the K Framework
Haskell
210
star
4

iele-semantics

Semantics of Virtual Machine for IELE prototype blockchain
HTML
130
star
5

publications

Publications of Runtime Verification, Inc.
HTML
87
star
6

wasm-semantics

A Prototype Formal Semantics of WebAssembly in K
WebAssembly
78
star
7

kontrol

Python
49
star
8

erc20-semantics

ERC20 in K
47
star
9

javamop

Runtime verification system for Java, using AspectJ for instrumentation.
Java
44
star
10

llvm-backend

KORE to llvm translation
C++
31
star
11

deposit-contract-verification

Makefile
30
star
12

plutus-core-semantics

Haskell
27
star
13

algorand-verification

Formal verification of the Algorand consensus protocol
Coq
26
star
14

beacon-chain-spec

Formalization of the Beacon Chain Phase 0 Specification in K
TeX
20
star
15

python-semantics

The semantics of Python in K
Python
19
star
16

beacon-chain-verification

TeX
18
star
17

michelson-semantics

A K semantics of Tezos' Michelson language.
Makefile
17
star
18

casper-proofs

Coq definitions and lemmas for verification of Casper
TeX
17
star
19

solidity

Fork of the Solidity Compiler for compiling Solidity to IELE
C++
16
star
20

rv-monitor

RV-Monitor core system code
Java
15
star
21

avm-semantics

Python
15
star
22

pyk

Python tools for the K Framework
Python
13
star
23

foundry-upgradeable-contracts-examples

Example tests for exploring upgradeable contracts with Foundry
Solidity
13
star
24

kontrol-demo

Foundry blog posts' executable demos
Solidity
12
star
25

zero-to-k-tutorial

Makefile
12
star
26

simbolik-vscode

TypeScript
12
star
27

k-editor-support

Plugin files for editing K files
Java
11
star
28

erc777-semantics

Makefile
11
star
29

mpfr-java

GNU MPFR Java Bindings
Java
10
star
30

kontrol-solady

Solady formal verification with Kontrol
Solidity
10
star
31

polkadot-verification

Verification of Polkadot WASM code
WebAssembly
9
star
32

secureum-kontrol

Solidity
9
star
33

kontrol-cheatcodes

Cheatcodes library for your symbolic Kontrol tests
Solidity
9
star
34

blockchain-k-plugin

K plugin for IELE and KEVM
C++
8
star
35

bn128-ml

BN 128 elliptic curve implementation in OCAML (for Ethereum zero-knowledge proofs)
OCaml
8
star
36

knock

Nock semantics in K
Python
7
star
37

mx-semantics

Python
7
star
38

rdao-smc

A probabilistic rewriting model of Randao-based RNG schemes
TeX
7
star
39

hs-backend-booster

Accelerates K Framework's Haskell backend
Haskell
7
star
40

proof-generation

Python
6
star
41

kup

K and Semantics Distribution Tool
Python
6
star
42

kavm-demo

Python
6
star
43

rv-android

Android runtime library for the RV-Monitor environment.
Java
5
star
44

match

RV-Match issue tracker and releases
4
star
45

gitbook-kontrol

4
star
46

imp-semantics

The K semantics of IMP and associated tools
Python
4
star
47

predict

3
star
48

vlsm

Coq
3
star
49

property-db

An annotated Java API and a tool for generated documentation augmented with properties.
Java
3
star
50

k-vs-coq-language-frameworks

Coq
3
star
51

pl-tutorial

The K Programming Language Tutorial
Standard ML
3
star
52

rv-predict

Code for improved rv-predict and installer
C
2
star
53

evaluation

Evaluation results of RV tools and comparisons with other tools
Python
2
star
54

rvmatch-eclipse-plugin

Java
2
star
55

kontrol-tutorial

Solidity
2
star
56

khoon

Python
2
star
57

optimism-ci

CI Hosting Symbolic Execution for Ethereum-Optimism
2
star
58

llvmmop

MOP framework for LLVM
Java
2
star
59

CANtools

RV tools for reverse engineering the automotive CAN bus.
1
star
60

rv-toolkit-docs

HTML
1
star
61

racy-c-programs

Benchmark of C/C++ programs exhibiting races.
C++
1
star
62

test-maven-deployment

Test - Delete me
1
star
63

rv-match_testing

Shell
1
star
64

z3k

C++ type inferencer for K using libz3
C++
1
star
65

k-pldi-tutorial

Code supporting K tutorial session at PLDI 2023.
Shell
1
star
66

elrond-multisig

Starlark
1
star
67

gitbook-kevm

1
star
68

proof-checker-public

C++
1
star
69

mir-semantics

Python
1
star
70

kore-prof

Profiling utilities extracted from haskell-backend
Haskell
1
star
71

RV-Log

Frontend for feeding log files and other precomputed event traces to RV-Monitor.
Java
1
star
72

mir-semantics-compiletest

Test suite for MIR semantics
Rust
1
star
73

gitbook-home

1
star
74

riscv-gnu-toolchain-images

Docker image builds for the RISC-V GNU toolchain
Dockerfile
1
star
75

nailgun

Nailgun is a client, protocol, and server for running Java programs from the command line without incurring the JVM startup overhead.
Java
1
star
76

ercx-vscode

VSCode support for ERCx
TypeScript
1
star
77

simbolik-examples

Solidity
1
star
78

rv-install

Unified installer for all Runtime Verification Inc. products
Java
1
star