refactor: move all remaining files to orig/ directory
Completed clean root directory structure: - Root now contains only: .git, .env, docs/, orig/ - Moved all remaining files and directories to orig/: - Config files (.claude, .dockerignore, .drone.yml, etc.) - All .env variants (except active .env) - Git config (.gitconfig, .github, .gitignore, etc.) - Tool configs (.golangci.yml, .revive.toml, etc.) - Documentation (*.md files, @prompts) - Build files (Dockerfiles, Makefile, go.mod, go.sum) - Docker compose files - All source directories (scripts, tests, tools, etc.) - Runtime directories (logs, monitoring, reports) - Dependency files (node_modules, lib, cache) - Special files (--delete) - Removed empty runtime directories (bin/, data/) V2 structure is now clean: - docs/planning/ - V2 planning documents - orig/ - Complete V1 codebase preserved - .env - Active environment config (not in git) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
65
orig/tools/exchange-audit/main.go
Normal file
65
orig/tools/exchange-audit/main.go
Normal file
@@ -0,0 +1,65 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/fraktal/mev-beta/tools/exchange-audit/internal"
|
||||
)
|
||||
|
||||
func main() {
|
||||
var (
|
||||
exchanges = flag.String("exchanges", "uniswap_v2,uniswap_v3,curve,balancer", "Comma-separated list of exchanges to audit")
|
||||
network = flag.String("network", "arbitrum", "Network to audit (arbitrum, ethereum)")
|
||||
outputDir = flag.String("output", "reports/exchange-audit", "Output directory")
|
||||
verbose = flag.Bool("verbose", false, "Enable verbose output")
|
||||
deepCheck = flag.Bool("deep", false, "Perform deep integration checks")
|
||||
connectivity = flag.Bool("connectivity", true, "Check exchange connectivity")
|
||||
contracts = flag.Bool("contracts", true, "Validate contract addresses")
|
||||
apis = flag.Bool("apis", true, "Test API endpoints")
|
||||
integration = flag.Bool("integration", true, "Test integration completeness")
|
||||
timeout = flag.Duration("timeout", 5*time.Minute, "Timeout for audit operations")
|
||||
)
|
||||
flag.Parse()
|
||||
|
||||
// Create output directory
|
||||
if err := os.MkdirAll(*outputDir, 0755); err != nil {
|
||||
log.Fatalf("Failed to create output directory: %v", err)
|
||||
}
|
||||
|
||||
// Initialize exchange auditor
|
||||
auditor, err := internal.NewExchangeAuditor(&internal.ExchangeAuditConfig{
|
||||
Exchanges: *exchanges,
|
||||
Network: *network,
|
||||
OutputDir: *outputDir,
|
||||
Verbose: *verbose,
|
||||
DeepCheck: *deepCheck,
|
||||
CheckConnectivity: *connectivity,
|
||||
CheckContracts: *contracts,
|
||||
CheckAPIs: *apis,
|
||||
CheckIntegration: *integration,
|
||||
Timeout: *timeout,
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to initialize exchange auditor: %v", err)
|
||||
}
|
||||
|
||||
ctx := context.Background()
|
||||
ctx, cancel := context.WithTimeout(ctx, *timeout)
|
||||
defer cancel()
|
||||
|
||||
fmt.Printf("Starting exchange integration audit for %s network...\n", *network)
|
||||
if err := auditor.AuditExchanges(ctx); err != nil {
|
||||
log.Fatalf("Exchange audit failed: %v", err)
|
||||
}
|
||||
|
||||
if err := auditor.GenerateReport(); err != nil {
|
||||
log.Fatalf("Report generation failed: %v", err)
|
||||
}
|
||||
|
||||
fmt.Printf("Exchange audit complete. Reports saved to: %s\n", *outputDir)
|
||||
}
|
||||
Reference in New Issue
Block a user