Woke
⚠️ This package was deprecated in favor of eth-wake ⚠️
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 (version 3.7 or higher)
- Rosetta must be enabled on Apple Silicon (M1 & M2) Macs
⚠️ Python 3.11 is experimentally supported.
Installation
via pip
pip3 install woke
Documentation & Contribution
Woke documentation can be found here.
There you can also find a section on contributing.
Discovered vulnerabilities
| Vulnerability | Severity | Project | Method | Discovered by | Resources |
|---|---|---|---|---|---|
| Profit & loss accounted twice | Critical | IPOR | Fuzz test | Ackee Blockchain | Woke tests |
| Console permanent denial of service | High | Brahma | Fuzz test | Ackee Blockchain | Report |
| Swap unwinding formula error | High | IPOR | Fuzz test | Ackee Blockchain | Woke tests |
| Swap unwinding fee accounted twice | High | IPOR | Fuzz test | Ackee Blockchain | Woke tests |
| Incorrect event data | High | Solady | Integration test | Ackee Blockchain | Report, Woke tests |
INTEREST_FROM_STRATEGY_BELOW_ZERO reverts DoS |
Medium | IPOR | Fuzz test | Ackee Blockchain | Woke tests |
| Inaccurate hypothetical interest formula | Medium | IPOR | Fuzz test | Ackee Blockchain | Woke tests |
| Swap unwinding fee normalization error | Medium | IPOR | Fuzz test | Ackee Blockchain | Woke tests |
| Missing receive function | Medium | Axelar | Fuzz test | Ackee Blockchain | Woke tests |
Features
Testing framework
See examples and documentation for more information.
Writing tests is as simple as:
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.
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:
woke detect
LSP server
Woke implements an LSP server for Solidity. The only currently supported communication channel is TCP.
Woke LSP server can be run using:
woke lsp
Or with an optional --port argument (default 65432):
woke lsp --port 1234
All LSP server features can be found in the documentation.
License
This project is licensed under the ISC license.
Partners
| RockawayX | Coinbase |
|---|---|
Metadata
Release files for woke 3.6.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| woke-3.6.2.tar.gz | 292.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| woke-3.6.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 697.2 kB
Release files / woke-3.6.2.tar.gz
| Download URL | woke-3.6.2.tar.gz |
|---|---|
| Size | 292.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b7f6964be7969b5df8d3be2df1a388da1d771ab845b347fc167b060a34f8d30f
|
|
BLAKE2b-256 checksum How to use checksums |
b79a48960b996ca93bb58ca239e21f2cbf77f41db91033ac4a89b5f431d770c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.0 CPython/3.11.4 Linux/6.5.12-300.fc39.x86_64
|
Release files / woke-3.6.2-py3-none-any.whl
| Download URL | woke-3.6.2-py3-none-any.whl |
|---|---|
| Size | 404.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2b7d4719aa1b2d631d30046b7916933522a525d101c1b446e10bf538a0dfbef1
|
|
BLAKE2b-256 checksum How to use checksums |
cfef37742f37cfd20655b6957258cc04c00c44c955ffe54827b0e7fb99767a66
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.0 CPython/3.11.4 Linux/6.5.12-300.fc39.x86_64
|