{"id":19145384,"url":"https://github.com/paradigmxyz/pyrevm","last_synced_at":"2025-04-09T18:23:13.285Z","repository":{"id":60588512,"uuid":"544109975","full_name":"paradigmxyz/pyrevm","owner":"paradigmxyz","description":"Python wrapper around https://github.com/bluealloy/revm/ using PyO3","archived":false,"fork":false,"pushed_at":"2024-07-26T13:42:09.000Z","size":676,"stargazers_count":174,"open_issues_count":4,"forks_count":26,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-02T11:58:46.919Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paradigmxyz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-01T17:12:14.000Z","updated_at":"2025-03-11T09:03:01.000Z","dependencies_parsed_at":"2023-12-13T18:29:46.453Z","dependency_job_id":"e0ba8145-0945-48b3-b1ee-0f6c4ca2dbce","html_url":"https://github.com/paradigmxyz/pyrevm","commit_stats":null,"previous_names":["gakonst/pyrevm"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paradigmxyz%2Fpyrevm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paradigmxyz%2Fpyrevm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paradigmxyz%2Fpyrevm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paradigmxyz%2Fpyrevm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paradigmxyz","download_url":"https://codeload.github.com/paradigmxyz/pyrevm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248085971,"owners_count":21045245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T07:39:52.471Z","updated_at":"2025-04-09T18:23:13.255Z","avatar_url":"https://github.com/paradigmxyz.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003ch1 align=\"center\"\u003e pyrevm \u003c/h1\u003e\n\n**Blazing-fast Python bindings to [revm](https://github.com/bluealloy/revm/)**\n\n![py](https://github.com/gakonst/pyrevm/workflows/py/badge.svg)\n![rust](https://github.com/gakonst/pyrevm/workflows/rust/badge.svg)\n\n## Quickstart\n\n```\nmake install\nmake test\n```\n\n## Example Usage\n\nHere we show how you can fork from Ethereum mainnet and simulate\na transaction from `vitalik.eth`.\n\n```python\nfrom pyrevm import EVM, Env, BlockEnv\n\naddress = \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\"  # vitalik.eth\naddress2 = \"0xBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB\"\n\nfork_url = \"https://mainnet.infura.io/v3/c60b0bb42f8a4c6481ecd229eddaca27\"\n\n# set up an evm\nevm = EVM(\n    # can fork from a remote node\n    fork_url=fork_url,\n    # can set tracing to true/false\n    tracing=True,\n    # can configure the environment\n    env=Env(\n        block=BlockEnv(timestamp=100)\n    )\n)\n\nvb_before = evm.basic(address)\nassert vb_before != 0\n\n# Execute the tx\nevm.message_call(\n    caller=address,\n    to=address2,\n    value=10000\n    # data\n)\n\nassert vb_before != evm.basic(address)\nassert evm.basic(address2).balance == 10000\n```\n\n### Tracing\nThere is also support for tracing:\n```python\nfrom pyrevm import EVM\n\nEVM(tracing=True)\n```\n\n### Transactions\n\nThere is support for checkpoints:\n\n```python\nfrom pyrevm import EVM\n\nevm = EVM()\ncheckpoint = evm.snapshot()\nevm.message_call(\n    caller=...,\n    to=...,\n    value=...,\n)\nevm.revert(checkpoint)  # or: evm.commit() to clear all checkpoints\n```\n\n**Note**: in contrast to the Rust library, the Python library does not automatically commit to database.\n\nSee more usage examples in the [pytests](tests/test_evm.py).\n\n## Develop\n\nWe use Poetry for virtual environment management and [Maturin](https://github.com/PyO3/maturin) as our Rust \u003c\u003e Python FFI build system. The Rust bindings are auto-generated from the macros provided by [PyO3](https://pyo3.rs/v0.17.1/).\n\nTo build the library, run `make build`. To run the tests, run `make test`.\n\nNote: If building for production, use `make build-prod`, else performance will be degraded.\n\nTo release to pypi, create a new github release. This will run the `.github/workflows/release.yml` action and publish source+binary wheels to pypi.\n\n## Benchmarks\n\nTODO\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparadigmxyz%2Fpyrevm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparadigmxyz%2Fpyrevm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparadigmxyz%2Fpyrevm/lists"}