Skip to main content

No project description provided

Project description

pyrevm

Blazing-fast Python bindings to revm

py rust

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyrevm-0.3.7.tar.gz (60.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyrevm-0.3.7-cp314-none-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.14Windows x86-64

pyrevm-0.3.7-cp313-none-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.13Windows x86-64

pyrevm-0.3.7-cp312-none-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.12Windows x86-64

pyrevm-0.3.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

pyrevm-0.3.7-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl (4.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ i686

pyrevm-0.3.7-cp312-cp312-macosx_11_0_arm64.whl (3.9 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pyrevm-0.3.7-cp312-cp312-macosx_10_12_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

pyrevm-0.3.7-cp311-none-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.11Windows x86-64

pyrevm-0.3.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

pyrevm-0.3.7-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (4.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ i686

pyrevm-0.3.7-cp311-cp311-macosx_11_0_arm64.whl (3.9 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pyrevm-0.3.7-cp311-cp311-macosx_10_12_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

pyrevm-0.3.7-cp310-none-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.10Windows x86-64

pyrevm-0.3.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

pyrevm-0.3.7-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (4.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ i686

pyrevm-0.3.7-cp310-cp310-macosx_11_0_arm64.whl (3.9 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

pyrevm-0.3.7-cp310-cp310-macosx_10_12_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

pyrevm-0.3.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

pyrevm-0.3.7-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl (4.3 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ i686

pyrevm-0.3.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

pyrevm-0.3.7-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl (4.3 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ i686

File details

Details for the file pyrevm-0.3.7.tar.gz.

File metadata

  • Download URL: pyrevm-0.3.7.tar.gz
  • Upload date:
  • Size: 60.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.11.5

File hashes

Hashes for pyrevm-0.3.7.tar.gz
Algorithm Hash digest
SHA256 9fc770ec166a44a037da9a6dcdfa3e1757dbd3e0a2cdee97d7679ff5ce6a8f74
MD5 e4b9d25006f7ffba814ea8db368cfc8a
BLAKE2b-256 cd89128ca575eb4bb8163e50ca8a46d7da0ae43a5ca5e5deb4574eac3a79a7fc

See more details on using hashes here.

File details

Details for the file pyrevm-0.3.7-cp314-none-win_amd64.whl.

File metadata

  • Download URL: pyrevm-0.3.7-cp314-none-win_amd64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.11.5

File hashes

Hashes for pyrevm-0.3.7-cp314-none-win_amd64.whl
Algorithm Hash digest
SHA256 438686704d2705f7d7e4c833002da62f4e15e28006633a6aca3ae795cfb0ba22
MD5 be6c53852ed8d2b48c6991b050906e0a
BLAKE2b-256 8cf593a4d93333fa160b617d91abde66b058607ba30458876a73356097eae722

See more details on using hashes here.

File details

Details for the file pyrevm-0.3.7-cp313-none-win_amd64.whl.

File metadata

  • Download URL: pyrevm-0.3.7-cp313-none-win_amd64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.11.5

File hashes

Hashes for pyrevm-0.3.7-cp313-none-win_amd64.whl
Algorithm Hash digest
SHA256 288b6408c538670b21bffa36ae4b44fb7f252cf7355df73f46c9e044bf6c7225
MD5 dff416e1698c8f9e1fe5b85aa2be9c4d
BLAKE2b-256 fefb364072806feb7d507c8362fa44a4c530d2767a30c7e400926c3cf8478e72

See more details on using hashes here.

File details

Details for the file pyrevm-0.3.7-cp312-none-win_amd64.whl.

File metadata

  • Download URL: pyrevm-0.3.7-cp312-none-win_amd64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.11.5

File hashes

Hashes for pyrevm-0.3.7-cp312-none-win_amd64.whl
Algorithm Hash digest
SHA256 e5ce297d397c60c50f1c46f75d04620efa36190ef3b91523769d3631dfcefed2
MD5 2f4b91dc04091d13971e6a090414edef
BLAKE2b-256 b499a039c1c1cabf79f551c628fc4cccca06b113126489d9c2e3deb43c355f5f

See more details on using hashes here.

File details

Details for the file pyrevm-0.3.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyrevm-0.3.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d055860c3352d6bc180b80255d8563f0b3c0fe6ce62b5c2a52e1bc7ecc4fad4f
MD5 fda45e8c7b8370e7e04f6b7a0158bd36
BLAKE2b-256 7c6c17f60815e678474fa8bb36363e4a9f336fa444abb983c2a1e4bb08f681ae

See more details on using hashes here.

File details

Details for the file pyrevm-0.3.7-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pyrevm-0.3.7-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 a958e65c694ca99a22fe9283d57b83828902a808114f98f033490bbf0526bc75
MD5 626b4076cb5a859d52ce04ab10e12f7f
BLAKE2b-256 e0ab2caf460c88de7a582277f0ecb814188ab7ff6f209eff0908f76aba851e78

See more details on using hashes here.

File details

Details for the file pyrevm-0.3.7-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyrevm-0.3.7-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b149fe2b3e79fad7c638de6f3d5761d4c97fa35fd40a552337af8305c57a70dd
MD5 002c441bf684a0bd6c5af187dc0c5f1b
BLAKE2b-256 9c55279f3521ca43c7561c2f54cdd23b6fb91e65ea1e14d22d8482e01b32f13b

See more details on using hashes here.

File details

Details for the file pyrevm-0.3.7-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pyrevm-0.3.7-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 456411132c5431ccc58e59353325e43736ea4bd4941fd8b17c7c14583afda031
MD5 7ba2b45e3b58bf0b63811cd7aa42d2fc
BLAKE2b-256 718435d3bcd79e80fbbb4d92d1e1539babcb121b2efbc7906d89bfeaa9c3bb1e

See more details on using hashes here.

File details

Details for the file pyrevm-0.3.7-cp311-none-win_amd64.whl.

File metadata

  • Download URL: pyrevm-0.3.7-cp311-none-win_amd64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.11.5

File hashes

Hashes for pyrevm-0.3.7-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 cfc698975f47cf62f310d452e57148c81ac0463f19f04b8fa34b135170394c33
MD5 ed23c07083beb2cc5532c920fcc21aea
BLAKE2b-256 c5d91bd728ce052f9e4b0e81ea05a70df84243d5dcb4a6c95acdeef1731c38c5

See more details on using hashes here.

File details

Details for the file pyrevm-0.3.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyrevm-0.3.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d46fdc51cb6c06b5c2ad85b1c2160b35efc74d27baf318167360d2fb6636aa26
MD5 59316d652019c2c50782c6cfe75fe975
BLAKE2b-256 ef5cd5b3e55b827f3e1352ced97347c0e4467a068be2f346b16dc73a5badf5bd

See more details on using hashes here.

File details

Details for the file pyrevm-0.3.7-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pyrevm-0.3.7-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 2d68a13be420d0f129e37c1cf0e2868812ce17e45749f93f97ef07980c765341
MD5 4b60ac4f452d0e8b7ab8586457e8fc35
BLAKE2b-256 adce56d83dd012561ee21f99ed3db5de6602e7328092542e4e9f0d203cbffb40

See more details on using hashes here.

File details

Details for the file pyrevm-0.3.7-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyrevm-0.3.7-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f5b606806c1e65cbc2633ac13d819a04bce342d68335655ceb9a1bc51fed4447
MD5 dca686c358198ea6078d4d735ba3b7e4
BLAKE2b-256 e0ad2bd8a51d61457c0c9a1e265aca46957fcf294e231f57fb0c2acf65fbe035

See more details on using hashes here.

File details

Details for the file pyrevm-0.3.7-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pyrevm-0.3.7-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e43aae42944bfd35ba37f01aec2cd092440865581af44e4580ffc153e30f82cf
MD5 30995702b65f827f564555904ab2b414
BLAKE2b-256 726a3dc9c0d244786ab7d529403bd235c564f3c6607cb6dfac63fd8a4424b5cf

See more details on using hashes here.

File details

Details for the file pyrevm-0.3.7-cp310-none-win_amd64.whl.

File metadata

  • Download URL: pyrevm-0.3.7-cp310-none-win_amd64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.11.5

File hashes

Hashes for pyrevm-0.3.7-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 989b17e24ff5ee47985d996bb7e0d9f38cc2079f30e5d9a960436422008d31ed
MD5 14aab19b5819d3ae8b1e2ef2dd07f00d
BLAKE2b-256 8d499244c64e3f9c14eceb8d55595bbe3c0864527f025160a8c552070227c65f

See more details on using hashes here.

File details

Details for the file pyrevm-0.3.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyrevm-0.3.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 477b9b21c638179691f7bb0e1c7eb9d84c03ba90dc0e40cf50cf416e96d0ff4d
MD5 a990d0e7875698406e546305874ab45f
BLAKE2b-256 b4d0646bcef88f298f7b35af4e023bc8eb3e345deb677f9bc32ebc0c601e0943

See more details on using hashes here.

File details

Details for the file pyrevm-0.3.7-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pyrevm-0.3.7-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 ca46087037c438d32228b41321d1858499ed6f88aa476eafaf7dc4edb685ea67
MD5 de03bf972f1639438ef5c3aeb783accc
BLAKE2b-256 3df362162bbe7d1f1adc2b95c5e26d1f7c23a9afd2fa29ff1051ea96386d8ee0

See more details on using hashes here.

File details

Details for the file pyrevm-0.3.7-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyrevm-0.3.7-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c5c02592c5079b60764d2a38e9277f729f311a32b22129e239023c0849a1b25e
MD5 da86e026502f44850e846bc4121abb45
BLAKE2b-256 7772531b44c85b3e2c79269c27eca4aba53fc1f72ad6b2be7dd992e7dcbbbb7b

See more details on using hashes here.

File details

Details for the file pyrevm-0.3.7-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pyrevm-0.3.7-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9a167214a036e36f67424a0776ebdfaf5e17f7643e602f935c3301f20b950361
MD5 09d0341f80613999edc238b56e4c3f01
BLAKE2b-256 13bad99d87e769e9884690952c64a5d0875ab5e3b1ca9c048a7964aacedc73b4

See more details on using hashes here.

File details

Details for the file pyrevm-0.3.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyrevm-0.3.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b4a8de6b8b5a4d2ce2b846f8f567ac94346a7bf0aeb0d47e8ddf2f396b52fffd
MD5 65ab21ee77cb96ee135f4b6a529bb8c6
BLAKE2b-256 1f129dcf754670bedd5b77e9ea0a4c17d0500d18a881d4e5c75e6f1c918131a2

See more details on using hashes here.

File details

Details for the file pyrevm-0.3.7-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pyrevm-0.3.7-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 a25d619c40652bbc7ab6e03afe9dd93ef5a6d91ee88c8058db807e80d2a17236
MD5 a5496f6bfc3590266f4fae77d7af96ce
BLAKE2b-256 9c90ef27932557da442243ca06251a7799d362d091be8dbd2dec3b34ffb38661

See more details on using hashes here.

File details

Details for the file pyrevm-0.3.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyrevm-0.3.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 acb6f43d6ba71280282711ac243202f0855b1000f6520cb2f0bea92ab4c3e114
MD5 ad7f0c904f156f897c2f4210cca12cbe
BLAKE2b-256 1ed23814bb4a00123638c72941b4081e9d1ecb6aa90c1ef6fa8bb6f9613c99b1

See more details on using hashes here.

File details

Details for the file pyrevm-0.3.7-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pyrevm-0.3.7-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 b49a4d13eb97cdff2027663224f2d31fa6aa711e23c2d9cca7ace54008bb7e94
MD5 2e1e2114ead87bc6e0a9ddee04a00f45
BLAKE2b-256 853074f248f39f4492aa548ab92eb45721f9aa60f77feae80039e5e51c1c8c18

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page