Code Monkey home page Code Monkey logo

hevm's Introduction

hevm Build Status GitHub (pre-)release

The hevm project is an implementation of the Ethereum virtual machine (EVM) made specifically for unit testing and debugging smart contracts. It is developed by DappHub and integrates especially well with the dapp tool suite. The hevm command line program can run unit tests, interactively debug contracts while showing the Solidity source, or run arbitrary EVM code.

This is not yet a complete EVM. For example, the precompiled contracts are missing. We do well on Ethereum's VMTests suite (see hevm v0.11.1 test report) but we can't guarantee exact consensus conformance. The precompiled contracts are entirely missing for now, and we're in the process of implementing the Metropolis EIPs.

asciicast

Usage

Note: the hevm test runner and debugger currently assumes the use of the ds-test framework for Solidity unit tests and the dapp tool suite.

After running dapp build, you can run your unit test suite with

$ hevm dapp-test

or you can enter the interactive debugger using

$ hevm interactive

Debugger key bindings

  • Esc: exit debugger
  • n: step by one instruction
  • p: step backwards by one instruction
  • N: step to the next source position
  • C-n: step to the next source position and don't enter CALL or CREATE

Installing

Nix

DappHub maintains a repository for the Nix package manager, which works on any Linux distribution, OS X, and other Unix-likes.

These commands will install Nix, add the DappHub "channel", and install hevm. The channel has cached binaries for Linux and OS X.

$ curl https://nixos.org/nix/install | sh
$ nix-channel --add https://nix.dapphub.com/pkgs/dapphub
$ nix-channel --update
$ nix-env -iA dapphub.hevm

This Nix channel can also be used to install dapp, our development tool:

$ nix-env -iA dapphub.dapp

Static binary

If you don't want to compile anything, and you're on x86-64 Linux, you can download a static binary from the "Releases" tab on GitHub. If the static binary complains about a "terminfo" file, you have to set the TERMINFO environment variable; on Ubuntu, you should do

$ export TERMINFO=/lib/terminfo

(Put that in your ~/.bashrc for convenience.)

Building with Stack or Cabal

If you can't or won't use Nix, the easiest way especially if you don't have GHC (the Haskell compiler) installed already, is to use Stack, which can take care of installing GHC for you. These commands should work:

$ curl -sSL https://get.haskellstack.org/ | sh
$ git clone https://github.com/dapphub/hevm
$ cd hevm && stack setup && stack install

If you prefer to use your own installation of GHC and the basic Haskell package manager, Cabal, simply run:

$ git clone https://github.com/dapphub/hevm
$ cd hevm && cabal configure && cabal install

Contact

You can find us in the DappHub chat at https://dapphub.chat/, especially the #dev channel.

hevm's People

Contributors

dbrock avatar mbrock avatar rainbreak avatar

Watchers

 avatar  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.