Inspiration

Debugging solidity sucks. The feedback loop is very slow. Let's make that better.

What it does

You can now put debug statements in your Solidity code, and drop down into a read-only REPL for much quicker, iterative development!

How it works

Monkey-patches the EVM (ethereumjs-vm) with a new op-code that emits debug events with EVM metadata. ganache-core was patched as well (part of the truffle framework suite) to interact with the EVM, parse it, and allow for a read-only REPL.

What's next

If this project is v0, then:

  • v1 is better bindings and integrations with truffle, and get these PRs merged into their corresponding open source projects if possible. Possible get a keyword merged into solidity for debug statements - right now, I am grepping for a specific assembly string, which gets my debug opcode appended to it. Also, this does not let you view local variables unfortunately, only fields via smart contract calls. I can, in the future, use knowledge of the memory layout (https://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage) to map them to local variables.
  • v2 is a REPL that allows for evaluation and modification of the runtime, which is really hard and could take much more time than v1.
  • v3 is to get this working for not just local testnet via ganache, but other testnets like rinkeby, and not just via ganache. That might just be impossible based on the both difficulty and the philosophy of Ethereum to be decentralized, because this targets live debugging capabilities on only one of the EVMs.

Built With

Share this project:
×

Updates