All packages
substreams_evm_precompile_popularity

substreams_evm_precompile_popularity

maoueh
v0.1.0/2 downloads

Package ref

substreams-evm-precompile-popularity@v0.1.0

Run package

CLI

Run map_counts from the command line.

substreams run substreams-evm-precompile-popularity@v0.1.0 map_counts -e mainnet
Authenticate by running substreams auth or directly on thegraph.market (see docs).

README

Substreams EVM Precompiles Popularity

This project leverages Substreams to calculate the popularity of Ethereum precompiled contracts from call data.

Overview

  • Processes Ethereum call events using Substreams.
  • Counts and maps occurrences of precompiles.
  • Outputs results using Protocol Buffers.

Getting Started

  1. Ensure the Rust toolchain is installed.
  2. Build the project: cargo build --release.
  3. Deploy the WASM binary as specified in the Substreams configuration.

License

Apache 2.0

Modules

Execution graph

5 modules
Show 3 dependencies
map

ethcommon:all_calls

`all_calls` gives you all the calls in a block (including internal calls), with basic block hash/number/timestamp and transaction hash

Output

sf.substreams.ethereum.v1.Calls

map

ethcommon:filtered_calls

`filtered_calls` reads from `all_calls` and applies a filter on the called contract, the caller and the method 4-bytes signature Supported operators are: logical or `||`, logical and `&&` and parenthesis: `()` Addresses to match must be written as 0x-prefixed hexadecimal, lowercase, prefixed by `call_to:` or `call_from:`, methods by `call_method:`. Example: `(call_to:0x1234... || call_from:0x1234...) && call_method:0xdeadbeef...`

Output

sf.substreams.ethereum.v1.Calls

blockIndex

ethcommon:index_calls

`index_calls` sets the following keys on the block: * Call contract call_to:0x0123456789abcdef0123456789abcdef01234567 (contract address in hex, prefixed by 0x) * Caller call_from:0x0123456789abcdef0123456789abcdef01234567 (caller address in hex, prefixed by 0x) * Call method call_method:0x01234567 (4 bytes of method signature in hex, prefixed by 0x)

Output

sf.substreams.index.v1.Keys