Package Logo
substreams_evm_precompile_popularity
substreams_evm_precompile_popularity@v0.1.0
Total Downloads
1
Published
11 months ago
Network
mainnet mainnet
Publisher
User Avatar maoueh

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

Documentation

Modules

Maps icon
Maps

map
map_counts

34f69bcdc957354f045b97e21cc0bef46958319d
map map_counts (
store_countsGET<add,int64>
ethcommon:filtered_callssf.substreams.ethereum.v1.Calls
)  -> contract.v1.PrecompilesPopularity
substreams gui substreams-evm-precompile-popularity@v0.1.0 map_counts

map
ethcommon:all_calls

1aeb5fdc0e2ae46083b4543c9f5b759bba4748e7
map ethcommon:all_calls (
)  -> sf.substreams.ethereum.v1.Calls

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

substreams gui substreams-evm-precompile-popularity@v0.1.0 ethcommon:all_calls

map
ethcommon:filtered_calls

e24538410d5b3273f92b250e6f01a978e06268a2
Default param : call_to:0x0000000000000000000000000000000000000001 || call_to:0x0000000000000000000000000000000000000002 || call_to:0x0000000000000000000000000000000000000003 || call_to:0x0000000000000000000000000000000000000004 || call_to:0x0000000000000000000000000000000000000005 || call_to:0x00000000000000000000000000000000000000f5 || call_to:0x0000000000000000000000000000000000000006 || call_to:0x0000000000000000000000000000000000000007 || call_to:0x0000000000000000000000000000000000000008 || call_to:0x0000000000000000000000000000000000000009 || call_to:0x000000000000000000000000000000000000000a || call_to:0x0000000000000000000000000000000000000f0a || call_to:0x0000000000000000000000000000000000000f0b || call_to:0x0000000000000000000000000000000000000f0c || call_to:0x0000000000000000000000000000000000000f0d || call_to:0x0000000000000000000000000000000000000f0e || call_to:0x0000000000000000000000000000000000000f0f || call_to:0x0000000000000000000000000000000000000f10

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...

substreams gui substreams-evm-precompile-popularity@v0.1.0 ethcommon:filtered_calls
Stores icon
Stores

store
store_counts

a4aa8b6665cdb725e2bb5b940c229284734201d6
substreams gui substreams-evm-precompile-popularity@v0.1.0 store_counts
Block Indexes icon
Block Indexes

blockIndex
ethcommon:index_calls

eee3f6b287e7baca3f7a530810b3a359e2fb19aa

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)
substreams gui substreams-evm-precompile-popularity@v0.1.0 ethcommon:index_calls
Protobuf

Protobuf Docs Explorer

sf.ethereum.substreams.v1
contract.v1
sf.ethereum.type.v2