Consensys / surya

A set of utilities for exploring Solidity contracts
Apache License 2.0
1.07k stars 118 forks source link

add feature ContractCalls callgraph #106

Closed tintinweb closed 4 years ago

tintinweb commented 5 years ago

this is basically a variant of surya graph that is useful for large codebases. It only shows contract-to-contract call to allow someone to quickly understand how the contracts are interacting together. edge color and weight denote how many calls there are from one to the other component (and therefore how tightly coupled they are).

this is a super hacky copy of surya graph and we might want to refactor this at some point. :)

legend (there's a dark and a bright theme):

surya-contract-calls surya-contract-calls-bright
tintinweb commented 5 years ago

we could also think about hiding calls to undefined contracts (often class attribs or because of safemath etc.) the remove some clutter

maurelian commented 5 years ago

It feels a bit immature, but maybe that's OK to move into develop. Here's my comments from using it on github.com/consensys/erc1400 (graph output below):

image

Also, I think the command list is getting too long and confusing. I think we should consider consolidating all the commands that output graphviz markup into graph, and adding an arg to specify which type of graph.

GNSPS commented 4 years ago

We should probably close this, right @tintinweb ?

tintinweb commented 4 years ago

oh yeah :)