diff --git a/audit/config.go b/audit/config.go index be331494..2d76d6e8 100644 --- a/audit/config.go +++ b/audit/config.go @@ -7,9 +7,13 @@ import ( // allowedArgs defines a list of allowed arguments for slither. var allowedArgs = map[string]bool{ - "--json": true, - "-": true, - "--codex": true, + "--json": true, + "-": true, + "--codex": true, + "--solc-disable-warnings": true, + "--ignore-compile": true, + "--fail-none": true, + "--buidler-ignore-compile": true, } // requiredArgs defines a list of required arguments for slither. @@ -34,7 +38,7 @@ func NewDefaultConfig(tempDir string) (*Config, error) { toReturn := &Config{ tempDir: tempDir, Arguments: []string{ - "--json", "-", // Output to stdout. + "--ignore-compile", "--buidler-ignore-compile", "--fail-none", "--solc-disable-warnings", "--json", "-", // Output to stdout. }, } diff --git a/sources.go b/sources.go index 27f41680..a5e29086 100644 --- a/sources.go +++ b/sources.go @@ -281,6 +281,7 @@ func (s *Sources) WriteToDir(path string) error { // Write each SourceUnit's content to a file in the specified directory for _, sourceUnit := range s.SourceUnits { content := simplifyImportPaths(sourceUnit.Content) + filePath := filepath.Join(path, sourceUnit.Name+".sol") if err := utils.WriteToFile(filePath, []byte(content)); err != nil { return fmt.Errorf("failed to write source unit %s to file: %v", sourceUnit.Name, err) @@ -403,17 +404,13 @@ func (s *Sources) SortContracts() error { for _, sourceUnit := range s.SourceUnits { imports := extractImports(sourceUnit.Content) var dependencies []string - //fmt.Println("Unit name ->", sourceUnit.Name) for _, imp := range imports { baseName := filepath.Base(imp) - //fmt.Println("Unit name ->", sourceUnit.Name, "Basename -> ", baseName, "Contract Name ->", strings.TrimSuffix(baseName, ".sol")) dependencies = append(dependencies, strings.TrimSuffix(baseName, ".sol")) } nodes = append(nodes, Node{Name: sourceUnit.Name, Dependencies: dependencies}) } - //spew.Dump(nodes) - sortedNames, err := topologicalSort(nodes) if err != nil { return err @@ -426,10 +423,6 @@ func (s *Sources) SortContracts() error { } } - //for _, unit := range sortedSourceUnits { - // fmt.Println(unit.Name) - //} - s.SourceUnits = sortedSourceUnits return nil }