Code Monkey home page Code Monkey logo

hevm's Introduction

hevm's People

Contributors

apmilen avatar dbrock avatar mbrock avatar rainbreak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hevm's Issues

RPC: improve visual feedback in TTY

Need slight refactoring of blocking I/O interacting with the event
handler stuff.

We would like to have at least a status showing while downloading is
in progress, maybe a modal popup.

It might even be worth it to make a Y/N dialog box query.

TTY: command console

In order to do more easily do interesting things in the debugger, we
should have a console that pops up on Enter and lets you inspect and
manipulate the state of the VM and the environment.

Basic commands:

[ ] list known contract addresses
[ ] see contract details
[ ] get storage slot

Coverage analysis (also gas profiling)

See sc-forks/solidity-coverage#41 (comment)

Some small modifications to hevm should let us do precise coverage analysis of unit test suites.

Implementation thoughts...

  • In the Stepper interpreter defined in UnitTest, after each instruction we would save the current code position (e.g., code hash and program counter).
  • After completion, we would generate a coverage report by mapping all the code positions to source maps.
  • If we also output the number of times a position was touched, along with gas cost, this would also be a way to do gas profiling.

Convenience features for Git state store

We should be able to create repositories when they don't exist, and also to automatically reset --hard the working tree if there are no conflicts with local changes.

The gitlib-cmdline library can do these things, but maybe we should just shell out in a trivial way.

Creating a contract with .value() in the ds-test framework does not update balance

Running into an interesting issue when creating contracts with the .value() function when using DSTest.

I'd like to seed contracts with ether using the value field of the transaction, so I can limit payments to just the constructor, but checking the contract balance post-creation still shows a zero balance. transfer() of course works when I add a payable fallback, but I'd prefer to not have a payable fallback to avoid unintended ether transfers.

I made a test repo here https://github.com/ngmiller/dapp-value-test - with the relevant code here: https://github.com/ngmiller/dapp-value-test/blob/master/src/DappValueTest.t.sol#L11-L14

Results of dapp test:

+ dapp clean
+ rm -rf out
+ solc --overwrite ds-test/=lib/ds-test/src/ ds-test=lib/ds-test/src/index.sol --abi --bin --bin-runtime = -o out/ src/DappValueTest.t.sol
+ solc --overwrite ds-test/=lib/ds-test/src/ ds-test=lib/ds-test/src/index.sol --combined-json=abi,bin,bin-runtime,srcmap,srcmap-runtime,ast = src/DappValueTest.t.sol
+ solc --overwrite ds-test/=lib/ds-test/src/ ds-test=lib/ds-test/src/index.sol --abi --bin --bin-runtime = -o out/ src/DappValueTest.sol
+ solc --overwrite ds-test/=lib/ds-test/src/ ds-test=lib/ds-test/src/index.sol --combined-json=abi,bin,bin-runtime,srcmap,srcmap-runtime,ast = src/DappValueTest.sol
Running 2 tests for src/DappValueTest.t.sol:DappValueTestTest
FAIL test_balance()
PASS test_value() (gas: 3390)

Failure: test_balance

  "Error: Wrong `uint' value"
    Expected: ~1.00000000e18
      Actual: 0

  src/DappValueTest.t.sol:DappValueTestTest
   ├╴constructor
   ├╴initialize test
   │  └╴create DappValueTest (src/DappValueTest.t.sol:11)
   └╴test_balance()
      ├╴log_bytes32("Error: Wrong `uint' value") (lib/ds-test/src/test.sol:112)
      ├╴log_named_uint("  Expected", 1000000000000000000) (lib/ds-test/src/test.sol:113)
      └╴log_named_uint("    Actual", 0) (lib/ds-test/src/test.sol:114)

Library support

Linking with Solidity libraries requires loading code at particular addresses known in advance, which is right now possible through the Git state directory feature, but it should be thought through and then support should be implemented in dapp.

Implement Homestead fee schedule for VMTests

Turns out that the VMTests part of the Ethereum Foundation test
suite is made for the Homestead fork.

I don't know if the plan is to upgrade those tests to Metropolis, or
deprecate that whole suite... it's a bit confusing.

Contract state fetching from live nodes or Etherscan

Now that we can load states, we could rather easily load that state over the network from an actual blockchain.

Some wreq requests and aeson fiddling should be enough for the fetching.

We should also be able to autofetch missing contracts and refresh. This would require turning the exec function into a kind of coroutine that supports fetching. We could then have different fetching behaviors, e.g. in the debugger we show a dialog asking about the fetch, etc.

Allow loading exec code from file

I'm using hsevm to test my own manually written assembly and copy-pasting the bytecode manually into cli is cumbersome. -o option to load the file directly instead of --code would be useful.

internal error from HasCallStack

This doesn't look helpful, but it's the only error message given.

FAIL test_transfer()

hevm: internal error: method type
CallStack (from HasCallStack):
  error, called at src/EVM/Solidity.hs:214:22 in hevm-0.12.3-F2xYvHyywk1C4HRq6dL7d:EVM.Solidity

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.