Tool
Surya
Last updated:
October 7, 2021

Surya is a visual inspection tool created by ConsenSys Diligence. It is written in JavaScript and provides security-oriented contract visualization tools. Its most popular features are the control flow graphs, function call tracing, describe tool that provides a report of all modifiers on each function and inheritance graphs.

Graph of smart contracts
Surya in Solidity Visual Developer (source: Surya GitHub)
### How to use Surya (Mac) Surya can directly be used from the console. In order to use its visualization capabilities, you will also have to download graphviz.

-- CODE language-bash -- # Install graphviz (Homebrew), this can take 5-10 minutes brew install graphviz # Install surya npm install -g surya # Create a graph of control flow surya graph contracts/**/*.sol | dot -Tpng > MyContract.png # Run tracing surya ftrace APMRegistry::_newRepo all MyContract.sol # Generate an inheritance graph surya inheritance MyContract.sol | dot -Tpng > MyContract.png # Create a markdown report of all modifiers surya mdreport report_outfile.md MyContract.sol # ...alternatively, describe can be run directly surya describe *.sol

For more precise instructions and previews of outputs, please refer to the [GitHub repository](https://github.com/ConsenSys/surya).

See Also: