Package Logo
contract_creation
contract-creation@v0.3.0
README

Subgraph: Contract Creation

Tracks smart contract creation events.

Data Includes

  • Contract Address
  • Creator Deployer & Factory
  • Creator Transaction Hash & Index
  • Contract Code bytecode & Hash
  • Contract Input (init) bytecode

Subgraphs

Chain Subgraph ID
Ethereum EEWpgBNwW9TzJeHppqyGfRxeK6UuXErg3VVn6EoWjsuc
Arbitrum One 6w6xFpTo9HHKYYyL7d4HNDy28bG2fMNBiZLcwymoKwAh
BNB 7H7M2G2XSLBy7rzWcysC8DpCkEqJQNxMjUKFpgSgMCLc
Optimism 7RdSF6qXBh1HPFD9A9QV6UvqKCZhrWCXAsGWnCYaWeWE

GraphQL

{
  contract_creation(
    orderBy: block_number
    orderDirection: desc
  ) {
    address
    deployer
    code
    code_hash
    from
    to
    factory
    input
    ordinal
    block_hash
    block_number
    block_time
    block_date
    block_month
    transaction_hash
    transaction_index
  }
}

Graph

graph TD;
  map_contract_creation[map: map_contract_creation];
  sf.substreams.v1.Clock[source: sf.substreams.v1.Clock] --> map_contract_creation;
  block_index:map_block_index --> map_contract_creation;
  graph_out[map: graph_out];
  map_contract_creation --> graph_out;
  block_index:map_block_index[map: block_index:map_block_index];
  sf.ethereum.type.v2.Block[source: sf.ethereum.type.v2.Block] --> block_index:map_block_index;

Modules

Name: map_contract_creation
Initial block: 0
Kind: map
Input: source: sf.substreams.v1.Clock
Input: map: block_index:map_block_index
Output Type: proto:contract_creation.v1.Events
Hash: a003944925bdeca9470fd20078f042e158a1191c

Name: graph_out
Initial block: 0
Kind: map
Input: map: map_contract_creation
Output Type: proto:sf.substreams.sink.entity.v1.EntityChanges
Hash: 1a168932f997af5283526d4bf56cc2311649818c

Name: block_index:map_block_index
Initial block: 0
Kind: map
Input: source: sf.ethereum.type.v2.Block
Output Type: proto:sf.ethereum.type.v2.Block
Hash: 6c09d386577f8c62fe1b3f1cf50622bb0f08a48a

Subgraph deployment

graph indexer rules prepare --network arbitrum-one <Qm>
graph indexer allocations create <Qm> arbitrum-one 100

Build

Docker

docker build -t subgraph-contract-creation
docker run -it subgraph-contract-creation

Local

[!IMPORTANT] Requires substreams, buf and graph CLIs installed as well as Rust with wasm32-unknown-unknown target.

make [all]

Contract creation substream

make spkg-build

Contract creation block index

make block-index

Subgraphs

make subgraph-build-[mainnet|...|all]
)
Documentation
Modules
Maps icon
Maps

map
map_contract_creation

a003944925bdeca9470fd20078f042e158a1191c
map map_contract_creation (
clocksf.substreams.v1.Clock
)  -> contract_creation.v1.Events
substreams gui contract-creation@v0.3.0 map_contract_creation

map
graph_out

1a168932f997af5283526d4bf56cc2311649818c
substreams gui contract-creation@v0.3.0 graph_out

map
block_index:map_block_index

6c09d386577f8c62fe1b3f1cf50622bb0f08a48a
map block_index:map_block_index (
)  -> sf.ethereum.type.v2.Block
substreams gui contract-creation@v0.3.0 block_index:map_block_index
Protobuf

Protobuf Docs Explorer

contract_creation.v1
sf.ethereum.type.v2
sf.ethereum.substreams.v1