
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Blazing-fast Python bindings to revm
make install
make test
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
There is also support for tracing:
from pyrevm import EVM
EVM(tracing=True)
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.
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.
TODO
FAQs
Unknown package
We found that pyrevm demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.