@@ -645,7 +645,7 @@ def scan_contract(contract_address: str, workspace_override: str = None) -> None
645645 if solana_scanner .is_solana :
646646 _log ("INFO" , "Solana/Rust project detected! Routing to Solana Scanner engine..." )
647647 sol_res = solana_scanner .scan ()
648- sys .stdout .write (json .dumps (sol_res ) + "\\ n" )
648+ sys .stdout .write (json .dumps (sol_res ) + "\n " )
649649 sys .stdout .flush ()
650650 return
651651 except Exception as e :
@@ -878,29 +878,33 @@ def scan_contract(contract_address: str, workspace_override: str = None) -> None
878878
879879 # Heuristic findings
880880 for finding in heuristic_findings :
881- if finding .severity in ["Critical" , "High" ] and finding .line_number > 0 and posted_comments < 15 :
882- body = f"**[{ finding .severity } ] { finding .title } **\\ n{ finding .description } "
883- commenter .post_inline_comment (finding .file_path , finding .line_number , body )
881+ sev_str = finding .severity .value if hasattr (finding .severity , 'value' ) else str (finding .severity )
882+ if sev_str in ["Critical" , "High" ] and finding .line_number > 0 and posted_comments < 15 :
883+ body = f"**[{ sev_str } ] { finding .name } **\n { finding .description } "
884+ commenter .post_inline_comment (finding .filepath , finding .line_number , body )
884885 posted_comments += 1
885886
886887 # Slither findings
887888 for sf in slither_raw :
888- if sf .mapped_severity in ["Critical" , "High" ] and sf .lines and posted_comments < 15 :
889- # Use the first line of the first element
890- line_no = sf .lines [0 ]
889+ sev = getattr (sf , 'mapped_severity' , getattr (sf , 'severity' , 'Low' ))
890+ lines = getattr (sf , 'lines' , [])
891+ if sev in ["Critical" , "High" ] and lines and posted_comments < 15 :
892+ line_no = lines [0 ]
891893 if line_no > 0 :
892- body = f"**[{ sf .mapped_severity } ] { sf .check_name } **\\ n{ sf .description } "
893- # Slither file path is usually relative
894- commenter .post_inline_comment (sf .file_path , line_no , body )
894+ check = getattr (sf , 'check_name' , getattr (sf , 'check' , 'Unknown' ))
895+ desc = getattr (sf , 'description' , '' )
896+ fpath = getattr (sf , 'file_path' , getattr (sf , 'filename' , '' ))
897+ body = f"**[{ sev } ] { check } **\n { desc } "
898+ commenter .post_inline_comment (fpath , line_no , body )
895899 posted_comments += 1
896900
897901 # General summary comment
898902 if total_findings > 0 :
899- summary_body = f"The Web3 AI Scanner found **{ total_findings } ** issues.\\ n"
900- summary_body += f"- Critical: { merged_counts .get ('Critical' , 0 )} \\ n"
901- summary_body += f"- High: { merged_counts .get ('High' , 0 )} \\ n"
903+ summary_body = f"The Web3 AI Scanner found **{ total_findings } ** issues.\n "
904+ summary_body += f"- Critical: { merged_counts .get ('Critical' , 0 )} \n "
905+ summary_body += f"- High: { merged_counts .get ('High' , 0 )} \n "
902906 if not has_pro :
903- summary_body += "\\ n🔒 **Unlock AI False-Positive Suppression & Gas Optimizer** by sending 50 USDC to `0x9758AdAe878bD4EA0d0aa24408c56D7d4aEC29a5`."
907+ summary_body += "\n 🔒 **Unlock AI False-Positive Suppression & Gas Optimizer** by sending 50 USDC to `0x9758AdAe878bD4EA0d0aa24408c56D7d4aEC29a5`."
904908 commenter .post_general_comment (summary_body )
905909
906910 except Exception as e :
0 commit comments