remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
remix-project/libs/remix-analyzer
aniket-engg eb126729f7 publish libs 1 year ago
..
src fix other targets 1 year ago
test fix other targets 1 year ago
.eslintrc # This is a combination of 50 commits. 2 years ago
.npmignore moved libs into libs dir 4 years ago
README.md fix typos 1 year ago
package.json publish libs 1 year ago
project.json update project.json 2 years ago
tsconfig.json Setup tsconfig.base.json 3 years ago
tsconfig.lib.json updates for analyzer 4 years ago

README.md

Remix Analyzer

npm version npm npm GitHub contributions welcome

@remix-project/remix-analyzer is a tool to perform static analysis on Solidity smart contracts to check security vulnerabilities and bad development practices. It works underneath Remix IDE "SOLIDITY STATIC ANALYSIS" plugin which is used to run analysis for a compiled contract according to selected modules.

Installation

@remix-project/remix-analyzer is an NPM package and can be installed using NPM as:

yarn add @remix-project/remix-analyzer

How to use

@remix-project/remix-analyzer exports below interface:

import { CompilationResult, AnalyzerModule, AnalysisReport } from 'types';
declare type ModuleObj = {
    name: string;
    mod: AnalyzerModule;
};
export default class staticAnalysisRunner {
    /**
     * Run analysis (Used by IDE)
     * @param compilationResult contract compilation result
     * @param toRun module indexes (compiled from remix IDE)
     * @param callback callback
     */
    run(compilationResult: CompilationResult, toRun: number[], callback: ((reports: AnalysisReport[]) => void)): void;
    
    /**
     * Run analysis passing list of modules to run
     * @param compilationResult contract compilation result
     * @param modules analysis module
     * @param callback callback
     */
    runWithModuleList(compilationResult: CompilationResult, modules: ModuleObj[], callback: ((reports: AnalysisReport[]) => void)): void;
    
    /**
     * Get list of all analysis modules
     */
    modules(): any[];
}

One can import the module and use the available methods to run analysis. Related type descriptions can be seen here.

Details of modules are explained in official remix-ide documentation.

Contribute

Please feel free to open an issue or a pull request.

In case you want to add some code, do have a look at our contribution guidelines here. Reach us on Gitter in case of any queries.

License

MIT © 2018-21 Remix Team