midnight-extract-contract-structure
Extract and analyze Compact contract structure to detect syntax errors, deprecated patterns, and structural issues before generation.
Instructions
Extract and analyze Compact contract structure (circuits, witnesses, ledger). CRITICAL CHECKS: deprecated 'ledger { }' block syntax, 'Void' return type (should be []), old pragma format, unexported enums, deprecated Cell wrapper. Also detects: module-level const, stdlib name collisions, division operator, Counter.value access, missing disclose() calls, potential overflow. Use BEFORE generating contracts to catch syntax errors. Note: Static analysis only - catches common patterns but not semantic errors.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | The Compact contract source code to analyze (provide this OR filePath) | |
| filePath | No | Path to a .compact file to analyze (alternative to providing code directly) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| success | No | ||
| filename | No | ||
| languageVersion | No | ||
| imports | No | ||
| structure | No | ||
| exports | No | Names of all exported items | |
| stats | No | Counts of each type of definition | |
| potentialIssues | No | Common issues detected by static analysis | |
| summary | No | ||
| message | No |