iamdefinitelyahuman / opview

Solidity opcode viewer - archived, use https://github.com/HyperLink-Technology/brownie

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

opview

Solidity opcode viewer and unit test coverage visualizer for Brownie projects.

Opview as a standalone program has been deprecated. It is available directly from Brownie with the command brownie gui. This repo has been archived.

Dependencies

Installation

Ubuntu and OSX

curl https://raw.githubusercontent.com/HyperLink-Technology/opview/master/opview-install.sh | sh

Quick Usage

In the root folder of your brownie project, type:

opview

This opens the opview GUI. Next, select a contract from the dropdown in the upper right.

opview in action

Basic functionality is as follows:

  • Selecting an opcode will highlight the associated source code.
  • Highlighting a section of the source will jump to the most relevent opcode, if possible.
  • Opcodes with a darkened background have no associated source code.
  • Type a pc number to jump to that opcode.
  • Right click an opcode to toggle highlighting on all opcodes of the same type.
  • Press J to toggle highlighting on JUMP, JUMPI and JUMPDEST opcodes.
  • Press R to toggle highlighting on all REVERT opcodes.
  • Select a section of source code and press S to enter scope mode. The instructions will be filtered to only display opcodes related to the relevent code. Press A to disable and see all opcodes again.

Press C to toggle unit test coverage visualization. This will only work if you have already run brownie coverage on your project. The coverage results are shown via different colors of text highlight

opview coverage visualization

  • Green - executed fully
  • Yellow - conditional statement that only evaluated True
  • Orange - conditional statement that only evaluated False
  • Red - did not execute

Brownie's test coverage evaluation is still under development. There may be undiscovered issues, particularly cases where conditional True/False evaluation is incorrect. Use common sense when viewing coverage reports and please report any issues you encounter.

Development

This project is still in development and should be considered an early beta. Comments, questions, criticisms and pull requests are welcomed.

License

This project is licensed under the MIT license.

About

Solidity opcode viewer - archived, use https://github.com/HyperLink-Technology/brownie

License:MIT License


Languages

Language:Python 96.6%Language:Shell 3.4%