Skip to content

Commit

Permalink
chore: Update README.md examples section (#1853)
Browse files Browse the repository at this point in the history
* Update README.md examples section

* Update README.md

* Update README.md
  • Loading branch information
FredCoen authored Dec 6, 2024
1 parent bc73778 commit d0c6bad
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: `<tx index>.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.
Expand Down

0 comments on commit d0c6bad

Please sign in to comment.