Metadata-Version: 2.5
Name: eth-wake
Version: 5.0.0
Summary: Wake is a Python-based Solidity development and testing framework with built-in vulnerability detectors.
Project-URL: Homepage, https://ack3.ai/wake/docs/latest
Project-URL: Repository, https://github.com/ack3-ai/wake
Project-URL: Documentation, https://ack3.ai/wake/docs/latest
Project-URL: VS Code Extension, https://marketplace.visualstudio.com/items?itemName=AckeeBlockchain.tools-for-solidity
Author: ack3, Ackee Blockchain
License: ISC
License-File: LICENSE
Keywords: audit,development,ethereum,framework,security,solidity,static analysis,testing
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Requires-Python: >=3.10
Requires-Dist: aiofiles<1,>=0.8
Requires-Dist: aiohttp<4,>=3.8; python_version < '3.12'
Requires-Dist: aiohttp<4,>=3.9.0b1; python_version >= '3.12'
Requires-Dist: certifi==2026.10.19; platform_system == 'Darwin'
Requires-Dist: click<9,>=8
Requires-Dist: eth-utils<3,>=2.1
Requires-Dist: graphviz<1,>=0.19
Requires-Dist: intervaltree<4,>=3.1
Requires-Dist: ipdb<1,>=0.13.9
Requires-Dist: jschema-to-python<2,>=1.2.3
Requires-Dist: lazy-import<1,>=0.2.2
Requires-Dist: mcp<2,>=1.0
Requires-Dist: networkx<3,>=2.5
Requires-Dist: packaging>=22.0
Requires-Dist: parsimonious<1,>=0.9
Requires-Dist: pathvalidate<3,>=2.5
Requires-Dist: pycryptodome>=3.19.0
Requires-Dist: pydantic<3,>=2.7
Requires-Dist: pytest<8,>=7
Requires-Dist: pywin32>=302; platform_system == 'Windows'
Requires-Dist: rich-click<2,>=1.7.1
Requires-Dist: rich<14,>=13.3.2
Requires-Dist: sarif-om<2,>=1.0.4
Requires-Dist: starlette<2,>=0.37
Requires-Dist: tblib<2,>=1.7
Requires-Dist: tomli-w<2,>=1.0.0
Requires-Dist: tomli<3,>=2
Requires-Dist: tree-sitter-solidity<2,>=1.2
Requires-Dist: tree-sitter<1,>=0.22
Requires-Dist: typing-extensions>=4.12
Requires-Dist: uvicorn<1,>=0.30
Requires-Dist: watchdog<5,>=4
Requires-Dist: websocket-client<2,>=1.4
Provides-Extra: dev
Requires-Dist: black<23,>=22; extra == 'dev'
Requires-Dist: cairosvg<3,>=2.7; extra == 'dev'
Requires-Dist: isort<6,>=5; extra == 'dev'
Requires-Dist: mike<3,>=2.0.0; extra == 'dev'
Requires-Dist: mkdocs-material<10,>=9.5.17; extra == 'dev'
Requires-Dist: mkdocstrings-python<2,>=1.11; extra == 'dev'
Requires-Dist: mkdocstrings<1,>=0.26; extra == 'dev'
Requires-Dist: pillow<10,>=9; (python_version < '3.12') and extra == 'dev'
Requires-Dist: pillow<11,>=10.1; (python_version >= '3.12') and extra == 'dev'
Requires-Dist: pygments<3,>=2; extra == 'dev'
Requires-Dist: pymdown-extensions<11,>=10; extra == 'dev'
Provides-Extra: tests
Requires-Dist: gitpython<4,>=3.1.20; extra == 'tests'
Requires-Dist: pytest-asyncio<1,>=0.17; extra == 'tests'
Description-Content-Type: text/markdown

![Wake: the fuzzing and testing framework for Solidity, written in Python](https://github.com/ack3-ai/wake/blob/main/images/wake_cover.png?raw=true)

# Wake

Before a smart contract ships, someone tries to break it. Wake is the Python framework ack3's auditors break them with: tests, fuzz harnesses and static analysis in ordinary Python, executed by an EVM embedded in the Python process. Wake 5 changes who writes the harness: an agent drafts it, a person checks it, Wake runs it at native speed.

[![PyPI](https://img.shields.io/pypi/v/eth-wake?label=pypi)](https://pypi.org/project/eth-wake/)
[![Python](https://img.shields.io/pypi/pyversions/eth-wake)](https://pypi.org/project/eth-wake/)
[![License: ISC](https://img.shields.io/badge/license-ISC-blue)](LICENSE)
[![Docs](https://img.shields.io/badge/docs-ack3.ai%2Fwake-0E0F12)](https://ack3.ai/wake/docs/latest/)

Developed by [ack3](https://ack3.ai). Created at Ackee Blockchain in 2022. Open source under the [ISC license](LICENSE).

## Install

Python 3.10 or newer; prebuilt wheels for Linux (x86_64 and aarch64 on glibc and musl, i686 on glibc), macOS 14+ (Apple Silicon and Intel) and Windows (x64 and ARM64), CPython 3.10 to 3.15.

```shell
pip3 install eth-wake
```

With [uv](https://docs.astral.sh/uv/): `uv tool install eth-wake`.

Wake downloads the Solidity compiler versions a project needs on first use (on Apple Silicon, `solc` older than 0.8.24 runs through Rosetta 2: `softwareupdate --install-rosetta`). No node software is required: the in-process EVM is the default engine. Anvil or Hardhat are needed only to opt back into a JSON-RPC chain.

## Start fuzzing

```shell
wake up --example counter          # example project in an empty directory, or `wake up` in an existing one
wake test                          # run the tests (pytest underneath)
wake test --cov 1 tests/test_x.py  # the same, writing statement coverage to wake-coverage.cov
wake test tests/test_x.py --seed <hex>   # reproduce a failing sequence
```

`wake up` writes `wake.toml`, compiles the project and generates `pytypes`: Python types for every contract, so tests get autocompletion and type checking against the Solidity code. The engine is `[testing] cmd = "revm"`; projects created with older versions may still pin `anvil` there.

A fuzz test in Wake is **manually guided**: the auditor writes the moves (`@flow`, one transaction each) and the rule that must hold (`@invariant`), and keeps a Python model of what the contract state should be. Wake chooses the order and the values, checks the invariants after every flow, and when a sequence fails, shrinks it to the transactions that matter.

```python
from wake.testing import *
from wake.testing.fuzzing import *
from pytypes.contracts.Counter import Counter


class CounterTest(FuzzTest):
    def pre_sequence(self) -> None:
        self.owner = random_account()
        self.counter = Counter.deploy(from_=self.owner)
        self.count = 0                      # the model

    @flow()
    def flow_increment(self) -> None:
        self.counter.increment(from_=random_account())
        self.count += 1

    @flow()
    def flow_decrement(self) -> str | None:
        with may_revert(Panic(PanicCodeEnum.UNDERFLOW_OVERFLOW)) as e:
            self.counter.decrement(from_=random_account())
        if e.value is not None:
            assert self.count == 0          # the revert was expected
            return "underflow"              # revert paths get their own line in the summary
        self.count -= 1

    @invariant(period=10)
    def invariant_count(self) -> None:
        assert self.counter.count() == self.count


@chain.connect()
def test_counter_fuzz():
    CounterTest().run(sequences_count=10, flows_count=100)
```

The [getting started guide](https://ack3.ai/wake/docs/latest/testing-framework/getting-started/) walks through the example project step by step; the [fuzzing docs](https://ack3.ai/wake/docs/latest/testing-framework/fuzzing/) cover flows, invariants, preconditions, weights and the shrinker.

## Fuzz with an agent

Harnesses are plain Python an agent can read, run and revise, and every revision executes in-process at native speed. The person stays on the three things that decide whether a harness is any good: what it asserts, which values it asserts against, and which branches actually ran ([Vibe Fuzzing Guide](https://ack3.ai/research/vibe-fuzzing-guide-for-wakes-manually-guided-fuzzing/)).

Paste into any coding agent, in a project where `wake up` has run:

```text
Write a manually guided fuzz test in Wake for <path/Name.sol>. Put it in tests/test_<name>.py with `from wake.testing import *`, `from wake.testing.fuzzing import *` and `from pytypes.<path>.<Name> import <Name>`. The FuzzTest subclass deploys the contract in pre_sequence and keeps a Python model of its state; no helper methods on the class. One @flow per state-changing function, each sending exactly one transaction: compute the expected outcome from the model before the call, run the call under `with may_revert() as e:`, and on a revert assert that e.value is the exact error (`<Name>.SomeError(args)`, `Error("message")` or `Panic(PanicCodeEnum.X)`) and return a short string; otherwise assert every field of every event in `list(tx.events)` and update the model. Add @invariant methods comparing the model to the contract's view functions. Run `wake test --cov 1 tests/test_<name>.py` (wake.toml needs `[testing] cmd = "revm"`) and report the flow summary and the uncovered statements of <path/Name.sol> from wake-coverage.cov. Do not change the Solidity sources.
```

`wake mcp` gives the agent the same static facts the language server has (contracts, functions, definitions and references, inheritance order, storage layout, state changes, selectors, external calls), as compact text. Register it once:

```shell
claude mcp add wake -- wake mcp
```

```json
{ "mcpServers": { "wake": { "command": "wake", "args": ["mcp"], "cwd": "/path/to/project" } } }
```

## What Wake does

- **Testing framework** on top of [pytest](https://docs.pytest.org), with generated `pytypes`, call traces, console logs, coverage and a debugger. [Docs](https://ack3.ai/wake/docs/latest/testing-framework/overview/)
- **Manually guided fuzzing**: flows and invariants in Python, random sequencing by the engine, a two-phase shrinker. [Docs](https://ack3.ai/wake/docs/latest/testing-framework/fuzzing/)
- **In-process EVM** ([revm](https://github.com/bluealloy/revm)): no development node, forking of live chains through `chain.connect(fork=...)`, several chains in one process for cross-chain tests. [Migration from Wake 4](https://ack3.ai/wake/docs/latest/testing-framework/migrating-from-wake-4/)
- **Detectors** (`wake detect`, SARIF export) and **printers** (`wake print`: control-flow graphs, inheritance, storage layouts, selectors). Both are plugin APIs for project-specific rules. [Detectors](https://ack3.ai/wake/docs/latest/static-analysis/using-detectors/) · [Printers](https://ack3.ai/wake/docs/latest/static-analysis/using-printers/) · [Writing new ones](https://ack3.ai/wake/docs/latest/static-analysis/getting-started/)
- **MCP server** (`wake mcp`) for agents. [Docs](https://ack3.ai/wake/docs/latest/mcp/using-mcp/)
- **Language server** (`wake lsp`) and the [Solidity (Wake)](https://marketplace.visualstudio.com/items?itemName=AckeeBlockchain.tools-for-solidity) VS Code extension: diagnostics, references, graphs and detections in the editor. [Docs](https://ack3.ai/wake/docs/latest/language-server/)
- **Deployment scripts and mainnet interaction** with the same `pytypes` the tests use. [Docs](https://ack3.ai/wake/docs/latest/testing-framework/deployment/)
- **Solc version manager** (`wake svm`), Solidity through 0.8.38.

## What changed in Wake 5

- The default engine is the in-process EVM: [revm](https://github.com/bluealloy/revm) inside Wake's new Rust core, which also took over ABI encoding, accounts and transaction signing and ships in the prebuilt wheels, so there is nothing else to install. On the Daedaluzz maze benchmark Wake 5 executes 29,931 transactions per second, on par with Foundry (30,186) and 11.5× Echidna (2,600). The same measurement shows that on constant-guarded code the input generator, not the engine, bounds what random fuzzing finds in eight hours: 75 of 153 assertions, where an agent-written harness reached all 153 in 33 to 79 minutes. Both results are in the [preprint](#research).
- Chain history is bounded to the newest 256 blocks by default, which keeps multi-hour campaigns memory-stable; keep references to transaction objects needed later, or raise `testing.block_history`.
- Tests on a fork of a live chain now understand the contracts you didn't write. When one of them emits an event or reverts, Wake fetches its ABI from Sourcify or Etherscan and gives you the event or error by name, with named fields, instead of raw bytes. If your project already has the right interface, one line tells Wake to use it: `Account(usdt_address).pytypes_resolver = IUSDT`.
- `wake mcp` is new.
- `pytypes` generated by Wake 4 must be regenerated. The [migration guide](https://ack3.ai/wake/docs/latest/testing-framework/migrating-from-wake-4/) lists every breaking change.

## Research

- **Wake 5: A Python Framework for Solidity Testing, Fuzzing, and Static Analysis** (Gattermayer, Převrátil, 2026). arXiv preprint: [arXiv:2611.09307](https://arxiv.org/abs/2611.09307). Framework design, a three-fuzzer benchmark over 75 eight-hour campaigns, the generator-prior analysis, five agent-written harness campaigns, and a static-analysis ablation in an agentic review. Benchmark fork and campaign data: [daedaluzz-benchmark](https://github.com/ack3-ai/daedaluzz-benchmark).
- [Benchmarking EVM fuzzers against an agent-written harness](https://ack3.ai/research/benchmarking-evm-fuzzers-against-an-agent-written-harness/) and [Static analysis MCP tools in an AI audit benchmark](https://ack3.ai/research/ablating-static-analysis-from-an-ai-security-benchmark/), the research notes the preprint grew from.
- [Introducing manually guided fuzzing](https://ack3.ai/research/introducing-manually-guided-fuzzing-a-new-approach-in-smart-contract-testing/) and the [research journal's Wake articles](https://ack3.ai/research/tags/wake/).

```bibtex
@misc{gattermayer2026wake5,
  title         = {Wake 5: A Python Framework for Solidity Testing, Fuzzing, and Static Analysis},
  author        = {Gattermayer, Josef and P{\v{r}}evr{\'a}til, Michal},
  year          = {2026},
  eprint        = {2611.09307},
  archivePrefix = {arXiv},
  primaryClass  = {cs.SE},
  url           = {https://arxiv.org/abs/2611.09307}
}
```

## Documentation and community

- [Documentation](https://ack3.ai/wake/docs/latest/) · [Changelog](https://ack3.ai/wake/docs/latest/changelog/) · [Contributing](https://ack3.ai/wake/docs/latest/contributing/)
- [Awesome Wake tests](https://github.com/ack3-ai/awesome-wake-tests): fuzz tests and unit tests from real audits
- Questions and bugs: [GitHub issues](https://github.com/ack3-ai/wake/issues). Security reports: see [SECURITY.md](SECURITY.md)
- Updates: [x.com/ack3ai](https://x.com/ack3ai)

## Support the project

Wake is on [Giveth](https://giveth.io/project/wake:-solidity-static-analysis-and-fuzzing-framework).

## License

[ISC](LICENSE).
