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.
curl https://raw.githubusercontent.com/HyperLink-Technology/opview/master/opview-install.sh | sh
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.
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 onJUMP
,JUMPI
andJUMPDEST
opcodes. - Press
R
to toggle highlighting on allREVERT
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. PressA
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
- 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.
This project is still in development and should be considered an early beta. Comments, questions, criticisms and pull requests are welcomed.
This project is licensed under the MIT license.