Skip to content

Latest commit

 

History

History
48 lines (34 loc) · 1.22 KB

CONTRIBUTING.md

File metadata and controls

48 lines (34 loc) · 1.22 KB

Feel free to open PRs or open issues within this repository.

To add an issue to the analyzer, you have 2 choices:

  • use a detector based on a simple regex
  • use a detector based on the analysis of the Abstract Syntax Tree generated by the solc compiler

Regex-based detector:

Examples:

Following this type, just add a file in the issues/<X> folder:

type RegexIssue = {
  type: IssueTypes.GAS | IssueTypes.NC | IssueTypes.L | IssueTypes.M | IssueTypes.H,
  regex: RegExp,
  title: string,
  impact?: string,
  description?: string,
  regexOrAST: 'Regex',
};

AST-based detector:

Examples:

Following this type, just add a file in the issues/<X> folder:

type ASTIssue = {
  type: IssueTypes.GAS | IssueTypes.NC | IssueTypes.L | IssueTypes.M | IssueTypes.H,
  title: string,
  impact?: string,
  description?: string,
  detector: (files: InputType) => Instance[], // Function analyzing the AST and returning instances of the issue
  regexOrAST: 'AST',
};