Code Analysis
Searches verified contract source code using AI-generated regex patterns.Capabilities
- Search by natural language query
- Find functions, patterns, or behaviors
- Return filtered results or full code
Example Queries
Parameters
| Parameter | Required | Description |
|---|---|---|
query | Yes | What you’re searching for |
contractAddresses | Yes | Array of contract addresses to search |
includeProxies | No | Search proxy code instead of implementation (default: false) |
returnAllCode | No | Return all code without filtering (default: false) |
Usage Patterns
Finding Functions
Access Control
onlyOwner modifiers, role-based patterns, admin state variables
Security Patterns
Practical Examples
Example 1: Finding Fee Logic
You: “Show me how fees are calculated in the Uniswap V3 swap function” Result:Example 2: Checking for Dangerous Patterns
You: “Does this contract have any selfdestruct or delegatecall?” Result:Example 3: Understanding State Variables
You: “What are the main state variables in this contract?” Result:Full Code Retrieval
UsereturnAllCode: true to get complete source code for:
- Full code review
- Context around matches
- Cross-function patterns
Multi-Contract Search
Search across multiple contracts simultaneously:Tips
Common Search Queries
| What You Want | How to Ask |
|---|---|
| Admin functions | ”Find all functions with onlyOwner or admin access” |
| Token transfers | ”Show me functions that transfer or move tokens” |
| External calls | ”Find all external contract calls” |
| Events | ”What events does this contract emit?” |
| Modifiers | ”List all modifiers in this contract” |
| Constructor | ”Show me the constructor and initialization logic” |
| Upgrade logic | ”How does this contract handle upgrades?” |
Limitations
Combining with Other Tools
- Get overview first →
contractMetadataTool - Search specific code →
regexCodeAnalysisTool - Check how it’s used →
getLatestTransactionsTool
Next Steps
Contract Metadata
Get contract overview first
Version Diffs
Compare contract versions

