Skip to content

Blockchain-Oracle/rugguard

Repository files navigation

Project RUGGUARD

Node.js 18.x TypeScript 5.x

Project RUGGUARD is dedicated to building tools that help users assess the trustworthiness of token projects on the Solana Network. This repository contains a Twitter bot that analyzes account information upon request.

Features

  • Monitors Twitter for mentions containing the trigger phrase @projectrugguard riddle me this
  • Analyzes the trustworthiness of accounts in two ways:
    • When replying to a tweet: analyzes the original tweet's author
    • When directly mentioned (not as a reply): analyzes the user who mentioned the bot
  • Provides a detailed report including:
    • Account age analysis
    • Follower/following ratio analysis
    • Bio content analysis
    • Engagement patterns analysis
    • Trusted connections verification
  • Posts the analysis as a reply to the triggering comment
  • Uses colorful, emoji-rich console logs for easy monitoring and debugging

Architecture

The project follows a clean, modular architecture:

src/
├── config/         # Configuration settings
├── controllers/    # Bot controller logic
├── models/         # Data models
├── services/       # Service implementations
└── utils/          # Utility functions

Key Components

  • TwitterClient: Handles interactions with the Twitter API
  • TrustedAccounts: Manages the list of trusted accounts for cross-verification
  • AccountAnalyzer: Performs the account trustworthiness analysis
  • BotController: Orchestrates the bot's monitoring and response functionality

Setup Instructions

Prerequisites

  • Node.js 18.x or higher
  • npm, yarn, or pnpm
  • Twitter developer account
  • Twitter username and password

Installation

  1. Clone the repository:

    git clone https://github.com/Blockchain-Oracle/rugguard.git
    cd rugguard
  2. Install dependencies:

    pnpm install
  3. Create an environment file:

    cp .env.example .env
  4. Edit the .env file with your Twitter credentials:

    TWITTER_USERNAME=your_twitter_username
    TWITTER_PASSWORD=your_twitter_password
    TWITTER_EMAIL=your_twitter_email
    TWITTER_2FA_SECRET=your_2fa_secret_key
    
    # The following API keys are optional. The bot can function
    # without them, but they can provide more stable access.
    TWITTER_API_KEY=your_api_key
    TWITTER_API_KEY_SECRET=your_api_key_secret
    TWITTER_ACCESS_TOKEN=your_access_token
    TWITTER_ACCESS_TOKEN_SECRET=your_access_token_secret
    
  5. Build the project:

    pnpm build

Running the Bot

Start the bot in development mode:

pnpm dev

Start the bot in production mode:

pnpm start

Deploying to Replit

  1. Create a new Replit project from GitHub
  2. Set up environment variables in Replit's secrets tab
  3. In the Replit shell, run:
    pnpm install
    pnpm build
    pnpm start

Trusted Accounts

The bot verifies if the analyzed account is followed by trusted accounts from a predefined list. This list is loaded from trustedAccountList.json at startup.

An account is considered trustworthy if it's followed by at least 3 accounts from the trusted list.

Usage

There are two ways to use RUGGUARD:

1. Analyze the author of a tweet

To get a trustworthiness report for a specific Twitter user:

  1. Find a tweet from the user you want to analyze
  2. Reply to that tweet with the text @projectrugguard riddle me this
  3. The bot will reply with a comprehensive trustworthiness analysis of the original tweet's author

2. Analyze your own account

To get a trustworthiness report for your own account:

  1. Simply tweet or post @projectrugguard riddle me this (not as a reply to anyone)
  2. The bot will analyze your account and reply with a comprehensive trustworthiness report

Development

Adding New Analysis Features

To add new analysis criteria:

  1. Update the AccountAnalyzer class in src/services/analyzer.ts
  2. Add new metrics to the AnalysisResult interface
  3. Update the report generation in the generateReport method

Configuration Options

Configuration settings can be modified in src/config/config.ts.

License

This project is licensed under the ISC License.

Acknowledgments

  • Special thanks to the agent-twitter-client library for Twitter API integration
  • The list of trusted accounts is based on community-vetted sources in the Solana ecosystem

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published