Skip to content

SolanaRemix/SmartContractAudit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

58 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

SmartContractAudit πŸ›‘οΈ

Experimental multi-chain smart contract auditing, monitoring, and automated repair framework with AI-powered detection and GitHub Actions integration.

Status: Prototype – Not Production-Ready

This project is currently a framework/skeleton. The core detection modules are implemented as placeholders and may return no (or only trivial) results. Do not rely on this project for real-world security audits or production decisions until the detection logic is fully implemented and thoroughly tested. License: MIT Node.js Version

🌟 Features

Multi-Chain Support

  • EVM Chains: Ethereum, BSC, Polygon, Avalanche, Arbitrum, Optimism, Fantom
  • Solana: Full Solana program analysis support
  • Extensible architecture for adding new chains

Advanced Detection Modules

🦠 Antivirus Scanner

  • Bytecode pattern analysis
  • Source code vulnerability detection
  • Known exploit signature matching
  • Risk scoring algorithm

Detects:

  • Reentrancy attacks
  • Integer overflow/underflow
  • Unchecked external calls
  • tx.origin authentication
  • Unsafe delegatecall
  • Unprotected selfdestruct
  • Public mint functions

🚫 Spam Detector

  • Contract age analysis
  • Deployment frequency monitoring
  • Airdrop pattern recognition
  • Code similarity detection

🍯 Honeypot Detector

  • Transfer simulation testing
  • Fee structure analysis
  • Hidden function detection
  • Blacklist mechanism identification
  • Ownership manipulation checks

πŸ” Wallet Tracer

  • Recursive deposit tracing
  • Fund flow visualization
  • Deep wallet activity analysis
  • Transaction graph generation
  • Risk factor identification

Automation & CI/CD

GitHub Actions Workflows

  1. Auditor Bot: Continuous monitoring (runs every 6 hours)
  2. Auto-Repair: Automatic vulnerability fixing via PR
  3. PR Security Audit: Automated security checks on pull requests
  4. Deep Scan: Comprehensive weekly scans

Notification System

  • Email alerts
  • Slack integration
  • Telegram bot
  • Discord webhooks
  • Custom webhook support

πŸ“¦ Installation

# Clone the repository
git clone https://github.com/SolanaRemix/SmartContractAudit.git
cd SmartContractAudit

# Install dependencies
npm install

# Copy environment template
cp .env.example .env

# Edit .env with your API keys and RPC endpoints
nano .env

πŸš€ Quick Start

Scan a Contract

# Basic scan
npm run scan -- --address 0x1234567890123456789012345678901234567890 --chain ethereum

# Scan with specific modules
npm run scan -- --address 0x1234... --chain bsc --modules antivirus,honeypot

# Batch scan from file
npm run scan -- --file addresses.txt --chain polygon

Check for Honeypot

node script/scan.js --address 0x1234... --chain bsc --modules honeypot

Trace Wallet Deposits

node script/scan.js --address 0x1234... --chain ethereum --modules tracer --depth 10

Full Comprehensive Scan

node script/scan.js --address 0x1234... --chain ethereum --modules antivirus,spam,honeypot,tracer

πŸ“š Documentation

πŸ—οΈ Project Structure

SmartContractAudit/
β”œβ”€β”€ auditor/              # Core auditing modules
β”‚   β”œβ”€β”€ antivirus/       # Vulnerability scanner
β”‚   β”œβ”€β”€ spam/            # Spam detector
β”‚   β”œβ”€β”€ honeypot/        # Honeypot detector
β”‚   β”œβ”€β”€ tracer/          # Wallet tracer
β”‚   β”œβ”€β”€ scanner/         # Deep scanner orchestrator
β”‚   └── index.js         # Main auditor entry point
β”œβ”€β”€ contracts/           # Example smart contracts
β”‚   β”œβ”€β”€ ethereum/        # EVM contracts
β”‚   └── solana/          # Solana programs
β”œβ”€β”€ script/              # Automation scripts
β”‚   β”œβ”€β”€ scan.js          # Main scanning script
β”‚   β”œβ”€β”€ notify.js        # Notification handler
β”‚   └── repair.js        # Auto-repair engine
β”œβ”€β”€ config/              # Configuration files
β”‚   β”œβ”€β”€ chains.json      # Chain configurations
β”‚   β”œβ”€β”€ scanner.json     # Scanner settings
β”‚   β”œβ”€β”€ notifications.json
β”‚   └── repair.json
β”œβ”€β”€ .github/workflows/   # GitHub Actions
β”œβ”€β”€ docs/                # Documentation
└── reports/             # Scan reports

βš™οΈ Configuration

Chain Configuration (config/chains.json)

Add your RPC endpoints and API keys:

{
  "ethereum": {
    "rpc": "https://mainnet.infura.io/v3/YOUR_KEY",
    "apiKey": "YOUR_ETHERSCAN_KEY"
  }
}

Scanner Configuration (config/scanner.json)

Customize detection thresholds:

{
  "antivirus": {
    "threshold": 70,
    "patterns": ["reentrancy", "overflow", ...]
  }
}

See Configuration Guide for complete options.

πŸ€– GitHub Actions Setup

1. Add Repository Secrets

Go to Settings β†’ Secrets β†’ Actions and add:

ETHEREUM_RPC_URL
BSC_RPC_URL
POLYGON_RPC_URL
SOLANA_RPC_URL
ETHERSCAN_API_KEY
BSCSCAN_API_KEY
SLACK_WEBHOOK
NOTIFICATION_WEBHOOK

2. Enable Workflows

Workflows are located in .github/workflows/:

  • auditor-bot.yml - Continuous monitoring
  • auto-repair.yml - Automated fixes
  • pr-audit.yml - PR security checks
  • deep-scan.yml - Weekly comprehensive scans

3. Configure Monitoring

Create config/monitored-addresses.txt with addresses to monitor (one per line).

πŸ“Š Reports

All scan results are saved in the reports/ directory:

  • reports/json/ - JSON format reports
  • reports/latest.json - Most recent scan
  • Uploaded as GitHub Actions artifacts

πŸ”§ Development

Adding a New Detection Module

  1. Create module directory: auditor/mymodule/
  2. Implement scanner class with scan() method
  3. Register in auditor/index.js
  4. Add configuration to config/scanner.json
  5. Add tests

Adding Chain Support

  1. Add chain config to config/chains.json
  2. Create connector if needed
  3. Update documentation

See Development Guide for details.

πŸ§ͺ Testing

# Run all tests
npm test

# Run specific module tests
npm test -- auditor/antivirus

# With coverage
npm run test:coverage

πŸ” Security

This tool is designed to detect security vulnerabilities, not exploit them. Always use responsibly and ethically.

  • Report security issues privately
  • Do not use for malicious purposes
  • Respect rate limits and terms of service
  • Keep API keys and secrets secure

πŸ“ License

MIT License - see LICENSE file for details.

🀝 Contributing

Contributions are welcome! Please read CONTRIBUTING.md for guidelines.

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Open a Pull Request

πŸ“ž Support

🌟 Star History

If you find this project useful, please consider giving it a star! ⭐

πŸ™ Acknowledgments

  • OpenZeppelin for security best practices
  • The Ethereum security community
  • All contributors and supporters

⚠️ Disclaimer: This tool is provided as-is for educational and security research purposes. Users are responsible for complying with all applicable laws and regulations. The authors assume no liability for misuse.

Made with ❀️ by the SmartContractAudit Team

About

Audis files contracts Antivirus on chain automation Ai workers

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

 
 
 

Contributors