Overview
Add Solidity compilation support to Chop, enabling users to compile .sol files directly within the CLI.
Motivation
- Eliminate need for external Solidity tooling
- Streamline contract testing workflow
- Enable hot-reload development workflow
Features to Implement
1. Compiler Integration
- Integrate Guillotine's
foundry-wrapper (from primitives repo)
- Add
compile command for single-file compilation
- Support both inline source and file input
- Multiple output formats (JSON, hex, combined)
- Optimizer control and EVM version targeting
- Error/warning collection and display
2. Watch Mode
- Add
--watch flag to monitor .sol files
- Use
fsnotify for file system monitoring
- Auto-recompile on changes
- Auto-deploy on successful compilation
3. TUI Integration
- Add "Compiler" tab (8th tab) with:
- File selector for .sol files in current directory
- Compile button with progress indicator
- Display compilation errors/warnings
- Show generated bytecode and ABI
- "Deploy" button to deploy compiled contract
Implementation Notes
- Follow patterns from TEVM CLI (tevm-monorepo/cli/src/commands/compile.tsx)
- Follow patterns from Guillotine CLI (guillotine/apps/cli/commands/compile.go)
- Ensure thread-safe compilation when watch mode is active
Dependencies
foundry-wrapper from evmts/primitives
fsnotify for watch mode
Related
- Builds on server infrastructure from Phase 1
- May integrate with forking support for testing against mainnet state
Overview
Add Solidity compilation support to Chop, enabling users to compile .sol files directly within the CLI.
Motivation
Features to Implement
1. Compiler Integration
foundry-wrapper(from primitives repo)compilecommand for single-file compilation2. Watch Mode
--watchflag to monitor .sol filesfsnotifyfor file system monitoring3. TUI Integration
Implementation Notes
Dependencies
foundry-wrapperfrom evmts/primitivesfsnotifyfor watch modeRelated