Skip to content

AidenNabavi/SmartContract_Audit_Helper_Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Bot

πŸš€ Purpose of the Script

This Node.js script is designed for static analysis of Solidity smart contracts. It helps quickly identify potentially dangerous patterns in .sol files that are commonly associated with vulnerabilities.


πŸ” What It Detects

The script searches for well-known security red flags using regex patterns:

Pattern Why It’s Dangerous
fallback() / receive() Can lead to unintended Ether reception or behavior
.call() Prone to reentrancy attacks if not handled safely
.delegatecall() Executes code in the caller's context β€” very risky
selfdestruct() Destroys the contract, which can lead to fund loss
tx.origin Vulnerable to phishing-style attacks if used for auth
block.timestamp / block.number Can be manipulated for unsafe randomness or logic
blockhash() / block.difficulty Also misused for randomness β€” not secure

βš™οΈ How It Works

  1. Takes a directory or .sol file path as input from the command line.
  2. Recursively scans for .sol files inside the directory.
  3. Reads each file line by line and accumulates lines into a buffer until { is found (to detect multi-line patterns).
  4. If any dangerous pattern matches, it adds a ⚠️ warning to the line where the block starts.
  5. It saves the modified file so you can easily spot risk areas in your IDE.

πŸ‘¨β€πŸ’» Why It’s Useful for a Bug Hunter Like You

  • Fast scanning tool to help during initial audit stages.
  • Helps prioritize manual code review by highlighting high-risk areas.
  • Can be integrated into a larger automated auditing pipeline (CI/CD).
  • Saves time in bounty programs where quick bug spotting is crucial.

Hot to use?

node XXBOT.js File.sol

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published