slither icon indicating copy to clipboard operation
slither copied to clipboard

slither-constellation / slither-composability: create a mapping of connected contracts

Open montyly opened this issue 3 years ago • 1 comments

We can extend what we did with slither-read-storage to create a graph of contracts that are connected to each others:

  • From an address, fetch the source code, detect all the address/ contract
  • Read the addresses onchain, and fetch the new source code
  • Iterate, and create a graph

We might need to limit the iteration in case the graph is becoming too large. We could also have different types of edges (to highlight the type of calls, transfer of funds, etc..).

We might need some heuristics, or user configuration, for array/mapping, in case there are too many elements to check.

montyly avatar Aug 17 '22 15:08 montyly

A test contract full of abundance for one-level deeper (also grabbing & iterating on addresses in storage) is UniswapV2Factory.

If you'd like to experiment with reading mappings w/o replaying historical txs or relying on event gathering to find mapping keys, using a tool like erigon-db to walk_storage() can provide results for you.

plotchy avatar Aug 17 '22 16:08 plotchy