Skip to content

node-real/bscexorcist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BSC Exorcist 🛡️

Go Reference License: MIT

Lightweight Go SDK for detecting sandwich attacks in BSC transaction bundles

🎯 Purpose

BSC Exorcist provides a simple and efficient way to detect sandwich attack patterns in transaction bundles. This SDK is required for builders submitting bids to 48Club validators, ensuring MEV protection and fair transaction ordering.

Contributions welcome! Help us improve functionality or add support for more protocols.

⚡ Quick Start

Installation

go get github.com/48Club/bscexorcist

Basic Usage

import "github.com/48Club/bscexorcist"

// Detect sandwich attacks in transaction bundle
err := bscexorcist.DetectSandwichForBundle(transactionsLogs)
if err != nil {
// Sandwich attack detected - handle accordingly
log.Printf("Attack detected: %v", err)
}

🔍 How It Works

The SDK analyzes DEX swap patterns across transaction bundles to identify sandwich attacks:

Bundle Structure:
┌─────────────┐
│   TX 1: Buy │  ← Attacker front-runs
├─────────────┤
│   TX 2: Buy │  ← Victim transaction
├─────────────┤
│  TX 3: Sell │  ← Attacker back-runs
└─────────────┘

Detection Patterns

  • Buy-Buy-Sell: Front-run and back-run pattern
  • Sell-Sell-Buy: Reverse sandwich pattern

📋 Requirements

  • Go 1.21 or higher
  • Minimum 3 transactions per bundle
  • Transaction logs, separated by each transaction in the bundle

🏗️ For Builders

Integration with 48Club Validators

Builders MUST implement sandwich detection before submitting bids:

📊 Supported Protocols

Protocol Status Event Signatures
Uniswap V2 ✅ Supported 0xd78ad95f... 0x606ecd02...
Uniswap V3 ✅ Supported 0xc42079f9... 0x19b47279...
Uniswap V4 ✅ Supported 0x40e9cecb...
PancakeSwap V2 ✅ Supported Compatible
PancakeSwap V3 ✅ Supported Compatible
PancakeSwap V4 ✅ Supported 0x04206ad2... 0x3e8aae37...
DODOSwap ✅ Supported 0xc2c0245e...
FourMeme ✅ Supported 0x7db52723... 0x0a5575b3...

🔗 Resources


Built with ❤️ for the BSC ecosystem

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages