From d0c6bad6c9a020f1ad27d985f026ea1fcfd88cd2 Mon Sep 17 00:00:00 2001 From: FredCoen <43670554+FredCoen@users.noreply.github.com> Date: Fri, 6 Dec 2024 11:41:57 +0100 Subject: [PATCH] chore: Update README.md examples section (#1853) * Update README.md examples section * Update README.md * Update README.md --- README.md | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 87ed61e419..b76d90bea4 100644 --- a/README.md +++ b/README.md @@ -92,19 +92,35 @@ Flamegraph also requires sudo mode to run (hence the `--root` cli arg) and will [flamegraph]: https://docs.rs/crate/flamegraph/0.1.6 -## Running examples +## Running Examples ```shell -cargo run -p revm --features ethersdb --example fork_ref_transact -``` +# Run database reference example +cargo run -p example-database-ref -Generate block traces and write them to json files in a new `traces/` directory. -Each file corresponds to a transaction in the block and is named as such: `.json`. +# Run contract deployment example +cargo run -p example-contract-deployment -```shell -cargo run -p revm --features std,serde-json,ethersdb --example generate_block_traces +# Query Uniswap V2 pool reserves +cargo run -p example-uniswap-get-reserves + +# Execute USDC swap on Uniswap V2 +cargo run -p example-uniswap-v2-usdc-swap + +# Generate block traces +cargo run -p example-block-traces + +# Run database reference example +cargo run -p example-database-ref ``` +All examples can be found in the `examples/` directory. Each example demonstrates different aspects of revm: +- `block_traces`: Generating execution traces for entire blocks +- `contract_deployment`: Deploying and interacting with smart contracts +- `database_ref`: Using database references for state access +- `uniswap_get_reserves`: Reading state from Uniswap contracts +- `uniswap_v2_usdc_swap`: Executing swaps on Uniswap V2 + # Used by: * [Foundry](https://github.com/foundry-rs/foundry) is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.