ast-functions
v1.0.1
Published
Split apart an AST to extract contents
Downloads
13
Readme
AST Functions
This is a simple collection of utilities intended to read in the properties found in an AST as generated by a Solidity compiler.
There are times when the definitions provided by the ABI are too limited, specifically that it doesn't contain the struct or enum definitions because they're not considered part of the interface.
Usage
Usage will typically be to import either loadAll or specific functions.
const { loadAll } = require('ast-functions');
const astObject = loadAll(astFromWherever);Output
This will create an object that contains an array of the input parameters (name and type), output parameters (name and type) and the stateMutability. The latter includes whether it's public, payable, etc.
