README
solidity-abi-graphs
Turn Solidity compiler artifacts (from e.g. Truffle) into graph objects.
Uses graphlib
under the hood to make use of their lovely algorithms.
Currently parses functions (including the constructor) and their inputs/outputs from a single a contract. Ignores events and fallbacks.
Installation
npm install solidity-abi-graphs
Usage
import { ContractGraph } from 'solidity-abi-graphs'
// ...
const graph = new ContractGraph(artifact, options)
API
ContractGraph
See src/ContractGraph.js
for complete API.
constructor(artifact, options)
artifact
: a compiled Solidity contract artifact, e.g. fromtruffle
options
: an object with the following properties (defaults bold)constructorOnly
:true
if you only need constructor nodes,false
otherwisegraphlib
:true
if you want to maintain a graphlib representation,false
otherwiseid
: some truthy string if you want a custom id, otherwisenull
to use default (uuid/v4
)