pyrevm
Blazing-fast Python bindings to revm
Quickstart
make install
make test
Example Usage
Here we show how you can fork from Ethereum mainnet and simulate
a transaction from vitalik.eth.
from pyrevm import EVM, Env, BlockEnv
address = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" # vitalik.eth
address2 = "0xBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"
fork_url = "https://mainnet.infura.io/v3/c60b0bb42f8a4c6481ecd229eddaca27"
# set up an evm
evm = EVM(
# can fork from a remote node
fork_url=fork_url,
# can set tracing to true/false
tracing=True,
# can configure the environment
env=Env(
block=BlockEnv(timestamp=100)
)
)
vb_before = evm.basic(address)
assert vb_before != 0
# Execute the tx
evm.message_call(
caller=address,
to=address2,
value=10000
# data
)
assert vb_before != evm.basic(address)
assert evm.basic(address2).balance == 10000
Tracing
There is also support for tracing:
from pyrevm import EVM
EVM(tracing=True)
Transactions
There is support for checkpoints:
from pyrevm import EVM
evm = EVM()
checkpoint = evm.snapshot()
evm.message_call(
caller=...,
to=...,
value=...,
)
evm.revert(checkpoint) # or: evm.commit() to clear all checkpoints
Note: in contrast to the Rust library, the Python library does not automatically commit to database.
See more usage examples in the pytests.
Develop
We use Poetry for virtual environment management and Maturin as our Rust <> Python FFI build system. The Rust bindings are auto-generated from the macros provided by PyO3.
To build the library, run make build. To run the tests, run make test.
Note: If building for production, use make build-prod, else performance will be degraded.
To release to pypi, create a new github release. This will run the .github/workflows/release.yml action and publish source+binary wheels to pypi.
Benchmarks
TODO
Metadata
Release files for pyrevm 0.3.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyrevm-0.3.7.tar.gz | 60.8 kB | Details |
Built distributions (wheels)
Total release size: 85.9 MB
Release files / pyrevm-0.3.7.tar.gz
| Download URL | pyrevm-0.3.7.tar.gz |
|---|---|
| Size | 60.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9fc770ec166a44a037da9a6dcdfa3e1757dbd3e0a2cdee97d7679ff5ce6a8f74
|
|
BLAKE2b-256 checksum How to use checksums |
cd89128ca575eb4bb8163e50ca8a46d7da0ae43a5ca5e5deb4574eac3a79a7fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.11.5
|
Release files / pyrevm-0.3.7-cp314-none-win_amd64.whl
| Download URL | pyrevm-0.3.7-cp314-none-win_amd64.whl |
|---|---|
| Size | 3.8 MB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
438686704d2705f7d7e4c833002da62f4e15e28006633a6aca3ae795cfb0ba22
|
|
BLAKE2b-256 checksum How to use checksums |
8cf593a4d93333fa160b617d91abde66b058607ba30458876a73356097eae722
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.11.5
|
Release files / pyrevm-0.3.7-cp313-none-win_amd64.whl
| Download URL | pyrevm-0.3.7-cp313-none-win_amd64.whl |
|---|---|
| Size | 3.8 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
288b6408c538670b21bffa36ae4b44fb7f252cf7355df73f46c9e044bf6c7225
|
|
BLAKE2b-256 checksum How to use checksums |
fefb364072806feb7d507c8362fa44a4c530d2767a30c7e400926c3cf8478e72
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.11.5
|
Release files / pyrevm-0.3.7-cp312-none-win_amd64.whl
| Download URL | pyrevm-0.3.7-cp312-none-win_amd64.whl |
|---|---|
| Size | 3.8 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
e5ce297d397c60c50f1c46f75d04620efa36190ef3b91523769d3631dfcefed2
|
|
BLAKE2b-256 checksum How to use checksums |
b499a039c1c1cabf79f551c628fc4cccca06b113126489d9c2e3deb43c355f5f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.11.5
|
Release files / pyrevm-0.3.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | pyrevm-0.3.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 4.3 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
d055860c3352d6bc180b80255d8563f0b3c0fe6ce62b5c2a52e1bc7ecc4fad4f
|
|
BLAKE2b-256 checksum How to use checksums |
7c6c17f60815e678474fa8bb36363e4a9f336fa444abb983c2a1e4bb08f681ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.11.5
|
Release files / pyrevm-0.3.7-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
| Download URL | pyrevm-0.3.7-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl |
|---|---|
| Size | 4.3 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-32 |
|
SHA-256 checksum How to use checksums |
a958e65c694ca99a22fe9283d57b83828902a808114f98f033490bbf0526bc75
|
|
BLAKE2b-256 checksum How to use checksums |
e0ab2caf460c88de7a582277f0ecb814188ab7ff6f209eff0908f76aba851e78
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.11.5
|
Release files / pyrevm-0.3.7-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | pyrevm-0.3.7-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.9 MB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
b149fe2b3e79fad7c638de6f3d5761d4c97fa35fd40a552337af8305c57a70dd
|
|
BLAKE2b-256 checksum How to use checksums |
9c55279f3521ca43c7561c2f54cdd23b6fb91e65ea1e14d22d8482e01b32f13b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.11.5
|
Release files / pyrevm-0.3.7-cp312-cp312-macosx_10_12_x86_64.whl
| Download URL | pyrevm-0.3.7-cp312-cp312-macosx_10_12_x86_64.whl |
|---|---|
| Size | 4.0 MB |
| Tags | CPython 3.12 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
456411132c5431ccc58e59353325e43736ea4bd4941fd8b17c7c14583afda031
|
|
BLAKE2b-256 checksum How to use checksums |
718435d3bcd79e80fbbb4d92d1e1539babcb121b2efbc7906d89bfeaa9c3bb1e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.11.5
|
Release files / pyrevm-0.3.7-cp311-none-win_amd64.whl
| Download URL | pyrevm-0.3.7-cp311-none-win_amd64.whl |
|---|---|
| Size | 3.8 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
cfc698975f47cf62f310d452e57148c81ac0463f19f04b8fa34b135170394c33
|
|
BLAKE2b-256 checksum How to use checksums |
c5d91bd728ce052f9e4b0e81ea05a70df84243d5dcb4a6c95acdeef1731c38c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.11.5
|
Release files / pyrevm-0.3.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | pyrevm-0.3.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 4.3 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
d46fdc51cb6c06b5c2ad85b1c2160b35efc74d27baf318167360d2fb6636aa26
|
|
BLAKE2b-256 checksum How to use checksums |
ef5cd5b3e55b827f3e1352ced97347c0e4467a068be2f346b16dc73a5badf5bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.11.5
|
Release files / pyrevm-0.3.7-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
| Download URL | pyrevm-0.3.7-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl |
|---|---|
| Size | 4.3 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-32 |
|
SHA-256 checksum How to use checksums |
2d68a13be420d0f129e37c1cf0e2868812ce17e45749f93f97ef07980c765341
|
|
BLAKE2b-256 checksum How to use checksums |
adce56d83dd012561ee21f99ed3db5de6602e7328092542e4e9f0d203cbffb40
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.11.5
|
Release files / pyrevm-0.3.7-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | pyrevm-0.3.7-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.9 MB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
f5b606806c1e65cbc2633ac13d819a04bce342d68335655ceb9a1bc51fed4447
|
|
BLAKE2b-256 checksum How to use checksums |
e0ad2bd8a51d61457c0c9a1e265aca46957fcf294e231f57fb0c2acf65fbe035
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.11.5
|
Release files / pyrevm-0.3.7-cp311-cp311-macosx_10_12_x86_64.whl
| Download URL | pyrevm-0.3.7-cp311-cp311-macosx_10_12_x86_64.whl |
|---|---|
| Size | 4.0 MB |
| Tags | CPython 3.11 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
e43aae42944bfd35ba37f01aec2cd092440865581af44e4580ffc153e30f82cf
|
|
BLAKE2b-256 checksum How to use checksums |
726a3dc9c0d244786ab7d529403bd235c564f3c6607cb6dfac63fd8a4424b5cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.11.5
|
Release files / pyrevm-0.3.7-cp310-none-win_amd64.whl
| Download URL | pyrevm-0.3.7-cp310-none-win_amd64.whl |
|---|---|
| Size | 3.8 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
989b17e24ff5ee47985d996bb7e0d9f38cc2079f30e5d9a960436422008d31ed
|
|
BLAKE2b-256 checksum How to use checksums |
8d499244c64e3f9c14eceb8d55595bbe3c0864527f025160a8c552070227c65f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.11.5
|
Release files / pyrevm-0.3.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | pyrevm-0.3.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 4.3 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
477b9b21c638179691f7bb0e1c7eb9d84c03ba90dc0e40cf50cf416e96d0ff4d
|
|
BLAKE2b-256 checksum How to use checksums |
b4d0646bcef88f298f7b35af4e023bc8eb3e345deb677f9bc32ebc0c601e0943
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.11.5
|
Release files / pyrevm-0.3.7-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
| Download URL | pyrevm-0.3.7-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl |
|---|---|
| Size | 4.3 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-32 |
|
SHA-256 checksum How to use checksums |
ca46087037c438d32228b41321d1858499ed6f88aa476eafaf7dc4edb685ea67
|
|
BLAKE2b-256 checksum How to use checksums |
3df362162bbe7d1f1adc2b95c5e26d1f7c23a9afd2fa29ff1051ea96386d8ee0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.11.5
|
Release files / pyrevm-0.3.7-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | pyrevm-0.3.7-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.9 MB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c5c02592c5079b60764d2a38e9277f729f311a32b22129e239023c0849a1b25e
|
|
BLAKE2b-256 checksum How to use checksums |
7772531b44c85b3e2c79269c27eca4aba53fc1f72ad6b2be7dd992e7dcbbbb7b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.11.5
|
Release files / pyrevm-0.3.7-cp310-cp310-macosx_10_12_x86_64.whl
| Download URL | pyrevm-0.3.7-cp310-cp310-macosx_10_12_x86_64.whl |
|---|---|
| Size | 4.0 MB |
| Tags | CPython 3.10 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
9a167214a036e36f67424a0776ebdfaf5e17f7643e602f935c3301f20b950361
|
|
BLAKE2b-256 checksum How to use checksums |
13bad99d87e769e9884690952c64a5d0875ab5e3b1ca9c048a7964aacedc73b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.11.5
|
Release files / pyrevm-0.3.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | pyrevm-0.3.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 4.3 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
b4a8de6b8b5a4d2ce2b846f8f567ac94346a7bf0aeb0d47e8ddf2f396b52fffd
|
|
BLAKE2b-256 checksum How to use checksums |
1f129dcf754670bedd5b77e9ea0a4c17d0500d18a881d4e5c75e6f1c918131a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.11.5
|
Release files / pyrevm-0.3.7-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
| Download URL | pyrevm-0.3.7-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl |
|---|---|
| Size | 4.3 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-32 |
|
SHA-256 checksum How to use checksums |
a25d619c40652bbc7ab6e03afe9dd93ef5a6d91ee88c8058db807e80d2a17236
|
|
BLAKE2b-256 checksum How to use checksums |
9c90ef27932557da442243ca06251a7799d362d091be8dbd2dec3b34ffb38661
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.11.5
|
Release files / pyrevm-0.3.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | pyrevm-0.3.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 4.3 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
acb6f43d6ba71280282711ac243202f0855b1000f6520cb2f0bea92ab4c3e114
|
|
BLAKE2b-256 checksum How to use checksums |
1ed23814bb4a00123638c72941b4081e9d1ecb6aa90c1ef6fa8bb6f9613c99b1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.11.5
|
Release files / pyrevm-0.3.7-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
| Download URL | pyrevm-0.3.7-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl |
|---|---|
| Size | 4.3 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-32 |
|
SHA-256 checksum How to use checksums |
b49a4d13eb97cdff2027663224f2d31fa6aa711e23c2d9cca7ace54008bb7e94
|
|
BLAKE2b-256 checksum How to use checksums |
853074f248f39f4492aa548ab92eb45721f9aa60f77feae80039e5e51c1c8c18
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.11.5
|