Wake Framework as engine for AI
Last updated
Last updated
The Wake Framework serves as the foundation for Wakehacker's AI capabilities, providing comprehensive smart contract analysis through multiple approaches:
Testing Framework: Python-based testing environment with fast execution ()
Static Analysis: Vulnerability detection with focus on minimizing false positives ()
Fuzzing Framework: Advanced testing methodology including Manually Guided Fuzzing (, )
Wake's IR model provides deep understanding of smart contracts ():
Complete control flow graph (CFG) analysis
Data dependency graph (DDG) tracking
Cross-contract relationships
Storage layout verification ()
Function call hierarchies ()
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
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.
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
These findings were presented at the 2024 TUM Blockchain Conference .