πWake Framework as engine for AI
The Wake Framework serves as the foundation for Wakehacker's AI capabilities, providing comprehensive smart contract analysis through multiple approaches:
Core Capabilities
Testing Framework: Python-based testing environment with fast execution (Testing Framework Overview)
Static Analysis: Vulnerability detection with focus on minimizing false positives (Built-in Detectors)
Fuzzing Framework: Advanced testing methodology including Manually Guided Fuzzing (Fuzzing Documentation, Manually Guided Fuzzing)
Internal Representation (IR)
Wake's IR model provides deep understanding of smart contracts (Working with IR):
Complete control flow graph (CFG) analysis
Data dependency graph (DDG) tracking
Cross-contract relationships
Storage layout verification (Storage Layout Printer)
Function call hierarchies (Control Flow Graph)
Precision-First Approach
Wake prioritizes precision over recall in its analysis:
Condition-based detection rather than heuristics
Minimizes false positives through precise pattern matching
Provides detailed context for each detection
Enables efficient verification of findings
Measured Performance
Recent experiments comparing Wake's write-after-write detector with Slither (a widely-used heuristic-based analyzer) demonstrate its precision across two controlled studies:
Study 1: Controlled Test Suite Analysis of 34 purpose-built smart contracts containing both simple and edge cases:
Precision
100%
86.36%
Recall
76.19%
33.33%
F1-Score
86.59%
50%
Study 2: Production Contracts Analysis of 50 randomly selected smart contracts from a dataset of 9,388 production contracts:
Precision
100%
86.36%
Recall
94.74%
50%
F1-Score
97.29%
63.33%
These results demonstrate Wake's detection capabilities through its condition-based approach rather than heuristic methods, particularly in minimizing false positives while maintaining high recall rates. While these measurements focus on a single detector type, they illustrate the framework's potential when precise condition-based analysis is applied rather than heuristic approaches like those used in Slither.
These findings were presented at the 2024 TUM Blockchain Conference "Ethereum Vulnerability Detectors".
AI Integration
Wake's architecture enables AI enhancements through:
Structured IR data perfect for LLM consumption
Context-aware output slicing
Relationship mapping for complex analysis
By providing exact information in the right context, Wake enables AI models to:
Understand complex contract relationships
Provide extended vulnerability descriptions
Explain potential impact and remediation
Verify mathematical calculations
Reduce false positive detections
Last updated