• Stars
    star
    701
  • Rank 62,515 (Top 2 %)
  • Language
    Solidity
  • License
    Other
  • Created over 6 years ago
  • Updated almost 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)
Solidity
463
star
2

k

K Framework Tools 6.0
Java
395
star
3

haskell-backend

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

iele-semantics

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

publications

Publications of Runtime Verification, Inc.
HTML
78
star
6

wasm-semantics

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

erc20-semantics

ERC20 in K
46
star
8

javamop

Runtime verification system for Java, using AspectJ for instrumentation.
Java
42
star
9

llvm-backend

KORE to llvm translation
C++
31
star
10

plutus-core-semantics

Haskell
27
star
11

algorand-verification

Formal verification of the Algorand consensus protocol
Coq
26
star
12

kontrol

Python
25
star
13

deposit-contract-verification

Makefile
25
star
14

beacon-chain-spec

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

beacon-chain-verification

TeX
18
star
16

python-semantics

The semantics of Python in K
Python
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++
15
star
20

avm-semantics

Python
15
star
21

rv-monitor

RV-Monitor core system code
Java
14
star
22

foundry-upgradeable-contracts-examples

Example tests for exploring upgradeable contracts with Foundry
Solidity
12
star
23

k-editor-support

Plugin files for editing K files
Java
11
star
24

erc777-semantics

Makefile
11
star
25

mpfr-java

GNU MPFR Java Bindings
Java
10
star
26

zero-to-k-tutorial

Makefile
10
star
27

pyk

Python tools for the K Framework
Python
10
star
28

polkadot-verification

Verification of Polkadot WASM code
WebAssembly
9
star
29

secureum-kontrol

Solidity
9
star
30

blockchain-k-plugin

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

knock

Nock semantics in K
Python
7
star
32

rdao-smc

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

bn128-ml

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

kavm-demo

Python
7
star
35

elrond-semantics

Python
6
star
36

foundry-demo

Foundry blog posts' executable demos
Solidity
6
star
37

proof-generation

Python
6
star
38

hs-backend-booster

Accelerates K Framework's Haskell backend
Haskell
6
star
39

rv-android

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

match

RV-Match issue tracker and releases
4
star
41

imp-semantics

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

kup

K and Semantics Distribution Tool
Python
3
star
43

predict

3
star
44

vlsm

Coq
3
star
45

property-db

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

k-vs-coq-language-frameworks

Coq
3
star
47

rv-predict

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

evaluation

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

rvmatch-eclipse-plugin

Java
2
star
50

kontrol-tutorial

Solidity
2
star
51

llvmmop

MOP framework for LLVM
Java
2
star
52

khoon

Python
2
star
53

gitbook-kontrol

2
star
54

CANtools

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

racy-c-programs

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

rv-toolkit-docs

HTML
1
star
57

test-maven-deployment

Test - Delete me
1
star
58

rv-match_testing

Shell
1
star
59

z3k

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

k-pldi-tutorial

Code supporting K tutorial session at PLDI 2023.
C++
1
star
61

elrond-multisig

Starlark
1
star
62

gitbook-kevm

1
star
63

rv-install

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

proof-checker-public

C++
1
star
65

mir-semantics

Python
1
star
66

kore-prof

Profiling utilities extracted from haskell-backend
Haskell
1
star
67

RV-Log

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

mir-semantics-compiletest

Test suite for MIR semantics
Rust
1
star
69

gitbook-home

1
star
70

pl-tutorial

The K Programming Language Tutorial
Standard ML
1
star