This guide aligns with CLAUDE.md and describes how to work in this repo efficiently and safely.
oyente/: Core analyzer (CLI inoyente/oyente.py, symexec, detectors, helpers).tests/: Unit, integration, property, performance tests; fixtures and mocks.samples/: Reference bytecode/contracts for manual checks.docs/: Roadmap, testing guide, PRD.scripts/: Dev helpers (e.g.,setup-venv.sh,update-libs.sh).
make setup: Install deps with Poetry for dev.make all: Format, lint, type-check, unit+integration tests. Run before every commit.make format | lint | type-check: Black, Ruff, mypy respectively.make testormake test TEST=path::Class::test_name: Run tests (unit by default).make test-integration/make test-cov: Integration tests / coverage.pre-commit run -a: Run all hooks on all files (must pass before commit).- Quick run:
python oyente/oyente.py -s tests/integration/fixtures/contracts/simple_safe.sol. - Dependency bumps:
make libs-bump-latest | libs-bump-dev | libs-bump-all(usesscripts/update-libs.sh). - Solidity version:
solc-select use <version>(e.g.,0.8.19) if compilation mismatches.
- Formatting: Black (120 cols). Linting: Ruff. Types: mypy must be clean.
- Add type hints and Google-style docstrings to new/changed public APIs.
- Naming: Classes
PascalCase; functions/varssnake_case; constantsUPPER_SNAKE_CASE. - Security: Never use
shell=True; validate inputs; no secrets in code.
- Framework: pytest. Markers in
pyproject.toml(unit,integration, etc.). - Default
pytest/make testruns unit tests; integration is opt-in. - Name tests
test_<feature>_<expected>()and add tests for all changes. - Coverage targets enforced via CI; use
make test-covlocally when adding features. - See
docs/testing.mdfor structure, fixtures, and examples.
- Commits: Imperative, concise subject (e.g., "Fix coverage drop", "Add Dockerfile variants").
- Before committing:
make all && pre-commit run -amust pass. - PRs must: pass
make all; runpre-commit run -a; include description, rationale, and reproduction steps; link issues; attach CLI logs/screenshots; update docs and tests.
- Use
solc-selectto match compiler versions for tests and local runs. - Avoid filesystem/network in unit tests; prefer mocks (see
tests/mocks/).
- Version mismatch errors: switch compiler with
solc-select use <version>(e.g.,0.8.19).