Coder Social home page Coder Social logo

certikproject / smartpulsetool Goto Github PK

View Code? Open in Web Editor NEW

This project forked from utopia-group/smartpulsetool

1.0 0.0 0.0 211.41 MB

Shell 0.09% Ruby 0.02% Python 0.08% C 51.93% SMT 0.53% Batchfile 0.01% Perl 0.01% Makefile 0.01% C++ 0.01% SWIG 17.91% Assembly 0.01% Java 9.17% Lex 0.02% HTML 0.12% CSS 0.02% JavaScript 0.02% Solidity 1.79% Boogie 18.30%

smartpulsetool's Introduction

SmartPulse

This is the main repository for SmartPulse, a tool for verifying temporal properties of Smart Contracts. SmartPulse is comprised of two tools. The first, a modified version of VeriSol, translates the Smart Contract from Solidity to Boogie. The second, a modified version of Ultimate Automizer, consumes the translated contract and verifies the given property. This repository contains SmartPulse's version of Ultimate Automizer and the modified version of VeriSol can be found here.

Usage

./SmartPulse.py [args] contract.sol contractName spec.spec 

Behavioral Models: 
  -modArith                   | Model integers using modular arithmetic rather than as mathematical integers 
  -instrumentGas              | Instrument gas usage using model (assumes model comes from solc) 
Adversary Models: 
  -noReentrancy               | Assume attacker cannot make reentrant calls 
  -singleCallback             | Assume attacker will only make one reentrant call 
  -powerfulAdversary          | Assume attacker can make arbitrary reentrant calls 
Harness Modifiers: \
  -tnxsOnFields               | Allow transactions to be issued to contracts in fields of main contract 
  -checkPrePost:<fn1,fn2,...> | Check pre/post conditions of the specified functions 

Example

./SmartPulse.py LockedFunds.sol Wallet LockedFunds.spec

SmartLTL Specification Language

SmartLTL is an ltl-like language specific to Smart Contracts. We classify it as LTL-like because SmartLTL is the same as LTL with the exception of its atoms. Here, we will provide information about the SmartLTL specification language, but some knowledge of LTL is assumed.

Specification Structure

A SmartLTL specification has 3 parts: (1) the fresh variable declaration, (2) the fairness property and (3) the property to verify. Here, we will briefly discuss each part of the specification.

Fresh Variable Declaration

Fairness Property

Verification Property

Atoms

started(f, ψ)

finished(f, ψ)

reverted(f, ψ)

sent(ψ)

This is syntactic sugar for started(send, ψ) or started(transfer, ψ).

Constraints on Atoms

Examples

Building

SmartPulse requires the modified version of Ultimate Automizer and VeriSol be built. To build VeriSol, follow the instructions in this repository. As the build process for Ultimate automizer is complex, we provide pre-built binaries. We recommend using these binaries rather than building Ultimate Automizer from scratch.

Building from Pre-build Binaries

Requirements

Instructions

  1. Build and install VeriSol.
  2. Download a pre-built binary from here.

Building from Scratch

Requirements

  • Z3
  • Java JDK (1.8)
  • VeriSol
  • Maven 3.0
  • Eclipse IDE for RCP and RAP Developers 2019-09 or older

Instructions

  1. Build and install VeriSol.
  2. Follow these instructions to build Ultimate Automizer.
  3. Run createSmartPulse.sh

Troubleshooting

Cannot run program "ltl2ba"

This occurs when ltl2ba cannot be found or executed. To ensure ltl2ba can be executed, run the ltl2ba executable in the base SmartPulse directory. If it does not execute, build a fresh version of ltl2ba from here. If ltl2ba can be executed, it is likely that you are executing SmartPulse from outside the base directory. If this is the case, edit line 11 of the settings.epf file like so:

/instance/de.uni_freiburg.informatik.ultimate.ltl2aut/Path\ to\ LTL*BA\ executable\ (LTL2BA,\ LTL3BA)=/path/to/executable/ltl2ba

smartpulsetool's People

Contributors

nicholaswong112 avatar stephensj2 avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.