/SolidityPreprocessor

Pre-process solidity code.

Primary LanguageTypeScriptGNU General Public License v3.0GPL-3.0

SolidityPreprocessor

The SolidityPreprocessor generates a JSON summary of a Solidity contract that is used by Vanguard.

Requirements

The SolidityPreprocessor has the following requirements:

  • Typescript (Version 4.6.3)
  • Node.js (Version 17.8.0)
  • solc-typed-ast (install with command: npm install --save solc-typed-ast not npm install -g solc-typed-ast)

Build

Run tsc from src/ directory.

Usage

To generate a summary, run the following command:

node preprocess.js <PATH_TO_SOL_CONTRACT>

where preprocess.js is a javascript file generated by the call to tsc, which will be in the src/ directory and <PATH_TO_CONTRACT> is the path to the contract for which you would like a summary. This will print the JSON summary to STDOUT, which you can easily redirect to a file using this command:

node preprocess.js <PATH_TO_SOL_CONTRACT> > <SUMMARY_PATH>