Metadata-Version: 2.1
Name: woke
Version: 3.1.0
Summary: Woke is a Python-based development and testing framework for Solidity.
Home-page: https://ackeeblockchain.com
License: ISC
Keywords: ethereum,solidity,security,testing,development,framework,audit
Author: Ackee Blockchain
Requires-Python: >=3.7.9,<4.0.0
Classifier: License :: OSI Approved
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Provides-Extra: dev
Provides-Extra: tests
Requires-Dist: GitPython (>=3.1.20,<4.0.0) ; extra == "tests"
Requires-Dist: aiofiles (>=0.8,<0.9)
Requires-Dist: aiohttp (>=3.8,<4.0)
Requires-Dist: black (>=22,<23) ; extra == "dev"
Requires-Dist: cairosvg (>=2.7,<3.0) ; extra == "dev"
Requires-Dist: click (>=8,<9)
Requires-Dist: eth-abi (>=4.0.0b2,<5.0.0)
Requires-Dist: eth-account (>=0.8,<0.9)
Requires-Dist: eth-hash[pycryptodome] (>=0.5.1,<0.6.0)
Requires-Dist: eth-utils (>=2.1,<3.0)
Requires-Dist: graphviz (>=0.19,<0.20)
Requires-Dist: intervaltree (>=3.1,<4.0)
Requires-Dist: isort (>=5,<6) ; extra == "dev"
Requires-Dist: mkdocs-material (>=9,<10) ; extra == "dev"
Requires-Dist: mkdocstrings[python] (>=0.19,<0.20) ; extra == "dev"
Requires-Dist: networkx (>=2.5,<3.0)
Requires-Dist: parsimonious (>=0.9,<0.10)
Requires-Dist: pathvalidate (>=2.5,<3.0)
Requires-Dist: pdbr[ipython] (>=0.8.0,<0.9.0)
Requires-Dist: pillow (>=9,<10) ; extra == "dev"
Requires-Dist: pydantic (>=1.9.1,<2.0.0)
Requires-Dist: pygments (>=2,<3) ; extra == "dev"
Requires-Dist: pymdown-extensions (>=9,<10) ; extra == "dev"
Requires-Dist: pytest (>=7,<8)
Requires-Dist: pytest-asyncio (>=0.17,<0.18) ; extra == "tests"
Requires-Dist: pywin32 (>=302) ; sys_platform == "win32"
Requires-Dist: rich (>=13.3.2,<14.0.0)
Requires-Dist: rich-click (>=1.6,<2.0)
Requires-Dist: tblib (>=1.7,<2.0)
Requires-Dist: tomli (>=2,<3)
Requires-Dist: typing-extensions (>=4,<5)
Requires-Dist: watchdog (>=2.2,<3.0)
Requires-Dist: websocket-client (>=1.4,<2.0)
Project-URL: Announcement, https://ackeeblockchain.com/blog/woke-our-development-and-testing-framework-for-solidity/
Project-URL: Documentation, https://ackeeblockchain.com/woke/docs/latest
Project-URL: Repository, https://github.com/Ackee-Blockchain/woke
Project-URL: VS Code Extension, https://marketplace.visualstudio.com/items?itemName=AckeeBlockchain.tools-for-solidity
Description-Content-Type: text/markdown

# Woke

Woke is a Python-based development and testing framework for Solidity.

Features:

- **Testing framework** - a testing framework for Solidity smart contracts with Python-native equivalents of Solidity types and blazing fast execution.

- **Fuzzer** - a property-based fuzzer for Solidity smart contracts that allows testers to write their fuzz tests in Python.

- **Vulnerability detectors**

- **LSP server**

## Dependencies

- [Python](https://www.python.org/downloads/release/python-3910/) (version 3.7 or higher)

> :warning: Python 3.11 is experimentally supported.

## Installation

via `pip`

```shell
pip3 install woke
```

## Documentation & Contribution

Woke documentation can be found [here](https://ackeeblockchain.com/woke/docs/latest).

There you can also find a section on [contributing](https://ackeeblockchain.com/woke/docs/latest/contributing/).

## Features

### Testing framework

See [examples](examples/testing) and [documentation](https://ackeeblockchain.com/woke/docs/latest/testing-framework/overview) for more information.

Writing tests is as simple as:

```python
from woke.testing import *
from pytypes.contracts.Counter import Counter

@default_chain.connect()
def test_counter():
    default_chain.set_default_accounts(default_chain.accounts[0])

    counter = Counter.deploy()
    assert counter.count() == 0

    counter.increment()
    assert counter.count() == 1
```

### Fuzzer

Fuzzer builds on top of the testing framework and allows efficient fuzz testing of Solidity smart contracts.

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

class CounterTest(FuzzTest):
    def pre_sequence(self) -> None:
        self.counter = Counter.deploy()
        self.count = 0

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

    @flow()
    def decrement(self) -> None:
        with may_revert(Panic(PanicCodeEnum.UNDERFLOW_OVERFLOW)) as e:
            self.counter.decrement()

        if e.value is not None:
            assert self.count == 0
        else:
            self.count -= 1

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

@default_chain.connect()
def test_counter():
    default_chain.set_default_accounts(default_chain.accounts[0])
    CounterTest().run(sequences_count=30, flows_count=100)
```

### Vulnerability detectors

Vulnerability detectors can be run using:
```shell
woke detect
```

### LSP server

Woke implements an [LSP](https://microsoft.github.io/language-server-protocol/) server for Solidity. The only currently supported communication channel is TCP.

Woke LSP server can be run using:

```shell
woke lsp
```

Or with an optional --port argument:

```shell
woke lsp --port 1234
```

All LSP server features can be found in the [documentation](https://ackeeblockchain.com/woke/docs/latest/language-server/).

## License

This project is licensed under the [ISC license](https://github.com/Ackee-Blockchain/woke/blob/main/LICENSE).

## Partners

RockawayX             |  Coinbase
:-------------------------:|:-------------------------:
[![](https://github.com/Ackee-Blockchain/woke/blob/main/images/rockawayx.jpg?raw=true)](https://rockawayx.com/)  |  [![](https://github.com/Ackee-Blockchain/woke/blob/main/images/coinbase.png?raw=true)](https://www.coinbase.com/)







